From ebc73fee8e2a31fbdd1d944bb6a6da00d524644a Mon Sep 17 00:00:00 2001 From: Sebastian Kunert Date: Thu, 26 Jan 2023 13:27:24 +0100 Subject: [PATCH] Do not verify on state import for relay chain verifier (#2140) * Skip verification on state import * Actually use existing variables * Merge checks --- client/consensus/relay-chain/src/import_queue.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/client/consensus/relay-chain/src/import_queue.rs b/client/consensus/relay-chain/src/import_queue.rs index 31004c0005..d77ffdd3e3 100644 --- a/client/consensus/relay-chain/src/import_queue.rs +++ b/client/consensus/relay-chain/src/import_queue.rs @@ -58,6 +58,14 @@ where &mut self, mut block_params: BlockImportParams, ) -> Result<(BlockImportParams, Option)>>), String> { + // 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_params.state_action.skip_execution_checks() || block_params.with_state() { + return Ok((block_params, Default::default())) + } + if let Some(inner_body) = block_params.body.take() { let inherent_data_providers = self .create_inherent_data_providers