Ensure relay chain parent is the relay chain head (#103)

This commit is contained in:
Cecile Tonglet
2020-05-27 14:43:45 +02:00
committed by GitHub
parent adc88bf167
commit 8f02e233da
7 changed files with 615 additions and 60 deletions
+4 -2
View File
@@ -25,6 +25,7 @@ use cumulus_primitives::{
};
use cumulus_runtime::ParachainBlockData;
use sp_blockchain::HeaderBackend;
use sp_consensus::{
BlockImport, BlockImportParams, BlockOrigin, Environment, Error as ConsensusError,
ForkChoiceStrategy, Proposal, Proposer, RecordProof,
@@ -350,14 +351,15 @@ where
polkadot_network: impl CollatorNetwork + Clone + 'static,
) -> Result<Self::ParachainContext, ()>
where
PClient: ProvideRuntimeApi<PBlock> + Send + Sync + BlockchainEvents<PBlock> + 'static,
PClient: ProvideRuntimeApi<PBlock> + BlockchainEvents<PBlock> + HeaderBackend<PBlock>
+ Send + Sync + 'static,
PClient::Api: RuntimeApiCollection<Extrinsic>,
<PClient::Api as ApiExt<PBlock>>::StateBackend: StateBackend<HashFor<PBlock>>,
Spawner: Spawn + Clone + Send + Sync + 'static,
Extrinsic: codec::Codec + Send + Sync + 'static,
{
self.delayed_block_announce_validator.set(
Box::new(JustifiedBlockAnnounceValidator::new(Vec::new(), polkadot_client.clone())),
Box::new(JustifiedBlockAnnounceValidator::new(polkadot_client.clone())),
);
let follow =