mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-13 08:11:04 +00:00
pvf-precheck: PVF pre-checker subsystem (#4643)
This commit implements the last major piece of #3211: the subsystem that tracks PVFs that require voting, issues pre-check requests to candidate-validation and makes sure that the votes are submitted to the chain.
This commit is contained in:
@@ -89,6 +89,7 @@ pub fn dummy_overseer_builder<'a, Spawner, SupportsParachains>(
|
||||
DummySubsystem,
|
||||
DummySubsystem,
|
||||
DummySubsystem,
|
||||
DummySubsystem,
|
||||
>,
|
||||
SubsystemError,
|
||||
>
|
||||
@@ -129,6 +130,7 @@ pub fn one_for_all_overseer_builder<'a, Spawner, SupportsParachains, Sub>(
|
||||
Sub,
|
||||
Sub,
|
||||
Sub,
|
||||
Sub,
|
||||
>,
|
||||
SubsystemError,
|
||||
>
|
||||
@@ -155,7 +157,8 @@ where
|
||||
+ Subsystem<OverseerSubsystemContext<GossipSupportMessage>, SubsystemError>
|
||||
+ Subsystem<OverseerSubsystemContext<DisputeCoordinatorMessage>, SubsystemError>
|
||||
+ Subsystem<OverseerSubsystemContext<DisputeDistributionMessage>, SubsystemError>
|
||||
+ Subsystem<OverseerSubsystemContext<ChainSelectionMessage>, SubsystemError>,
|
||||
+ Subsystem<OverseerSubsystemContext<ChainSelectionMessage>, SubsystemError>
|
||||
+ Subsystem<OverseerSubsystemContext<PvfCheckerMessage>, SubsystemError>,
|
||||
{
|
||||
let metrics = <OverseerMetrics as MetricsTrait>::register(registry)?;
|
||||
|
||||
@@ -167,6 +170,7 @@ where
|
||||
.bitfield_signing(subsystem.clone())
|
||||
.candidate_backing(subsystem.clone())
|
||||
.candidate_validation(subsystem.clone())
|
||||
.pvf_checker(subsystem.clone())
|
||||
.chain_api(subsystem.clone())
|
||||
.collation_generation(subsystem.clone())
|
||||
.collator_protocol(subsystem.clone())
|
||||
|
||||
@@ -84,8 +84,8 @@ use polkadot_node_subsystem_types::messages::{
|
||||
BitfieldSigningMessage, CandidateBackingMessage, CandidateValidationMessage, ChainApiMessage,
|
||||
ChainSelectionMessage, CollationGenerationMessage, CollatorProtocolMessage,
|
||||
DisputeCoordinatorMessage, DisputeDistributionMessage, GossipSupportMessage,
|
||||
NetworkBridgeEvent, NetworkBridgeMessage, ProvisionerMessage, RuntimeApiMessage,
|
||||
StatementDistributionMessage,
|
||||
NetworkBridgeEvent, NetworkBridgeMessage, ProvisionerMessage, PvfCheckerMessage,
|
||||
RuntimeApiMessage, StatementDistributionMessage,
|
||||
};
|
||||
pub use polkadot_node_subsystem_types::{
|
||||
errors::{SubsystemError, SubsystemResult},
|
||||
@@ -420,6 +420,9 @@ pub struct Overseer<SupportsParachains> {
|
||||
#[subsystem(no_dispatch, CandidateValidationMessage)]
|
||||
candidate_validation: CandidateValidation,
|
||||
|
||||
#[subsystem(no_dispatch, PvfCheckerMessage)]
|
||||
pvf_checker: PvfChecker,
|
||||
|
||||
#[subsystem(no_dispatch, CandidateBackingMessage)]
|
||||
candidate_backing: CandidateBacking,
|
||||
|
||||
|
||||
@@ -920,9 +920,9 @@ fn test_chain_selection_msg() -> ChainSelectionMessage {
|
||||
// Checks that `stop`, `broadcast_signal` and `broadcast_message` are implemented correctly.
|
||||
#[test]
|
||||
fn overseer_all_subsystems_receive_signals_and_messages() {
|
||||
const NUM_SUBSYSTEMS: usize = 20;
|
||||
// -3 for BitfieldSigning, GossipSupport and AvailabilityDistribution
|
||||
const NUM_SUBSYSTEMS_MESSAGED: usize = NUM_SUBSYSTEMS - 3;
|
||||
const NUM_SUBSYSTEMS: usize = 21;
|
||||
// -4 for BitfieldSigning, GossipSupport, AvailabilityDistribution and PvfCheckerSubsystem.
|
||||
const NUM_SUBSYSTEMS_MESSAGED: usize = NUM_SUBSYSTEMS - 4;
|
||||
|
||||
let spawner = sp_core::testing::TaskExecutor::new();
|
||||
executor::block_on(async move {
|
||||
@@ -1005,6 +1005,7 @@ fn overseer_all_subsystems_receive_signals_and_messages() {
|
||||
handle
|
||||
.send_msg_anon(AllMessages::ChainSelection(test_chain_selection_msg()))
|
||||
.await;
|
||||
// handle.send_msg_anon(AllMessages::PvfChecker(test_pvf_checker_msg())).await;
|
||||
|
||||
// Wait until all subsystems have received. Otherwise the messages might race against
|
||||
// the conclude signal.
|
||||
@@ -1058,6 +1059,7 @@ fn context_holds_onto_message_until_enough_signals_received() {
|
||||
let (dispute_coordinator_bounded_tx, _) = metered::channel(CHANNEL_CAPACITY);
|
||||
let (dispute_distribution_bounded_tx, _) = metered::channel(CHANNEL_CAPACITY);
|
||||
let (chain_selection_bounded_tx, _) = metered::channel(CHANNEL_CAPACITY);
|
||||
let (pvf_checker_bounded_tx, _) = metered::channel(CHANNEL_CAPACITY);
|
||||
|
||||
let (candidate_validation_unbounded_tx, _) = metered::unbounded();
|
||||
let (candidate_backing_unbounded_tx, _) = metered::unbounded();
|
||||
@@ -1079,6 +1081,7 @@ fn context_holds_onto_message_until_enough_signals_received() {
|
||||
let (dispute_coordinator_unbounded_tx, _) = metered::unbounded();
|
||||
let (dispute_distribution_unbounded_tx, _) = metered::unbounded();
|
||||
let (chain_selection_unbounded_tx, _) = metered::unbounded();
|
||||
let (pvf_checker_unbounded_tx, _) = metered::unbounded();
|
||||
|
||||
let channels_out = ChannelsOut {
|
||||
candidate_validation: candidate_validation_bounded_tx.clone(),
|
||||
@@ -1101,6 +1104,7 @@ fn context_holds_onto_message_until_enough_signals_received() {
|
||||
dispute_coordinator: dispute_coordinator_bounded_tx.clone(),
|
||||
dispute_distribution: dispute_distribution_bounded_tx.clone(),
|
||||
chain_selection: chain_selection_bounded_tx.clone(),
|
||||
pvf_checker: pvf_checker_bounded_tx.clone(),
|
||||
|
||||
candidate_validation_unbounded: candidate_validation_unbounded_tx.clone(),
|
||||
candidate_backing_unbounded: candidate_backing_unbounded_tx.clone(),
|
||||
@@ -1122,6 +1126,7 @@ fn context_holds_onto_message_until_enough_signals_received() {
|
||||
dispute_coordinator_unbounded: dispute_coordinator_unbounded_tx.clone(),
|
||||
dispute_distribution_unbounded: dispute_distribution_unbounded_tx.clone(),
|
||||
chain_selection_unbounded: chain_selection_unbounded_tx.clone(),
|
||||
pvf_checker_unbounded: pvf_checker_unbounded_tx.clone(),
|
||||
};
|
||||
|
||||
let (mut signal_tx, signal_rx) = metered::channel(CHANNEL_CAPACITY);
|
||||
|
||||
Reference in New Issue
Block a user