Skip to content

Commit 5b70d4f

Browse files
committed
fix: cleanup comments, remove unused field
1 parent 16ed89c commit 5b70d4f

File tree

3 files changed

+1
-26
lines changed

3 files changed

+1
-26
lines changed

stacks-signer/src/tests/signer_state.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,6 @@ fn determine_global_states() {
219219
burn_block_height,
220220
current_miner: (&current_miner).into(),
221221
active_signer_protocol_version: local_supported_signer_protocol_version, // a majority of signers are saying they support version the same local_supported_signer_protocol_version, so update it here...
222-
tx_replay_state: false,
223222
tx_replay_set: None,
224223
};
225224

@@ -265,7 +264,6 @@ fn determine_global_states() {
265264
burn_block_height,
266265
current_miner: (&new_miner).into(),
267266
active_signer_protocol_version: local_supported_signer_protocol_version, // a majority of signers are saying they support version the same local_supported_signer_protocol_version, so update it here...
268-
tx_replay_state: false,
269267
tx_replay_set: None,
270268
};
271269

stacks-signer/src/v0/signer_state.rs

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,6 @@ impl GlobalStateEvaluator {
151151
burn_block_height: *burn_block_height,
152152
current_miner: current_miner.into(),
153153
active_signer_protocol_version,
154-
tx_replay_state: false,
155154
tx_replay_set: None,
156155
};
157156
let entry = state_views
@@ -249,9 +248,6 @@ pub struct SignerStateMachine {
249248
pub current_miner: MinerState,
250249
/// The active signing protocol version
251250
pub active_signer_protocol_version: u64,
252-
/// Whether or not we're in a tx replay state
253-
/// TODO: just a placeholder for now
254-
pub tx_replay_state: bool,
255251
/// Transaction replay set
256252
pub tx_replay_set: Option<Vec<StacksTransaction>>,
257253
}
@@ -392,7 +388,6 @@ impl LocalStateMachine {
392388
burn_block_height: 0,
393389
current_miner: MinerState::NoValidMiner,
394390
active_signer_protocol_version: SUPPORTED_SIGNER_PROTOCOL_VERSION,
395-
tx_replay_state: false,
396391
tx_replay_set: None,
397392
}
398393
}
@@ -689,18 +684,6 @@ impl LocalStateMachine {
689684
proposal_config: &ProposalEvalConfig,
690685
mut expected_burn_block: Option<NewBurnBlock>,
691686
) -> Result<(), SignerChainstateError> {
692-
// TODO: test only, remove
693-
match expected_burn_block.clone() {
694-
Some(expected_burn_block) => {
695-
if expected_burn_block.burn_block_height > 230 {
696-
info!(
697-
"---- bitcoin_block_arrival {} {} ----",
698-
expected_burn_block.burn_block_height, expected_burn_block.consensus_hash
699-
);
700-
}
701-
}
702-
None => {}
703-
}
704687
// set self to uninitialized so that if this function errors,
705688
// self is left as uninitialized.
706689
let prior_state = std::mem::replace(self, Self::Uninitialized);
@@ -733,7 +716,6 @@ impl LocalStateMachine {
733716
let peer_info = client.get_peer_info()?;
734717
let next_burn_block_height = peer_info.burn_block_height;
735718
let next_burn_block_hash = peer_info.pox_consensus;
736-
let mut fork_detected = prior_state_machine.tx_replay_state;
737719
let mut tx_replay_set = prior_state_machine.tx_replay_set.clone();
738720

739721
if let Some(expected_burn_block) = expected_burn_block {
@@ -758,8 +740,7 @@ impl LocalStateMachine {
758740
// TODO: handle fork while still in replay
759741
&& tx_replay_set.is_none()
760742
{
761-
fork_detected = true;
762-
info!("---- Signer State: Possible fork! ----";
743+
info!("Signer State: fork detected";
763744
"expected_burn_block.height" => expected_burn_block.burn_block_height,
764745
"expected_burn_block.hash" => %expected_burn_block.consensus_hash,
765746
"next_burn_block_height" => next_burn_block_height,
@@ -851,7 +832,6 @@ impl LocalStateMachine {
851832
burn_block_height: next_burn_block_height,
852833
current_miner: miner_state,
853834
active_signer_protocol_version: prior_state_machine.active_signer_protocol_version,
854-
tx_replay_state: fork_detected,
855835
tx_replay_set,
856836
});
857837

@@ -897,7 +877,6 @@ impl LocalStateMachine {
897877
burn_block_height: *burn_block_height,
898878
current_miner: current_miner.into(),
899879
active_signer_protocol_version,
900-
tx_replay_state: false,
901880
tx_replay_set: None,
902881
});
903882
// Because we updated our active signer protocol version, update local_update so its included in the subsequent evaluations
@@ -931,7 +910,6 @@ impl LocalStateMachine {
931910
burn_block_height,
932911
current_miner: (&new_miner).into(),
933912
active_signer_protocol_version,
934-
tx_replay_state: false,
935913
tx_replay_set: None,
936914
});
937915
}

testnet/stacks-node/src/tests/signer/v0.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2873,7 +2873,6 @@ fn tx_replay_forking_test() {
28732873
for state in signer_states {
28742874
match state {
28752875
LocalStateMachine::Initialized(signer_state_machine) => {
2876-
assert!(signer_state_machine.tx_replay_state);
28772876
let Some(tx_replay_set) = signer_state_machine.tx_replay_set else {
28782877
panic!(
28792878
"Signer state machine is in tx replay state, but tx replay set is not set"

0 commit comments

Comments
 (0)