@@ -10823,18 +10823,13 @@ fn injected_signatures_are_ignored_across_boundaries() {
10823
10823
/// Signers accept and the stacks tip advances to N
10824
10824
/// Miner 1's block commits are paused so it cannot confirm the next tenure.
10825
10825
/// Sortition occurs. Miner 2 wins.
10826
- /// Miner 2 proposes block N+1
10827
- /// Signers accept and the stacks tip advances to N+1
10826
+ /// Miner 2 successfully mines blocks N+1, N+2, and N+3
10828
10827
/// Sortition occurs quickly, within first_proposal_burn_block_timing_secs. Miner 1 wins.
10829
10828
/// Miner 1 proposes block N+1'
10830
10829
/// Signers approve N+1', saying "Miner is not building off of most recent tenure. A tenure they
10831
10830
/// reorg has already mined blocks, but the block was poorly timed, allowing the reorg."
10832
- /// Miner 1 proposes N+2 and it is accepted.
10833
- /// Asserts:
10834
- /// - N+1 is signed and broadcasted
10835
- /// - N+1' is signed and broadcasted
10836
- /// - The tip advances to N+1 (Signed by Miner 1)
10837
- /// - The tip advances to N+2 (Signed by Miner 1)
10831
+ /// Miner 1 proposes N+2' and it is accepted.
10832
+ /// Miner 1 wins the next tenure and mines N+4, off of miner 2's tip.
10838
10833
#[ test]
10839
10834
#[ ignore]
10840
10835
fn allow_reorg_within_first_proposal_burn_block_timing_secs ( ) {
@@ -11184,7 +11179,7 @@ fn allow_reorg_within_first_proposal_burn_block_timing_secs() {
11184
11179
send_amt,
11185
11180
) ;
11186
11181
let tx = submit_tx ( & http_origin, & transfer_tx) ;
11187
- info ! ( "Submitted tx {tx} in attempt to mine block N+2 " ) ;
11182
+ info ! ( "Submitted tx {tx} in attempt to mine block N+3 " ) ;
11188
11183
sender_nonce += 1 ;
11189
11184
11190
11185
wait_for ( 30 , || {
@@ -11201,7 +11196,7 @@ fn allow_reorg_within_first_proposal_burn_block_timing_secs() {
11201
11196
11202
11197
assert_eq ! ( get_chain_info( & conf) . stacks_tip_height, block_n_height + 3 ) ;
11203
11198
11204
- info ! ( "------------------------- Miner 1 Wins the Next Tenure -------------------------" ) ;
11199
+ info ! ( "------------------------- Miner 1 Wins the Next Tenure, Mines N+1' -------------------------" ) ;
11205
11200
11206
11201
let blocks_processed_before_1 = blocks_mined1. load ( Ordering :: SeqCst ) ;
11207
11202
let mined_before = test_observer:: get_mined_nakamoto_blocks ( ) . len ( ) ;
@@ -11222,7 +11217,25 @@ fn allow_reorg_within_first_proposal_burn_block_timing_secs() {
11222
11217
let last_block = blocks. last ( ) . expect ( "No blocks mined" ) ;
11223
11218
assert_eq ! ( last_block. stacks_height, block_n_height + 1 ) ;
11224
11219
11225
- info ! ( "------------------------- Miner 1 Mines N+2 -------------------------" ) ;
11220
+ info ! ( "------------------------- Miner 1 Submits a Block Commit -------------------------" ) ;
11221
+
11222
+ let rl1_commits_before = rl1_commits. load ( Ordering :: SeqCst ) ;
11223
+ signer_test
11224
+ . running_nodes
11225
+ . nakamoto_test_skip_commit_op
11226
+ . set ( false ) ;
11227
+
11228
+ wait_for ( 30 , || {
11229
+ Ok ( rl1_commits. load ( Ordering :: SeqCst ) > rl1_commits_before)
11230
+ } )
11231
+ . expect ( "Timed out waiting for Miner 1 to submit its block commit" ) ;
11232
+
11233
+ signer_test
11234
+ . running_nodes
11235
+ . nakamoto_test_skip_commit_op
11236
+ . set ( true ) ;
11237
+
11238
+ info ! ( "------------------------- Miner 1 Mines N+2' -------------------------" ) ;
11226
11239
11227
11240
let blocks_processed_before_1 = blocks_mined1. load ( Ordering :: SeqCst ) ;
11228
11241
let mined_before = test_observer:: get_mined_nakamoto_blocks ( ) . len ( ) ;
@@ -11237,20 +11250,33 @@ fn allow_reorg_within_first_proposal_burn_block_timing_secs() {
11237
11250
send_amt,
11238
11251
) ;
11239
11252
let tx = submit_tx ( & http_origin, & transfer_tx) ;
11240
- info ! ( "Submitted tx {tx} in attempt to mine block N+2" ) ;
11253
+ info ! ( "Submitted tx {tx} in attempt to mine block N+2' " ) ;
11241
11254
11242
11255
wait_for ( 30 , || {
11243
11256
Ok (
11244
11257
blocks_mined1. load ( Ordering :: SeqCst ) > blocks_processed_before_1
11245
11258
&& test_observer:: get_mined_nakamoto_blocks ( ) . len ( ) > mined_before,
11246
11259
)
11247
11260
} )
11248
- . expect ( "Timed out waiting for Miner 1 to Mine Block N+2" ) ;
11261
+ . expect ( "Timed out waiting for Miner 1 to Mine Block N+2' " ) ;
11249
11262
11250
11263
let blocks = test_observer:: get_mined_nakamoto_blocks ( ) ;
11251
11264
let last_block = blocks. last ( ) . expect ( "No blocks mined" ) ;
11252
11265
assert_eq ! ( last_block. stacks_height, block_n_height + 2 ) ;
11253
11266
11267
+ info ! ( "------------------------- Miner 1 Mines N+4 in Next Tenure -------------------------" ) ;
11268
+
11269
+ next_block_and_process_new_stacks_block (
11270
+ & mut signer_test. running_nodes . btc_regtest_controller ,
11271
+ 30 ,
11272
+ & signer_test. running_nodes . coord_channel ,
11273
+ )
11274
+ . expect ( "Timed out waiting for Miner 1 to Mine Block N+4" ) ;
11275
+
11276
+ let blocks = test_observer:: get_mined_nakamoto_blocks ( ) ;
11277
+ let last_block = blocks. last ( ) . expect ( "No blocks mined" ) ;
11278
+ assert_eq ! ( last_block. stacks_height, block_n_height + 4 ) ;
11279
+
11254
11280
info ! ( "------------------------- Shutdown -------------------------" ) ;
11255
11281
rl2_coord_channels
11256
11282
. lock ( )
0 commit comments