diff --git a/polkadot/network/src/legacy/collator_pool.rs b/polkadot/network/src/legacy/collator_pool.rs index 89b7ba3a52..e13b2dc8fd 100644 --- a/polkadot/network/src/legacy/collator_pool.rs +++ b/polkadot/network/src/legacy/collator_pool.rs @@ -65,6 +65,7 @@ impl CollationSlot { } } +#[derive(Debug)] enum SlotEntries { Blank, // not queried yet @@ -75,7 +76,7 @@ enum SlotEntries { impl SlotEntries { fn received_collation(&mut self, collation: Collation) { - *self = match ::std::mem::replace(self, SlotEntries::Blank) { + *self = match std::mem::replace(self, SlotEntries::Blank) { SlotEntries::Blank => SlotEntries::Pending(vec![collation]), SlotEntries::Pending(mut cs) => { cs.push(collation); @@ -185,6 +186,12 @@ impl CollatorPool { /// The collator should be registered for the parachain of the collation as a precondition of this function. /// The collation should have been checked for integrity of signature before passing to this function. pub fn on_collation(&mut self, collator_id: CollatorId, relay_parent: Hash, collation: Collation) { + log::debug!( + target: "collator-pool", "On collation from collator {} for relay parent {}", + collator_id, + relay_parent, + ); + if let Some((para_id, _)) = self.collators.get(&collator_id) { debug_assert_eq!(para_id, &collation.info.parachain_index); diff --git a/polkadot/parachain/src/lib.rs b/polkadot/parachain/src/lib.rs index 3f1993a23e..d3f24c34bf 100644 --- a/polkadot/parachain/src/lib.rs +++ b/polkadot/parachain/src/lib.rs @@ -81,9 +81,9 @@ pub struct ValidationResult { /// Unique identifier of a parachain. #[derive( Clone, CompactAs, Copy, Decode, Default, Encode, Eq, - Hash, Ord, PartialEq, PartialOrd, RuntimeDebug + Hash, Ord, PartialEq, PartialOrd, RuntimeDebug, )] -#[cfg_attr(feature = "std", derive(serde::Serialize, serde::Deserialize))] +#[cfg_attr(feature = "std", derive(serde::Serialize, serde::Deserialize, derive_more::Display))] pub struct Id(u32); impl TypeId for Id { diff --git a/polkadot/validation/src/collation.rs b/polkadot/validation/src/collation.rs index 0be87a5a94..cb60d4b532 100644 --- a/polkadot/validation/src/collation.rs +++ b/polkadot/validation/src/collation.rs @@ -614,6 +614,8 @@ pub fn validate_collation

( { let para_id = collation.info.parachain_index; + debug!("Validating collation for parachain {} at relay parent: {}", para_id, relay_parent); + do_validation( client, relay_parent,