mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-30 18:57:57 +00:00
Aura: Do not verify on state import (#13058)
* Aura: Do not verify on state import When we import the state, we can not fetch authorities to verify the seal etc. So, we can directly skip any verification. * Skip checks as well for gap sync * Update client/consensus/aura/src/import_queue.rs Co-authored-by: André Silva <123550+andresilva@users.noreply.github.com> * Review comment Co-authored-by: André Silva <123550+andresilva@users.noreply.github.com>
This commit is contained in:
@@ -186,6 +186,19 @@ 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.
|
||||
//
|
||||
// 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() {
|
||||
return Ok((block, Default::default()))
|
||||
}
|
||||
|
||||
let hash = block.header.hash();
|
||||
let parent_hash = *block.header.parent_hash();
|
||||
let authorities = authorities(
|
||||
|
||||
Reference in New Issue
Block a user