Skip to content

Commit

Permalink
Aura: Do not verify on state import (paritytech#13058)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>

* Review comment

Co-authored-by: André Silva <[email protected]>
  • Loading branch information
bkchr and andresilva authored Jan 4, 2023
1 parent 68fc275 commit ea387c6
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions client/consensus/aura/src/import_queue.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit ea387c6

Please sign in to comment.