mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-25 08:21:10 +00:00
Limit number of blocks per level (2nd attempt) (#1559)
Prevents the StateDbError::TooManySiblingBlocks error from being triggered by eagerly removing stale blocks from the backend on block import and before the error condition is met. Introduces a just in time block recovery mechanism for blocks that were wrongly removed via an explicit pov-recovery method Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
This commit is contained in:
@@ -16,7 +16,7 @@
|
||||
|
||||
use std::{marker::PhantomData, sync::Arc};
|
||||
|
||||
use cumulus_client_consensus_common::ParachainBlockImport;
|
||||
use cumulus_client_consensus_common::ParachainBlockImportMarker;
|
||||
|
||||
use sc_consensus::{
|
||||
import_queue::{BasicQueue, Verifier as VerifierT},
|
||||
@@ -107,13 +107,17 @@ where
|
||||
/// Start an import queue for a Cumulus collator that does not uses any special authoring logic.
|
||||
pub fn import_queue<Client, Block: BlockT, I, CIDP>(
|
||||
client: Arc<Client>,
|
||||
block_import: ParachainBlockImport<I>,
|
||||
block_import: I,
|
||||
create_inherent_data_providers: CIDP,
|
||||
spawner: &impl sp_core::traits::SpawnEssentialNamed,
|
||||
registry: Option<&substrate_prometheus_endpoint::Registry>,
|
||||
) -> ClientResult<BasicQueue<Block, I::Transaction>>
|
||||
where
|
||||
I: BlockImport<Block, Error = ConsensusError> + Send + Sync + 'static,
|
||||
I: BlockImport<Block, Error = ConsensusError>
|
||||
+ ParachainBlockImportMarker
|
||||
+ Send
|
||||
+ Sync
|
||||
+ 'static,
|
||||
I::Transaction: Send,
|
||||
Client: ProvideRuntimeApi<Block> + Send + Sync + 'static,
|
||||
<Client as ProvideRuntimeApi<Block>>::Api: BlockBuilderApi<Block>,
|
||||
|
||||
Reference in New Issue
Block a user