Companion for substrate 14647 (#2941)

* Companion for substrate 14647

* Futher cleanup

* Apply review suggestion

Co-authored-by: Sebastian Kunert <skunert49@gmail.com>

* Apply suggestions from code review

Co-authored-by: Sebastian Kunert <skunert49@gmail.com>

* update lockfile for {"polkadot", "substrate"}

---------

Co-authored-by: Sebastian Kunert <skunert49@gmail.com>
Co-authored-by: parity-processbot <>
This commit is contained in:
Davide Galassi
2023-07-27 13:07:24 +02:00
committed by GitHub
parent 7995da0460
commit 63f4c2e53c
7 changed files with 234 additions and 234 deletions
@@ -19,7 +19,7 @@
/// Equivocation resistance in general is a hard problem, as different nodes in the network
/// may see equivocations in a different order, and therefore may not agree on which blocks
/// should be thrown out and which ones should be kept.
use codec::{Decode, Encode};
use codec::Codec;
use cumulus_client_consensus_common::ParachainBlockImportMarker;
use lru::LruCache;
@@ -72,15 +72,15 @@ struct Verifier<P, Client, Block, CIDP> {
slot_duration: SlotDuration,
defender: NaiveEquivocationDefender,
telemetry: Option<TelemetryHandle>,
_marker: std::marker::PhantomData<(Block, P)>,
_phantom: std::marker::PhantomData<fn() -> (Block, P)>,
}
#[async_trait::async_trait]
impl<P, Client, Block, CIDP> VerifierT<Block> for Verifier<P, Client, Block, CIDP>
where
P: Pair,
P::Signature: Encode + Decode,
P::Public: Encode + Decode + PartialEq + Clone + Debug,
P::Signature: Codec,
P::Public: Codec + Debug,
Block: BlockT,
Client: ProvideRuntimeApi<Block> + Send + Sync,
<Client as ProvideRuntimeApi<Block>>::Api: BlockBuilderApi<Block> + AuraApi<Block, P::Public>,
@@ -223,9 +223,9 @@ pub fn fully_verifying_import_queue<P, Client, Block: BlockT, I, CIDP>(
telemetry: Option<TelemetryHandle>,
) -> BasicQueue<Block, I::Transaction>
where
P: Pair,
P::Signature: Encode + Decode,
P::Public: Encode + Decode + PartialEq + Clone + Debug,
P: Pair + 'static,
P::Signature: Codec,
P::Public: Codec + Debug,
I: BlockImport<Block, Error = ConsensusError>
+ ParachainBlockImportMarker
+ Send
@@ -242,7 +242,7 @@ where
defender: NaiveEquivocationDefender::default(),
slot_duration,
telemetry,
_marker: std::marker::PhantomData,
_phantom: std::marker::PhantomData,
};
BasicQueue::new(verifier, Box::new(block_import), None, spawner, registry)