@@ -26,7 +26,6 @@ use sp_runtime::traits::Header as _;
26
26
use {
27
27
polkadot_primitives:: v1:: { Hash , Block as PolkadotBlock , Header as PolkadotHeader } ,
28
28
polkadot_subsystem:: messages:: ApprovalVotingMessage ,
29
- prometheus_endpoint:: { self , Registry } ,
30
29
polkadot_overseer:: Handle ,
31
30
futures:: channel:: oneshot,
32
31
} ;
@@ -35,37 +34,20 @@ use {
35
34
/// voting subsystem's desired votes.
36
35
///
37
36
/// 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.
40
38
#[ cfg( feature = "full-node" ) ]
41
39
#[ derive( Clone ) ]
42
40
pub ( crate ) struct ApprovalCheckingVotingRule {
43
- checking_lag : Option < prometheus_endpoint:: Gauge < prometheus_endpoint:: U64 > > ,
44
41
overseer : Handle ,
45
42
}
46
43
47
44
#[ cfg( feature = "full-node" ) ]
48
45
impl ApprovalCheckingVotingRule {
49
46
/// 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 {
67
49
overseer,
68
- } )
50
+ }
69
51
}
70
52
}
71
53
@@ -115,7 +97,6 @@ impl<B> grandpa::VotingRule<PolkadotBlock, B> for ApprovalCheckingVotingRule
115
97
) -> grandpa:: VotingRuleResult < PolkadotBlock > {
116
98
// Query approval checking and issue metrics.
117
99
let mut overseer = self . overseer . clone ( ) ;
118
- let checking_lag = self . checking_lag . clone ( ) ;
119
100
120
101
let best_hash = best_target. hash ( ) ;
121
102
let best_number = best_target. number . clone ( ) ;
@@ -147,10 +128,6 @@ impl<B> grandpa::VotingRule<PolkadotBlock, B> for ApprovalCheckingVotingRule
147
128
|( _h, n) | best_number - n,
148
129
) ;
149
130
150
- if let Some ( ref checking_lag) = checking_lag {
151
- checking_lag. set ( approval_checking_subsystem_lag as _ ) ;
152
- }
153
-
154
131
let min_vote = {
155
132
let diff = best_number. saturating_sub ( base_number) ;
156
133
if diff >= MAX_APPROVAL_CHECKING_FINALITY_LAG {
0 commit comments