@@ -780,19 +780,18 @@ pub fn next_block_and_wait_for_commits(
780
780
. map ( |info| info. stacks_tip_height )
781
781
. max ( )
782
782
. unwrap ( ) ;
783
- let last_commit_burn_hts: Vec < _ > = node_counters
783
+ let last_commit_burn_hts = node_counters
784
784
. iter ( )
785
- . map ( |c| & c. naka_submitted_commit_last_burn_height )
786
- . collect ( ) ;
787
- let last_commit_stacks_hts: Vec < _ > = node_counters
785
+ . map ( |c| & c. naka_submitted_commit_last_burn_height ) ;
786
+ let last_commit_stacks_hts = node_counters
788
787
. iter ( )
789
- . map ( |c| & c. naka_submitted_commit_last_stacks_tip )
790
- . collect ( ) ;
788
+ . map ( |c| & c. naka_submitted_commit_last_stacks_tip ) ;
791
789
792
790
next_block_and ( btc_controller, timeout_secs, || {
793
- let burn_height_committed_to = last_commit_burn_hts. iter ( ) . all ( |last_commit_burn_height| {
794
- last_commit_burn_height. load ( Ordering :: SeqCst ) > burn_ht_before
795
- } ) ;
791
+ let burn_height_committed_to =
792
+ last_commit_burn_hts. clone ( ) . all ( |last_commit_burn_height| {
793
+ last_commit_burn_height. load ( Ordering :: SeqCst ) > burn_ht_before
794
+ } ) ;
796
795
if !wait_for_stacks_block {
797
796
Ok ( burn_height_committed_to)
798
797
} else {
@@ -801,7 +800,7 @@ pub fn next_block_and_wait_for_commits(
801
800
}
802
801
let stacks_tip_committed_to =
803
802
last_commit_stacks_hts
804
- . iter ( )
803
+ . clone ( )
805
804
. all ( |last_commit_stacks_height| {
806
805
last_commit_stacks_height. load ( Ordering :: SeqCst ) > stacks_ht_before
807
806
} ) ;
@@ -7564,6 +7563,7 @@ fn check_block_times() {
7564
7563
naka_proposed_blocks : proposals_submitted,
7565
7564
..
7566
7565
} = run_loop. counters ( ) ;
7566
+ let counters = run_loop. counters ( ) ;
7567
7567
7568
7568
let coord_channel = run_loop. coordinator_channels ( ) ;
7569
7569
@@ -7606,19 +7606,13 @@ fn check_block_times() {
7606
7606
7607
7607
info ! ( "Nakamoto miner started..." ) ;
7608
7608
blind_signer ( & naka_conf, & signers, proposals_submitted) ;
7609
+ wait_for_first_naka_block_commit ( 60 , & counters. naka_submitted_commits ) ;
7609
7610
7610
- let epochs = naka_conf. burnchain . epochs . clone ( ) . unwrap ( ) ;
7611
- let epoch_3 = & epochs[ StacksEpochId :: Epoch30 ] ;
7612
- let epoch_3_start = epoch_3. start_height ;
7613
- let mut last_stacks_block_height = 0 ;
7614
- let mut last_tenure_height = 0 ;
7615
- next_block_and ( & mut btc_regtest_controller, 60 , || {
7616
- let info = get_chain_info_result ( & naka_conf) . unwrap ( ) ;
7617
- last_stacks_block_height = info. stacks_tip_height as u128 ;
7618
- last_tenure_height = last_stacks_block_height + 1 ;
7619
- Ok ( info. burn_block_height == epoch_3_start)
7620
- } )
7621
- . unwrap ( ) ;
7611
+ let info = get_chain_info_result ( & naka_conf) . unwrap ( ) ;
7612
+ let mut last_stacks_block_height = info. stacks_tip_height as u128 ;
7613
+ let mut last_tenure_height = last_stacks_block_height + 1 ;
7614
+
7615
+ next_block_and_mine_commit ( & mut btc_regtest_controller, 60 , & naka_conf, & counters) . unwrap ( ) ;
7622
7616
7623
7617
let time0_value = call_read_only (
7624
7618
& naka_conf,
@@ -7676,16 +7670,13 @@ fn check_block_times() {
7676
7670
Ok ( stacks_block_height > last_stacks_block_height && cur_sender_nonce == sender_nonce)
7677
7671
} )
7678
7672
. expect ( "Timed out waiting for contracts to publish" ) ;
7679
- last_stacks_block_height = stacks_block_height;
7680
7673
7681
7674
// Repeat these tests for 5 tenures
7682
7675
for _ in 0 ..5 {
7683
- next_block_and ( & mut btc_regtest_controller, 60 , || {
7684
- let info = get_chain_info_result ( & naka_conf) . unwrap ( ) ;
7685
- stacks_block_height = info. stacks_tip_height as u128 ;
7686
- Ok ( stacks_block_height > last_stacks_block_height)
7687
- } )
7688
- . unwrap ( ) ;
7676
+ next_block_and_mine_commit ( & mut btc_regtest_controller, 60 , & naka_conf, & counters) . unwrap ( ) ;
7677
+ let info = get_chain_info_result ( & naka_conf) . unwrap ( ) ;
7678
+ stacks_block_height = info. stacks_tip_height as u128 ;
7679
+
7689
7680
last_stacks_block_height = stacks_block_height;
7690
7681
last_tenure_height += 1 ;
7691
7682
info ! ( "New tenure {last_tenure_height}, Stacks height: {last_stacks_block_height}" ) ;
0 commit comments