diff --git a/collator/src/lib.rs b/collator/src/lib.rs index 82f1a9766a..36c1b86438 100644 --- a/collator/src/lib.rs +++ b/collator/src/lib.rs @@ -520,7 +520,12 @@ where ))); let follow = - match cumulus_consensus::follow_polkadot(self.para_id, self.client, polkadot_client) { + match cumulus_consensus::follow_polkadot( + self.para_id, + self.client, + polkadot_client, + self.announce_block.clone(), + ) { Ok(follow) => follow, Err(e) => { return Err(error!("Could not start following polkadot: {:?}", e)); diff --git a/consensus/src/lib.rs b/consensus/src/lib.rs index 8b534b7780..0814739215 100644 --- a/consensus/src/lib.rs +++ b/consensus/src/lib.rs @@ -104,6 +104,7 @@ pub fn follow_polkadot( para_id: ParaId, local: Arc, polkadot: P, + announce_block: Arc) + Send + Sync>, ) -> ClientResult + Send + Unpin> where Block: BlockT, @@ -136,7 +137,7 @@ where .map(|_| ()) }; - Ok(future::select(follow_finalized, follow_new_best(para_id, local, polkadot)?).map(|_| ())) + Ok(future::select(follow_finalized, follow_new_best(para_id, local, polkadot, announce_block)?).map(|_| ())) } /// Follow the relay chain new best head, to update the Parachain new best head. @@ -144,6 +145,7 @@ fn follow_new_best( para_id: ParaId, local: Arc, polkadot: P, + announce_block: Arc) + Send + Sync>, ) -> ClientResult + Send + Unpin> where Block: BlockT, @@ -195,6 +197,8 @@ where hash, err ); } + + (*announce_block)(hash, Vec::new()); } Ok(BlockStatus::InChainPruned) => { error!(