@@ -70,7 +70,7 @@ pub struct SignerCoordinator {
70
70
/// burn block has arrived since this thread started.
71
71
burn_tip_at_start : ConsensusHash ,
72
72
/// The timeout configuration based on the percentage of rejections
73
- block_rejection_timeout_steps : BTreeMap < u64 , Duration > ,
73
+ block_rejection_timeout_steps : BTreeMap < u32 , Duration > ,
74
74
}
75
75
76
76
impl SignerCoordinator {
@@ -107,10 +107,10 @@ impl SignerCoordinator {
107
107
let miners_session = StackerDBSession :: new ( & rpc_socket. to_string ( ) , miners_contract_id) ;
108
108
109
109
// build a BTreeMap of the various timeout steps
110
- let mut block_rejection_timeout_steps = BTreeMap :: < u64 , Duration > :: new ( ) ;
110
+ let mut block_rejection_timeout_steps = BTreeMap :: < u32 , Duration > :: new ( ) ;
111
111
for ( percentage, duration) in config. miner . block_rejection_timeout_steps . iter ( ) {
112
112
let rejections_amount =
113
- ( ( f64:: from ( listener. total_weight ) / 100.0 ) * f64:: from ( * percentage) ) as u64 ;
113
+ ( ( f64:: from ( listener. total_weight ) / 100.0 ) * f64:: from ( * percentage) ) as u32 ;
114
114
block_rejection_timeout_steps. insert ( rejections_amount, * duration) ;
115
115
}
116
116
@@ -308,7 +308,7 @@ impl SignerCoordinator {
308
308
counters : & Counters ,
309
309
) -> Result < Vec < MessageSignature > , NakamotoNodeError > {
310
310
// the amount of current rejections (used to eventually modify the timeout)
311
- let mut rejections: u64 = 0 ;
311
+ let mut rejections: u32 = 0 ;
312
312
// default timeout (the 0 entry must be always present)
313
313
let mut rejections_timeout = self
314
314
. block_rejection_timeout_steps
@@ -334,7 +334,7 @@ impl SignerCoordinator {
334
334
return false ;
335
335
}
336
336
// number or rejections changed?
337
- if u64 :: from ( status. total_reject_weight ) != rejections {
337
+ if status. total_reject_weight != rejections {
338
338
return false ;
339
339
}
340
340
// enough signatures?
@@ -388,8 +388,8 @@ impl SignerCoordinator {
388
388
}
389
389
} ;
390
390
391
- if rejections != u64 :: from ( block_status. total_reject_weight ) {
392
- rejections = u64 :: from ( block_status. total_reject_weight ) ;
391
+ if rejections != block_status. total_reject_weight {
392
+ rejections = block_status. total_reject_weight ;
393
393
let ( rejections_step, new_rejections_timeout) = self
394
394
. block_rejection_timeout_steps
395
395
. range ( ( Included ( 0 ) , Included ( rejections) ) )
@@ -406,7 +406,7 @@ impl SignerCoordinator {
406
406
"rejections_step" => rejections_step,
407
407
"rejections_threshold" => self . total_weight. saturating_sub( self . weight_threshold) ) ;
408
408
409
- counters. set_miner_current_rejections_timeout ( rejections_timeout. as_secs ( ) ) ;
409
+ counters. set_miner_current_rejections_timeout_secs ( rejections_timeout. as_secs ( ) ) ;
410
410
counters. set_miner_current_rejections ( rejections) ;
411
411
}
412
412
0 commit comments