Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

relay-chain-consensus: set a fork_choice #2462

Merged
merged 3 commits into from
Nov 24, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion cumulus/client/consensus/relay-chain/src/import_queue.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ use std::{marker::PhantomData, sync::Arc};
use cumulus_client_consensus_common::ParachainBlockImportMarker;

use sc_consensus::{
block_import::ForkChoiceStrategy,
import_queue::{BasicQueue, Verifier as VerifierT},
BlockImport, BlockImportParams,
};
Expand All @@ -30,6 +31,7 @@ use sp_inherents::{CreateInherentDataProviders, InherentDataProvider};
use sp_runtime::traits::{Block as BlockT, Header as HeaderT};

/// A verifier that just checks the inherents.

michalkucharczyk marked this conversation as resolved.
Show resolved Hide resolved
pub struct Verifier<Client, Block, CIDP> {
client: Arc<Client>,
create_inherent_data_providers: CIDP,
Expand All @@ -55,6 +57,8 @@ where
&mut self,
mut block_params: BlockImportParams<Block>,
) -> Result<BlockImportParams<Block>, String> {
block_params.fork_choice = Some(ForkChoiceStrategy::LongestChain);
michalkucharczyk marked this conversation as resolved.
Show resolved Hide resolved

// 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
Expand Down Expand Up @@ -100,7 +104,6 @@ where
}

block_params.post_hash = Some(block_params.header.hash());

Ok(block_params)
}
}
Expand Down