|
|
|
@@ -94,6 +94,7 @@ pub use polkadot_subsystem::{
|
|
|
|
|
};
|
|
|
|
|
use polkadot_node_subsystem_util::{TimeoutExt, metrics::{self, prometheus}, metered, Metronome};
|
|
|
|
|
use polkadot_node_primitives::SpawnNamed;
|
|
|
|
|
use polkadot_procmacro_overseer_subsystems_gen::AllSubsystemsGen;
|
|
|
|
|
|
|
|
|
|
// A capacity of bounded channels inside the overseer.
|
|
|
|
|
const CHANNEL_CAPACITY: usize = 1024;
|
|
|
|
@@ -143,7 +144,7 @@ impl<Client> HeadSupportsParachains for Arc<Client> where
|
|
|
|
|
/// Each [`Subsystem`] is supposed to implement some interface that is generic over
|
|
|
|
|
/// message type that is specific to this [`Subsystem`]. At the moment not all
|
|
|
|
|
/// subsystems are implemented and the rest can be mocked with the [`DummySubsystem`].
|
|
|
|
|
#[derive(Debug, Clone)]
|
|
|
|
|
#[derive(Debug, Clone, AllSubsystemsGen)]
|
|
|
|
|
pub struct AllSubsystems<
|
|
|
|
|
CV = (), CB = (), CS = (), SD = (), AD = (), AR = (), BS = (), BD = (), P = (),
|
|
|
|
|
RA = (), AS = (), NB = (), CA = (), CG = (), CP = (), ApD = (), ApV = (),
|
|
|
|
@@ -244,492 +245,6 @@ impl<CV, CB, CS, SD, AD, AR, BS, BD, P, RA, AS, NB, CA, CG, CP, ApD, ApV, GS>
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// Replace the `candidate_validation` instance in `self`.
|
|
|
|
|
pub fn replace_candidate_validation<NEW>(
|
|
|
|
|
self,
|
|
|
|
|
candidate_validation: NEW,
|
|
|
|
|
) -> 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,
|
|
|
|
|
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,
|
|
|
|
|
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 `candidate_backing` instance in `self`.
|
|
|
|
|
pub fn replace_candidate_backing<NEW>(
|
|
|
|
|
self,
|
|
|
|
|
candidate_backing: NEW,
|
|
|
|
|
) -> 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,
|
|
|
|
|
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,
|
|
|
|
|
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 `candidate_selection` instance in `self`.
|
|
|
|
|
pub fn replace_candidate_selection<NEW>(
|
|
|
|
|
self,
|
|
|
|
|
candidate_selection: NEW,
|
|
|
|
|
) -> 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,
|
|
|
|
|
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,
|
|
|
|
|
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 `statement_distribution` instance in `self`.
|
|
|
|
|
pub fn replace_statement_distribution<NEW>(
|
|
|
|
|
self,
|
|
|
|
|
statement_distribution: NEW,
|
|
|
|
|
) -> 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,
|
|
|
|
|
candidate_selection: self.candidate_selection,
|
|
|
|
|
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,
|
|
|
|
|
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 `availability_distribution` instance in `self`.
|
|
|
|
|
pub fn replace_availability_distribution<NEW>(
|
|
|
|
|
self,
|
|
|
|
|
availability_distribution: NEW,
|
|
|
|
|
) -> 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,
|
|
|
|
|
candidate_selection: self.candidate_selection,
|
|
|
|
|
statement_distribution: self.statement_distribution,
|
|
|
|
|
availability_distribution,
|
|
|
|
|
availability_recovery: self.availability_recovery,
|
|
|
|
|
bitfield_signing: self.bitfield_signing,
|
|
|
|
|
bitfield_distribution: self.bitfield_distribution,
|
|
|
|
|
provisioner: self.provisioner,
|
|
|
|
|
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 `availability_recovery` instance in `self`.
|
|
|
|
|
pub fn replace_availability_recovery<NEW>(
|
|
|
|
|
self,
|
|
|
|
|
availability_recovery: NEW,
|
|
|
|
|
) -> 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,
|
|
|
|
|
candidate_selection: self.candidate_selection,
|
|
|
|
|
statement_distribution: self.statement_distribution,
|
|
|
|
|
availability_distribution: self.availability_distribution,
|
|
|
|
|
availability_recovery,
|
|
|
|
|
bitfield_signing: self.bitfield_signing,
|
|
|
|
|
bitfield_distribution: self.bitfield_distribution,
|
|
|
|
|
provisioner: self.provisioner,
|
|
|
|
|
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 `bitfield_signing` instance in `self`.
|
|
|
|
|
pub fn replace_bitfield_signing<NEW>(
|
|
|
|
|
self,
|
|
|
|
|
bitfield_signing: NEW,
|
|
|
|
|
) -> 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,
|
|
|
|
|
candidate_selection: self.candidate_selection,
|
|
|
|
|
statement_distribution: self.statement_distribution,
|
|
|
|
|
availability_distribution: self.availability_distribution,
|
|
|
|
|
availability_recovery: self.availability_recovery,
|
|
|
|
|
bitfield_signing,
|
|
|
|
|
bitfield_distribution: self.bitfield_distribution,
|
|
|
|
|
provisioner: self.provisioner,
|
|
|
|
|
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 `bitfield_distribution` instance in `self`.
|
|
|
|
|
pub fn replace_bitfield_distribution<NEW>(
|
|
|
|
|
self,
|
|
|
|
|
bitfield_distribution: NEW,
|
|
|
|
|
) -> 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,
|
|
|
|
|
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,
|
|
|
|
|
provisioner: self.provisioner,
|
|
|
|
|
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 `provisioner` instance in `self`.
|
|
|
|
|
pub fn replace_provisioner<NEW>(
|
|
|
|
|
self,
|
|
|
|
|
provisioner: NEW,
|
|
|
|
|
) -> 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,
|
|
|
|
|
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,
|
|
|
|
|
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 `runtime_api` instance in `self`.
|
|
|
|
|
pub fn replace_runtime_api<NEW>(
|
|
|
|
|
self,
|
|
|
|
|
runtime_api: NEW,
|
|
|
|
|
) -> 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,
|
|
|
|
|
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,
|
|
|
|
|
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 `availability_store` instance in `self`.
|
|
|
|
|
pub fn replace_availability_store<NEW>(
|
|
|
|
|
self,
|
|
|
|
|
availability_store: NEW,
|
|
|
|
|
) -> 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,
|
|
|
|
|
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,
|
|
|
|
|
runtime_api: self.runtime_api,
|
|
|
|
|
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 `network_bridge` instance in `self`.
|
|
|
|
|
pub fn replace_network_bridge<NEW>(
|
|
|
|
|
self,
|
|
|
|
|
network_bridge: NEW,
|
|
|
|
|
) -> 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,
|
|
|
|
|
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,
|
|
|
|
|
runtime_api: self.runtime_api,
|
|
|
|
|
availability_store: self.availability_store,
|
|
|
|
|
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 `chain_api` instance in `self`.
|
|
|
|
|
pub fn replace_chain_api<NEW>(
|
|
|
|
|
self,
|
|
|
|
|
chain_api: NEW,
|
|
|
|
|
) -> 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,
|
|
|
|
|
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,
|
|
|
|
|
runtime_api: self.runtime_api,
|
|
|
|
|
availability_store: self.availability_store,
|
|
|
|
|
network_bridge: self.network_bridge,
|
|
|
|
|
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 `collation_generation` instance in `self`.
|
|
|
|
|
pub fn replace_collation_generation<NEW>(
|
|
|
|
|
self,
|
|
|
|
|
collation_generation: NEW,
|
|
|
|
|
) -> 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,
|
|
|
|
|
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,
|
|
|
|
|
runtime_api: self.runtime_api,
|
|
|
|
|
availability_store: self.availability_store,
|
|
|
|
|
network_bridge: self.network_bridge,
|
|
|
|
|
chain_api: self.chain_api,
|
|
|
|
|
collation_generation,
|
|
|
|
|
collator_protocol: self.collator_protocol,
|
|
|
|
|
approval_distribution: self.approval_distribution,
|
|
|
|
|
approval_voting: self.approval_voting,
|
|
|
|
|
gossip_support: self.gossip_support,
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// Replace the `collator_protocol` instance in `self`.
|
|
|
|
|
pub fn replace_collator_protocol<NEW>(
|
|
|
|
|
self,
|
|
|
|
|
collator_protocol: NEW,
|
|
|
|
|
) -> 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,
|
|
|
|
|
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,
|
|
|
|
|
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,
|
|
|
|
|
approval_distribution: self.approval_distribution,
|
|
|
|
|
approval_voting: self.approval_voting,
|
|
|
|
|
gossip_support: self.gossip_support,
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// Replace the `approval_distribution` instance in `self`.
|
|
|
|
|
pub fn replace_approval_distribution<NEW>(
|
|
|
|
|
self,
|
|
|
|
|
approval_distribution: NEW,
|
|
|
|
|
) -> 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,
|
|
|
|
|
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,
|
|
|
|
|
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,
|
|
|
|
|
approval_voting: self.approval_voting,
|
|
|
|
|
gossip_support: self.gossip_support,
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// Replace the `approval_voting` instance in `self`.
|
|
|
|
|
pub fn replace_approval_voting<NEW>(
|
|
|
|
|
self,
|
|
|
|
|
approval_voting: NEW,
|
|
|
|
|
) -> 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,
|
|
|
|
|
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,
|
|
|
|
|
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,
|
|
|
|
|
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, 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,
|
|
|
|
|
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,
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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,
|
|
|
|
|