@@ -79,6 +79,7 @@ use stacks_signer::client::{SignerSlotID, StackerDB};
79
79
use stacks_signer::config::{build_signer_config_tomls, GlobalConfig as SignerConfig, Network};
80
80
use stacks_signer::signerdb::SignerDb;
81
81
use stacks_signer::v0::signer::TEST_REPEAT_PROPOSAL_RESPONSE;
82
+ use stacks_signer::v0::signer_state::SUPPORTED_SIGNER_PROTOCOL_VERSION;
82
83
use stacks_signer::v0::tests::{
83
84
TEST_IGNORE_ALL_BLOCK_PROPOSALS, TEST_PAUSE_BLOCK_BROADCAST, TEST_REJECT_ALL_BLOCK_PROPOSAL,
84
85
TEST_SKIP_BLOCK_BROADCAST, TEST_SKIP_SIGNER_CLEANUP, TEST_STALL_BLOCK_VALIDATION_SUBMISSION,
@@ -1434,6 +1435,7 @@ pub fn wait_for_state_machine_update(
1434
1435
expected_burn_block: &ConsensusHash,
1435
1436
expected_burn_block_height: u64,
1436
1437
expected_miner_info: Option<(Hash160, u64)>,
1438
+ version: u64,
1437
1439
) -> Result<(), String> {
1438
1440
wait_for(timeout_secs, || {
1439
1441
let stackerdb_events = test_observer::get_stackerdb_chunks();
@@ -1446,18 +1448,25 @@ pub fn wait_for_state_machine_update(
1446
1448
let SignerMessage::StateMachineUpdate(update) = message else {
1447
1449
continue;
1448
1450
};
1449
- let (burn_block, burn_block_height, current_miner) = match &update.content {
1450
- StateMachineUpdateContent::V0 {
1451
- burn_block,
1452
- burn_block_height,
1453
- current_miner,
1454
- }
1455
- | StateMachineUpdateContent::V1 {
1456
- burn_block,
1457
- burn_block_height,
1458
- current_miner,
1459
- ..
1460
- } => (burn_block, burn_block_height, current_miner),
1451
+ let (burn_block, burn_block_height, current_miner) = match (version, &update.content) {
1452
+ (
1453
+ 0,
1454
+ StateMachineUpdateContent::V0 {
1455
+ burn_block,
1456
+ burn_block_height,
1457
+ current_miner,
1458
+ },
1459
+ ) => (burn_block, burn_block_height, current_miner),
1460
+ (
1461
+ 1,
1462
+ StateMachineUpdateContent::V1 {
1463
+ burn_block,
1464
+ burn_block_height,
1465
+ current_miner,
1466
+ ..
1467
+ },
1468
+ ) => (burn_block, burn_block_height, current_miner),
1469
+ (other, _) => panic!("Unsupported protocol version: {other}"),
1461
1470
};
1462
1471
if *burn_block_height != expected_burn_block_height || burn_block != expected_burn_block
1463
1472
{
@@ -13747,6 +13756,7 @@ fn signers_send_state_message_updates() {
13747
13756
&get_burn_consensus_hash(),
13748
13757
starting_burn_height + 1,
13749
13758
Some((miner_pkh_1, starting_peer_height)),
13759
+ SUPPORTED_SIGNER_PROTOCOL_VERSION,
13750
13760
)
13751
13761
.expect("Timed out waiting for signers to send a state update");
13752
13762
@@ -13775,6 +13785,7 @@ fn signers_send_state_message_updates() {
13775
13785
&get_burn_consensus_hash(),
13776
13786
starting_burn_height + 2,
13777
13787
Some((miner_pkh_2, starting_peer_height + 1)),
13788
+ SUPPORTED_SIGNER_PROTOCOL_VERSION,
13778
13789
)
13779
13790
.expect("Timed out waiting for signers to send their state update");
13780
13791
@@ -13793,6 +13804,7 @@ fn signers_send_state_message_updates() {
13793
13804
&get_burn_consensus_hash(),
13794
13805
starting_burn_height + 2,
13795
13806
Some((miner_pkh_1, starting_peer_height)),
13807
+ SUPPORTED_SIGNER_PROTOCOL_VERSION,
13796
13808
)
13797
13809
.expect("Timed out waiting for signers to send their state update");
13798
13810
@@ -14385,18 +14397,34 @@ fn reorging_signers_capitulate_to_nonreorging_signers_during_tenure_fork() {
14385
14397
let SignerMessage::StateMachineUpdate(update) = message else {
14386
14398
continue;
14387
14399
};
14388
- let StateMachineUpdateContent::V0 {
14389
- burn_block,
14390
- burn_block_height,
14391
- current_miner:
14392
- StateMachineUpdateMinerState::ActiveMiner {
14393
- current_miner_pkh, ..
14394
- },
14395
- ..
14396
- } = update.content
14397
- else {
14398
- continue;
14399
- };
14400
+ let (burn_block, burn_block_height, current_miner_pkh) =
14401
+ match (SUPPORTED_SIGNER_PROTOCOL_VERSION, update.content) {
14402
+ (
14403
+ 0,
14404
+ StateMachineUpdateContent::V0 {
14405
+ burn_block,
14406
+ burn_block_height,
14407
+ current_miner:
14408
+ StateMachineUpdateMinerState::ActiveMiner {
14409
+ current_miner_pkh, ..
14410
+ },
14411
+ ..
14412
+ },
14413
+ )
14414
+ | (
14415
+ 1,
14416
+ StateMachineUpdateContent::V1 {
14417
+ burn_block,
14418
+ burn_block_height,
14419
+ current_miner:
14420
+ StateMachineUpdateMinerState::ActiveMiner {
14421
+ current_miner_pkh, ..
14422
+ },
14423
+ ..
14424
+ },
14425
+ ) => (burn_block, burn_block_height, current_miner_pkh),
14426
+ _ => continue,
14427
+ };
14400
14428
if burn_block == tenure_c_block_proposal.header.consensus_hash
14401
14429
&& burn_block_height == burn_height_before + 1
14402
14430
&& current_miner_pkh == miner_pkh_1
0 commit comments