Skip to content

Commit b14efd5

Browse files
committed
Fix rollover_signer_protocol_version
Signed-off-by: Jacinta Ferrant <[email protected]>
1 parent a6ce2fb commit b14efd5

File tree

1 file changed

+15
-3
lines changed
  • stacks-node/src/tests/signer

1 file changed

+15
-3
lines changed

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

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17627,9 +17627,11 @@ fn rollover_signer_protocol_version() {
1762717627
.collect();
1762817628
TEST_PIN_SUPPORTED_SIGNER_PROTOCOL_VERSION.set(pinned_signers_versions);
1762917629

17630-
info!("------------------------- Confirm Signers Sign The Block After Complete Downgraded Version Number -------------------------");
17631-
signer_test.mine_and_verify_confirmed_naka_block(Duration::from_secs(30), num_signers, true);
17632-
17630+
// Not strictly necessary, but makes it easier to logic out if miner doesn't send a proposal until signers are on same page...
17631+
TEST_MINE_SKIP.set(true);
17632+
info!("------------------------- Confirm Signers Sent Downgraded State Machine Updates -------------------------");
17633+
// Cannot use any built in functions that call mine_nakamoto_block since it expects signer updates matching the majority version and we are manually messing with these versions
17634+
signer_test.mine_bitcoin_block();
1763317635
let tip = SortitionDB::get_canonical_burn_chain_tip(sortdb.conn()).unwrap();
1763417636
let burn_consensus_hash = tip.consensus_hash;
1763517637
let burn_height = tip.block_height;
@@ -17648,6 +17650,16 @@ fn rollover_signer_protocol_version() {
1764817650
)
1764917651
.expect("Timed out waiting for signers to send their state update for block N+2");
1765017652

17653+
let info = signer_test.get_peer_info();
17654+
info!("------------------------- Confirm Signers Sign The Block After Complete Downgraded Version Number -------------------------");
17655+
TEST_MINE_SKIP.set(false);
17656+
let expected_miner =
17657+
StacksPublicKey::from_private(&signer_test.running_nodes.conf.miner.mining_key.unwrap());
17658+
let block = wait_for_block_pushed_by_miner_key(60, info.stacks_tip_height + 1, &expected_miner)
17659+
.expect("Failed to mine block after downgraded version number.");
17660+
// Expect ALL signers even after downgrade to approve the proposed blocks
17661+
wait_for_block_acceptance_from_signers(30, &block.header.signer_signature_hash(), &all_signers);
17662+
1765117663
info!("------------------------- Reset All Signers to {SUPPORTED_SIGNER_PROTOCOL_VERSION} -------------------------");
1765217664
TEST_PIN_SUPPORTED_SIGNER_PROTOCOL_VERSION.set(HashMap::new());
1765317665
test_observer::clear();

0 commit comments

Comments
 (0)