Unverified Commit a4dfdf16 authored by Lldenaurois's avatar Lldenaurois Committed by GitHub
Browse files

Remove candidate selection (#3148)

* Create validator_side module

* Subsume Candidate Selection

* Add test to ensure candidate backing logic is correct

* Ensure secondings are adequately cleaned up and address test flakyness

* Address Feedback
parent a81f78f4
Pipeline #141279 passed with stages
in 41 minutes and 11 seconds
......@@ -6055,22 +6055,6 @@ dependencies = [
"wasm-timer",
]
[[package]]
name = "polkadot-node-core-candidate-selection"
version = "0.1.0"
dependencies = [
"futures 0.3.14",
"polkadot-node-primitives",
"polkadot-node-subsystem",
"polkadot-node-subsystem-test-helpers",
"polkadot-node-subsystem-util",
"polkadot-primitives",
"sp-core",
"sp-keystore",
"thiserror",
"tracing",
]
[[package]]
name = "polkadot-node-core-candidate-validation"
version = "0.1.0"
......@@ -6667,7 +6651,6 @@ dependencies = [
"polkadot-node-core-av-store",
"polkadot-node-core-backing",
"polkadot-node-core-bitfield-signing",
"polkadot-node-core-candidate-selection",
"polkadot-node-core-candidate-validation",
"polkadot-node-core-chain-api",
"polkadot-node-core-parachains-inherent",
......
......@@ -48,7 +48,6 @@ members = [
"node/core/av-store",
"node/core/backing",
"node/core/bitfield-signing",
"node/core/candidate-selection",
"node/core/candidate-validation",
"node/core/chain-api",
"node/core/parachains-inherent",
......
......@@ -39,7 +39,7 @@ use polkadot_subsystem::{
jaeger,
messages::{
AllMessages, AvailabilityDistributionMessage, AvailabilityStoreMessage,
CandidateBackingMessage, CandidateSelectionMessage, CandidateValidationMessage,
CandidateBackingMessage, CandidateValidationMessage, CollatorProtocolMessage,
ProvisionableData, ProvisionerMessage, RuntimeApiRequest,
StatementDistributionMessage, ValidationFailed
}
......@@ -600,14 +600,14 @@ impl CandidateBackingJob {
root_span,
).await? {
sender.send_message(
CandidateSelectionMessage::Seconded(self.parent, stmt).into()
CollatorProtocolMessage::Seconded(self.parent, stmt).into()
).await;
}
}
}
Err(candidate) => {
sender.send_message(
CandidateSelectionMessage::Invalid(self.parent, candidate).into()
CollatorProtocolMessage::Invalid(self.parent, candidate).into()
).await;
}
}
......@@ -685,7 +685,7 @@ impl CandidateBackingJob {
.map_or(false, |c| c != &candidate.descriptor().collator)
{
sender.send_message(
CandidateSelectionMessage::Invalid(self.parent, candidate.clone()).into()
CollatorProtocolMessage::Invalid(self.parent, candidate.clone()).into()
).await;
return Ok(());
}
......@@ -1332,7 +1332,7 @@ mod tests {
use futures::{future, Future};
use polkadot_primitives::v1::{GroupRotationInfo, HeadData, PersistedValidationData, ScheduledCore};
use polkadot_subsystem::{
messages::{RuntimeApiRequest, RuntimeApiMessage},
messages::{RuntimeApiRequest, RuntimeApiMessage, CollatorProtocolMessage},
ActiveLeavesUpdate, FromOverseer, OverseerSignal, ActivatedLeaf, LeafStatus,
};
use polkadot_node_primitives::{InvalidCandidate, BlockData};
......@@ -1648,7 +1648,7 @@ mod tests {
assert_matches!(
virtual_overseer.recv().await,
AllMessages::CandidateSelection(CandidateSelectionMessage::Seconded(hash, statement)) => {
AllMessages::CollatorProtocol(CollatorProtocolMessage::Seconded(hash, statement)) => {
assert_eq!(test_state.relay_parent, hash);
assert_matches!(statement.payload(), Statement::Seconded(_));
}
......@@ -2172,8 +2172,8 @@ mod tests {
assert_matches!(
virtual_overseer.recv().await,
AllMessages::CandidateSelection(
CandidateSelectionMessage::Invalid(parent_hash, c)
AllMessages::CollatorProtocol(
CollatorProtocolMessage::Invalid(parent_hash, c)
) if parent_hash == test_state.relay_parent && c == candidate_a.to_plain()
);
......@@ -2482,8 +2482,8 @@ mod tests {
assert_matches!(
virtual_overseer.recv().await,
AllMessages::CandidateSelection(
CandidateSelectionMessage::Invalid(parent, c)
AllMessages::CollatorProtocol(
CollatorProtocolMessage::Invalid(parent, c)
) if parent == test_state.relay_parent && c == candidate.to_plain() => {
}
);
......
[package]
name = "polkadot-node-core-candidate-selection"
version = "0.1.0"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
[dependencies]
futures = "0.3.12"
tracing = "0.1.26"
thiserror = "1.0.23"
sp-keystore = { git = "https://github.com/paritytech/substrate", branch = "master" }
polkadot-primitives = { path = "../../../primitives" }
polkadot-node-subsystem = { path = "../../subsystem" }
polkadot-node-primitives = { path = "../../primitives" }
polkadot-node-subsystem-util = { path = "../../subsystem-util" }
[dev-dependencies]
sp-core = { git = "https://github.com/paritytech/substrate", branch = "master" }
polkadot-node-subsystem-test-helpers = { path = "../../subsystem-test-helpers" }
This diff is collapsed.
......@@ -2365,7 +2365,6 @@ mod tests {
match msg {
AllMessages::CandidateValidation(_) => unreachable!("Not interested in network events"),
AllMessages::CandidateBacking(_) => unreachable!("Not interested in network events"),
AllMessages::CandidateSelection(_) => unreachable!("Not interested in network events"),
AllMessages::ChainApi(_) => unreachable!("Not interested in network events"),
AllMessages::CollatorProtocol(_) => unreachable!("Not interested in network events"),
AllMessages::StatementDistribution(_) => { cnt += 1; }
......
......@@ -570,30 +570,12 @@ async fn process_msg(
}
}
}
FetchCollation(_, _, _, _) => {
tracing::warn!(
target: LOG_TARGET,
"FetchCollation message is not expected on the collator side of the protocol",
);
}
ReportCollator(_) => {
tracing::warn!(
target: LOG_TARGET,
"ReportCollator message is not expected on the collator side of the protocol",
);
}
NoteGoodCollation(_) => {
tracing::warn!(
target: LOG_TARGET,
"NoteGoodCollation message is not expected on the collator side of the protocol",
);
}
NotifyCollationSeconded(_, _, _) => {
tracing::warn!(
target: LOG_TARGET,
"NotifyCollationSeconded message is not expected on the collator side of the protocol",
);
}
NetworkBridgeUpdateV1(event) => {
if let Err(e) = handle_network_msg(
ctx,
......@@ -646,6 +628,7 @@ async fn process_msg(
}
}
}
_ => {},
}
Ok(())
......
......@@ -294,8 +294,9 @@ pub mod v1 {
use polkadot_primitives::v1::{
CandidateHash, CandidateIndex, CollatorId, CollatorSignature,
CompactStatement, Hash, Id as ParaId, UncheckedSignedAvailabilityBitfield,
ValidatorIndex, ValidatorSignature
ValidatorIndex, ValidatorSignature,
};
use polkadot_node_primitives::{
approval::{IndirectAssignmentCert, IndirectSignedApprovalVote},
UncheckedSignedFullStatement,
......
......@@ -82,7 +82,7 @@ use sp_api::{ApiExt, ProvideRuntimeApi};
use polkadot_subsystem::messages::{
CandidateValidationMessage, CandidateBackingMessage,
CandidateSelectionMessage, ChainApiMessage, StatementDistributionMessage,
ChainApiMessage, StatementDistributionMessage,
AvailabilityDistributionMessage, BitfieldSigningMessage, BitfieldDistributionMessage,
ProvisionerMessage, RuntimeApiMessage,
AvailabilityStoreMessage, NetworkBridgeMessage, AllMessages, CollationGenerationMessage,
......@@ -148,7 +148,7 @@ impl<Client> HeadSupportsParachains for Arc<Client> where
/// subsystems are implemented and the rest can be mocked with the [`DummySubsystem`].
#[derive(Debug, Clone, AllSubsystemsGen)]
pub struct AllSubsystems<
CV = (), CB = (), CS = (), SD = (), AD = (), AR = (), BS = (), BD = (), P = (),
CV = (), CB = (), SD = (), AD = (), AR = (), BS = (), BD = (), P = (),
RA = (), AS = (), NB = (), CA = (), CG = (), CP = (), ApD = (), ApV = (),
GS = (),
> {
......@@ -156,8 +156,6 @@ pub struct AllSubsystems<
pub candidate_validation: CV,
/// A candidate backing subsystem.
pub candidate_backing: CB,
/// A candidate selection subsystem.
pub candidate_selection: CS,
/// A statement distribution subsystem.
pub statement_distribution: SD,
/// An availability distribution subsystem.
......@@ -190,8 +188,8 @@ pub struct AllSubsystems<
pub gossip_support: 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>
impl<CV, CB, SD, AD, AR, BS, BD, P, RA, AS, NB, CA, CG, CP, ApD, ApV, GS>
AllSubsystems<CV, CB, SD, AD, AR, BS, BD, P, RA, AS, NB, CA, CG, CP, ApD, ApV, GS>
{
/// Create a new instance of [`AllSubsystems`].
///
......@@ -223,12 +221,10 @@ impl<CV, CB, CS, SD, AD, AR, BS, BD, P, RA, AS, NB, CA, CG, CP, ApD, ApV, GS>
DummySubsystem,
DummySubsystem,
DummySubsystem,
DummySubsystem,
> {
AllSubsystems {
candidate_validation: DummySubsystem,
candidate_backing: DummySubsystem,
candidate_selection: DummySubsystem,
statement_distribution: DummySubsystem,
availability_distribution: DummySubsystem,
availability_recovery: DummySubsystem,
......@@ -247,11 +243,10 @@ impl<CV, CB, CS, SD, AD, AR, BS, BD, P, 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> {
fn as_ref(&self) -> AllSubsystems<&'_ CV, &'_ CB, &'_ 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: &self.candidate_selection,
statement_distribution: &self.statement_distribution,
availability_distribution: &self.availability_distribution,
availability_recovery: &self.availability_recovery,
......@@ -274,7 +269,6 @@ impl<CV, CB, CS, SD, AD, AR, BS, BD, P, RA, AS, NB, CA, CG, CP, ApD, ApV, GS>
-> AllSubsystems<
<M as MapSubsystem<CV>>::Output,
<M as MapSubsystem<CB>>::Output,
<M as MapSubsystem<CS>>::Output,
<M as MapSubsystem<SD>>::Output,
<M as MapSubsystem<AD>>::Output,
<M as MapSubsystem<AR>>::Output,
......@@ -294,7 +288,6 @@ impl<CV, CB, CS, SD, AD, AR, BS, BD, P, RA, AS, NB, CA, CG, CP, ApD, ApV, GS>
where
M: MapSubsystem<CV>,
M: MapSubsystem<CB>,
M: MapSubsystem<CS>,
M: MapSubsystem<SD>,
M: MapSubsystem<AD>,
M: MapSubsystem<AR>,
......@@ -314,7 +307,6 @@ impl<CV, CB, CS, SD, AD, AR, BS, BD, P, RA, AS, NB, CA, CG, CP, ApD, ApV, GS>
AllSubsystems {
candidate_validation: m.map_subsystem(self.candidate_validation),
candidate_backing: m.map_subsystem(self.candidate_backing),
candidate_selection: m.map_subsystem(self.candidate_selection),
statement_distribution: m.map_subsystem(self.statement_distribution),
availability_distribution: m.map_subsystem(self.availability_distribution),
availability_recovery: m.map_subsystem(self.availability_recovery),
......@@ -338,7 +330,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,
>;
/// A type of messages that are sent from [`Subsystem`] to [`Overseer`].
......@@ -546,7 +538,6 @@ fn make_packet<T>(signals_received: usize, message: T) -> MessagePacket<T> {
struct ChannelsOut {
candidate_validation: metered::MeteredSender<MessagePacket<CandidateValidationMessage>>,
candidate_backing: metered::MeteredSender<MessagePacket<CandidateBackingMessage>>,
candidate_selection: metered::MeteredSender<MessagePacket<CandidateSelectionMessage>>,
statement_distribution: metered::MeteredSender<MessagePacket<StatementDistributionMessage>>,
availability_distribution: metered::MeteredSender<MessagePacket<AvailabilityDistributionMessage>>,
availability_recovery: metered::MeteredSender<MessagePacket<AvailabilityRecoveryMessage>>,
......@@ -565,7 +556,6 @@ struct ChannelsOut {
candidate_validation_unbounded: metered::UnboundedMeteredSender<MessagePacket<CandidateValidationMessage>>,
candidate_backing_unbounded: metered::UnboundedMeteredSender<MessagePacket<CandidateBackingMessage>>,
candidate_selection_unbounded: metered::UnboundedMeteredSender<MessagePacket<CandidateSelectionMessage>>,
statement_distribution_unbounded: metered::UnboundedMeteredSender<MessagePacket<StatementDistributionMessage>>,
availability_distribution_unbounded: metered::UnboundedMeteredSender<MessagePacket<AvailabilityDistributionMessage>>,
availability_recovery_unbounded: metered::UnboundedMeteredSender<MessagePacket<AvailabilityRecoveryMessage>>,
......@@ -596,9 +586,6 @@ impl ChannelsOut {
AllMessages::CandidateBacking(msg) => {
self.candidate_backing.send(make_packet(signals_received, msg)).await
},
AllMessages::CandidateSelection(msg) => {
self.candidate_selection.send(make_packet(signals_received, msg)).await
},
AllMessages::StatementDistribution(msg) => {
self.statement_distribution.send(make_packet(signals_received, msg)).await
},
......@@ -671,11 +658,6 @@ impl ChannelsOut {
.unbounded_send(make_packet(signals_received, msg))
.map_err(|e| e.into_send_error())
},
AllMessages::CandidateSelection(msg) => {
self.candidate_selection_unbounded
.unbounded_send(make_packet(signals_received, msg))
.map_err(|e| e.into_send_error())
},
AllMessages::StatementDistribution(msg) => {
self.statement_distribution_unbounded
.unbounded_send(make_packet(signals_received, msg))
......@@ -1058,7 +1040,6 @@ pub struct Overseer<S, SupportsParachains> {
subsystems: AllSubsystems<
OverseenSubsystem<CandidateValidationMessage>,
OverseenSubsystem<CandidateBackingMessage>,
OverseenSubsystem<CandidateSelectionMessage>,
OverseenSubsystem<StatementDistributionMessage>,
OverseenSubsystem<AvailabilityDistributionMessage>,
OverseenSubsystem<AvailabilityRecoveryMessage>,
......@@ -1379,9 +1360,9 @@ where
/// #
/// # }); }
/// ```
pub fn new<CV, CB, CS, SD, AD, AR, BS, BD, P, RA, AS, NB, CA, CG, CP, ApD, ApV, GS>(
pub fn new<CV, CB, 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, RA, AS, NB, CA, CG, CP, ApD, ApV, GS>,
all_subsystems: AllSubsystems<CV, CB, SD, AD, AR, BS, BD, P, RA, AS, NB, CA, CG, CP, ApD, ApV, GS>,
prometheus_registry: Option<&prometheus::Registry>,
supports_parachains: SupportsParachains,
mut s: S,
......@@ -1389,7 +1370,6 @@ where
where
CV: Subsystem<OverseerSubsystemContext<CandidateValidationMessage>> + Send,
CB: Subsystem<OverseerSubsystemContext<CandidateBackingMessage>> + Send,
CS: Subsystem<OverseerSubsystemContext<CandidateSelectionMessage>> + Send,
SD: Subsystem<OverseerSubsystemContext<StatementDistributionMessage>> + Send,
AD: Subsystem<OverseerSubsystemContext<AvailabilityDistributionMessage>> + Send,
AR: Subsystem<OverseerSubsystemContext<AvailabilityRecoveryMessage>> + Send,
......@@ -1422,8 +1402,6 @@ where
= metered::channel(CHANNEL_CAPACITY);
let (candidate_backing_bounded_tx, candidate_backing_bounded_rx)
= metered::channel(CHANNEL_CAPACITY);
let (candidate_selection_bounded_tx, candidate_selection_bounded_rx)
= metered::channel(CHANNEL_CAPACITY);
let (statement_distribution_bounded_tx, statement_distribution_bounded_rx)
= metered::channel(CHANNEL_CAPACITY);
let (availability_distribution_bounded_tx, availability_distribution_bounded_rx)
......@@ -1459,8 +1437,6 @@ where
= metered::unbounded();
let (candidate_backing_unbounded_tx, candidate_backing_unbounded_rx)
= metered::unbounded();
let (candidate_selection_unbounded_tx, candidate_selection_unbounded_rx)
= metered::unbounded();
let (statement_distribution_unbounded_tx, statement_distribution_unbounded_rx)
= metered::unbounded();
let (availability_distribution_unbounded_tx, availability_distribution_unbounded_rx)
......@@ -1495,7 +1471,6 @@ where
let channels_out = ChannelsOut {
candidate_validation: candidate_validation_bounded_tx.clone(),
candidate_backing: candidate_backing_bounded_tx.clone(),
candidate_selection: candidate_selection_bounded_tx.clone(),
statement_distribution: statement_distribution_bounded_tx.clone(),
availability_distribution: availability_distribution_bounded_tx.clone(),
availability_recovery: availability_recovery_bounded_tx.clone(),
......@@ -1514,7 +1489,6 @@ where
candidate_validation_unbounded: candidate_validation_unbounded_tx.clone(),
candidate_backing_unbounded: candidate_backing_unbounded_tx.clone(),
candidate_selection_unbounded: candidate_selection_unbounded_tx.clone(),
statement_distribution_unbounded: statement_distribution_unbounded_tx.clone(),
availability_distribution_unbounded: availability_distribution_unbounded_tx.clone(),
availability_recovery_unbounded: availability_recovery_unbounded_tx.clone(),
......@@ -1558,19 +1532,6 @@ where
TaskKind::Regular,
)?;
let candidate_selection_subsystem = spawn(
&mut s,
candidate_selection_bounded_tx,
stream::select(candidate_selection_bounded_rx, candidate_selection_unbounded_rx),
candidate_selection_unbounded_tx.meter().clone(),
channels_out.clone(),
to_overseer_tx.clone(),
all_subsystems.candidate_selection,
&metrics,
&mut running_subsystems,
TaskKind::Regular,
)?;
let statement_distribution_subsystem = spawn(
&mut s,
statement_distribution_bounded_tx,
......@@ -1777,7 +1738,6 @@ where
let subsystems = AllSubsystems {
candidate_validation: candidate_validation_subsystem,
candidate_backing: candidate_backing_subsystem,
candidate_selection: candidate_selection_subsystem,
statement_distribution: statement_distribution_subsystem,
availability_distribution: availability_distribution_subsystem,
availability_recovery: availability_recovery_subsystem,
......@@ -1853,7 +1813,6 @@ where
async fn stop(mut self) {
let _ = self.subsystems.candidate_validation.send_signal(OverseerSignal::Conclude).await;
let _ = self.subsystems.candidate_backing.send_signal(OverseerSignal::Conclude).await;
let _ = self.subsystems.candidate_selection.send_signal(OverseerSignal::Conclude).await;
let _ = self.subsystems.statement_distribution.send_signal(OverseerSignal::Conclude).await;
let _ = self.subsystems.availability_distribution.send_signal(OverseerSignal::Conclude).await;
let _ = self.subsystems.availability_recovery.send_signal(OverseerSignal::Conclude).await;
......@@ -2036,7 +1995,6 @@ where
async fn broadcast_signal(&mut self, signal: OverseerSignal) -> SubsystemResult<()> {
self.subsystems.candidate_validation.send_signal(signal.clone()).await?;
self.subsystems.candidate_backing.send_signal(signal.clone()).await?;
self.subsystems.candidate_selection.send_signal(signal.clone()).await?;
self.subsystems.statement_distribution.send_signal(signal.clone()).await?;
self.subsystems.availability_distribution.send_signal(signal.clone()).await?;
self.subsystems.availability_recovery.send_signal(signal.clone()).await?;
......@@ -2066,9 +2024,6 @@ where
AllMessages::CandidateBacking(msg) => {
self.subsystems.candidate_backing.send_message(msg).await?;
},
AllMessages::CandidateSelection(msg) => {
self.subsystems.candidate_selection.send_message(msg).await?;
},
AllMessages::StatementDistribution(msg) => {
self.subsystems.statement_distribution.send_message(msg).await?;
},
......@@ -3092,10 +3047,6 @@ mod tests {
CandidateBackingMessage::GetBackedCandidates(Default::default(), Vec::new(), sender)
}
fn test_candidate_selection_msg() -> CandidateSelectionMessage {
CandidateSelectionMessage::default()
}
fn test_chain_api_msg() -> ChainApiMessage {
let (sender, _) = oneshot::channel();
ChainApiMessage::FinalizedBlockNumber(sender)
......@@ -3177,7 +3128,7 @@ mod tests {
// Checks that `stop`, `broadcast_signal` and `broadcast_message` are implemented correctly.
#[test]
fn overseer_all_subsystems_receive_signals_and_messages() {
const NUM_SUBSYSTEMS: usize = 18;
const NUM_SUBSYSTEMS: usize = 17;
// -3 for BitfieldSigning, GossipSupport and AvailabilityDistribution
const NUM_SUBSYSTEMS_MESSAGED: usize = NUM_SUBSYSTEMS - 3;
......@@ -3196,7 +3147,6 @@ mod tests {
let all_subsystems = AllSubsystems {
candidate_validation: subsystem.clone(),
candidate_backing: subsystem.clone(),
candidate_selection: subsystem.clone(),
collation_generation: subsystem.clone(),
collator_protocol: subsystem.clone(),
statement_distribution: subsystem.clone(),
......@@ -3235,7 +3185,6 @@ mod tests {
// 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;
handler.send_msg(AllMessages::CollationGeneration(test_collator_generation_msg())).await;
handler.send_msg(AllMessages::CollatorProtocol(test_collator_protocol_msg())).await;
handler.send_msg(AllMessages::StatementDistribution(test_statement_distribution_msg())).await;
......@@ -3285,7 +3234,6 @@ mod tests {
fn context_holds_onto_message_until_enough_signals_received() {
let (candidate_validation_bounded_tx, _) = metered::channel(CHANNEL_CAPACITY);
let (candidate_backing_bounded_tx, _) = metered::channel(CHANNEL_CAPACITY);
let (candidate_selection_bounded_tx, _) = metered::channel(CHANNEL_CAPACITY);
let (statement_distribution_bounded_tx, _) = metered::channel(CHANNEL_CAPACITY);
let (availability_distribution_bounded_tx, _) = metered::channel(CHANNEL_CAPACITY);
let (availability_recovery_bounded_tx, _) = metered::channel(CHANNEL_CAPACITY);
......@@ -3304,7 +3252,6 @@ mod tests {
let (candidate_validation_unbounded_tx, _) = metered::unbounded();
let (candidate_backing_unbounded_tx, _) = metered::unbounded();
let (candidate_selection_unbounded_tx, _) = metered::unbounded();
let (statement_distribution_unbounded_tx, _) = metered::unbounded();
let (availability_distribution_unbounded_tx, _) = metered::unbounded();
let (availability_recovery_unbounded_tx, _) = metered::unbounded();
......@@ -3324,7 +3271,6 @@ mod tests {
let channels_out = ChannelsOut {
candidate_validation: candidate_validation_bounded_tx.clone(),
candidate_backing: candidate_backing_bounded_tx.clone(),
candidate_selection: candidate_selection_bounded_tx.clone(),
statement_distribution: statement_distribution_bounded_tx.clone(),
availability_distribution: availability_distribution_bounded_tx.clone(),
availability_recovery: availability_recovery_bounded_tx.clone(),
......@@ -3343,7 +3289,6 @@ mod tests {
candidate_validation_unbounded: candidate_validation_unbounded_tx.clone(),
candidate_backing_unbounded: candidate_backing_unbounded_tx.clone(),
candidate_selection_unbounded: candidate_selection_unbounded_tx.clone(),
statement_distribution_unbounded: statement_distribution_unbounded_tx.clone(),
availability_distribution_unbounded: availability_distribution_unbounded_tx.clone(),
availability_recovery_unbounded: availability_recovery_unbounded_tx.clone(),
......
......@@ -97,7 +97,6 @@ polkadot-node-collation-generation = { path = "../collation-generation", optiona
polkadot-node-core-av-store = { path = "../core/av-store", optional = true }
polkadot-node-core-backing = { path = "../core/backing", optional = true }
polkadot-node-core-bitfield-signing = { path = "../core/bitfield-signing", optional = true }
polkadot-node-core-candidate-selection = { path = "../core/candidate-selection", optional = true }
polkadot-node-core-candidate-validation = { path = "../core/candidate-validation", optional = true }
polkadot-node-core-chain-api = { path = "../core/chain-api", optional = true }
polkadot-node-core-provisioner = { path = "../core/provisioner", optional = true }
......@@ -125,7 +124,6 @@ full-node = [
"polkadot-node-collation-generation",
"polkadot-node-core-backing",
"polkadot-node-core-bitfield-signing",
"polkadot-node-core-candidate-selection",
"polkadot-node-core-candidate-validation",
"polkadot-node-core-chain-api",
"polkadot-node-core-provisioner",
......
......@@ -447,7 +447,6 @@ where
use polkadot_availability_bitfield_distribution::BitfieldDistribution as BitfieldDistributionSubsystem;
use polkadot_node_core_bitfield_signing::BitfieldSigningSubsystem;
use polkadot_node_core_backing::CandidateBackingSubsystem;
use polkadot_node_core_candidate_selection::CandidateSelectionSubsystem;
use polkadot_node_core_candidate_validation::CandidateValidationSubsystem;
use polkadot_node_core_chain_api::ChainApiSubsystem;
use polkadot_node_collation_generation::CollationGenerationSubsystem;
......@@ -486,11 +485,6 @@ where
keystore.clone(),
Metrics::register(registry)?,
),
candidate_selection: CandidateSelectionSubsystem::new(
spawner.clone(),
keystore.clone(),
Metrics::register(registry)?,
),
candidate_validation: CandidateValidationSubsystem::with_config(
candidate_validation_config,
Metrics::register(registry)?,
......
......@@ -362,8 +362,8 @@ mod tests {
use super::*;
use polkadot_overseer::{Overseer, HeadSupportsParachains, AllSubsystems};
use futures::executor::block_on;
use polkadot_node_subsystem::messages::CandidateSelectionMessage;
use polkadot_primitives::v1::Hash;
use polkadot_node_subsystem::messages::CollatorProtocolMessage;
struct AlwaysSupportsParachains;
impl HeadSupportsParachains for AlwaysSupportsParachains {
......@@ -374,7 +374,7 @@ mod tests {
fn forward_subsystem_works() {
let spawner = sp_core::testing::TaskExecutor::new();
let (tx, rx) = mpsc::channel(2);
let all_subsystems = AllSubsystems::<()>::dummy().replace_candidate_selection(ForwardSubsystem(tx));
let all_subsystems = AllSubsystems::<()>::dummy().replace_collator_protocol(ForwardSubsystem(tx));
let (overseer, mut handler) = Overseer::new(
Vec::new(),
all_subsystems,
......@@ -385,7 +385,7 @@ mod tests {
spawner.spawn("overseer", overseer.run().then(|_| async { () }).boxed());
block_on(handler.send_msg(CandidateSelectionMessage::Invalid(Default::default(), Default::default())));
assert!(matches!(block_on(rx.into_future()).0.unwrap(), CandidateSelectionMessage::Invalid(_, _)));
block_on(handler.send_msg(CollatorProtocolMessage::CollateOn(Default::default())));
assert!(matches!(block_on(rx.into_future()).0.unwrap(), CollatorProtocolMessage::CollateOn(_)));
}
}
......@@ -867,7 +867,7 @@ mod tests {
use thiserror::Error;
use polkadot_node_jaeger as jaeger;
use polkadot_node_subsystem::{
messages::{AllMessages, CandidateSelectionMessage}, ActiveLeavesUpdate, FromOverseer, OverseerSignal,
messages::{AllMessages, CollatorProtocolMessage}, ActiveLeavesUpdate, FromOverseer, OverseerSignal,
SpawnedSubsystem, ActivatedLeaf, LeafStatus,
};
use assert_matches::assert_matches;
......@@ -884,8 +884,8 @@ mod tests {
// job structs are constructed within JobTrait::run
// most will want to retain the sender and receiver, as well as whatever other data they like
struct FakeCandidateSelectionJob {
receiver: mpsc::Receiver<CandidateSelectionMessage>,
struct FakeCollatorProtocolJob {
receiver: mpsc::Receiver<CollatorProtocolMessage>,
}
// Error will mostly be a wrapper to make the try operator more convenient;
......@@ -897,13 +897,13 @@ mod tests {
Sending(#[from]mpsc::SendError),
}
impl JobTrait for FakeCandidateSelectionJob {
type ToJob = CandidateSelectionMessage;
impl JobTrait for FakeCollatorProtocolJob {
type ToJob = CollatorProtocolMessage;
type Error = Error;
type RunArgs = bool;
type Metrics = ();
const NAME: &'static str = "FakeCandidateSelectionJob";
const NAME: &'static str = "FakeCollatorProtocolJob";