Skip to content

Commit 50f3f50

Browse files
committed
include additional checks for relay-chain import_queue
1 parent 1631d8f commit 50f3f50

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

cumulus/client/consensus/relay-chain/src/import_queue.rs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ use std::{marker::PhantomData, sync::Arc};
2020
use sc_consensus::{import_queue::Verifier as VerifierT, BlockImportParams};
2121
use sp_api::ProvideRuntimeApi;
2222
use sp_block_builder::BlockBuilder as BlockBuilderApi;
23+
use sp_consensus::BlockOrigin;
2324
use sp_inherents::CreateInherentDataProviders;
2425
use sp_runtime::traits::{Block as BlockT, Header as HeaderT};
2526

@@ -49,9 +50,14 @@ where
4950
&self,
5051
mut block_params: BlockImportParams<Block>,
5152
) -> Result<BlockImportParams<Block>, String> {
52-
block_params.fork_choice = Some(sc_consensus::ForkChoiceStrategy::Custom(
53-
block_params.origin == sp_consensus::BlockOrigin::NetworkInitialSync,
54-
));
53+
let is_sync_selected = matches!(
54+
block_params.origin,
55+
BlockOrigin::NetworkInitialSync |
56+
BlockOrigin::WarpSync |
57+
BlockOrigin::StateSync { .. } |
58+
BlockOrigin::GapSync
59+
);
60+
block_params.fork_choice = Some(sc_consensus::ForkChoiceStrategy::Custom(is_sync_selected));
5561

5662
// Skip checks that include execution, if being told so, or when importing only state.
5763
//

0 commit comments

Comments
 (0)