Unverified Commit 7754c036 authored by asynchronous rob's avatar asynchronous rob Committed by GitHub
Browse files

merge approval-checking feature back into real-overseer (#2518)

parent 680a8777
Pipeline #125646 canceled with stages
in 23 minutes and 57 seconds
...@@ -91,7 +91,6 @@ panic = "unwind" ...@@ -91,7 +91,6 @@ panic = "unwind"
[features] [features]
runtime-benchmarks=["cli/runtime-benchmarks"] runtime-benchmarks=["cli/runtime-benchmarks"]
real-overseer=["cli/real-overseer"] real-overseer=["cli/real-overseer"]
approval-checking=["real-overseer", "service/approval-checking"]
try-runtime = ["cli/try-runtime"] try-runtime = ["cli/try-runtime"]
# Configuration for building a .deb package - for use with `cargo-deb` # Configuration for building a .deb package - for use with `cargo-deb`
......
...@@ -141,7 +141,3 @@ real-overseer = [ ...@@ -141,7 +141,3 @@ real-overseer = [
"polkadot-statement-distribution", "polkadot-statement-distribution",
"polkadot-approval-distribution", "polkadot-approval-distribution",
] ]
approval-checking = [
"real-overseer"
]
...@@ -24,7 +24,7 @@ use sp_runtime::traits::{Block as BlockT, NumberFor}; ...@@ -24,7 +24,7 @@ use sp_runtime::traits::{Block as BlockT, NumberFor};
use sp_runtime::generic::BlockId; use sp_runtime::generic::BlockId;
use sp_runtime::traits::Header as _; use sp_runtime::traits::Header as _;
#[cfg(feature = "approval-checking")] #[cfg(feature = "real-overseer")]
use { use {
polkadot_primitives::v1::{Block as PolkadotBlock, Header as PolkadotHeader, BlockNumber}, polkadot_primitives::v1::{Block as PolkadotBlock, Header as PolkadotHeader, BlockNumber},
polkadot_subsystem::messages::ApprovalVotingMessage, polkadot_subsystem::messages::ApprovalVotingMessage,
...@@ -39,14 +39,14 @@ use { ...@@ -39,14 +39,14 @@ use {
/// The practical effect of this voting rule is to implement a fixed delay of /// 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 /// blocks and to issue a prometheus metric on the lag behind the head that
/// approval checking would indicate. /// approval checking would indicate.
#[cfg(feature = "approval-checking")] #[cfg(feature = "real-overseer")]
#[derive(Clone)] #[derive(Clone)]
pub(crate) struct ApprovalCheckingDiagnostic { pub(crate) struct ApprovalCheckingDiagnostic {
checking_lag: Option<prometheus_endpoint::Histogram>, checking_lag: Option<prometheus_endpoint::Histogram>,
overseer: OverseerHandler, overseer: OverseerHandler,
} }
#[cfg(feature = "approval-checking")] #[cfg(feature = "real-overseer")]
impl ApprovalCheckingDiagnostic { impl ApprovalCheckingDiagnostic {
/// Create a new approval checking diagnostic voting rule. /// Create a new approval checking diagnostic voting rule.
pub fn new(overseer: OverseerHandler, registry: Option<&Registry>) pub fn new(overseer: OverseerHandler, registry: Option<&Registry>)
...@@ -71,7 +71,7 @@ impl ApprovalCheckingDiagnostic { ...@@ -71,7 +71,7 @@ impl ApprovalCheckingDiagnostic {
} }
} }
#[cfg(feature = "approval-checking")] #[cfg(feature = "real-overseer")]
impl<B> grandpa::VotingRule<PolkadotBlock, B> for ApprovalCheckingDiagnostic impl<B> grandpa::VotingRule<PolkadotBlock, B> for ApprovalCheckingDiagnostic
where B: sp_blockchain::HeaderBackend<PolkadotBlock> where B: sp_blockchain::HeaderBackend<PolkadotBlock>
{ {
......
...@@ -418,10 +418,10 @@ where ...@@ -418,10 +418,10 @@ where
use polkadot_availability_recovery::AvailabilityRecoverySubsystem; use polkadot_availability_recovery::AvailabilityRecoverySubsystem;
use polkadot_approval_distribution::ApprovalDistribution as ApprovalDistributionSubsystem; use polkadot_approval_distribution::ApprovalDistribution as ApprovalDistributionSubsystem;
#[cfg(feature = "approval-checking")] #[cfg(feature = "real-overseer")]
use polkadot_node_core_approval_voting::ApprovalVotingSubsystem; use polkadot_node_core_approval_voting::ApprovalVotingSubsystem;
#[cfg(not(feature = "approval-checking"))] #[cfg(not(feature = "real-overseer"))]
let _ = approval_voting_config; // silence. let _ = approval_voting_config; // silence.
let all_subsystems = AllSubsystems { let all_subsystems = AllSubsystems {
...@@ -498,12 +498,12 @@ where ...@@ -498,12 +498,12 @@ where
approval_distribution: ApprovalDistributionSubsystem::new( approval_distribution: ApprovalDistributionSubsystem::new(
Metrics::register(registry)?, Metrics::register(registry)?,
), ),
#[cfg(feature = "approval-checking")] #[cfg(feature = "real-overseer")]
approval_voting: ApprovalVotingSubsystem::with_config( approval_voting: ApprovalVotingSubsystem::with_config(
approval_voting_config, approval_voting_config,
keystore.clone(), keystore.clone(),
)?, )?,
#[cfg(not(feature = "approval-checking"))] #[cfg(not(feature = "real-overseer"))]
approval_voting: polkadot_subsystem::DummySubsystem, approval_voting: polkadot_subsystem::DummySubsystem,
}; };
...@@ -848,7 +848,7 @@ pub fn new_full<RuntimeApi, Executor>( ...@@ -848,7 +848,7 @@ pub fn new_full<RuntimeApi, Executor>(
// given delay. // given delay.
let builder = grandpa::VotingRulesBuilder::default(); let builder = grandpa::VotingRulesBuilder::default();
#[cfg(feature = "approval-checking")] #[cfg(feature = "real-overseer")]
let builder = if let Some(ref overseer) = overseer_handler { let builder = if let Some(ref overseer) = overseer_handler {
builder.add(grandpa_support::ApprovalCheckingDiagnostic::new( builder.add(grandpa_support::ApprovalCheckingDiagnostic::new(
overseer.clone(), overseer.clone(),
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment