From 0fac609a61d7257c300ca30b2e85b585fd772ca0 Mon Sep 17 00:00:00 2001 From: Robert Habermeier Date: Wed, 24 Feb 2021 11:28:32 -0600 Subject: [PATCH] merge approval-checking feature back into real-overseer (#2518) --- polkadot/Cargo.toml | 1 - polkadot/node/service/Cargo.toml | 4 ---- polkadot/node/service/src/grandpa_support.rs | 8 ++++---- polkadot/node/service/src/lib.rs | 10 +++++----- 4 files changed, 9 insertions(+), 14 deletions(-) diff --git a/polkadot/Cargo.toml b/polkadot/Cargo.toml index e073800c83..c0211ed506 100644 --- a/polkadot/Cargo.toml +++ b/polkadot/Cargo.toml @@ -91,7 +91,6 @@ panic = "unwind" [features] runtime-benchmarks=["cli/runtime-benchmarks"] real-overseer=["cli/real-overseer"] -approval-checking=["real-overseer", "service/approval-checking"] try-runtime = ["cli/try-runtime"] # Configuration for building a .deb package - for use with `cargo-deb` diff --git a/polkadot/node/service/Cargo.toml b/polkadot/node/service/Cargo.toml index 9022f483c4..650768b50c 100644 --- a/polkadot/node/service/Cargo.toml +++ b/polkadot/node/service/Cargo.toml @@ -141,7 +141,3 @@ real-overseer = [ "polkadot-statement-distribution", "polkadot-approval-distribution", ] - -approval-checking = [ - "real-overseer" -] diff --git a/polkadot/node/service/src/grandpa_support.rs b/polkadot/node/service/src/grandpa_support.rs index fd68580269..70df2be23d 100644 --- a/polkadot/node/service/src/grandpa_support.rs +++ b/polkadot/node/service/src/grandpa_support.rs @@ -24,7 +24,7 @@ use sp_runtime::traits::{Block as BlockT, NumberFor}; use sp_runtime::generic::BlockId; use sp_runtime::traits::Header as _; -#[cfg(feature = "approval-checking")] +#[cfg(feature = "real-overseer")] use { polkadot_primitives::v1::{Block as PolkadotBlock, Header as PolkadotHeader, BlockNumber}, polkadot_subsystem::messages::ApprovalVotingMessage, @@ -39,14 +39,14 @@ use { /// The practical effect of this voting rule is to implement a fixed delay of /// blocks and to issue a prometheus metric on the lag behind the head that /// approval checking would indicate. -#[cfg(feature = "approval-checking")] +#[cfg(feature = "real-overseer")] #[derive(Clone)] pub(crate) struct ApprovalCheckingDiagnostic { checking_lag: Option, overseer: OverseerHandler, } -#[cfg(feature = "approval-checking")] +#[cfg(feature = "real-overseer")] impl ApprovalCheckingDiagnostic { /// Create a new approval checking diagnostic voting rule. pub fn new(overseer: OverseerHandler, registry: Option<&Registry>) @@ -71,7 +71,7 @@ impl ApprovalCheckingDiagnostic { } } -#[cfg(feature = "approval-checking")] +#[cfg(feature = "real-overseer")] impl grandpa::VotingRule for ApprovalCheckingDiagnostic where B: sp_blockchain::HeaderBackend { diff --git a/polkadot/node/service/src/lib.rs b/polkadot/node/service/src/lib.rs index 71f9d29dcd..08b6303b6e 100644 --- a/polkadot/node/service/src/lib.rs +++ b/polkadot/node/service/src/lib.rs @@ -418,10 +418,10 @@ where use polkadot_availability_recovery::AvailabilityRecoverySubsystem; use polkadot_approval_distribution::ApprovalDistribution as ApprovalDistributionSubsystem; - #[cfg(feature = "approval-checking")] + #[cfg(feature = "real-overseer")] use polkadot_node_core_approval_voting::ApprovalVotingSubsystem; - #[cfg(not(feature = "approval-checking"))] + #[cfg(not(feature = "real-overseer"))] let _ = approval_voting_config; // silence. let all_subsystems = AllSubsystems { @@ -498,12 +498,12 @@ where approval_distribution: ApprovalDistributionSubsystem::new( Metrics::register(registry)?, ), - #[cfg(feature = "approval-checking")] + #[cfg(feature = "real-overseer")] approval_voting: ApprovalVotingSubsystem::with_config( approval_voting_config, keystore.clone(), )?, - #[cfg(not(feature = "approval-checking"))] + #[cfg(not(feature = "real-overseer"))] approval_voting: polkadot_subsystem::DummySubsystem, }; @@ -848,7 +848,7 @@ pub fn new_full( // given delay. let builder = grandpa::VotingRulesBuilder::default(); - #[cfg(feature = "approval-checking")] + #[cfg(feature = "real-overseer")] let builder = if let Some(ref overseer) = overseer_handler { builder.add(grandpa_support::ApprovalCheckingDiagnostic::new( overseer.clone(),