diff --git a/node/core/backing/src/lib.rs b/node/core/backing/src/lib.rs index 556939025211..564d81730167 100644 --- a/node/core/backing/src/lib.rs +++ b/node/core/backing/src/lib.rs @@ -18,7 +18,6 @@ #![recursion_limit="256"] -use std::sync::Arc; use std::collections::{HashMap, HashSet}; use std::convert::TryFrom; use std::pin::Pin; @@ -234,7 +233,7 @@ impl CandidateBackingJob { async fn validate_and_second( &mut self, candidate: AbridgedCandidateReceipt, - pov: Arc, + pov: PoVBlock, ) -> Result { let (valid, global_validation_schedule, local_validation_data) = self.request_candidate_validation(candidate.clone(), pov.clone()).await?; let statement = match valid { @@ -454,7 +453,7 @@ impl CandidateBackingJob { async fn request_pov_from_distribution( &mut self, descriptor: CandidateDescriptor, - ) -> Result, Error> { + ) -> Result { let (tx, rx) = oneshot::channel(); self.tx_from.send(FromJob::PoVDistribution( @@ -467,7 +466,7 @@ impl CandidateBackingJob { async fn request_candidate_validation( &mut self, candidate: AbridgedCandidateReceipt, - pov: Arc, + pov: PoVBlock, ) -> Result<(ValidationResult, GlobalValidationSchedule, LocalValidationData), Error> { let (tx, rx) = oneshot::channel(); @@ -500,7 +499,7 @@ impl CandidateBackingJob { async fn make_pov_available( &mut self, - pov_block: Arc, + pov_block: PoVBlock, global_validation: GlobalValidationSchedule, local_validation: LocalValidationData, ) -> Result<(), Error> { diff --git a/node/subsystem/src/messages.rs b/node/subsystem/src/messages.rs index a5304350790d..555060759a1a 100644 --- a/node/subsystem/src/messages.rs +++ b/node/subsystem/src/messages.rs @@ -35,8 +35,6 @@ use polkadot_node_primitives::{ MisbehaviorReport, SignedFullStatement, View, ProtocolId, ValidationResult, }; -use std::sync::Arc; - pub use sc_network::{ObservedRole, ReputationChange, PeerId}; /// A notification of a new backed candidate. @@ -59,7 +57,7 @@ pub enum CandidateBackingMessage { RegisterBackingWatcher(Hash, mpsc::Sender), /// Note that the Candidate Backing subsystem should second the given candidate in the context of the /// given relay-parent (ref. by hash). This candidate must be validated. - Second(Hash, AbridgedCandidateReceipt, Arc), + Second(Hash, AbridgedCandidateReceipt, PoVBlock), /// Note a validator's statement about a particular candidate. Disagreements about validity must be escalated /// to a broader check by Misbehavior Arbitration. Agreements are simply tallied until a quorum is reached. Statement(Hash, SignedFullStatement), @@ -80,7 +78,7 @@ pub enum CandidateValidationMessage { Hash, AbridgedCandidateReceipt, HeadData, - Arc, + PoVBlock, oneshot::Sender>), + FetchPoV(Hash, CandidateDescriptor, oneshot::Sender), /// Distribute a PoV for the given relay-parent and CandidateDescriptor. /// The PoV should correctly hash to the PoV hash mentioned in the CandidateDescriptor - DistributePoV(Hash, CandidateDescriptor, Arc), + DistributePoV(Hash, CandidateDescriptor, PoVBlock), /// An update from the network bridge. NetworkBridgeUpdate(NetworkBridgeEvent), } diff --git a/primitives/src/parachain.rs b/primitives/src/parachain.rs index 787dad6dad57..d8eaadab8fff 100644 --- a/primitives/src/parachain.rs +++ b/primitives/src/parachain.rs @@ -19,7 +19,6 @@ use sp_std::prelude::*; use sp_std::cmp::Ordering; -use sp_std::sync::Arc; use parity_scale_codec::{Encode, Decode}; use bitvec::vec::BitVec; use super::{Hash, Balance, BlockNumber}; @@ -719,7 +718,7 @@ impl PoVBlock { #[cfg_attr(feature = "std", derive(Debug, Encode, Decode))] pub struct AvailableData { /// The PoV block. - pub pov_block: Arc, + pub pov_block: PoVBlock, /// Data that is omitted from an abridged candidate receipt /// that is necessary for validation. pub omitted_validation: OmittedValidationData,