Skip to content
Snippets Groups Projects
Commit 428a4275 authored by Bastian Köcher's avatar Bastian Köcher Committed by GitHub
Browse files

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: default avatarAndré Silva <123550+andresilva@users.noreply.github.com>

* Review comment

Co-authored-by: default avatarAndré Silva <123550+andresilva@users.noreply.github.com>
parent 78621b8d
No related merge requests found
......@@ -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(
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment