Skip to content

Commit

Permalink
Avoid incomplete block import pipeline with full verifying import que…
Browse files Browse the repository at this point in the history
…ue (#7050)

## 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 paritytech/project-mythical#256

---------

Co-authored-by: command-bot <>
  • Loading branch information
skunert authored Jan 6, 2025
1 parent ffa90d0 commit 1dcff3d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand Down
11 changes: 11 additions & 0 deletions prdoc/pr_7050.prdoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
title: Avoid incomplete block import pipeline with full verifying import queue
doc:
- audience: Node Dev
description: |-
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.

The prevents the error `ClientImport("Incomplete block import pipeline.")` after state sync.
crates:
- name: cumulus-client-consensus-aura
bump: patch

0 comments on commit 1dcff3d

Please sign in to comment.