Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 2 commits
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
8 changes: 5 additions & 3 deletions client/consensus/aura/src/import_queue.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ use codec::Codec;
use cumulus_client_consensus_common::ParachainBlockImport;
use sc_client_api::{backend::AuxStore, BlockOf, UsageProvider};
use sc_consensus::{import_queue::DefaultImportQueue, BlockImport};
use sc_consensus_aura::AuraVerifier;
use sc_consensus_aura::{AuraVerifier, CompatibilityMode};
use sc_consensus_slots::InherentDataProviderExt;
use sc_telemetry::TelemetryHandle;
use sp_api::{ApiExt, ProvideRuntimeApi};
Expand Down Expand Up @@ -92,6 +92,7 @@ where
registry,
check_for_equivocation: sc_consensus_aura::CheckForEquivocation::No,
telemetry,
compatibility_mode: CompatibilityMode::None,
})
}

Expand All @@ -106,16 +107,17 @@ pub struct BuildVerifierParams<C, CIDP> {
}

/// Build the [`AuraVerifier`].
pub fn build_verifier<P, C, CIDP>(
pub fn build_verifier<P, C, CIDP, N>(
BuildVerifierParams { client, create_inherent_data_providers, telemetry }: BuildVerifierParams<
C,
CIDP,
>,
) -> AuraVerifier<C, P, CIDP> {
) -> AuraVerifier<C, P, CIDP, N> {
sc_consensus_aura::build_verifier(sc_consensus_aura::BuildVerifierParams {
client,
create_inherent_data_providers,
telemetry,
check_for_equivocation: sc_consensus_aura::CheckForEquivocation::No,
compatibility_mode: CompatibilityMode::None,
})
}
1 change: 1 addition & 0 deletions client/consensus/aura/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ where
telemetry,
block_proposal_slot_portion,
max_block_proposal_slot_portion,
compatibility_mode: sc_consensus_aura::CompatibilityMode::None,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
compatibility_mode: sc_consensus_aura::CompatibilityMode::None,
compatibility_mode: CompatibilityMode::None,

Silly nit :-) (feel free to ignore). Just to be inline with the way the symbol is imported in the import queue source.
Obviously this requires to adjust the sc_consensus_aura import list at the begin of the file

},
);

Expand Down
24 changes: 13 additions & 11 deletions polkadot-parachain/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1029,23 +1029,25 @@ where
let aura_verifier = move || {
let slot_duration = cumulus_client_consensus_aura::slot_duration(&*client2).unwrap();

Box::new(cumulus_client_consensus_aura::build_verifier::<<AuraId as AppKey>::Pair, _, _>(
cumulus_client_consensus_aura::BuildVerifierParams {
client: client2.clone(),
create_inherent_data_providers: move |_, _| async move {
let timestamp = sp_timestamp::InherentDataProvider::from_system_time();

let slot =
Box::new(
cumulus_client_consensus_aura::build_verifier::<<AuraId as AppKey>::Pair, _, _, _>(
cumulus_client_consensus_aura::BuildVerifierParams {
client: client2.clone(),
create_inherent_data_providers: move |_, _| async move {
let timestamp = sp_timestamp::InherentDataProvider::from_system_time();

let slot =
sp_consensus_aura::inherents::InherentDataProvider::from_timestamp_and_slot_duration(
*timestamp,
slot_duration,
);

Ok((slot, timestamp))
Ok((slot, timestamp))
},
telemetry: telemetry_handle,
},
telemetry: telemetry_handle,
},
)) as Box<_>
),
) as Box<_>
};

let relay_chain_verifier =
Expand Down