diff --git a/polkadot/node/core/provisioner/src/lib.rs b/polkadot/node/core/provisioner/src/lib.rs index 84bff27dca..4b85f6ec5b 100644 --- a/polkadot/node/core/provisioner/src/lib.rs +++ b/polkadot/node/core/provisioner/src/lib.rs @@ -84,7 +84,6 @@ struct ProvisioningJob { relay_parent: Hash, sender: mpsc::Sender, receiver: mpsc::Receiver, - provisionable_data_channels: Vec>, backed_candidates: Vec, signed_bitfields: Vec, metrics: Metrics, @@ -173,7 +172,6 @@ impl ProvisioningJob { relay_parent, sender, receiver, - provisionable_data_channels: Vec::new(), backed_candidates: Vec::new(), signed_bitfields: Vec::new(), metrics, @@ -184,7 +182,7 @@ impl ProvisioningJob { async fn run_loop(mut self, span: PerLeafSpan) -> Result<(), Error> { use ProvisionerMessage::{ - ProvisionableData, RequestBlockAuthorshipData, RequestInherentData, + ProvisionableData, RequestInherentData, }; loop { futures::select! { @@ -199,45 +197,11 @@ impl ProvisioningJob { self.awaiting_inherent.push(return_sender); } } - Some(RequestBlockAuthorshipData(_, sender)) => { - let _span = span.child("req-block-authorship"); - self.provisionable_data_channels.push(sender) - } Some(ProvisionableData(_, data)) => { let _span = span.child("provisionable-data"); let _timer = self.metrics.time_provisionable_data(); - let mut bad_indices = Vec::new(); - for (idx, channel) in self.provisionable_data_channels.iter_mut().enumerate() { - match channel.send(data.clone()).await { - Ok(_) => {} - Err(_) => bad_indices.push(idx), - } - } self.note_provisionable_data(data); - - // clean up our list of channels by removing the bad indices - // start by reversing it for efficient pop - bad_indices.reverse(); - // Vec::retain would be nicer here, but it doesn't provide - // an easy API for retaining by index, so we re-collect instead. - self.provisionable_data_channels = self - .provisionable_data_channels - .into_iter() - .enumerate() - .filter(|(idx, _)| { - if bad_indices.is_empty() { - return true; - } - let tail = bad_indices[bad_indices.len() - 1]; - let retain = *idx != tail; - if *idx >= tail { - let _ = bad_indices.pop(); - } - retain - }) - .map(|(_, item)| item) - .collect(); } None => break, }, diff --git a/polkadot/node/subsystem/src/messages.rs b/polkadot/node/subsystem/src/messages.rs index 817956b661..7706b12739 100644 --- a/polkadot/node/subsystem/src/messages.rs +++ b/polkadot/node/subsystem/src/messages.rs @@ -551,9 +551,6 @@ pub type ProvisionerInherentData = (Vec, Vec), /// This message allows external subsystems to request the set of bitfields and backed candidates /// associated with a particular potential block hash. /// @@ -567,7 +564,6 @@ pub enum ProvisionerMessage { impl BoundToRelayParent for ProvisionerMessage { fn relay_parent(&self) -> Hash { match self { - Self::RequestBlockAuthorshipData(hash, _) => *hash, Self::RequestInherentData(hash, _) => *hash, Self::ProvisionableData(hash, _) => *hash, } diff --git a/polkadot/roadmap/implementers-guide/src/node/subsystems-and-jobs.md b/polkadot/roadmap/implementers-guide/src/node/subsystems-and-jobs.md index 1d0a6e7b7b..2eabf6fc9e 100644 --- a/polkadot/roadmap/implementers-guide/src/node/subsystems-and-jobs.md +++ b/polkadot/roadmap/implementers-guide/src/node/subsystems-and-jobs.md @@ -382,10 +382,7 @@ sequenceDiagram participant RA as RuntimeApi participant PO as Proposer - alt receive request to forward block authorship data - A ->> PV: RequestBlockAuthorshipData - Note over A,PV: This request contains a mpsc::Sender, which the Provisioner keeps - else receive provisionable data + alt receive provisionable data alt CB ->> PV: ProvisionableData else @@ -415,8 +412,7 @@ sequenceDiagram ``` In principle, any arbitrary subsystem could send a `RequestInherentData` to the `Provisioner`. In practice, -only the `Proposer` does so. Likewise, any arbitrary subsystem could send a `RequestBlockAuthorshipData`; the -distinction is that no subsystem currently does so. +only the `Proposer` does so. The proposer is an atypical subsystem in that, unlike most of them, it is not primarily driven by the `Overseer`, but instead by the `sp_consensus::Environment` and `sp_consensus::Proposer` traits diff --git a/polkadot/roadmap/implementers-guide/src/node/utility/provisioner.md b/polkadot/roadmap/implementers-guide/src/node/utility/provisioner.md index ea62f863f6..bbaf1071a1 100644 --- a/polkadot/roadmap/implementers-guide/src/node/utility/provisioner.md +++ b/polkadot/roadmap/implementers-guide/src/node/utility/provisioner.md @@ -34,9 +34,9 @@ Dispute resolution is complex and is explained in substantially more detail [her Input: [`ProvisionerMessage`](../../types/overseer-protocol.md#provisioner-message). Backed candidates come from the [Candidate Backing subsystem](../backing/candidate-backing.md), signed bitfields come from the [Bitfield Distribution subsystem](../availability/bitfield-distribution.md), and misbehavior reports and disputes come from the [Misbehavior Arbitration subsystem](misbehavior-arbitration.md). -At initialization, this subsystem has no outputs. Block authors can send a `ProvisionerMessage::RequestBlockAuthorshipData`, which includes a channel over which provisionable data can be sent. All appropriate provisionable data will then be sent over this channel, as it is received. +At initialization, this subsystem has no outputs. -Note that block authors must re-send a `ProvisionerMessage::RequestBlockAuthorshipData` for each relay parent they are interested in receiving provisionable data for. +Block authors request the inherent data they should use for constructing the inherent in the block which contains parachain execution information. ## Block Production @@ -89,8 +89,6 @@ To compute bitfield availability, then: See also: [Scheduler Module: Availability Cores](../../runtime/scheduler.md#availability-cores). -One might ask: given `ProvisionerMessage::RequestInherentData`, what's the point of `ProvisionerMessage::RequestBlockAuthorshipData`? The answer is that the block authorship data includes more information than is present in the inherent data; disputes, for example. - ## Functionality The subsystem should maintain a set of handles to Block Authorship Provisioning Jobs that are currently live. diff --git a/polkadot/roadmap/implementers-guide/src/types/overseer-protocol.md b/polkadot/roadmap/implementers-guide/src/types/overseer-protocol.md index 9d079f92bb..81ca8ef490 100644 --- a/polkadot/roadmap/implementers-guide/src/types/overseer-protocol.md +++ b/polkadot/roadmap/implementers-guide/src/types/overseer-protocol.md @@ -453,9 +453,6 @@ enum ProvisionableData { /// /// In all cases, the Hash is that of the relay parent. enum ProvisionerMessage { - /// This message allows potential block authors to be kept updated with all new authorship data - /// as it becomes available. - RequestBlockAuthorshipData(Hash, Sender), /// This message allows external subsystems to request current inherent data that could be used for /// advancing the state of parachain consensus in a block building upon the given hash. ///