mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-31 18:01:03 +00:00
relay-chain-consensus: set a fork_choice (#2462)
After #2001 the `fork_choice` strategy may remain uninitialized in the block import pipeline which uses relay-chain verifier. Refer to https://github.com/paritytech/polkadot-sdk/pull/2430#issuecomment-1823979813 for some further discussion.
This commit is contained in:
committed by
GitHub
parent
7554f53f9e
commit
891628a7f1
@@ -55,6 +55,10 @@ where
|
|||||||
&mut self,
|
&mut self,
|
||||||
mut block_params: BlockImportParams<Block>,
|
mut block_params: BlockImportParams<Block>,
|
||||||
) -> Result<BlockImportParams<Block>, String> {
|
) -> Result<BlockImportParams<Block>, String> {
|
||||||
|
block_params.fork_choice = Some(sc_consensus::ForkChoiceStrategy::Custom(
|
||||||
|
block_params.origin == sp_consensus::BlockOrigin::NetworkInitialSync,
|
||||||
|
));
|
||||||
|
|
||||||
// Skip checks that include execution, if being told so, or when importing only state.
|
// Skip checks that include execution, if being told so, or when importing only state.
|
||||||
//
|
//
|
||||||
// This is done for example when gap syncing and it is expected that the block after the gap
|
// This is done for example when gap syncing and it is expected that the block after the gap
|
||||||
@@ -100,7 +104,6 @@ where
|
|||||||
}
|
}
|
||||||
|
|
||||||
block_params.post_hash = Some(block_params.header.hash());
|
block_params.post_hash = Some(block_params.header.hash());
|
||||||
|
|
||||||
Ok(block_params)
|
Ok(block_params)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user