diff --git a/polkadot/node/subsystem/src/messages.rs b/polkadot/node/subsystem/src/messages.rs index fb4300f561c682a89b023a0183e226c2af14f526..1ff4986b067520e17c18b2edadabb3a37849c9c8 100644 --- a/polkadot/node/subsystem/src/messages.rs +++ b/polkadot/node/subsystem/src/messages.rs @@ -27,7 +27,7 @@ use futures::channel::{mpsc, oneshot}; use polkadot_primitives::{BlockNumber, Hash, Signature}; use polkadot_primitives::parachain::{ AbridgedCandidateReceipt, PoVBlock, ErasureChunk, BackedCandidate, Id as ParaId, - SignedAvailabilityBitfield, SignedAvailabilityBitfields, SigningContext, ValidatorId, ValidationCode, ValidatorIndex, + SignedAvailabilityBitfield, SigningContext, ValidatorId, ValidationCode, ValidatorIndex, }; use polkadot_node_primitives::{ MisbehaviorReport, SignedFullStatement, View, ProtocolId, @@ -194,7 +194,7 @@ pub enum ProvisionableData { /// This data needs to make its way from the provisioner into the InherentData. /// /// There, it is used to construct the InclusionInherent. -pub type ProvisionerInherentData = (SignedAvailabilityBitfields, Vec<BackedCandidate>); +pub type ProvisionerInherentData = (Vec<SignedAvailabilityBitfield>, Vec<BackedCandidate>); /// Message to the Provisioner. /// diff --git a/polkadot/primitives/src/parachain.rs b/polkadot/primitives/src/parachain.rs index 4a10fea6991c49b6571151ae0cabbd00fcc165ab..b187d488e1918099dd2b744805fc96a2a897b28c 100644 --- a/polkadot/primitives/src/parachain.rs +++ b/polkadot/primitives/src/parachain.rs @@ -736,14 +736,7 @@ impl From<BitVec<bitvec::order::Lsb0, u8>> for AvailabilityBitfield { pub type SignedAvailabilityBitfield = Signed<AvailabilityBitfield>; /// A set of signed availability bitfields. Should be sorted by validator index, ascending. -#[derive(Encode, Decode, Clone, PartialEq, Eq, RuntimeDebug, Default)] -pub struct SignedAvailabilityBitfields(pub Vec<SignedAvailabilityBitfield>); - -impl From<Vec<SignedAvailabilityBitfield>> for SignedAvailabilityBitfields { - fn from(fields: Vec<SignedAvailabilityBitfield>) -> SignedAvailabilityBitfields { - SignedAvailabilityBitfields(fields) - } -} +pub type SignedAvailabilityBitfields = Vec<SignedAvailabilityBitfield>; /// A backed (or backable, depending on context) candidate. // TODO: yes, this is roughly the same as AttestedCandidate. diff --git a/polkadot/runtime/parachains/src/inclusion.rs b/polkadot/runtime/parachains/src/inclusion.rs index c31c4a62e6e27686a6638246e75893b3755d7480..f9696bb33cdc5561e35ccedfb2716dde0e21da44 100644 --- a/polkadot/runtime/parachains/src/inclusion.rs +++ b/polkadot/runtime/parachains/src/inclusion.rs @@ -190,7 +190,7 @@ impl<T: Trait> Module<T> { session_index, }; - for signed_bitfield in &signed_bitfields.0 { + for signed_bitfield in &signed_bitfields { ensure!( signed_bitfield.payload().0.len() == n_bits, Error::<T>::WrongBitfieldSize, @@ -220,7 +220,7 @@ impl<T: Trait> Module<T> { } let now = <system::Module<T>>::block_number(); - for signed_bitfield in signed_bitfields.0 { + for signed_bitfield in signed_bitfields { for (bit_idx, _) in signed_bitfield.payload().0.iter().enumerate().filter(|(_, is_av)| **is_av) { @@ -755,7 +755,7 @@ mod tests { ); assert!(Inclusion::process_bitfields( - SignedAvailabilityBitfields(vec![signed]), + vec![signed], &core_lookup, ).is_err()); } @@ -771,7 +771,7 @@ mod tests { ); assert!(Inclusion::process_bitfields( - SignedAvailabilityBitfields(vec![signed.clone(), signed]), + vec![signed.clone(), signed], &core_lookup, ).is_err()); } @@ -794,7 +794,7 @@ mod tests { ); assert!(Inclusion::process_bitfields( - SignedAvailabilityBitfields(vec![signed_1, signed_0]), + vec![signed_1, signed_0], &core_lookup, ).is_err()); } @@ -811,7 +811,7 @@ mod tests { ); assert!(Inclusion::process_bitfields( - SignedAvailabilityBitfields(vec![signed]), + vec![signed], &core_lookup, ).is_err()); } @@ -827,7 +827,7 @@ mod tests { ); assert!(Inclusion::process_bitfields( - SignedAvailabilityBitfields(vec![signed]), + vec![signed], &core_lookup, ).is_ok()); } @@ -855,7 +855,7 @@ mod tests { ); assert!(Inclusion::process_bitfields( - SignedAvailabilityBitfields(vec![signed]), + vec![signed], &core_lookup, ).is_ok()); } @@ -959,7 +959,7 @@ mod tests { }).collect(); assert!(Inclusion::process_bitfields( - SignedAvailabilityBitfields(signed_bitfields), + signed_bitfields, &core_lookup, ).is_ok());