Skip to content

Commit 5308a99

Browse files
committed
test: improvements to interrupt_miner_on_new_stacks_tip
1 parent 2f99dde commit 5308a99

File tree

1 file changed

+17
-4
lines changed
  • testnet/stacks-node/src/tests/signer

1 file changed

+17
-4
lines changed

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

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13077,8 +13077,13 @@ fn tenure_extend_cost_threshold() {
1307713077
/// The stacks node is then advanced to Epoch 3.0 boundary to allow block signing.
1307813078
///
1307913079
/// Test Execution:
13080-
/// The node mines 1 stacks block N (all signers sign it). The subsequent block N+1 is proposed, but <30% accept it. The remaining signers
13081-
/// do not make a decision on the block. A new tenure begins and the miner proposes a new block N+1' which all signers accept.
13080+
/// Miner 1 mines a tenure change block, then mines a second block, block N,
13081+
/// but the signers will not broadcast it, and the miner will stall before
13082+
/// broadcasting. Miner 2 wins the next sortition and proposes a block N',
13083+
/// since it has not seen N, but signers are ignoring proposals so that it is
13084+
/// not rejected. Miner 1 then announces N. Miner 2 sees N, stops waiting
13085+
/// for signatures on N' and submits a new proposal, N+1, which is accepted.
13086+
/// Finally a new tenure arrives and N+2 is mined.
1308213087
///
1308313088
/// Test Assertion:
1308413089
/// Stacks tip advances to N+1'
@@ -13141,6 +13146,7 @@ fn interrupt_miner_on_new_stacks_tip() {
1314113146
config.node.pox_sync_sample_secs = 30;
1314213147
config.miner.block_commit_delay = Duration::from_secs(0);
1314313148
config.miner.tenure_cost_limit_per_block_percentage = None;
13149+
config.miner.block_rejection_timeout_steps = [(0, Duration::from_secs(1200))].into();
1314413150

1314513151
config.events_observers.retain(|listener| {
1314613152
match std::net::SocketAddr::from_str(&listener.endpoint) {
@@ -13330,7 +13336,6 @@ fn interrupt_miner_on_new_stacks_tip() {
1333013336

1333113337
// Make the miner stall before broadcasting the block once it has been approved
1333213338
TEST_P2P_BROADCAST_STALL.set(true);
13333-
// TEST_BLOCK_ANNOUNCE_STALL.set(true);
1333413339
// Make the signers not broadcast the block once it has been approved
1333513340
TEST_SKIP_BLOCK_BROADCAST.set(true);
1333613341

@@ -13482,7 +13487,15 @@ fn interrupt_miner_on_new_stacks_tip() {
1348213487
)
1348313488
.expect("Timed out waiting for the next block to be mined");
1348413489

13485-
wait_for_chains().expect("Timed out waiting for Rl1 and Rl2 chains to advance");
13490+
wait_for(30, || {
13491+
let Some(chain_info) = get_chain_info_opt(&conf) else {
13492+
return Ok(false);
13493+
};
13494+
Ok(chain_info.stacks_tip_height == block_n.stacks_height + 2)
13495+
})
13496+
.expect("Timed out waiting for height to advance to block N+2");
13497+
13498+
wait_for_chains().expect("Timed out waiting for Rl2 to reach N+2");
1348613499

1348713500
info!("------------------------- Shutdown -------------------------");
1348813501
signer_test.shutdown();

0 commit comments

Comments
 (0)