mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-12 05:21:08 +00:00
Aura: Fix warp syncing (#13221)
* Aura: Fix warp syncing We need to set the fork choice rule! When using Cumulus this is done by the `ParachainsBlockImport`, but for standalone chains we still need this! Closes: https://github.com/paritytech/substrate/issues/13220 * Improve fork choice
This commit is contained in:
@@ -186,16 +186,15 @@ where
|
||||
&mut self,
|
||||
mut block: BlockImportParams<B, ()>,
|
||||
) -> Result<(BlockImportParams<B, ()>, Option<Vec<(CacheKeyId, Vec<u8>)>>), String> {
|
||||
// When importing whole state we don't verify the seal as the state is not available.
|
||||
if block.with_state() {
|
||||
return Ok((block, Default::default()))
|
||||
}
|
||||
|
||||
// Skip checks that include execution, if being told so.
|
||||
// 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
|
||||
// was checked/chosen properly, e.g. by warp syncing to this block using a finality proof.
|
||||
if block.state_action.skip_execution_checks() {
|
||||
// Or when we are importing state only and can not verify the seal.
|
||||
if block.with_state() || block.state_action.skip_execution_checks() {
|
||||
// When we are importing only the state of a block, it will be the best block.
|
||||
block.fork_choice = Some(ForkChoiceStrategy::Custom(block.with_state()));
|
||||
|
||||
return Ok((block, Default::default()))
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user