Skip to content

Commit 6bd1467

Browse files
committed
Revert breaking changes
Signed-off-by: Jacinta Ferrant <[email protected]>
1 parent aceeca6 commit 6bd1467

File tree

2 files changed

+32
-25
lines changed

2 files changed

+32
-25
lines changed

testnet/stacks-node/src/tests/nakamoto_integrations.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4114,7 +4114,8 @@ fn follower_bootup_across_multiple_cycles() {
41144114

41154115
debug!("Booted follower-thread");
41164116

4117-
wait_for(300, || {
4117+
// Wait a long time for the follower to catch up because CI is slow.
4118+
wait_for(600, || {
41184119
sleep_ms(1000);
41194120
let Ok(follower_node_info) = get_chain_info_result(&follower_conf) else {
41204121
return Ok(false);

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

Lines changed: 30 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -3175,7 +3175,7 @@ fn tenure_extend_after_idle_miner() {
31753175
wait_for_tenure_change_tx(
31763176
miner_idle_timeout.as_secs() + 20,
31773177
TenureChangeCause::Extended,
3178-
tip_height_before + 1,
3178+
tip_height_before + 2,
31793179
)
31803180
.expect("Timed out waiting for a block with a tenure extend");
31813181
signer_test.shutdown();
@@ -6546,30 +6546,36 @@ fn continue_after_tenure_extend() {
65466546
let sortdb = burnchain.open_sortition_db(true).unwrap();
65476547

65486548
signer_test.boot_to_epoch_3();
6549+
info!("------------------------- Mine A Normal Tenure -------------------------");
6550+
signer_test.mine_and_verify_confirmed_naka_block(timeout, num_signers, true);
6551+
6552+
info!("------------------------- Pause Block Commits-------------------------");
65496553
signer_test
65506554
.running_nodes
65516555
.counters
65526556
.naka_skip_commit_op
65536557
.set(true);
6554-
info!("------------------------- Mine A Normal Tenure -------------------------");
6555-
signer_test.mine_and_verify_confirmed_naka_block(timeout, num_signers, true);
6556-
6557-
info!("------------------------- Extend Tenure -------------------------");
6558-
let stacks_height_before = signer_test.get_peer_info().stacks_tip_height;
6558+
info!("------------------------- Flush Pending Commits -------------------------");
6559+
// Mine a couple blocks to flush the last submitted commit out.
6560+
let peer_info = signer_test.get_peer_info();
6561+
let burn_height_before = peer_info.burn_block_height;
6562+
let stacks_height_before = peer_info.stacks_tip_height;
65596563
signer_test
65606564
.running_nodes
65616565
.btc_regtest_controller
6562-
.build_next_block(1);
6566+
.build_next_block(2);
6567+
wait_for(30, || {
6568+
let peer_info = signer_test.get_peer_info();
6569+
Ok(peer_info.burn_block_height > burn_height_before + 1)
6570+
})
6571+
.expect("Timed out waiting for burn block height to increase");
65636572
// assure we have NO sortition
65646573
let tip = SortitionDB::get_canonical_burn_chain_tip(sortdb.conn()).unwrap();
65656574
assert!(!tip.sortition);
65666575

6567-
let extend_block = wait_for_block_pushed_by_miner_key(30, stacks_height_before + 1, &miner_pk)
6568-
.expect("Timed out waiting for block N+1 to be mined");
6569-
assert_eq!(
6570-
extend_block.try_get_tenure_change_payload().unwrap().cause,
6571-
TenureChangeCause::Extended
6572-
);
6576+
info!("------------------------- Extend Tenure -------------------------");
6577+
wait_for_tenure_change_tx(30, TenureChangeCause::Extended, stacks_height_before + 2)
6578+
.expect("Timed out waiting for tenure change tx");
65736579

65746580
// Verify that the miner can continue mining in the tenure with the tenure extend
65756581
info!("------------------------- Mine After Tenure Extend -------------------------");
@@ -8141,9 +8147,8 @@ fn global_acceptance_depends_on_block_announcement() {
81418147
let tx = submit_tx(&http_origin, &transfer_tx);
81428148
info!("Submitted tx {tx} in to mine block N+1");
81438149

8144-
let block_n_1 =
8145-
wait_for_block_pushed_by_miner_key(30, info_before.stacks_tip_height + 1, &miner_pk)
8146-
.expect("Timed out waiting for block N+1 to be mined");
8150+
let block_n_1 = wait_for_block_proposal(30, info_before.stacks_tip_height + 1, &miner_pk)
8151+
.expect("Timed out waiting for block N+1 to be proposed");
81478152

81488153
// Even though one of the signers rejected the block, it will eventually accept the block as it sees the 70% threshold of signatures
81498154
wait_for_block_global_acceptance_from_signers(
@@ -8386,17 +8391,18 @@ fn no_reorg_due_to_successive_block_validation_ok() {
83868391
info!("------------------------- Unpause Block Validation Submission and Response for N+1' -------------------------");
83878392
TEST_STALL_BLOCK_VALIDATION_SUBMISSION.set(false);
83888393

8389-
info!("------------------------- Confirm N+1 is Accepted ------------------------");
8390-
let block_n_1 = wait_for_block_pushed(30, block_n_1_signature_hash)
8391-
.expect("Timed out waiting for Block N+1 to be mined");
8392-
debug!("Miner 1 mined block N+1: {block_n_1_signature_hash}");
8393-
83948394
info!("------------------------- Confirm N+1' is Rejected ------------------------");
83958395
wait_for_block_global_rejection(30, block_n_1_prime_signature_hash, num_signers)
83968396
.expect("Failed to find block N+1'");
83978397

8398-
info!("------------------------- Confirm N+2 Accepted ------------------------");
8398+
info!("------------------------- Confirm N+1 Accepted -------------------------");
8399+
let mined_block_n_1 = test_observer::get_mined_nakamoto_blocks()
8400+
.into_iter()
8401+
.find(|block| block.signer_signature_hash == block_n_1_signature_hash)
8402+
.expect("Failed to find block N+1");
83998403

8404+
// Miner 2 will see block N+1 as a valid block and reattempt to mine N+2 on top.
8405+
info!("------------------------- Confirm N+2 Accepted ------------------------");
84008406
let block_n_2 =
84018407
wait_for_block_pushed_by_miner_key(30, block_n_1.header.chain_length + 1, &miner_pk_2)
84028408
.expect("Failed to find block N+2");
@@ -8415,8 +8421,8 @@ fn no_reorg_due_to_successive_block_validation_ok() {
84158421
block_n_2.header.consensus_hash
84168422
);
84178423
assert_eq!(
8418-
block_n_2.header.parent_block_id,
8419-
block_n_1.header.block_id()
8424+
block_n_2.header.parent_block_id.to_string(),
8425+
mined_block_n_1.block_id
84208426
);
84218427
assert_eq!(block_n_1.header.parent_block_id, block_n.header.block_id());
84228428

0 commit comments

Comments
 (0)