mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-31 09:51:02 +00:00
Single ParachainBlockImport instance (#1782)
This commit is contained in:
@@ -17,6 +17,7 @@
|
||||
//! Parachain specific wrapper for the AuRa import queue.
|
||||
|
||||
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;
|
||||
@@ -33,10 +34,10 @@ use sp_runtime::traits::Block as BlockT;
|
||||
use std::{fmt::Debug, hash::Hash, sync::Arc};
|
||||
use substrate_prometheus_endpoint::Registry;
|
||||
|
||||
/// Parameters of [`import_queue`].
|
||||
/// Parameters for [`import_queue`].
|
||||
pub struct ImportQueueParams<'a, I, C, CIDP, S> {
|
||||
/// The block import to use.
|
||||
pub block_import: I,
|
||||
pub block_import: ParachainBlockImport<I>,
|
||||
/// The client to interact with the chain.
|
||||
pub client: Arc<C>,
|
||||
/// The inherent data providers, to create the inherent data.
|
||||
@@ -83,7 +84,7 @@ where
|
||||
CIDP::InherentDataProviders: InherentDataProviderExt + Send + Sync,
|
||||
{
|
||||
sc_consensus_aura::import_queue::<P, _, _, _, _, _>(sc_consensus_aura::ImportQueueParams {
|
||||
block_import: cumulus_client_consensus_common::ParachainBlockImport::new(block_import),
|
||||
block_import,
|
||||
justification_import: None,
|
||||
client,
|
||||
create_inherent_data_providers,
|
||||
|
||||
@@ -71,6 +71,22 @@ impl<B, CIDP, W> Clone for AuraConsensus<B, CIDP, W> {
|
||||
}
|
||||
}
|
||||
|
||||
/// Parameters of [`AuraConsensus::build`].
|
||||
pub struct BuildAuraConsensusParams<PF, BI, CIDP, Client, BS, SO> {
|
||||
pub proposer_factory: PF,
|
||||
pub create_inherent_data_providers: CIDP,
|
||||
pub block_import: ParachainBlockImport<BI>,
|
||||
pub para_client: Arc<Client>,
|
||||
pub backoff_authoring_blocks: Option<BS>,
|
||||
pub sync_oracle: SO,
|
||||
pub keystore: SyncCryptoStorePtr,
|
||||
pub force_authoring: bool,
|
||||
pub slot_duration: SlotDuration,
|
||||
pub telemetry: Option<TelemetryHandle>,
|
||||
pub block_proposal_slot_portion: SlotProportion,
|
||||
pub max_block_proposal_slot_portion: Option<SlotProportion>,
|
||||
}
|
||||
|
||||
impl<B, CIDP> AuraConsensus<B, CIDP, ()>
|
||||
where
|
||||
B: BlockT,
|
||||
@@ -117,7 +133,7 @@ where
|
||||
let worker = sc_consensus_aura::build_aura_worker::<P, _, _, _, _, _, _, _, _>(
|
||||
BuildAuraWorkerParams {
|
||||
client: para_client,
|
||||
block_import: ParachainBlockImport::new(block_import),
|
||||
block_import,
|
||||
justification_sync_link: (),
|
||||
proposer_factory,
|
||||
sync_oracle,
|
||||
@@ -216,19 +232,3 @@ where
|
||||
Some(ParachainCandidate { block: res.block, proof: res.storage_proof })
|
||||
}
|
||||
}
|
||||
|
||||
/// Parameters of [`AuraConsensus::build`].
|
||||
pub struct BuildAuraConsensusParams<PF, BI, CIDP, Client, BS, SO> {
|
||||
pub proposer_factory: PF,
|
||||
pub create_inherent_data_providers: CIDP,
|
||||
pub block_import: BI,
|
||||
pub para_client: Arc<Client>,
|
||||
pub backoff_authoring_blocks: Option<BS>,
|
||||
pub sync_oracle: SO,
|
||||
pub keystore: SyncCryptoStorePtr,
|
||||
pub force_authoring: bool,
|
||||
pub slot_duration: SlotDuration,
|
||||
pub telemetry: Option<TelemetryHandle>,
|
||||
pub block_proposal_slot_portion: SlotProportion,
|
||||
pub max_block_proposal_slot_portion: Option<SlotProportion>,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user