@@ -6535,19 +6535,22 @@ fn miner_recovers_when_broadcast_block_delay_across_tenures_occurs() {
6535
6535
/// Mine 2 empty burn blocks (simulate fast blocks scenario)
6536
6536
/// Miner 2 proposes block N+1 with a TenureChangePayload
6537
6537
/// Signers accept and the stacks tip advances to N+1
6538
- /// Miner 2 proposes block N+2 with a TokenTransfer
6538
+ /// Miner 2 proposes block N+2 with a TenureExtend
6539
6539
/// Signers accept and the stacks tip advances to N+2
6540
+ /// Miner 2 proposes block N+3 with a TokenTransfer
6541
+ /// Signers accept and the stacks tip advances to N+3
6540
6542
/// Mine an empty burn block
6541
- /// Miner 2 proposes block N+3 with a TenureExtend
6542
- /// Signers accept and the chain advances to N+3
6543
- /// Miner 1 wins the next tenure and proposes a block N+4 with a TenureChangePayload
6543
+ /// Miner 2 proposes block N+4 with a TenureExtend
6544
6544
/// Signers accept and the chain advances to N+4
6545
+ /// Miner 1 wins the next tenure and proposes a block N+5 with a TenureChangePayload
6546
+ /// Signers accept and the chain advances to N+5
6545
6547
/// Asserts:
6546
6548
/// - Block N+1 contains the TenureChangePayload
6547
- /// - Block N+2 contains the TokenTransfer
6548
- /// - Block N+3 contains the TenureExtend
6549
- /// - Block N+4 contains the TenureChangePayload
6550
- /// - The stacks tip advances to N+4
6549
+ /// - Block N+2 contains the TenureExtend
6550
+ /// - Block N+3 contains the TokenTransfer
6551
+ /// - Block N+4 contains the TenureExtend
6552
+ /// - Block N+5 contains the TenureChangePayload
6553
+ /// - The stacks tip advances to N+5
6551
6554
#[ test]
6552
6555
#[ ignore]
6553
6556
fn continue_after_fast_block_no_sortition ( ) {
@@ -6908,7 +6911,7 @@ fn continue_after_fast_block_no_sortition() {
6908
6911
// Allow signers to respond to proposals again
6909
6912
TEST_REJECT_ALL_BLOCK_PROPOSAL . set ( Vec :: new ( ) ) ;
6910
6913
6911
- info ! ( "------------------------- Wait for Miner B's Block N -------------------------" ;
6914
+ info ! ( "------------------------- Wait for Miner B's Block N+1 -------------------------" ;
6912
6915
"blocks_processed_before_2" => %blocks_processed_before_2,
6913
6916
"stacks_height_before" => %stacks_height_before,
6914
6917
"nmb_old_blocks" => %nmb_old_blocks) ;
@@ -6923,7 +6926,7 @@ fn continue_after_fast_block_no_sortition() {
6923
6926
6924
6927
let blocks_mined1_val = blocks_mined1. load ( Ordering :: SeqCst ) ;
6925
6928
let blocks_mined2_val = blocks_mined2. load ( Ordering :: SeqCst ) ;
6926
- info ! ( "Waiting for Miner B's Block N" ;
6929
+ info ! ( "Waiting for Miner B's Block N+1 " ;
6927
6930
"blocks_mined1_val" => %blocks_mined1_val,
6928
6931
"blocks_mined2_val" => %blocks_mined2_val,
6929
6932
"stacks_height" => %stacks_height,
@@ -6938,11 +6941,11 @@ fn continue_after_fast_block_no_sortition() {
6938
6941
. expect ( "Timed out waiting for block to be mined and processed" ) ;
6939
6942
6940
6943
info ! (
6941
- "------------------------- Verify Tenure Change Tx in Miner B's Block N -------------------------"
6944
+ "------------------------- Verify Tenure Change Tx in Miner B's Block N+1 -------------------------"
6942
6945
) ;
6943
6946
verify_last_block_contains_tenure_change_tx ( TenureChangeCause :: BlockFound ) ;
6944
6947
6945
- info ! ( "------------------------- Wait for Miner B's Block N+1 -------------------------" ) ;
6948
+ info ! ( "------------------------- Wait for Miner B's Block N+2 -------------------------" ) ;
6946
6949
6947
6950
let nmb_old_blocks = test_observer:: get_blocks ( ) . len ( ) ;
6948
6951
let blocks_processed_before_2 = blocks_mined2. load ( Ordering :: SeqCst ) ;
@@ -6952,18 +6955,7 @@ fn continue_after_fast_block_no_sortition() {
6952
6955
. expect ( "Failed to get peer info" )
6953
6956
. stacks_tip_height ;
6954
6957
6955
- // submit a tx so that the miner will mine an extra block
6956
- let transfer_tx = make_stacks_transfer (
6957
- & sender_sk,
6958
- sender_nonce,
6959
- send_fee,
6960
- signer_test. running_nodes . conf . burnchain . chain_id ,
6961
- & recipient,
6962
- send_amt,
6963
- ) ;
6964
- submit_tx ( & http_origin, & transfer_tx) ;
6965
-
6966
- // wait for the tenure-extend block to be processed
6958
+ // wait for the transfer block to be processed
6967
6959
wait_for ( 30 , || {
6968
6960
let stacks_height = signer_test
6969
6961
. stacks_client
@@ -6978,8 +6970,12 @@ fn continue_after_fast_block_no_sortition() {
6978
6970
} )
6979
6971
. expect ( "Timed out waiting for block to be mined and processed" ) ;
6980
6972
6973
+ info ! ( "------------------------- Verify Miner B's Block N+2 -------------------------" ) ;
6974
+
6981
6975
verify_last_block_contains_tenure_change_tx ( TenureChangeCause :: Extended ) ;
6982
6976
6977
+ info ! ( "------------------------- Wait for Miner B's Block N+3 -------------------------" ) ;
6978
+
6983
6979
let nmb_old_blocks = test_observer:: get_blocks ( ) . len ( ) ;
6984
6980
let blocks_processed_before_2 = blocks_mined2. load ( Ordering :: SeqCst ) ;
6985
6981
let stacks_height_before = signer_test
@@ -6988,22 +6984,24 @@ fn continue_after_fast_block_no_sortition() {
6988
6984
. expect ( "Failed to get peer info" )
6989
6985
. stacks_tip_height ;
6990
6986
6991
- // wait for the new block with the STX transfer to be processed
6987
+ // submit a tx so that the miner will mine an extra block
6988
+ let transfer_tx = make_stacks_transfer (
6989
+ & sender_sk,
6990
+ sender_nonce,
6991
+ send_fee,
6992
+ signer_test. running_nodes . conf . burnchain . chain_id ,
6993
+ & recipient,
6994
+ send_amt,
6995
+ ) ;
6996
+ submit_tx ( & http_origin, & transfer_tx) ;
6997
+
6998
+ // wait for the transfer block to be processed
6992
6999
wait_for ( 30 , || {
6993
7000
let stacks_height = signer_test
6994
7001
. stacks_client
6995
7002
. get_peer_info ( )
6996
7003
. expect ( "Failed to get peer info" )
6997
7004
. stacks_tip_height ;
6998
-
6999
- let blocks_mined1_val = blocks_mined1. load ( Ordering :: SeqCst ) ;
7000
- let blocks_mined2_val = blocks_mined2. load ( Ordering :: SeqCst ) ;
7001
- info ! ( "Waiting for Miner B's Block N" ;
7002
- "blocks_mined1_val" => %blocks_mined1_val,
7003
- "blocks_mined2_val" => %blocks_mined2_val,
7004
- "stacks_height" => %stacks_height,
7005
- "observed_blocks" => %test_observer:: get_blocks( ) . len( ) ) ;
7006
-
7007
7005
Ok (
7008
7006
blocks_mined2. load ( Ordering :: SeqCst ) > blocks_processed_before_2
7009
7007
&& stacks_height > stacks_height_before
@@ -7012,7 +7010,7 @@ fn continue_after_fast_block_no_sortition() {
7012
7010
} )
7013
7011
. expect ( "Timed out waiting for block to be mined and processed" ) ;
7014
7012
7015
- info ! ( "------------------------- Verify Miner B's Block N+1 -------------------------" ) ;
7013
+ info ! ( "------------------------- Verify Miner B's Block N+3 -------------------------" ) ;
7016
7014
7017
7015
verify_last_block_contains_transfer_tx ( ) ;
7018
7016
@@ -7029,7 +7027,7 @@ fn continue_after_fast_block_no_sortition() {
7029
7027
. unwrap ( ) ;
7030
7028
btc_blocks_mined += 1 ;
7031
7029
7032
- info ! ( "------------------------- Verify Miner B's Issues a Tenure Change Extend in Block N+2 -------------------------" ) ;
7030
+ info ! ( "------------------------- Verify Miner B's Issues a Tenure Change Extend in Block N+4 -------------------------" ) ;
7033
7031
verify_last_block_contains_tenure_change_tx ( TenureChangeCause :: Extended ) ;
7034
7032
7035
7033
info ! ( "------------------------- Unpause Miner A's Block Commits -------------------------" ) ;
@@ -7064,7 +7062,7 @@ fn continue_after_fast_block_no_sortition() {
7064
7062
assert ! ( tip. sortition) ;
7065
7063
assert_eq ! ( tip. miner_pk_hash. unwrap( ) , mining_pkh_1) ;
7066
7064
7067
- info ! ( "------------------------- Verify Miner A's Issued a Tenure Change in Block N+4 -------------------------" ) ;
7065
+ info ! ( "------------------------- Verify Miner A's Issued a Tenure Change in Block N+5 -------------------------" ) ;
7068
7066
verify_last_block_contains_tenure_change_tx ( TenureChangeCause :: BlockFound ) ;
7069
7067
7070
7068
info ! (
0 commit comments