Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.

Commit 3f8c664

Browse files
author
Andronik Ordian
committed
remove duplicate metric
1 parent e95bc30 commit 3f8c664

File tree

2 files changed

+5
-29
lines changed

2 files changed

+5
-29
lines changed

node/service/src/grandpa_support.rs

Lines changed: 4 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ use sp_runtime::traits::Header as _;
2626
use {
2727
polkadot_primitives::v1::{Hash, Block as PolkadotBlock, Header as PolkadotHeader},
2828
polkadot_subsystem::messages::ApprovalVotingMessage,
29-
prometheus_endpoint::{self, Registry},
3029
polkadot_overseer::Handle,
3130
futures::channel::oneshot,
3231
};
@@ -35,37 +34,20 @@ use {
3534
/// voting subsystem's desired votes.
3635
///
3736
/// The practical effect of this voting rule is to implement a fixed delay of
38-
/// blocks and to issue a prometheus metric on the lag behind the head that
39-
/// approval checking would indicate.
37+
/// blocks.
4038
#[cfg(feature = "full-node")]
4139
#[derive(Clone)]
4240
pub(crate) struct ApprovalCheckingVotingRule {
43-
checking_lag: Option<prometheus_endpoint::Gauge<prometheus_endpoint::U64>>,
4441
overseer: Handle,
4542
}
4643

4744
#[cfg(feature = "full-node")]
4845
impl ApprovalCheckingVotingRule {
4946
/// Create a new approval checking diagnostic voting rule.
50-
pub fn new(overseer: Handle, registry: Option<&Registry>)
51-
-> Result<Self, prometheus_endpoint::PrometheusError>
52-
{
53-
Ok(ApprovalCheckingVotingRule {
54-
checking_lag: if let Some(registry) = registry {
55-
Some(prometheus_endpoint::register(
56-
prometheus_endpoint::Gauge::with_opts(
57-
prometheus_endpoint::Opts::new(
58-
"parachain_approval_checking_finality_lag",
59-
"How far behind the head of the chain the Approval Checking protocol wants to vote",
60-
)
61-
)?,
62-
registry,
63-
)?)
64-
} else {
65-
None
66-
},
47+
pub fn new(overseer: Handle) -> Self {
48+
Self {
6749
overseer,
68-
})
50+
}
6951
}
7052
}
7153

@@ -115,7 +97,6 @@ impl<B> grandpa::VotingRule<PolkadotBlock, B> for ApprovalCheckingVotingRule
11597
) -> grandpa::VotingRuleResult<PolkadotBlock> {
11698
// Query approval checking and issue metrics.
11799
let mut overseer = self.overseer.clone();
118-
let checking_lag = self.checking_lag.clone();
119100

120101
let best_hash = best_target.hash();
121102
let best_number = best_target.number.clone();
@@ -147,10 +128,6 @@ impl<B> grandpa::VotingRule<PolkadotBlock, B> for ApprovalCheckingVotingRule
147128
|(_h, n)| best_number - n,
148129
);
149130

150-
if let Some(ref checking_lag) = checking_lag {
151-
checking_lag.set(approval_checking_subsystem_lag as _);
152-
}
153-
154131
let min_vote = {
155132
let diff = best_number.saturating_sub(base_number);
156133
if diff >= MAX_APPROVAL_CHECKING_FINALITY_LAG {

node/service/src/lib.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -917,8 +917,7 @@ pub fn new_full<RuntimeApi, Executor, OverseerGenerator>(
917917
if enable_approval_checking_voting_rule {
918918
builder.add(grandpa_support::ApprovalCheckingVotingRule::new(
919919
overseer.clone(),
920-
prometheus_registry.as_ref(),
921-
)?)
920+
))
922921
} else {
923922
builder
924923
}

0 commit comments

Comments
 (0)