@@ -52,7 +52,7 @@ use crate::client::{ClientError, SignerSlotID, StackerDB, StacksClient};
52
52
use crate :: config:: { SignerConfig , SignerConfigMode } ;
53
53
use crate :: runloop:: SignerResult ;
54
54
use crate :: signerdb:: { BlockInfo , BlockState , SignerDb } ;
55
- use crate :: v0:: signer_state:: NewBurnBlock ;
55
+ use crate :: v0:: signer_state:: { NewBurnBlock , ReplayScopeOpt } ;
56
56
use crate :: Signer as SignerTrait ;
57
57
58
58
/// A global variable that can be used to make signers repeat their proposal
@@ -125,6 +125,8 @@ pub struct Signer {
125
125
pub global_state_evaluator : GlobalStateEvaluator ,
126
126
/// Whether to validate blocks with replay transactions
127
127
pub validate_with_replay_tx : bool ,
128
+ /// Scope of Tx Replay in terms of Burn block boundaries
129
+ pub tx_replay_scope : ReplayScopeOpt ,
128
130
}
129
131
130
132
impl std:: fmt:: Display for SignerMode {
@@ -241,6 +243,7 @@ impl SignerTrait<SignerMessage> for Signer {
241
243
recently_processed : RecentlyProcessedBlocks :: new ( ) ,
242
244
global_state_evaluator,
243
245
validate_with_replay_tx : signer_config. validate_with_replay_tx ,
246
+ tx_replay_scope : None ,
244
247
}
245
248
}
246
249
@@ -263,7 +266,9 @@ impl SignerTrait<SignerMessage> for Signer {
263
266
264
267
let mut prior_state = self . local_state_machine . clone ( ) ;
265
268
if self . reward_cycle <= current_reward_cycle {
266
- self . local_state_machine . handle_pending_update ( & self . signer_db , stacks_client, & self . proposal_config )
269
+ self . local_state_machine . handle_pending_update ( & self . signer_db , stacks_client,
270
+ & self . proposal_config ,
271
+ & mut self . tx_replay_scope )
267
272
. unwrap_or_else ( |e| error ! ( "{self}: failed to update local state machine for pending update" ; "err" => ?e) ) ;
268
273
}
269
274
@@ -532,11 +537,14 @@ impl Signer {
532
537
) ;
533
538
panic ! ( "{self} Failed to write burn block event to signerdb: {e}" ) ;
534
539
} ) ;
540
+
535
541
self . local_state_machine
536
542
. bitcoin_block_arrival ( & self . signer_db , stacks_client, & self . proposal_config , Some ( NewBurnBlock {
537
543
burn_block_height : * burn_height,
538
544
consensus_hash : * consensus_hash,
539
- } ) )
545
+ } ) ,
546
+ & mut self . tx_replay_scope
547
+ )
540
548
. unwrap_or_else ( |e| error ! ( "{self}: failed to update local state machine for latest bitcoin block arrival" ; "err" => ?e) ) ;
541
549
* sortition_state = None ;
542
550
}
0 commit comments