@@ -35,6 +35,17 @@ SignerAgreementStateChangeReason {
35
35
ProtocolUpgrade ( "protocol_upgrade" ) ,
36
36
} ) ;
37
37
38
+ define_named_enum ! (
39
+ /// Represent different conflict types on signer agreement protocol
40
+ SignerAgreementStateConflict {
41
+ /// Waiting for burn block propagation to be aligned with the signer set
42
+ BurnBlockDelay ( "burn_block_delay" ) ,
43
+ /// Waiting for stacks block propagation to be aligned with the signer set
44
+ StacksBlockDelay ( "stacks_block_delay" ) ,
45
+ /// Not allowing reorg to a new miner
46
+ ReorgDisallowed ( "reorg_disallowed" ) ,
47
+ } ) ;
48
+
38
49
/// Actions for updating metrics
39
50
#[ cfg( feature = "monitoring_prom" ) ]
40
51
pub mod actions {
@@ -44,7 +55,7 @@ pub mod actions {
44
55
45
56
use crate :: config:: GlobalConfig ;
46
57
use crate :: monitoring:: prometheus:: * ;
47
- use crate :: monitoring:: SignerAgreementStateChangeReason ;
58
+ use crate :: monitoring:: { SignerAgreementStateChangeReason , SignerAgreementStateConflict } ;
48
59
use crate :: v0:: signer_state:: LocalStateMachine ;
49
60
50
61
/// Update stacks tip height gauge
@@ -134,6 +145,14 @@ pub mod actions {
134
145
. inc ( ) ;
135
146
}
136
147
148
+ /// Increment signer agreement state conflict counter
149
+ pub fn increment_signer_agreement_state_conflict ( conflict : SignerAgreementStateConflict ) {
150
+ let label_value = conflict. get_name ( ) ;
151
+ SIGNER_AGREEMENT_STATE_CONFLICTS
152
+ . with_label_values ( & [ & label_value] )
153
+ . inc ( ) ;
154
+ }
155
+
137
156
/// Start serving monitoring metrics.
138
157
/// This will only serve the metrics if the `monitoring_prom` feature is enabled.
139
158
pub fn start_serving_monitoring_metrics ( config : GlobalConfig ) -> Result < ( ) , String > {
@@ -157,7 +176,7 @@ pub mod actions {
157
176
use blockstack_lib:: chainstate:: nakamoto:: NakamotoBlock ;
158
177
use stacks_common:: info;
159
178
160
- use crate :: monitoring:: SignerAgreementStateChangeReason ;
179
+ use crate :: monitoring:: { SignerAgreementStateChangeReason , SignerAgreementStateConflict } ;
161
180
use crate :: v0:: signer_state:: LocalStateMachine ;
162
181
use crate :: GlobalConfig ;
163
182
@@ -212,6 +231,9 @@ pub mod actions {
212
231
) {
213
232
}
214
233
234
+ /// Increment signer agreement state conflict counter
235
+ pub fn increment_signer_agreement_state_conflict ( _conflict : SignerAgreementStateConflict ) { }
236
+
215
237
/// Start serving monitoring metrics.
216
238
/// This will only serve the metrics if the `monitoring_prom` feature is enabled.
217
239
pub fn start_serving_monitoring_metrics ( config : GlobalConfig ) -> Result < ( ) , String > {
0 commit comments