From 3d9eddbeb262277c79f2b93b9efb5af95a3a35a8 Mon Sep 17 00:00:00 2001 From: Sebastian Kunert Date: Mon, 6 Jan 2025 10:51:41 +0100 Subject: [PATCH 1/3] Import warp synced block as best block. Avoid incomplete import pipeline. --- cumulus/client/consensus/aura/src/equivocation_import_queue.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/cumulus/client/consensus/aura/src/equivocation_import_queue.rs b/cumulus/client/consensus/aura/src/equivocation_import_queue.rs index 68f2d37c8748..dbd9d5ba6a6f 100644 --- a/cumulus/client/consensus/aura/src/equivocation_import_queue.rs +++ b/cumulus/client/consensus/aura/src/equivocation_import_queue.rs @@ -97,6 +97,7 @@ where // 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() { + block_params.fork_choice = Some(ForkChoiceStrategy::Custom(block_params.with_state())); return Ok(block_params) } From 5afbe2e2f1663631a90d64a355d2465a977de8b0 Mon Sep 17 00:00:00 2001 From: command-bot <> Date: Mon, 6 Jan 2025 10:32:32 +0000 Subject: [PATCH 2/3] Update from skunert running command 'prdoc --bump patch --audience node_dev' --- prdoc/pr_7050.prdoc | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 prdoc/pr_7050.prdoc diff --git a/prdoc/pr_7050.prdoc b/prdoc/pr_7050.prdoc new file mode 100644 index 000000000000..35ecd638e7e1 --- /dev/null +++ b/prdoc/pr_7050.prdoc @@ -0,0 +1,20 @@ +title: Avoid incomplete block import pipeline with full verifying import queue +doc: +- audience: Node Dev + description: |- + ## Problem + In the parachain template we use the [fully verifying import queue + ](https://github.com/paritytech/polkadot-sdk/blob/3d9eddbeb262277c79f2b93b9efb5af95a3a35a8/cumulus/client/consensus/aura/src/equivocation_import_queue.rs#L224-L224) which does extra equivocation checks. + + However, when we import a warp synced block with state, we don't set a fork choice, leading to an incomplete block import pipeline and error here: https://github.com/paritytech/polkadot-sdk/blob/3d9eddbeb262277c79f2b93b9efb5af95a3a35a8/substrate/client/service/src/client/client.rs#L488-L488 + + This renders warp sync useless for chains using this import queue. + + ## Fix + The fix is to always import a block with state as best block, as we already do in the normal Aura Verifier. + In a follow up we should also take another look into unifying the usage of the different import queues. + + fixes https://github.com/paritytech/project-mythical/issues/256 +crates: +- name: cumulus-client-consensus-aura + bump: patch From 82c42dc89941d2fc7a7e079faf38e5c87599909f Mon Sep 17 00:00:00 2001 From: Sebastian Kunert Date: Mon, 6 Jan 2025 12:55:38 +0100 Subject: [PATCH 3/3] Improve PRDOC wording --- prdoc/pr_7050.prdoc | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/prdoc/pr_7050.prdoc b/prdoc/pr_7050.prdoc index 35ecd638e7e1..da9dd808033d 100644 --- a/prdoc/pr_7050.prdoc +++ b/prdoc/pr_7050.prdoc @@ -2,19 +2,10 @@ title: Avoid incomplete block import pipeline with full verifying import queue doc: - audience: Node Dev description: |- - ## Problem - In the parachain template we use the [fully verifying import queue - ](https://github.com/paritytech/polkadot-sdk/blob/3d9eddbeb262277c79f2b93b9efb5af95a3a35a8/cumulus/client/consensus/aura/src/equivocation_import_queue.rs#L224-L224) which does extra equivocation checks. + When warp syncing a node using the equivocation checking verifier, we now properly set the fork_choice rule. + Affected are mostly nodes that are derived from the parachain template. Omni-node is not affected. - However, when we import a warp synced block with state, we don't set a fork choice, leading to an incomplete block import pipeline and error here: https://github.com/paritytech/polkadot-sdk/blob/3d9eddbeb262277c79f2b93b9efb5af95a3a35a8/substrate/client/service/src/client/client.rs#L488-L488 - - This renders warp sync useless for chains using this import queue. - - ## Fix - The fix is to always import a block with state as best block, as we already do in the normal Aura Verifier. - In a follow up we should also take another look into unifying the usage of the different import queues. - - fixes https://github.com/paritytech/project-mythical/issues/256 + The prevents the error `ClientImport("Incomplete block import pipeline.")` after state sync. crates: - name: cumulus-client-consensus-aura bump: patch