mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-07-19 21:35:44 +00:00
Request based PoV distribution (#2640)
* Indentation fix. * Prepare request-response for PoV fetching. * Drop old PoV distribution. * WIP: Fetch PoV directly from backing. * Backing compiles. * Runtime access and connection management for PoV distribution. * Get rid of seemingly dead code. * Implement PoV fetching. Backing does not yet use it. * Don't send `ConnectToValidators` for empty list. * Even better - no need to check over and over again. * PoV fetching implemented. + Typechecks + Should work Missing: - Guide - Tests - Do fallback fetching in case fetching from seconding validator fails. * Check PoV hash upon reception. * Implement retry of PoV fetching in backing. * Avoid pointless validation spawning. * Add jaeger span to pov requesting. * Add back tracing. * Review remarks. * Whitespace. * Whitespace again. * Cleanup + fix tests. * Log to log target in overseer. * Fix more tests. * Don't fail if group cannot be found. * Simple test for PoV fetcher. * Handle missing group membership better. * Add test for retry functionality. * Fix flaky test. * Spaces again. * Guide updates. * Spaces.
This commit is contained in:
@@ -83,7 +83,7 @@ use polkadot_subsystem::messages::{
|
||||
CandidateValidationMessage, CandidateBackingMessage,
|
||||
CandidateSelectionMessage, ChainApiMessage, StatementDistributionMessage,
|
||||
AvailabilityDistributionMessage, BitfieldSigningMessage, BitfieldDistributionMessage,
|
||||
ProvisionerMessage, PoVDistributionMessage, RuntimeApiMessage,
|
||||
ProvisionerMessage, RuntimeApiMessage,
|
||||
AvailabilityStoreMessage, NetworkBridgeMessage, AllMessages, CollationGenerationMessage,
|
||||
CollatorProtocolMessage, AvailabilityRecoveryMessage, ApprovalDistributionMessage,
|
||||
ApprovalVotingMessage, GossipSupportMessage,
|
||||
@@ -522,7 +522,6 @@ pub struct Overseer<S> {
|
||||
OverseenSubsystem<BitfieldSigningMessage>,
|
||||
OverseenSubsystem<BitfieldDistributionMessage>,
|
||||
OverseenSubsystem<ProvisionerMessage>,
|
||||
OverseenSubsystem<PoVDistributionMessage>,
|
||||
OverseenSubsystem<RuntimeApiMessage>,
|
||||
OverseenSubsystem<AvailabilityStoreMessage>,
|
||||
OverseenSubsystem<NetworkBridgeMessage>,
|
||||
@@ -588,7 +587,7 @@ impl<F, T, U> MapSubsystem<T> for F where F: Fn(T) -> U {
|
||||
/// subsystems are implemented and the rest can be mocked with the [`DummySubsystem`].
|
||||
pub struct AllSubsystems<
|
||||
CV = (), CB = (), CS = (), SD = (), AD = (), AR = (), BS = (), BD = (), P = (),
|
||||
PoVD = (), RA = (), AS = (), NB = (), CA = (), CG = (), CP = (), ApD = (), ApV = (),
|
||||
RA = (), AS = (), NB = (), CA = (), CG = (), CP = (), ApD = (), ApV = (),
|
||||
GS = (),
|
||||
> {
|
||||
/// A candidate validation subsystem.
|
||||
@@ -609,8 +608,6 @@ pub struct AllSubsystems<
|
||||
pub bitfield_distribution: BD,
|
||||
/// A provisioner subsystem.
|
||||
pub provisioner: P,
|
||||
/// A PoV distribution subsystem.
|
||||
pub pov_distribution: PoVD,
|
||||
/// A runtime API subsystem.
|
||||
pub runtime_api: RA,
|
||||
/// An availability store subsystem.
|
||||
@@ -631,8 +628,8 @@ pub struct AllSubsystems<
|
||||
pub gossip_support: GS,
|
||||
}
|
||||
|
||||
impl<CV, CB, CS, SD, AD, AR, BS, BD, P, PoVD, RA, AS, NB, CA, CG, CP, ApD, ApV, GS>
|
||||
AllSubsystems<CV, CB, CS, SD, AD, AR, BS, BD, P, PoVD, RA, AS, NB, CA, CG, CP, ApD, ApV, GS>
|
||||
impl<CV, CB, CS, SD, AD, AR, BS, BD, P, RA, AS, NB, CA, CG, CP, ApD, ApV, GS>
|
||||
AllSubsystems<CV, CB, CS, SD, AD, AR, BS, BD, P, RA, AS, NB, CA, CG, CP, ApD, ApV, GS>
|
||||
{
|
||||
/// Create a new instance of [`AllSubsystems`].
|
||||
///
|
||||
@@ -665,7 +662,6 @@ impl<CV, CB, CS, SD, AD, AR, BS, BD, P, PoVD, RA, AS, NB, CA, CG, CP, ApD, ApV,
|
||||
DummySubsystem,
|
||||
DummySubsystem,
|
||||
DummySubsystem,
|
||||
DummySubsystem,
|
||||
> {
|
||||
AllSubsystems {
|
||||
candidate_validation: DummySubsystem,
|
||||
@@ -677,7 +673,6 @@ impl<CV, CB, CS, SD, AD, AR, BS, BD, P, PoVD, RA, AS, NB, CA, CG, CP, ApD, ApV,
|
||||
bitfield_signing: DummySubsystem,
|
||||
bitfield_distribution: DummySubsystem,
|
||||
provisioner: DummySubsystem,
|
||||
pov_distribution: DummySubsystem,
|
||||
runtime_api: DummySubsystem,
|
||||
availability_store: DummySubsystem,
|
||||
network_bridge: DummySubsystem,
|
||||
@@ -694,7 +689,7 @@ impl<CV, CB, CS, SD, AD, AR, BS, BD, P, PoVD, RA, AS, NB, CA, CG, CP, ApD, ApV,
|
||||
pub fn replace_candidate_validation<NEW>(
|
||||
self,
|
||||
candidate_validation: NEW,
|
||||
) -> AllSubsystems<NEW, CB, CS, SD, AD, AR, BS, BD, P, PoVD, RA, AS, NB, CA, CG, CP, ApD, ApV, GS> {
|
||||
) -> AllSubsystems<NEW, CB, CS, SD, AD, AR, BS, BD, P, RA, AS, NB, CA, CG, CP, ApD, ApV, GS> {
|
||||
AllSubsystems {
|
||||
candidate_validation,
|
||||
candidate_backing: self.candidate_backing,
|
||||
@@ -705,7 +700,6 @@ impl<CV, CB, CS, SD, AD, AR, BS, BD, P, PoVD, RA, AS, NB, CA, CG, CP, ApD, ApV,
|
||||
bitfield_signing: self.bitfield_signing,
|
||||
bitfield_distribution: self.bitfield_distribution,
|
||||
provisioner: self.provisioner,
|
||||
pov_distribution: self.pov_distribution,
|
||||
runtime_api: self.runtime_api,
|
||||
availability_store: self.availability_store,
|
||||
network_bridge: self.network_bridge,
|
||||
@@ -722,7 +716,7 @@ impl<CV, CB, CS, SD, AD, AR, BS, BD, P, PoVD, RA, AS, NB, CA, CG, CP, ApD, ApV,
|
||||
pub fn replace_candidate_backing<NEW>(
|
||||
self,
|
||||
candidate_backing: NEW,
|
||||
) -> AllSubsystems<CV, NEW, CS, SD, AD, AR, BS, BD, P, PoVD, RA, AS, NB, CA, CG, CP, ApD, ApV, GS> {
|
||||
) -> AllSubsystems<CV, NEW, CS, SD, AD, AR, BS, BD, P, RA, AS, NB, CA, CG, CP, ApD, ApV, GS> {
|
||||
AllSubsystems {
|
||||
candidate_validation: self.candidate_validation,
|
||||
candidate_backing,
|
||||
@@ -733,7 +727,6 @@ impl<CV, CB, CS, SD, AD, AR, BS, BD, P, PoVD, RA, AS, NB, CA, CG, CP, ApD, ApV,
|
||||
bitfield_signing: self.bitfield_signing,
|
||||
bitfield_distribution: self.bitfield_distribution,
|
||||
provisioner: self.provisioner,
|
||||
pov_distribution: self.pov_distribution,
|
||||
runtime_api: self.runtime_api,
|
||||
availability_store: self.availability_store,
|
||||
network_bridge: self.network_bridge,
|
||||
@@ -750,7 +743,7 @@ impl<CV, CB, CS, SD, AD, AR, BS, BD, P, PoVD, RA, AS, NB, CA, CG, CP, ApD, ApV,
|
||||
pub fn replace_candidate_selection<NEW>(
|
||||
self,
|
||||
candidate_selection: NEW,
|
||||
) -> AllSubsystems<CV, CB, NEW, SD, AD, AR, BS, BD, P, PoVD, RA, AS, NB, CA, CG, CP, ApD, ApV, GS> {
|
||||
) -> AllSubsystems<CV, CB, NEW, SD, AD, AR, BS, BD, P, RA, AS, NB, CA, CG, CP, ApD, ApV, GS> {
|
||||
AllSubsystems {
|
||||
candidate_validation: self.candidate_validation,
|
||||
candidate_backing: self.candidate_backing,
|
||||
@@ -761,7 +754,6 @@ impl<CV, CB, CS, SD, AD, AR, BS, BD, P, PoVD, RA, AS, NB, CA, CG, CP, ApD, ApV,
|
||||
bitfield_signing: self.bitfield_signing,
|
||||
bitfield_distribution: self.bitfield_distribution,
|
||||
provisioner: self.provisioner,
|
||||
pov_distribution: self.pov_distribution,
|
||||
runtime_api: self.runtime_api,
|
||||
availability_store: self.availability_store,
|
||||
network_bridge: self.network_bridge,
|
||||
@@ -778,7 +770,7 @@ impl<CV, CB, CS, SD, AD, AR, BS, BD, P, PoVD, RA, AS, NB, CA, CG, CP, ApD, ApV,
|
||||
pub fn replace_statement_distribution<NEW>(
|
||||
self,
|
||||
statement_distribution: NEW,
|
||||
) -> AllSubsystems<CV, CB, CS, NEW, AD, AR, BS, BD, P, PoVD, RA, AS, NB, CA, CG, CP, ApD, ApV, GS> {
|
||||
) -> AllSubsystems<CV, CB, CS, NEW, AD, AR, BS, BD, P, RA, AS, NB, CA, CG, CP, ApD, ApV, GS> {
|
||||
AllSubsystems {
|
||||
candidate_validation: self.candidate_validation,
|
||||
candidate_backing: self.candidate_backing,
|
||||
@@ -789,7 +781,6 @@ impl<CV, CB, CS, SD, AD, AR, BS, BD, P, PoVD, RA, AS, NB, CA, CG, CP, ApD, ApV,
|
||||
bitfield_signing: self.bitfield_signing,
|
||||
bitfield_distribution: self.bitfield_distribution,
|
||||
provisioner: self.provisioner,
|
||||
pov_distribution: self.pov_distribution,
|
||||
runtime_api: self.runtime_api,
|
||||
availability_store: self.availability_store,
|
||||
network_bridge: self.network_bridge,
|
||||
@@ -806,7 +797,7 @@ impl<CV, CB, CS, SD, AD, AR, BS, BD, P, PoVD, RA, AS, NB, CA, CG, CP, ApD, ApV,
|
||||
pub fn replace_availability_distribution<NEW>(
|
||||
self,
|
||||
availability_distribution: NEW,
|
||||
) -> AllSubsystems<CV, CB, CS, SD, NEW, AR, BS, BD, P, PoVD, RA, AS, NB, CA, CG, CP, ApD, ApV, GS> {
|
||||
) -> AllSubsystems<CV, CB, CS, SD, NEW, AR, BS, BD, P, RA, AS, NB, CA, CG, CP, ApD, ApV, GS> {
|
||||
AllSubsystems {
|
||||
candidate_validation: self.candidate_validation,
|
||||
candidate_backing: self.candidate_backing,
|
||||
@@ -817,7 +808,6 @@ impl<CV, CB, CS, SD, AD, AR, BS, BD, P, PoVD, RA, AS, NB, CA, CG, CP, ApD, ApV,
|
||||
bitfield_signing: self.bitfield_signing,
|
||||
bitfield_distribution: self.bitfield_distribution,
|
||||
provisioner: self.provisioner,
|
||||
pov_distribution: self.pov_distribution,
|
||||
runtime_api: self.runtime_api,
|
||||
availability_store: self.availability_store,
|
||||
network_bridge: self.network_bridge,
|
||||
@@ -834,7 +824,7 @@ impl<CV, CB, CS, SD, AD, AR, BS, BD, P, PoVD, RA, AS, NB, CA, CG, CP, ApD, ApV,
|
||||
pub fn replace_availability_recovery<NEW>(
|
||||
self,
|
||||
availability_recovery: NEW,
|
||||
) -> AllSubsystems<CV, CB, CS, SD, AD, NEW, BS, BD, P, PoVD, RA, AS, NB, CA, CG, CP, ApD, ApV, GS> {
|
||||
) -> AllSubsystems<CV, CB, CS, SD, AD, NEW, BS, BD, P, RA, AS, NB, CA, CG, CP, ApD, ApV, GS> {
|
||||
AllSubsystems {
|
||||
candidate_validation: self.candidate_validation,
|
||||
candidate_backing: self.candidate_backing,
|
||||
@@ -845,7 +835,6 @@ impl<CV, CB, CS, SD, AD, AR, BS, BD, P, PoVD, RA, AS, NB, CA, CG, CP, ApD, ApV,
|
||||
bitfield_signing: self.bitfield_signing,
|
||||
bitfield_distribution: self.bitfield_distribution,
|
||||
provisioner: self.provisioner,
|
||||
pov_distribution: self.pov_distribution,
|
||||
runtime_api: self.runtime_api,
|
||||
availability_store: self.availability_store,
|
||||
network_bridge: self.network_bridge,
|
||||
@@ -862,7 +851,7 @@ impl<CV, CB, CS, SD, AD, AR, BS, BD, P, PoVD, RA, AS, NB, CA, CG, CP, ApD, ApV,
|
||||
pub fn replace_bitfield_signing<NEW>(
|
||||
self,
|
||||
bitfield_signing: NEW,
|
||||
) -> AllSubsystems<CV, CB, CS, SD, AD, AR, NEW, BD, P, PoVD, RA, AS, NB, CA, CG, CP, ApD, ApV, GS> {
|
||||
) -> AllSubsystems<CV, CB, CS, SD, AD, AR, NEW, BD, P, RA, AS, NB, CA, CG, CP, ApD, ApV, GS> {
|
||||
AllSubsystems {
|
||||
candidate_validation: self.candidate_validation,
|
||||
candidate_backing: self.candidate_backing,
|
||||
@@ -873,7 +862,6 @@ impl<CV, CB, CS, SD, AD, AR, BS, BD, P, PoVD, RA, AS, NB, CA, CG, CP, ApD, ApV,
|
||||
bitfield_signing,
|
||||
bitfield_distribution: self.bitfield_distribution,
|
||||
provisioner: self.provisioner,
|
||||
pov_distribution: self.pov_distribution,
|
||||
runtime_api: self.runtime_api,
|
||||
availability_store: self.availability_store,
|
||||
network_bridge: self.network_bridge,
|
||||
@@ -890,7 +878,7 @@ impl<CV, CB, CS, SD, AD, AR, BS, BD, P, PoVD, RA, AS, NB, CA, CG, CP, ApD, ApV,
|
||||
pub fn replace_bitfield_distribution<NEW>(
|
||||
self,
|
||||
bitfield_distribution: NEW,
|
||||
) -> AllSubsystems<CV, CB, CS, SD, AD, AR, BS, NEW, P, PoVD, RA, AS, NB, CA, CG, CP, ApD, ApV, GS> {
|
||||
) -> AllSubsystems<CV, CB, CS, SD, AD, AR, BS, NEW, P, RA, AS, NB, CA, CG, CP, ApD, ApV, GS> {
|
||||
AllSubsystems {
|
||||
candidate_validation: self.candidate_validation,
|
||||
candidate_backing: self.candidate_backing,
|
||||
@@ -901,7 +889,6 @@ impl<CV, CB, CS, SD, AD, AR, BS, BD, P, PoVD, RA, AS, NB, CA, CG, CP, ApD, ApV,
|
||||
bitfield_signing: self.bitfield_signing,
|
||||
bitfield_distribution,
|
||||
provisioner: self.provisioner,
|
||||
pov_distribution: self.pov_distribution,
|
||||
runtime_api: self.runtime_api,
|
||||
availability_store: self.availability_store,
|
||||
network_bridge: self.network_bridge,
|
||||
@@ -918,7 +905,7 @@ impl<CV, CB, CS, SD, AD, AR, BS, BD, P, PoVD, RA, AS, NB, CA, CG, CP, ApD, ApV,
|
||||
pub fn replace_provisioner<NEW>(
|
||||
self,
|
||||
provisioner: NEW,
|
||||
) -> AllSubsystems<CV, CB, CS, SD, AD, AR, BS, BD, NEW, PoVD, RA, AS, NB, CA, CG, CP, ApD, ApV, GS> {
|
||||
) -> AllSubsystems<CV, CB, CS, SD, AD, AR, BS, BD, NEW, RA, AS, NB, CA, CG, CP, ApD, ApV, GS> {
|
||||
AllSubsystems {
|
||||
candidate_validation: self.candidate_validation,
|
||||
candidate_backing: self.candidate_backing,
|
||||
@@ -929,35 +916,6 @@ impl<CV, CB, CS, SD, AD, AR, BS, BD, P, PoVD, RA, AS, NB, CA, CG, CP, ApD, ApV,
|
||||
bitfield_signing: self.bitfield_signing,
|
||||
bitfield_distribution: self.bitfield_distribution,
|
||||
provisioner,
|
||||
pov_distribution: self.pov_distribution,
|
||||
runtime_api: self.runtime_api,
|
||||
availability_store: self.availability_store,
|
||||
network_bridge: self.network_bridge,
|
||||
chain_api: self.chain_api,
|
||||
collation_generation: self.collation_generation,
|
||||
collator_protocol: self.collator_protocol,
|
||||
approval_distribution: self.approval_distribution,
|
||||
approval_voting: self.approval_voting,
|
||||
gossip_support: self.gossip_support,
|
||||
}
|
||||
}
|
||||
|
||||
/// Replace the `pov_distribution` instance in `self`.
|
||||
pub fn replace_pov_distribution<NEW>(
|
||||
self,
|
||||
pov_distribution: NEW,
|
||||
) -> AllSubsystems<CV, CB, CS, SD, AD, AR, BS, BD, P, NEW, RA, AS, NB, CA, CG, CP, ApD, ApV, GS> {
|
||||
AllSubsystems {
|
||||
candidate_validation: self.candidate_validation,
|
||||
candidate_backing: self.candidate_backing,
|
||||
candidate_selection: self.candidate_selection,
|
||||
statement_distribution: self.statement_distribution,
|
||||
availability_distribution: self.availability_distribution,
|
||||
availability_recovery: self.availability_recovery,
|
||||
bitfield_signing: self.bitfield_signing,
|
||||
bitfield_distribution: self.bitfield_distribution,
|
||||
provisioner: self.provisioner,
|
||||
pov_distribution,
|
||||
runtime_api: self.runtime_api,
|
||||
availability_store: self.availability_store,
|
||||
network_bridge: self.network_bridge,
|
||||
@@ -974,7 +932,7 @@ impl<CV, CB, CS, SD, AD, AR, BS, BD, P, PoVD, RA, AS, NB, CA, CG, CP, ApD, ApV,
|
||||
pub fn replace_runtime_api<NEW>(
|
||||
self,
|
||||
runtime_api: NEW,
|
||||
) -> AllSubsystems<CV, CB, CS, SD, AD, AR, BS, BD, P, PoVD, NEW, AS, NB, CA, CG, CP, ApD, ApV, GS> {
|
||||
) -> AllSubsystems<CV, CB, CS, SD, AD, AR, BS, BD, P, NEW, AS, NB, CA, CG, CP, ApD, ApV, GS> {
|
||||
AllSubsystems {
|
||||
candidate_validation: self.candidate_validation,
|
||||
candidate_backing: self.candidate_backing,
|
||||
@@ -985,7 +943,6 @@ impl<CV, CB, CS, SD, AD, AR, BS, BD, P, PoVD, RA, AS, NB, CA, CG, CP, ApD, ApV,
|
||||
bitfield_signing: self.bitfield_signing,
|
||||
bitfield_distribution: self.bitfield_distribution,
|
||||
provisioner: self.provisioner,
|
||||
pov_distribution: self.pov_distribution,
|
||||
runtime_api,
|
||||
availability_store: self.availability_store,
|
||||
network_bridge: self.network_bridge,
|
||||
@@ -1002,7 +959,7 @@ impl<CV, CB, CS, SD, AD, AR, BS, BD, P, PoVD, RA, AS, NB, CA, CG, CP, ApD, ApV,
|
||||
pub fn replace_availability_store<NEW>(
|
||||
self,
|
||||
availability_store: NEW,
|
||||
) -> AllSubsystems<CV, CB, CS, SD, AD, AR, BS, BD, P, PoVD, RA, NEW, NB, CA, CG, CP, ApD, ApV, GS> {
|
||||
) -> AllSubsystems<CV, CB, CS, SD, AD, AR, BS, BD, P, RA, NEW, NB, CA, CG, CP, ApD, ApV, GS> {
|
||||
AllSubsystems {
|
||||
candidate_validation: self.candidate_validation,
|
||||
candidate_backing: self.candidate_backing,
|
||||
@@ -1013,7 +970,6 @@ impl<CV, CB, CS, SD, AD, AR, BS, BD, P, PoVD, RA, AS, NB, CA, CG, CP, ApD, ApV,
|
||||
bitfield_signing: self.bitfield_signing,
|
||||
bitfield_distribution: self.bitfield_distribution,
|
||||
provisioner: self.provisioner,
|
||||
pov_distribution: self.pov_distribution,
|
||||
runtime_api: self.runtime_api,
|
||||
availability_store,
|
||||
network_bridge: self.network_bridge,
|
||||
@@ -1030,7 +986,7 @@ impl<CV, CB, CS, SD, AD, AR, BS, BD, P, PoVD, RA, AS, NB, CA, CG, CP, ApD, ApV,
|
||||
pub fn replace_network_bridge<NEW>(
|
||||
self,
|
||||
network_bridge: NEW,
|
||||
) -> AllSubsystems<CV, CB, CS, SD, AD, AR, BS, BD, P, PoVD, RA, AS, NEW, CA, CG, CP, ApD, ApV, GS> {
|
||||
) -> AllSubsystems<CV, CB, CS, SD, AD, AR, BS, BD, P, RA, AS, NEW, CA, CG, CP, ApD, ApV, GS> {
|
||||
AllSubsystems {
|
||||
candidate_validation: self.candidate_validation,
|
||||
candidate_backing: self.candidate_backing,
|
||||
@@ -1041,7 +997,6 @@ impl<CV, CB, CS, SD, AD, AR, BS, BD, P, PoVD, RA, AS, NB, CA, CG, CP, ApD, ApV,
|
||||
bitfield_signing: self.bitfield_signing,
|
||||
bitfield_distribution: self.bitfield_distribution,
|
||||
provisioner: self.provisioner,
|
||||
pov_distribution: self.pov_distribution,
|
||||
runtime_api: self.runtime_api,
|
||||
availability_store: self.availability_store,
|
||||
network_bridge,
|
||||
@@ -1058,7 +1013,7 @@ impl<CV, CB, CS, SD, AD, AR, BS, BD, P, PoVD, RA, AS, NB, CA, CG, CP, ApD, ApV,
|
||||
pub fn replace_chain_api<NEW>(
|
||||
self,
|
||||
chain_api: NEW,
|
||||
) -> AllSubsystems<CV, CB, CS, SD, AD, AR, BS, BD, P, PoVD, RA, AS, NB, NEW, CG, CP, ApD, ApV, GS> {
|
||||
) -> AllSubsystems<CV, CB, CS, SD, AD, AR, BS, BD, P, RA, AS, NB, NEW, CG, CP, ApD, ApV, GS> {
|
||||
AllSubsystems {
|
||||
candidate_validation: self.candidate_validation,
|
||||
candidate_backing: self.candidate_backing,
|
||||
@@ -1069,7 +1024,6 @@ impl<CV, CB, CS, SD, AD, AR, BS, BD, P, PoVD, RA, AS, NB, CA, CG, CP, ApD, ApV,
|
||||
bitfield_signing: self.bitfield_signing,
|
||||
bitfield_distribution: self.bitfield_distribution,
|
||||
provisioner: self.provisioner,
|
||||
pov_distribution: self.pov_distribution,
|
||||
runtime_api: self.runtime_api,
|
||||
availability_store: self.availability_store,
|
||||
network_bridge: self.network_bridge,
|
||||
@@ -1086,7 +1040,7 @@ impl<CV, CB, CS, SD, AD, AR, BS, BD, P, PoVD, RA, AS, NB, CA, CG, CP, ApD, ApV,
|
||||
pub fn replace_collation_generation<NEW>(
|
||||
self,
|
||||
collation_generation: NEW,
|
||||
) -> AllSubsystems<CV, CB, CS, SD, AD, AR, BS, BD, P, PoVD, RA, AS, NB, CA, NEW, CP, ApD, ApV, GS> {
|
||||
) -> AllSubsystems<CV, CB, CS, SD, AD, AR, BS, BD, P, RA, AS, NB, CA, NEW, CP, ApD, ApV, GS> {
|
||||
AllSubsystems {
|
||||
candidate_validation: self.candidate_validation,
|
||||
candidate_backing: self.candidate_backing,
|
||||
@@ -1097,7 +1051,6 @@ impl<CV, CB, CS, SD, AD, AR, BS, BD, P, PoVD, RA, AS, NB, CA, CG, CP, ApD, ApV,
|
||||
bitfield_signing: self.bitfield_signing,
|
||||
bitfield_distribution: self.bitfield_distribution,
|
||||
provisioner: self.provisioner,
|
||||
pov_distribution: self.pov_distribution,
|
||||
runtime_api: self.runtime_api,
|
||||
availability_store: self.availability_store,
|
||||
network_bridge: self.network_bridge,
|
||||
@@ -1114,7 +1067,7 @@ impl<CV, CB, CS, SD, AD, AR, BS, BD, P, PoVD, RA, AS, NB, CA, CG, CP, ApD, ApV,
|
||||
pub fn replace_collator_protocol<NEW>(
|
||||
self,
|
||||
collator_protocol: NEW,
|
||||
) -> AllSubsystems<CV, CB, CS, SD, AD, AR, BS, BD, P, PoVD, RA, AS, NB, CA, CG, NEW, ApD, ApV, GS> {
|
||||
) -> AllSubsystems<CV, CB, CS, SD, AD, AR, BS, BD, P, RA, AS, NB, CA, CG, NEW, ApD, ApV, GS> {
|
||||
AllSubsystems {
|
||||
candidate_validation: self.candidate_validation,
|
||||
candidate_backing: self.candidate_backing,
|
||||
@@ -1125,7 +1078,6 @@ impl<CV, CB, CS, SD, AD, AR, BS, BD, P, PoVD, RA, AS, NB, CA, CG, CP, ApD, ApV,
|
||||
bitfield_signing: self.bitfield_signing,
|
||||
bitfield_distribution: self.bitfield_distribution,
|
||||
provisioner: self.provisioner,
|
||||
pov_distribution: self.pov_distribution,
|
||||
runtime_api: self.runtime_api,
|
||||
availability_store: self.availability_store,
|
||||
network_bridge: self.network_bridge,
|
||||
@@ -1142,7 +1094,7 @@ impl<CV, CB, CS, SD, AD, AR, BS, BD, P, PoVD, RA, AS, NB, CA, CG, CP, ApD, ApV,
|
||||
pub fn replace_approval_distribution<NEW>(
|
||||
self,
|
||||
approval_distribution: NEW,
|
||||
) -> AllSubsystems<CV, CB, CS, SD, AD, AR, BS, BD, P, PoVD, RA, AS, NB, CA, CG, CP, NEW, ApV, GS> {
|
||||
) -> AllSubsystems<CV, CB, CS, SD, AD, AR, BS, BD, P, RA, AS, NB, CA, CG, CP, NEW, ApV, GS> {
|
||||
AllSubsystems {
|
||||
candidate_validation: self.candidate_validation,
|
||||
candidate_backing: self.candidate_backing,
|
||||
@@ -1153,7 +1105,6 @@ impl<CV, CB, CS, SD, AD, AR, BS, BD, P, PoVD, RA, AS, NB, CA, CG, CP, ApD, ApV,
|
||||
bitfield_signing: self.bitfield_signing,
|
||||
bitfield_distribution: self.bitfield_distribution,
|
||||
provisioner: self.provisioner,
|
||||
pov_distribution: self.pov_distribution,
|
||||
runtime_api: self.runtime_api,
|
||||
availability_store: self.availability_store,
|
||||
network_bridge: self.network_bridge,
|
||||
@@ -1170,7 +1121,7 @@ impl<CV, CB, CS, SD, AD, AR, BS, BD, P, PoVD, RA, AS, NB, CA, CG, CP, ApD, ApV,
|
||||
pub fn replace_approval_voting<NEW>(
|
||||
self,
|
||||
approval_voting: NEW,
|
||||
) -> AllSubsystems<CV, CB, CS, SD, AD, AR, BS, BD, P, PoVD, RA, AS, NB, CA, CG, CP, ApD, NEW, GS> {
|
||||
) -> AllSubsystems<CV, CB, CS, SD, AD, AR, BS, BD, P, RA, AS, NB, CA, CG, CP, ApD, NEW, GS> {
|
||||
AllSubsystems {
|
||||
candidate_validation: self.candidate_validation,
|
||||
candidate_backing: self.candidate_backing,
|
||||
@@ -1181,7 +1132,6 @@ impl<CV, CB, CS, SD, AD, AR, BS, BD, P, PoVD, RA, AS, NB, CA, CG, CP, ApD, ApV,
|
||||
bitfield_signing: self.bitfield_signing,
|
||||
bitfield_distribution: self.bitfield_distribution,
|
||||
provisioner: self.provisioner,
|
||||
pov_distribution: self.pov_distribution,
|
||||
runtime_api: self.runtime_api,
|
||||
availability_store: self.availability_store,
|
||||
network_bridge: self.network_bridge,
|
||||
@@ -1198,7 +1148,7 @@ impl<CV, CB, CS, SD, AD, AR, BS, BD, P, PoVD, RA, AS, NB, CA, CG, CP, ApD, ApV,
|
||||
pub fn replace_gossip_support<NEW>(
|
||||
self,
|
||||
gossip_support: NEW,
|
||||
) -> AllSubsystems<CV, CB, CS, SD, AD, AR, BS, BD, P, PoVD, RA, AS, NB, CA, CG, CP, ApD, ApV, NEW> {
|
||||
) -> AllSubsystems<CV, CB, CS, SD, AD, AR, BS, BD, P, RA, AS, NB, CA, CG, CP, ApD, ApV, NEW> {
|
||||
AllSubsystems {
|
||||
candidate_validation: self.candidate_validation,
|
||||
candidate_backing: self.candidate_backing,
|
||||
@@ -1209,7 +1159,6 @@ impl<CV, CB, CS, SD, AD, AR, BS, BD, P, PoVD, RA, AS, NB, CA, CG, CP, ApD, ApV,
|
||||
bitfield_signing: self.bitfield_signing,
|
||||
bitfield_distribution: self.bitfield_distribution,
|
||||
provisioner: self.provisioner,
|
||||
pov_distribution: self.pov_distribution,
|
||||
runtime_api: self.runtime_api,
|
||||
availability_store: self.availability_store,
|
||||
network_bridge: self.network_bridge,
|
||||
@@ -1222,7 +1171,7 @@ impl<CV, CB, CS, SD, AD, AR, BS, BD, P, PoVD, RA, AS, NB, CA, CG, CP, ApD, ApV,
|
||||
}
|
||||
}
|
||||
|
||||
fn as_ref(&self) -> AllSubsystems<&'_ CV, &'_ CB, &'_ CS, &'_ SD, &'_ AD, &'_ AR, &'_ BS, &'_ BD, &'_ P, &'_ PoVD, &'_ RA, &'_ AS, &'_ NB, &'_ CA, &'_ CG, &'_ CP, &'_ ApD, &'_ ApV, &'_ GS> {
|
||||
fn as_ref(&self) -> AllSubsystems<&'_ CV, &'_ CB, &'_ CS, &'_ SD, &'_ AD, &'_ AR, &'_ BS, &'_ BD, &'_ P, &'_ RA, &'_ AS, &'_ NB, &'_ CA, &'_ CG, &'_ CP, &'_ ApD, &'_ ApV, &'_ GS> {
|
||||
AllSubsystems {
|
||||
candidate_validation: &self.candidate_validation,
|
||||
candidate_backing: &self.candidate_backing,
|
||||
@@ -1233,7 +1182,6 @@ impl<CV, CB, CS, SD, AD, AR, BS, BD, P, PoVD, RA, AS, NB, CA, CG, CP, ApD, ApV,
|
||||
bitfield_signing: &self.bitfield_signing,
|
||||
bitfield_distribution: &self.bitfield_distribution,
|
||||
provisioner: &self.provisioner,
|
||||
pov_distribution: &self.pov_distribution,
|
||||
runtime_api: &self.runtime_api,
|
||||
availability_store: &self.availability_store,
|
||||
network_bridge: &self.network_bridge,
|
||||
@@ -1257,7 +1205,6 @@ impl<CV, CB, CS, SD, AD, AR, BS, BD, P, PoVD, RA, AS, NB, CA, CG, CP, ApD, ApV,
|
||||
<M as MapSubsystem<BS>>::Output,
|
||||
<M as MapSubsystem<BD>>::Output,
|
||||
<M as MapSubsystem<P>>::Output,
|
||||
<M as MapSubsystem<PoVD>>::Output,
|
||||
<M as MapSubsystem<RA>>::Output,
|
||||
<M as MapSubsystem<AS>>::Output,
|
||||
<M as MapSubsystem<NB>>::Output,
|
||||
@@ -1278,7 +1225,6 @@ impl<CV, CB, CS, SD, AD, AR, BS, BD, P, PoVD, RA, AS, NB, CA, CG, CP, ApD, ApV,
|
||||
M: MapSubsystem<BS>,
|
||||
M: MapSubsystem<BD>,
|
||||
M: MapSubsystem<P>,
|
||||
M: MapSubsystem<PoVD>,
|
||||
M: MapSubsystem<RA>,
|
||||
M: MapSubsystem<AS>,
|
||||
M: MapSubsystem<NB>,
|
||||
@@ -1299,7 +1245,6 @@ impl<CV, CB, CS, SD, AD, AR, BS, BD, P, PoVD, RA, AS, NB, CA, CG, CP, ApD, ApV,
|
||||
bitfield_signing: m.map_subsystem(self.bitfield_signing),
|
||||
bitfield_distribution: m.map_subsystem(self.bitfield_distribution),
|
||||
provisioner: m.map_subsystem(self.provisioner),
|
||||
pov_distribution: m.map_subsystem(self.pov_distribution),
|
||||
runtime_api: m.map_subsystem(self.runtime_api),
|
||||
availability_store: m.map_subsystem(self.availability_store),
|
||||
network_bridge: m.map_subsystem(self.network_bridge),
|
||||
@@ -1317,7 +1262,7 @@ type AllSubsystemsSame<T> = AllSubsystems<
|
||||
T, T, T, T, T,
|
||||
T, T, T, T, T,
|
||||
T, T, T, T, T,
|
||||
T, T, T, T,
|
||||
T, T, T,
|
||||
>;
|
||||
|
||||
/// Overseer Prometheus metrics.
|
||||
@@ -1566,9 +1511,9 @@ where
|
||||
/// #
|
||||
/// # }); }
|
||||
/// ```
|
||||
pub fn new<CV, CB, CS, SD, AD, AR, BS, BD, P, PoVD, RA, AS, NB, CA, CG, CP, ApD, ApV, GS>(
|
||||
pub fn new<CV, CB, CS, SD, AD, AR, BS, BD, P, RA, AS, NB, CA, CG, CP, ApD, ApV, GS>(
|
||||
leaves: impl IntoIterator<Item = BlockInfo>,
|
||||
all_subsystems: AllSubsystems<CV, CB, CS, SD, AD, AR, BS, BD, P, PoVD, RA, AS, NB, CA, CG, CP, ApD, ApV, GS>,
|
||||
all_subsystems: AllSubsystems<CV, CB, CS, SD, AD, AR, BS, BD, P, RA, AS, NB, CA, CG, CP, ApD, ApV, GS>,
|
||||
prometheus_registry: Option<&prometheus::Registry>,
|
||||
mut s: S,
|
||||
) -> SubsystemResult<(Self, OverseerHandler)>
|
||||
@@ -1582,7 +1527,6 @@ where
|
||||
BS: Subsystem<OverseerSubsystemContext<BitfieldSigningMessage>> + Send,
|
||||
BD: Subsystem<OverseerSubsystemContext<BitfieldDistributionMessage>> + Send,
|
||||
P: Subsystem<OverseerSubsystemContext<ProvisionerMessage>> + Send,
|
||||
PoVD: Subsystem<OverseerSubsystemContext<PoVDistributionMessage>> + Send,
|
||||
RA: Subsystem<OverseerSubsystemContext<RuntimeApiMessage>> + Send,
|
||||
AS: Subsystem<OverseerSubsystemContext<AvailabilityStoreMessage>> + Send,
|
||||
NB: Subsystem<OverseerSubsystemContext<NetworkBridgeMessage>> + Send,
|
||||
@@ -1697,16 +1641,6 @@ where
|
||||
TaskKind::Regular,
|
||||
)?;
|
||||
|
||||
let pov_distribution_subsystem = spawn(
|
||||
&mut s,
|
||||
&mut running_subsystems,
|
||||
metered::UnboundedMeteredSender::<_>::clone(&to_overseer_tx),
|
||||
all_subsystems.pov_distribution,
|
||||
&metrics,
|
||||
&mut seed,
|
||||
TaskKind::Regular,
|
||||
)?;
|
||||
|
||||
let runtime_api_subsystem = spawn(
|
||||
&mut s,
|
||||
&mut running_subsystems,
|
||||
@@ -1816,7 +1750,6 @@ where
|
||||
bitfield_signing: bitfield_signing_subsystem,
|
||||
bitfield_distribution: bitfield_distribution_subsystem,
|
||||
provisioner: provisioner_subsystem,
|
||||
pov_distribution: pov_distribution_subsystem,
|
||||
runtime_api: runtime_api_subsystem,
|
||||
availability_store: availability_store_subsystem,
|
||||
network_bridge: network_bridge_subsystem,
|
||||
@@ -1893,7 +1826,6 @@ where
|
||||
let _ = self.subsystems.bitfield_signing.send_signal(OverseerSignal::Conclude).await;
|
||||
let _ = self.subsystems.bitfield_distribution.send_signal(OverseerSignal::Conclude).await;
|
||||
let _ = self.subsystems.provisioner.send_signal(OverseerSignal::Conclude).await;
|
||||
let _ = self.subsystems.pov_distribution.send_signal(OverseerSignal::Conclude).await;
|
||||
let _ = self.subsystems.runtime_api.send_signal(OverseerSignal::Conclude).await;
|
||||
let _ = self.subsystems.availability_store.send_signal(OverseerSignal::Conclude).await;
|
||||
let _ = self.subsystems.network_bridge.send_signal(OverseerSignal::Conclude).await;
|
||||
@@ -2072,7 +2004,6 @@ where
|
||||
self.subsystems.bitfield_signing.send_signal(signal.clone()).await?;
|
||||
self.subsystems.bitfield_distribution.send_signal(signal.clone()).await?;
|
||||
self.subsystems.provisioner.send_signal(signal.clone()).await?;
|
||||
self.subsystems.pov_distribution.send_signal(signal.clone()).await?;
|
||||
self.subsystems.runtime_api.send_signal(signal.clone()).await?;
|
||||
self.subsystems.availability_store.send_signal(signal.clone()).await?;
|
||||
self.subsystems.network_bridge.send_signal(signal.clone()).await?;
|
||||
@@ -2118,9 +2049,6 @@ where
|
||||
AllMessages::Provisioner(msg) => {
|
||||
self.subsystems.provisioner.send_message(msg).await?;
|
||||
},
|
||||
AllMessages::PoVDistribution(msg) => {
|
||||
self.subsystems.pov_distribution.send_message(msg).await?;
|
||||
},
|
||||
AllMessages::RuntimeApi(msg) => {
|
||||
self.subsystems.runtime_api.send_message(msg).await?;
|
||||
},
|
||||
@@ -2244,9 +2172,9 @@ fn spawn<S: SpawnNamed, M: Send + 'static>(
|
||||
|
||||
let fut = Box::pin(async move {
|
||||
if let Err(e) = future.await {
|
||||
tracing::error!(subsystem=name, err = ?e, "subsystem exited with error");
|
||||
tracing::error!(target: LOG_TARGET, subsystem=name, err = ?e, "subsystem exited with error");
|
||||
} else {
|
||||
tracing::debug!(subsystem=name, "subsystem exited without an error");
|
||||
tracing::debug!(target: LOG_TARGET, subsystem=name, "subsystem exited without an error");
|
||||
}
|
||||
let _ = tx.send(());
|
||||
});
|
||||
@@ -3006,10 +2934,6 @@ mod tests {
|
||||
ProvisionerMessage::RequestInherentData(Default::default(), sender)
|
||||
}
|
||||
|
||||
fn test_pov_distribution_msg() -> PoVDistributionMessage {
|
||||
PoVDistributionMessage::NetworkBridgeUpdateV1(test_network_bridge_event())
|
||||
}
|
||||
|
||||
fn test_runtime_api_msg() -> RuntimeApiMessage {
|
||||
let (sender, _) = oneshot::channel();
|
||||
RuntimeApiMessage::Request(Default::default(), RuntimeApiRequest::Validators(sender))
|
||||
@@ -3061,7 +2985,6 @@ mod tests {
|
||||
bitfield_signing: subsystem.clone(),
|
||||
bitfield_distribution: subsystem.clone(),
|
||||
provisioner: subsystem.clone(),
|
||||
pov_distribution: subsystem.clone(),
|
||||
runtime_api: subsystem.clone(),
|
||||
availability_store: subsystem.clone(),
|
||||
network_bridge: subsystem.clone(),
|
||||
@@ -3100,7 +3023,6 @@ mod tests {
|
||||
// handler.send_msg(AllMessages::GossipSupport(test_bitfield_signing_msg())).await;
|
||||
handler.send_msg(AllMessages::BitfieldDistribution(test_bitfield_distribution_msg())).await;
|
||||
handler.send_msg(AllMessages::Provisioner(test_provisioner_msg())).await;
|
||||
handler.send_msg(AllMessages::PoVDistribution(test_pov_distribution_msg())).await;
|
||||
handler.send_msg(AllMessages::RuntimeApi(test_runtime_api_msg())).await;
|
||||
handler.send_msg(AllMessages::AvailabilityStore(test_availability_store_msg())).await;
|
||||
handler.send_msg(AllMessages::NetworkBridge(test_network_bridge_msg())).await;
|
||||
@@ -3113,7 +3035,7 @@ mod tests {
|
||||
|
||||
select! {
|
||||
res = overseer_fut => {
|
||||
const NUM_SUBSYSTEMS: usize = 19;
|
||||
const NUM_SUBSYSTEMS: usize = 18;
|
||||
|
||||
assert_eq!(stop_signals_received.load(atomic::Ordering::SeqCst), NUM_SUBSYSTEMS);
|
||||
assert_eq!(signals_received.load(atomic::Ordering::SeqCst), NUM_SUBSYSTEMS);
|
||||
|
||||
Reference in New Issue
Block a user