@@ -280,7 +280,7 @@ impl SignerTest<SpawnedSigner> {
280
280
// could be other miners mining blocks.
281
281
let height_before = get_chain_info ( & self . running_nodes . conf ) . stacks_tip_height ;
282
282
info ! ( "Waiting for first Nakamoto block: {}" , height_before + 1 ) ;
283
- self . mine_nakamoto_block ( Duration :: from_secs ( 30 ) ) ;
283
+ self . mine_nakamoto_block ( Duration :: from_secs ( 30 ) , false ) ;
284
284
wait_for ( 30 , || {
285
285
Ok ( get_chain_info ( & self . running_nodes . conf ) . stacks_tip_height > height_before)
286
286
} )
@@ -289,12 +289,17 @@ impl SignerTest<SpawnedSigner> {
289
289
}
290
290
291
291
// Only call after already past the epoch 3.0 boundary
292
- fn mine_and_verify_confirmed_naka_block ( & mut self , timeout : Duration , num_signers : usize ) {
292
+ fn mine_and_verify_confirmed_naka_block (
293
+ & mut self ,
294
+ timeout : Duration ,
295
+ num_signers : usize ,
296
+ use_nakamoto_blocks_mined : bool ,
297
+ ) {
293
298
info ! ( "------------------------- Try mining one block -------------------------" ) ;
294
299
295
300
let reward_cycle = self . get_current_reward_cycle ( ) ;
296
301
297
- self . mine_nakamoto_block ( timeout) ;
302
+ self . mine_nakamoto_block ( timeout, use_nakamoto_blocks_mined ) ;
298
303
299
304
// Verify that the signers accepted the proposed block, sending back a validate ok response
300
305
let proposed_signer_signature_hash = self
@@ -377,7 +382,7 @@ impl SignerTest<SpawnedSigner> {
377
382
let total_nmb_blocks_to_mine = burnchain_height. saturating_sub ( current_block_height) ;
378
383
debug ! ( "Mining {total_nmb_blocks_to_mine} Nakamoto block(s) to reach burnchain height {burnchain_height}" ) ;
379
384
for _ in 0 ..total_nmb_blocks_to_mine {
380
- self . mine_and_verify_confirmed_naka_block ( timeout, num_signers) ;
385
+ self . mine_and_verify_confirmed_naka_block ( timeout, num_signers, false ) ;
381
386
}
382
387
}
383
388
@@ -590,7 +595,7 @@ fn miner_gather_signatures() {
590
595
signer_test. boot_to_epoch_3 ( ) ;
591
596
592
597
info ! ( "------------------------- Test Mine and Verify Confirmed Nakamoto Block -------------------------" ) ;
593
- signer_test. mine_and_verify_confirmed_naka_block ( timeout, num_signers) ;
598
+ signer_test. mine_and_verify_confirmed_naka_block ( timeout, num_signers, true ) ;
594
599
595
600
// Test prometheus metrics response
596
601
#[ cfg( feature = "monitoring_prom" ) ]
@@ -1327,7 +1332,7 @@ fn bitcoind_forking_test() {
1327
1332
1328
1333
for i in 0 ..pre_fork_tenures {
1329
1334
info ! ( "Mining pre-fork tenure {} of {pre_fork_tenures}" , i + 1 ) ;
1330
- signer_test. mine_nakamoto_block ( Duration :: from_secs ( 30 ) ) ;
1335
+ signer_test. mine_nakamoto_block ( Duration :: from_secs ( 30 ) , true ) ;
1331
1336
}
1332
1337
1333
1338
let pre_fork_1_nonce = get_account ( & http_origin, & miner_address) . nonce ;
@@ -1399,7 +1404,7 @@ fn bitcoind_forking_test() {
1399
1404
1400
1405
for i in 0 ..5 {
1401
1406
info ! ( "Mining post-fork tenure {} of 5" , i + 1 ) ;
1402
- signer_test. mine_nakamoto_block ( Duration :: from_secs ( 30 ) ) ;
1407
+ signer_test. mine_nakamoto_block ( Duration :: from_secs ( 30 ) , true ) ;
1403
1408
}
1404
1409
1405
1410
let pre_fork_2_nonce = get_account ( & http_origin, & miner_address) . nonce ;
@@ -1475,7 +1480,7 @@ fn bitcoind_forking_test() {
1475
1480
1476
1481
for i in 0 ..5 {
1477
1482
info ! ( "Mining post-fork tenure {} of 5" , i + 1 ) ;
1478
- signer_test. mine_nakamoto_block ( Duration :: from_secs ( 30 ) ) ;
1483
+ signer_test. mine_nakamoto_block ( Duration :: from_secs ( 30 ) , true ) ;
1479
1484
}
1480
1485
1481
1486
let test_end_nonce = get_account ( & http_origin, & miner_address) . nonce ;
@@ -2508,7 +2513,7 @@ fn signers_broadcast_signed_blocks() {
2508
2513
. running_nodes
2509
2514
. nakamoto_blocks_mined
2510
2515
. load ( Ordering :: SeqCst ) ;
2511
- signer_test. mine_nakamoto_block ( Duration :: from_secs ( 30 ) ) ;
2516
+ signer_test. mine_nakamoto_block ( Duration :: from_secs ( 30 ) , true ) ;
2512
2517
2513
2518
wait_for ( 30 , || {
2514
2519
let blocks_mined = signer_test
@@ -2609,7 +2614,7 @@ fn tenure_extend_after_idle() {
2609
2614
signer_test. boot_to_epoch_3 ( ) ;
2610
2615
2611
2616
info ! ( "---- Nakamoto booted, starting test ----" ) ;
2612
- signer_test. mine_nakamoto_block ( Duration :: from_secs ( 30 ) ) ;
2617
+ signer_test. mine_nakamoto_block ( Duration :: from_secs ( 30 ) , true ) ;
2613
2618
2614
2619
info ! ( "---- Waiting for a tenure extend ----" ) ;
2615
2620
@@ -2671,7 +2676,7 @@ fn stx_transfers_dont_effect_idle_timeout() {
2671
2676
"info_height" => info_before. stacks_tip_height,
2672
2677
"blocks_before" => blocks_before,
2673
2678
) ;
2674
- signer_test. mine_nakamoto_block ( Duration :: from_secs ( 30 ) ) ;
2679
+ signer_test. mine_nakamoto_block ( Duration :: from_secs ( 30 ) , true ) ;
2675
2680
2676
2681
info ! ( "---- Getting current idle timeout ----" ) ;
2677
2682
@@ -2809,7 +2814,7 @@ fn idle_tenure_extend_active_mining() {
2809
2814
// Add a delay to the block validation process
2810
2815
TEST_VALIDATE_DELAY_DURATION_SECS . lock ( ) . unwrap ( ) . replace ( 3 ) ;
2811
2816
2812
- signer_test. mine_nakamoto_block ( Duration :: from_secs ( 30 ) ) ;
2817
+ signer_test. mine_nakamoto_block ( Duration :: from_secs ( 30 ) , true ) ;
2813
2818
2814
2819
info ! ( "---- Getting current idle timeout ----" ) ;
2815
2820
@@ -2877,7 +2882,7 @@ fn idle_tenure_extend_active_mining() {
2877
2882
2878
2883
info ! ( "----- Submitted deploy txs, mining BTC block -----" ) ;
2879
2884
2880
- signer_test. mine_nakamoto_block ( Duration :: from_secs ( 30 ) ) ;
2885
+ signer_test. mine_nakamoto_block ( Duration :: from_secs ( 30 ) , true ) ;
2881
2886
let mut last_response = signer_test. get_latest_block_response ( slot_id) ;
2882
2887
2883
2888
// Make multiple tenures that get extended through idle timeouts
@@ -3990,7 +3995,7 @@ fn signer_set_rollover() {
3990
3995
send_amt,
3991
3996
) ;
3992
3997
submit_tx ( & http_origin, & transfer_tx) ;
3993
- signer_test. mine_nakamoto_block ( short_timeout) ;
3998
+ signer_test. mine_nakamoto_block ( short_timeout, true ) ;
3994
3999
let mined_block = test_observer:: get_mined_nakamoto_blocks ( ) . pop ( ) . unwrap ( ) ;
3995
4000
let block_sighash = mined_block. signer_signature_hash ;
3996
4001
let signer_signatures = mined_block. signer_signature ;
@@ -4064,7 +4069,7 @@ fn signer_set_rollover() {
4064
4069
} )
4065
4070
. expect ( "Timed out waiting for stacking txs to be mined" ) ;
4066
4071
4067
- signer_test. mine_nakamoto_block ( short_timeout) ;
4072
+ signer_test. mine_nakamoto_block ( short_timeout, true ) ;
4068
4073
4069
4074
let next_reward_cycle = reward_cycle. saturating_add ( 1 ) ;
4070
4075
@@ -4117,7 +4122,7 @@ fn signer_set_rollover() {
4117
4122
send_amt,
4118
4123
) ;
4119
4124
submit_tx ( & http_origin, & transfer_tx) ;
4120
- signer_test. mine_nakamoto_block ( short_timeout) ;
4125
+ signer_test. mine_nakamoto_block ( short_timeout, true ) ;
4121
4126
let mined_block = test_observer:: get_mined_nakamoto_blocks ( ) . pop ( ) . unwrap ( ) ;
4122
4127
4123
4128
info ! ( "---- Verifying that the new signers signed the block -----" ) ;
@@ -4304,7 +4309,7 @@ fn duplicate_signers() {
4304
4309
4305
4310
info ! ( "------------------------- Try mining one block -------------------------" ) ;
4306
4311
4307
- signer_test. mine_and_verify_confirmed_naka_block ( timeout, num_signers) ;
4312
+ signer_test. mine_and_verify_confirmed_naka_block ( timeout, num_signers, true ) ;
4308
4313
4309
4314
info ! ( "------------------------- Read all `BlockResponse::Accepted` messages -------------------------" ) ;
4310
4315
@@ -6816,7 +6821,7 @@ fn continue_after_tenure_extend() {
6816
6821
signer_test. boot_to_epoch_3 ( ) ;
6817
6822
6818
6823
info ! ( "------------------------- Mine Normal Tenure -------------------------" ) ;
6819
- signer_test. mine_and_verify_confirmed_naka_block ( timeout, num_signers) ;
6824
+ signer_test. mine_and_verify_confirmed_naka_block ( timeout, num_signers, true ) ;
6820
6825
6821
6826
info ! ( "------------------------- Extend Tenure -------------------------" ) ;
6822
6827
signer_test
@@ -7462,7 +7467,7 @@ fn block_validation_response_timeout() {
7462
7467
signer_test. boot_to_epoch_3 ( ) ;
7463
7468
7464
7469
info ! ( "------------------------- Test Mine and Verify Confirmed Nakamoto Block -------------------------" ) ;
7465
- signer_test. mine_and_verify_confirmed_naka_block ( timeout, num_signers) ;
7470
+ signer_test. mine_and_verify_confirmed_naka_block ( timeout, num_signers, true ) ;
7466
7471
info ! ( "------------------------- Test Block Validation Stalled -------------------------" ) ;
7467
7472
TEST_VALIDATE_STALL . lock ( ) . unwrap ( ) . replace ( true ) ;
7468
7473
let validation_stall_start = Instant :: now ( ) ;
@@ -7580,7 +7585,7 @@ fn block_validation_response_timeout() {
7580
7585
) ;
7581
7586
info ! ( "------------------------- Test Mine and Verify Confirmed Nakamoto Block -------------------------" ) ;
7582
7587
let info_before = info_after;
7583
- signer_test. mine_and_verify_confirmed_naka_block ( timeout, num_signers) ;
7588
+ signer_test. mine_and_verify_confirmed_naka_block ( timeout, num_signers, true ) ;
7584
7589
7585
7590
wait_for ( 30 , || {
7586
7591
let info = get_chain_info ( & signer_test. running_nodes . conf ) ;
0 commit comments