diff --git a/substrate/client/consensus/aura/src/import_queue.rs b/substrate/client/consensus/aura/src/import_queue.rs index 3ac26345db..4c8722c31f 100644 --- a/substrate/client/consensus/aura/src/import_queue.rs +++ b/substrate/client/consensus/aura/src/import_queue.rs @@ -186,16 +186,15 @@ where &mut self, mut block: BlockImportParams, ) -> Result<(BlockImportParams, Option)>>), 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())) }