|
|
|
@@ -86,7 +86,7 @@ use polkadot_subsystem::messages::{
|
|
|
|
|
ProvisionerMessage, PoVDistributionMessage, RuntimeApiMessage,
|
|
|
|
|
AvailabilityStoreMessage, NetworkBridgeMessage, AllMessages, CollationGenerationMessage,
|
|
|
|
|
CollatorProtocolMessage, AvailabilityRecoveryMessage, ApprovalDistributionMessage,
|
|
|
|
|
ApprovalVotingMessage,
|
|
|
|
|
ApprovalVotingMessage, GossipSupportMessage,
|
|
|
|
|
};
|
|
|
|
|
pub use polkadot_subsystem::{
|
|
|
|
|
Subsystem, SubsystemContext, OverseerSignal, FromOverseer, SubsystemError, SubsystemResult,
|
|
|
|
@@ -565,6 +565,9 @@ pub struct Overseer<S> {
|
|
|
|
|
/// An Approval Voting subsystem.
|
|
|
|
|
approval_voting_subsystem: OverseenSubsystem<ApprovalVotingMessage>,
|
|
|
|
|
|
|
|
|
|
/// A Gossip Support subsystem.
|
|
|
|
|
gossip_support_subsystem: OverseenSubsystem<GossipSupportMessage>,
|
|
|
|
|
|
|
|
|
|
/// Spawner to spawn tasks to.
|
|
|
|
|
s: S,
|
|
|
|
|
|
|
|
|
@@ -606,6 +609,7 @@ pub struct Overseer<S> {
|
|
|
|
|
pub struct AllSubsystems<
|
|
|
|
|
CV = (), CB = (), CS = (), SD = (), AD = (), AR = (), BS = (), BD = (), P = (),
|
|
|
|
|
PoVD = (), RA = (), AS = (), NB = (), CA = (), CG = (), CP = (), ApD = (), ApV = (),
|
|
|
|
|
GS = (),
|
|
|
|
|
> {
|
|
|
|
|
/// A candidate validation subsystem.
|
|
|
|
|
pub candidate_validation: CV,
|
|
|
|
@@ -643,10 +647,12 @@ pub struct AllSubsystems<
|
|
|
|
|
pub approval_distribution: ApD,
|
|
|
|
|
/// An Approval Voting subsystem.
|
|
|
|
|
pub approval_voting: ApV,
|
|
|
|
|
/// A Connection Request Issuer subsystem.
|
|
|
|
|
pub gossip_support: GS,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
impl<CV, CB, CS, SD, AD, AR, BS, BD, P, PoVD, RA, AS, NB, CA, CG, CP, ApD, ApV>
|
|
|
|
|
AllSubsystems<CV, CB, CS, SD, AD, AR, BS, BD, P, PoVD, RA, AS, NB, CA, CG, CP, ApD, ApV>
|
|
|
|
|
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>
|
|
|
|
|
{
|
|
|
|
|
/// Create a new instance of [`AllSubsystems`].
|
|
|
|
|
///
|
|
|
|
@@ -679,6 +685,7 @@ 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,
|
|
|
|
@@ -699,6 +706,7 @@ impl<CV, CB, CS, SD, AD, AR, BS, BD, P, PoVD, RA, AS, NB, CA, CG, CP, ApD, ApV>
|
|
|
|
|
collator_protocol: DummySubsystem,
|
|
|
|
|
approval_distribution: DummySubsystem,
|
|
|
|
|
approval_voting: DummySubsystem,
|
|
|
|
|
gossip_support: DummySubsystem,
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -706,7 +714,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> {
|
|
|
|
|
) -> AllSubsystems<NEW, CB, CS, SD, AD, AR, BS, BD, P, PoVD, RA, AS, NB, CA, CG, CP, ApD, ApV, GS> {
|
|
|
|
|
AllSubsystems {
|
|
|
|
|
candidate_validation,
|
|
|
|
|
candidate_backing: self.candidate_backing,
|
|
|
|
@@ -726,6 +734,7 @@ impl<CV, CB, CS, SD, AD, AR, BS, BD, P, PoVD, RA, AS, NB, CA, CG, CP, ApD, ApV>
|
|
|
|
|
collator_protocol: self.collator_protocol,
|
|
|
|
|
approval_distribution: self.approval_distribution,
|
|
|
|
|
approval_voting: self.approval_voting,
|
|
|
|
|
gossip_support: self.gossip_support,
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -733,7 +742,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> {
|
|
|
|
|
) -> AllSubsystems<CV, NEW, CS, SD, AD, AR, BS, BD, P, PoVD, RA, AS, NB, CA, CG, CP, ApD, ApV, GS> {
|
|
|
|
|
AllSubsystems {
|
|
|
|
|
candidate_validation: self.candidate_validation,
|
|
|
|
|
candidate_backing,
|
|
|
|
@@ -753,6 +762,7 @@ impl<CV, CB, CS, SD, AD, AR, BS, BD, P, PoVD, RA, AS, NB, CA, CG, CP, ApD, ApV>
|
|
|
|
|
collator_protocol: self.collator_protocol,
|
|
|
|
|
approval_distribution: self.approval_distribution,
|
|
|
|
|
approval_voting: self.approval_voting,
|
|
|
|
|
gossip_support: self.gossip_support,
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -760,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_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> {
|
|
|
|
|
) -> AllSubsystems<CV, CB, NEW, SD, AD, AR, BS, BD, P, PoVD, RA, AS, NB, CA, CG, CP, ApD, ApV, GS> {
|
|
|
|
|
AllSubsystems {
|
|
|
|
|
candidate_validation: self.candidate_validation,
|
|
|
|
|
candidate_backing: self.candidate_backing,
|
|
|
|
@@ -780,6 +790,7 @@ impl<CV, CB, CS, SD, AD, AR, BS, BD, P, PoVD, RA, AS, NB, CA, CG, CP, ApD, ApV>
|
|
|
|
|
collator_protocol: self.collator_protocol,
|
|
|
|
|
approval_distribution: self.approval_distribution,
|
|
|
|
|
approval_voting: self.approval_voting,
|
|
|
|
|
gossip_support: self.gossip_support,
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -787,7 +798,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> {
|
|
|
|
|
) -> AllSubsystems<CV, CB, CS, NEW, AD, AR, BS, BD, P, PoVD, RA, AS, NB, CA, CG, CP, ApD, ApV, GS> {
|
|
|
|
|
AllSubsystems {
|
|
|
|
|
candidate_validation: self.candidate_validation,
|
|
|
|
|
candidate_backing: self.candidate_backing,
|
|
|
|
@@ -807,6 +818,7 @@ impl<CV, CB, CS, SD, AD, AR, BS, BD, P, PoVD, RA, AS, NB, CA, CG, CP, ApD, ApV>
|
|
|
|
|
collator_protocol: self.collator_protocol,
|
|
|
|
|
approval_distribution: self.approval_distribution,
|
|
|
|
|
approval_voting: self.approval_voting,
|
|
|
|
|
gossip_support: self.gossip_support,
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -814,7 +826,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> {
|
|
|
|
|
) -> AllSubsystems<CV, CB, CS, SD, NEW, AR, BS, BD, P, PoVD, RA, AS, NB, CA, CG, CP, ApD, ApV, GS> {
|
|
|
|
|
AllSubsystems {
|
|
|
|
|
candidate_validation: self.candidate_validation,
|
|
|
|
|
candidate_backing: self.candidate_backing,
|
|
|
|
@@ -834,6 +846,7 @@ impl<CV, CB, CS, SD, AD, AR, BS, BD, P, PoVD, RA, AS, NB, CA, CG, CP, ApD, ApV>
|
|
|
|
|
collator_protocol: self.collator_protocol,
|
|
|
|
|
approval_distribution: self.approval_distribution,
|
|
|
|
|
approval_voting: self.approval_voting,
|
|
|
|
|
gossip_support: self.gossip_support,
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -841,7 +854,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> {
|
|
|
|
|
) -> AllSubsystems<CV, CB, CS, SD, AD, NEW, BS, BD, P, PoVD, RA, AS, NB, CA, CG, CP, ApD, ApV, GS> {
|
|
|
|
|
AllSubsystems {
|
|
|
|
|
candidate_validation: self.candidate_validation,
|
|
|
|
|
candidate_backing: self.candidate_backing,
|
|
|
|
@@ -861,6 +874,7 @@ impl<CV, CB, CS, SD, AD, AR, BS, BD, P, PoVD, RA, AS, NB, CA, CG, CP, ApD, ApV>
|
|
|
|
|
collator_protocol: self.collator_protocol,
|
|
|
|
|
approval_distribution: self.approval_distribution,
|
|
|
|
|
approval_voting: self.approval_voting,
|
|
|
|
|
gossip_support: self.gossip_support,
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -868,7 +882,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> {
|
|
|
|
|
) -> AllSubsystems<CV, CB, CS, SD, AD, AR, NEW, BD, P, PoVD, RA, AS, NB, CA, CG, CP, ApD, ApV, GS> {
|
|
|
|
|
AllSubsystems {
|
|
|
|
|
candidate_validation: self.candidate_validation,
|
|
|
|
|
candidate_backing: self.candidate_backing,
|
|
|
|
@@ -888,6 +902,7 @@ impl<CV, CB, CS, SD, AD, AR, BS, BD, P, PoVD, RA, AS, NB, CA, CG, CP, ApD, ApV>
|
|
|
|
|
collator_protocol: self.collator_protocol,
|
|
|
|
|
approval_distribution: self.approval_distribution,
|
|
|
|
|
approval_voting: self.approval_voting,
|
|
|
|
|
gossip_support: self.gossip_support,
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -895,7 +910,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> {
|
|
|
|
|
) -> AllSubsystems<CV, CB, CS, SD, AD, AR, BS, NEW, P, PoVD, RA, AS, NB, CA, CG, CP, ApD, ApV, GS> {
|
|
|
|
|
AllSubsystems {
|
|
|
|
|
candidate_validation: self.candidate_validation,
|
|
|
|
|
candidate_backing: self.candidate_backing,
|
|
|
|
@@ -915,6 +930,7 @@ impl<CV, CB, CS, SD, AD, AR, BS, BD, P, PoVD, RA, AS, NB, CA, CG, CP, ApD, ApV>
|
|
|
|
|
collator_protocol: self.collator_protocol,
|
|
|
|
|
approval_distribution: self.approval_distribution,
|
|
|
|
|
approval_voting: self.approval_voting,
|
|
|
|
|
gossip_support: self.gossip_support,
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -922,7 +938,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> {
|
|
|
|
|
) -> AllSubsystems<CV, CB, CS, SD, AD, AR, BS, BD, NEW, PoVD, RA, AS, NB, CA, CG, CP, ApD, ApV, GS> {
|
|
|
|
|
AllSubsystems {
|
|
|
|
|
candidate_validation: self.candidate_validation,
|
|
|
|
|
candidate_backing: self.candidate_backing,
|
|
|
|
@@ -942,6 +958,7 @@ impl<CV, CB, CS, SD, AD, AR, BS, BD, P, PoVD, RA, AS, NB, CA, CG, CP, ApD, ApV>
|
|
|
|
|
collator_protocol: self.collator_protocol,
|
|
|
|
|
approval_distribution: self.approval_distribution,
|
|
|
|
|
approval_voting: self.approval_voting,
|
|
|
|
|
gossip_support: self.gossip_support,
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -949,7 +966,7 @@ impl<CV, CB, CS, SD, AD, AR, BS, BD, P, PoVD, RA, AS, NB, CA, CG, CP, ApD, ApV>
|
|
|
|
|
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> {
|
|
|
|
|
) -> 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,
|
|
|
|
@@ -969,6 +986,7 @@ impl<CV, CB, CS, SD, AD, AR, BS, BD, P, PoVD, RA, AS, NB, CA, CG, CP, ApD, ApV>
|
|
|
|
|
collator_protocol: self.collator_protocol,
|
|
|
|
|
approval_distribution: self.approval_distribution,
|
|
|
|
|
approval_voting: self.approval_voting,
|
|
|
|
|
gossip_support: self.gossip_support,
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -976,7 +994,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> {
|
|
|
|
|
) -> AllSubsystems<CV, CB, CS, SD, AD, AR, BS, BD, P, PoVD, NEW, AS, NB, CA, CG, CP, ApD, ApV, GS> {
|
|
|
|
|
AllSubsystems {
|
|
|
|
|
candidate_validation: self.candidate_validation,
|
|
|
|
|
candidate_backing: self.candidate_backing,
|
|
|
|
@@ -996,6 +1014,7 @@ impl<CV, CB, CS, SD, AD, AR, BS, BD, P, PoVD, RA, AS, NB, CA, CG, CP, ApD, ApV>
|
|
|
|
|
collator_protocol: self.collator_protocol,
|
|
|
|
|
approval_distribution: self.approval_distribution,
|
|
|
|
|
approval_voting: self.approval_voting,
|
|
|
|
|
gossip_support: self.gossip_support,
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -1003,7 +1022,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> {
|
|
|
|
|
) -> AllSubsystems<CV, CB, CS, SD, AD, AR, BS, BD, P, PoVD, RA, NEW, NB, CA, CG, CP, ApD, ApV, GS> {
|
|
|
|
|
AllSubsystems {
|
|
|
|
|
candidate_validation: self.candidate_validation,
|
|
|
|
|
candidate_backing: self.candidate_backing,
|
|
|
|
@@ -1023,6 +1042,7 @@ impl<CV, CB, CS, SD, AD, AR, BS, BD, P, PoVD, RA, AS, NB, CA, CG, CP, ApD, ApV>
|
|
|
|
|
collator_protocol: self.collator_protocol,
|
|
|
|
|
approval_distribution: self.approval_distribution,
|
|
|
|
|
approval_voting: self.approval_voting,
|
|
|
|
|
gossip_support: self.gossip_support,
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -1030,7 +1050,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> {
|
|
|
|
|
) -> AllSubsystems<CV, CB, CS, SD, AD, AR, BS, BD, P, PoVD, RA, AS, NEW, CA, CG, CP, ApD, ApV, GS> {
|
|
|
|
|
AllSubsystems {
|
|
|
|
|
candidate_validation: self.candidate_validation,
|
|
|
|
|
candidate_backing: self.candidate_backing,
|
|
|
|
@@ -1050,6 +1070,7 @@ impl<CV, CB, CS, SD, AD, AR, BS, BD, P, PoVD, RA, AS, NB, CA, CG, CP, ApD, ApV>
|
|
|
|
|
collator_protocol: self.collator_protocol,
|
|
|
|
|
approval_distribution: self.approval_distribution,
|
|
|
|
|
approval_voting: self.approval_voting,
|
|
|
|
|
gossip_support: self.gossip_support,
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -1057,7 +1078,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> {
|
|
|
|
|
) -> AllSubsystems<CV, CB, CS, SD, AD, AR, BS, BD, P, PoVD, RA, AS, NB, NEW, CG, CP, ApD, ApV, GS> {
|
|
|
|
|
AllSubsystems {
|
|
|
|
|
candidate_validation: self.candidate_validation,
|
|
|
|
|
candidate_backing: self.candidate_backing,
|
|
|
|
@@ -1077,6 +1098,7 @@ impl<CV, CB, CS, SD, AD, AR, BS, BD, P, PoVD, RA, AS, NB, CA, CG, CP, ApD, ApV>
|
|
|
|
|
collator_protocol: self.collator_protocol,
|
|
|
|
|
approval_distribution: self.approval_distribution,
|
|
|
|
|
approval_voting: self.approval_voting,
|
|
|
|
|
gossip_support: self.gossip_support,
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -1084,7 +1106,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> {
|
|
|
|
|
) -> AllSubsystems<CV, CB, CS, SD, AD, AR, BS, BD, P, PoVD, RA, AS, NB, CA, NEW, CP, ApD, ApV, GS> {
|
|
|
|
|
AllSubsystems {
|
|
|
|
|
candidate_validation: self.candidate_validation,
|
|
|
|
|
candidate_backing: self.candidate_backing,
|
|
|
|
@@ -1104,6 +1126,7 @@ impl<CV, CB, CS, SD, AD, AR, BS, BD, P, PoVD, RA, AS, NB, CA, CG, CP, ApD, ApV>
|
|
|
|
|
collator_protocol: self.collator_protocol,
|
|
|
|
|
approval_distribution: self.approval_distribution,
|
|
|
|
|
approval_voting: self.approval_voting,
|
|
|
|
|
gossip_support: self.gossip_support,
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -1111,7 +1134,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> {
|
|
|
|
|
) -> AllSubsystems<CV, CB, CS, SD, AD, AR, BS, BD, P, PoVD, RA, AS, NB, CA, CG, NEW, ApD, ApV, GS> {
|
|
|
|
|
AllSubsystems {
|
|
|
|
|
candidate_validation: self.candidate_validation,
|
|
|
|
|
candidate_backing: self.candidate_backing,
|
|
|
|
@@ -1131,6 +1154,7 @@ impl<CV, CB, CS, SD, AD, AR, BS, BD, P, PoVD, RA, AS, NB, CA, CG, CP, ApD, ApV>
|
|
|
|
|
collator_protocol,
|
|
|
|
|
approval_distribution: self.approval_distribution,
|
|
|
|
|
approval_voting: self.approval_voting,
|
|
|
|
|
gossip_support: self.gossip_support,
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -1138,7 +1162,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> {
|
|
|
|
|
) -> AllSubsystems<CV, CB, CS, SD, AD, AR, BS, BD, P, PoVD, RA, AS, NB, CA, CG, CP, NEW, ApV, GS> {
|
|
|
|
|
AllSubsystems {
|
|
|
|
|
candidate_validation: self.candidate_validation,
|
|
|
|
|
candidate_backing: self.candidate_backing,
|
|
|
|
@@ -1158,6 +1182,7 @@ impl<CV, CB, CS, SD, AD, AR, BS, BD, P, PoVD, RA, AS, NB, CA, CG, CP, ApD, ApV>
|
|
|
|
|
collator_protocol: self.collator_protocol,
|
|
|
|
|
approval_distribution,
|
|
|
|
|
approval_voting: self.approval_voting,
|
|
|
|
|
gossip_support: self.gossip_support,
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -1165,7 +1190,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> {
|
|
|
|
|
) -> AllSubsystems<CV, CB, CS, SD, AD, AR, BS, BD, P, PoVD, RA, AS, NB, CA, CG, CP, ApD, NEW, GS> {
|
|
|
|
|
AllSubsystems {
|
|
|
|
|
candidate_validation: self.candidate_validation,
|
|
|
|
|
candidate_backing: self.candidate_backing,
|
|
|
|
@@ -1184,7 +1209,36 @@ impl<CV, CB, CS, SD, AD, AR, BS, BD, P, PoVD, RA, AS, NB, CA, CG, CP, ApD, ApV>
|
|
|
|
|
collation_generation: self.collation_generation,
|
|
|
|
|
collator_protocol: self.collator_protocol,
|
|
|
|
|
approval_distribution: self.approval_distribution,
|
|
|
|
|
approval_voting
|
|
|
|
|
approval_voting,
|
|
|
|
|
gossip_support: self.gossip_support,
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// Replace the `gossip_support` instance in `self`.
|
|
|
|
|
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 {
|
|
|
|
|
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: 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,
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@@ -1395,9 +1449,9 @@ where
|
|
|
|
|
/// #
|
|
|
|
|
/// # }); }
|
|
|
|
|
/// ```
|
|
|
|
|
pub fn new<CV, CB, CS, SD, AD, AR, BS, BD, P, PoVD, RA, AS, NB, CA, CG, CP, ApD, ApV>(
|
|
|
|
|
pub fn new<CV, CB, CS, SD, AD, AR, BS, BD, P, PoVD, 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>,
|
|
|
|
|
all_subsystems: AllSubsystems<CV, CB, CS, SD, AD, AR, BS, BD, P, PoVD, RA, AS, NB, CA, CG, CP, ApD, ApV, GS>,
|
|
|
|
|
prometheus_registry: Option<&prometheus::Registry>,
|
|
|
|
|
mut s: S,
|
|
|
|
|
) -> SubsystemResult<(Self, OverseerHandler)>
|
|
|
|
@@ -1420,6 +1474,7 @@ where
|
|
|
|
|
CP: Subsystem<OverseerSubsystemContext<CollatorProtocolMessage>> + Send,
|
|
|
|
|
ApD: Subsystem<OverseerSubsystemContext<ApprovalDistributionMessage>> + Send,
|
|
|
|
|
ApV: Subsystem<OverseerSubsystemContext<ApprovalVotingMessage>> + Send,
|
|
|
|
|
GS: Subsystem<OverseerSubsystemContext<GossipSupportMessage>> + Send,
|
|
|
|
|
{
|
|
|
|
|
let (events_tx, events_rx) = metered::channel(CHANNEL_CAPACITY, "overseer_events");
|
|
|
|
|
|
|
|
|
@@ -1631,6 +1686,16 @@ where
|
|
|
|
|
TaskKind::Blocking,
|
|
|
|
|
)?;
|
|
|
|
|
|
|
|
|
|
let gossip_support_subsystem = spawn(
|
|
|
|
|
&mut s,
|
|
|
|
|
&mut running_subsystems,
|
|
|
|
|
metered::UnboundedMeteredSender::<_>::clone(&to_overseer_tx),
|
|
|
|
|
all_subsystems.gossip_support,
|
|
|
|
|
&metrics,
|
|
|
|
|
&mut seed,
|
|
|
|
|
TaskKind::Regular,
|
|
|
|
|
)?;
|
|
|
|
|
|
|
|
|
|
let leaves = leaves
|
|
|
|
|
.into_iter()
|
|
|
|
|
.map(|BlockInfo { hash, parent_hash: _, number }| (hash, number))
|
|
|
|
@@ -1658,6 +1723,7 @@ where
|
|
|
|
|
collator_protocol_subsystem,
|
|
|
|
|
approval_distribution_subsystem,
|
|
|
|
|
approval_voting_subsystem,
|
|
|
|
|
gossip_support_subsystem,
|
|
|
|
|
s,
|
|
|
|
|
running_subsystems,
|
|
|
|
|
to_overseer_rx: to_overseer_rx.fuse(),
|
|
|
|
@@ -1692,6 +1758,7 @@ where
|
|
|
|
|
let _ = self.collation_generation_subsystem.send_signal(OverseerSignal::Conclude).await;
|
|
|
|
|
let _ = self.approval_distribution_subsystem.send_signal(OverseerSignal::Conclude).await;
|
|
|
|
|
let _ = self.approval_voting_subsystem.send_signal(OverseerSignal::Conclude).await;
|
|
|
|
|
let _ = self.gossip_support_subsystem.send_signal(OverseerSignal::Conclude).await;
|
|
|
|
|
|
|
|
|
|
let mut stop_delay = Delay::new(Duration::from_secs(STOP_DELAY)).fuse();
|
|
|
|
|
|
|
|
|
@@ -1861,7 +1928,8 @@ where
|
|
|
|
|
self.collator_protocol_subsystem.send_signal(signal.clone()).await?;
|
|
|
|
|
self.collation_generation_subsystem.send_signal(signal.clone()).await?;
|
|
|
|
|
self.approval_distribution_subsystem.send_signal(signal.clone()).await?;
|
|
|
|
|
self.approval_voting_subsystem.send_signal(signal).await?;
|
|
|
|
|
self.approval_voting_subsystem.send_signal(signal.clone()).await?;
|
|
|
|
|
self.gossip_support_subsystem.send_signal(signal).await?;
|
|
|
|
|
|
|
|
|
|
Ok(())
|
|
|
|
|
}
|
|
|
|
@@ -1925,6 +1993,9 @@ where
|
|
|
|
|
AllMessages::ApprovalVoting(msg) => {
|
|
|
|
|
self.approval_voting_subsystem.send_message(msg).await?;
|
|
|
|
|
},
|
|
|
|
|
AllMessages::GossipSupport(msg) => {
|
|
|
|
|
self.gossip_support_subsystem.send_message(msg).await?;
|
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Ok(())
|
|
|
|
@@ -2824,6 +2895,7 @@ mod tests {
|
|
|
|
|
chain_api: subsystem.clone(),
|
|
|
|
|
approval_distribution: subsystem.clone(),
|
|
|
|
|
approval_voting: subsystem.clone(),
|
|
|
|
|
gossip_support: subsystem.clone(),
|
|
|
|
|
};
|
|
|
|
|
let (overseer, mut handler) = Overseer::new(
|
|
|
|
|
vec![],
|
|
|
|
@@ -2843,7 +2915,7 @@ mod tests {
|
|
|
|
|
}).await;
|
|
|
|
|
|
|
|
|
|
// send a msg to each subsystem
|
|
|
|
|
// except for BitfieldSigning as the message is not instantiable
|
|
|
|
|
// except for BitfieldSigning and GossipSupport as the messages are not instantiable
|
|
|
|
|
handler.send_msg(AllMessages::CandidateValidation(test_candidate_validation_msg())).await;
|
|
|
|
|
handler.send_msg(AllMessages::CandidateBacking(test_candidate_backing_msg())).await;
|
|
|
|
|
handler.send_msg(AllMessages::CandidateSelection(test_candidate_selection_msg())).await;
|
|
|
|
@@ -2852,6 +2924,7 @@ mod tests {
|
|
|
|
|
handler.send_msg(AllMessages::StatementDistribution(test_statement_distribution_msg())).await;
|
|
|
|
|
handler.send_msg(AllMessages::AvailabilityRecovery(test_availability_recovery_msg())).await;
|
|
|
|
|
// handler.send_msg(AllMessages::BitfieldSigning(test_bitfield_signing_msg())).await;
|
|
|
|
|
// 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;
|
|
|
|
@@ -2867,13 +2940,12 @@ mod tests {
|
|
|
|
|
|
|
|
|
|
select! {
|
|
|
|
|
res = overseer_fut => {
|
|
|
|
|
const NUM_SUBSYSTEMS: usize = 18;
|
|
|
|
|
const NUM_SUBSYSTEMS: usize = 19;
|
|
|
|
|
|
|
|
|
|
assert_eq!(stop_signals_received.load(atomic::Ordering::SeqCst), NUM_SUBSYSTEMS);
|
|
|
|
|
// x2 because of broadcast_signal on startup
|
|
|
|
|
assert_eq!(signals_received.load(atomic::Ordering::SeqCst), NUM_SUBSYSTEMS);
|
|
|
|
|
// -2 for BitfieldSigning and Availability distribution
|
|
|
|
|
assert_eq!(msgs_received.load(atomic::Ordering::SeqCst), NUM_SUBSYSTEMS - 2);
|
|
|
|
|
// -3 for BitfieldSigning, GossipSupport and AvailabilityDistribution
|
|
|
|
|
assert_eq!(msgs_received.load(atomic::Ordering::SeqCst), NUM_SUBSYSTEMS - 3);
|
|
|
|
|
|
|
|
|
|
assert!(res.is_ok());
|
|
|
|
|
},
|
|
|
|
|