@@ -5230,47 +5230,41 @@ fn reorg_locally_accepted_blocks_across_tenures_fails() {
5230
5230
assert_ne ! ( info_after. stacks_tip. to_string( ) , block_n_1. block_hash) ;
5231
5231
5232
5232
info ! ( "------------------------- Starting Tenure B -------------------------" ) ;
5233
- // Start a new tenure and ensure the miner can propose a new block N+1' that is accepted by all signers
5234
5233
let blocks_before = mined_blocks. load ( Ordering :: SeqCst ) ;
5235
5234
let info_before = signer_test
5236
5235
. stacks_client
5237
5236
. get_peer_info ( )
5238
5237
. expect ( "Failed to get peer info" ) ;
5238
+
5239
+ // Clear the test observer so any old rejections are not counted
5240
+ test_observer:: clear ( ) ;
5241
+
5242
+ // Start a new tenure and ensure the we see the expected rejections
5239
5243
next_block_and (
5240
5244
& mut signer_test. running_nodes . btc_regtest_controller ,
5241
5245
60 ,
5242
5246
|| {
5243
- let info = signer_test. stacks_client . get_peer_info ( ) . unwrap ( ) ;
5244
- Ok ( info. burn_block_height > info_before. burn_block_height )
5247
+ let rejected_signers = test_observer:: get_stackerdb_chunks ( )
5248
+ . into_iter ( )
5249
+ . flat_map ( |chunk| chunk. modified_slots )
5250
+ . filter_map ( |chunk| {
5251
+ let message = SignerMessage :: consensus_deserialize ( & mut chunk. data . as_slice ( ) )
5252
+ . expect ( "Failed to deserialize SignerMessage" ) ;
5253
+ match message {
5254
+ SignerMessage :: BlockResponse ( BlockResponse :: Rejected ( BlockRejection {
5255
+ signature,
5256
+ signer_signature_hash,
5257
+ ..
5258
+ } ) ) => non_ignoring_signers. iter ( ) . find ( |key| {
5259
+ key. verify ( signer_signature_hash. bits ( ) , & signature) . is_ok ( )
5260
+ } ) ,
5261
+ _ => None ,
5262
+ }
5263
+ } )
5264
+ . collect :: < Vec < _ > > ( ) ;
5265
+ Ok ( rejected_signers. len ( ) + ignoring_signers. len ( ) == num_signers)
5245
5266
} ,
5246
5267
)
5247
- . unwrap ( ) ;
5248
-
5249
- info ! (
5250
- "------------------------- Attempt to mine Nakamoto Block N+1' in Tenure B -------------------------"
5251
- ) ;
5252
- // The miner's proposed block should get rejected by all the signers that PREVIOUSLY accepted the block
5253
- wait_for ( short_timeout, || {
5254
- let rejected_signers = test_observer:: get_stackerdb_chunks ( )
5255
- . into_iter ( )
5256
- . flat_map ( |chunk| chunk. modified_slots )
5257
- . filter_map ( |chunk| {
5258
- let message = SignerMessage :: consensus_deserialize ( & mut chunk. data . as_slice ( ) )
5259
- . expect ( "Failed to deserialize SignerMessage" ) ;
5260
- match message {
5261
- SignerMessage :: BlockResponse ( BlockResponse :: Rejected ( BlockRejection {
5262
- signature,
5263
- signer_signature_hash,
5264
- ..
5265
- } ) ) => non_ignoring_signers
5266
- . iter ( )
5267
- . find ( |key| key. verify ( signer_signature_hash. bits ( ) , & signature) . is_ok ( ) ) ,
5268
- _ => None ,
5269
- }
5270
- } )
5271
- . collect :: < Vec < _ > > ( ) ;
5272
- Ok ( rejected_signers. len ( ) + ignoring_signers. len ( ) == num_signers)
5273
- } )
5274
5268
. expect ( "FAIL: Timed out waiting for block proposal rejections" ) ;
5275
5269
5276
5270
let blocks_after = mined_blocks. load ( Ordering :: SeqCst ) ;
@@ -5279,7 +5273,7 @@ fn reorg_locally_accepted_blocks_across_tenures_fails() {
5279
5273
. get_peer_info ( )
5280
5274
. expect ( "Failed to get peer info" ) ;
5281
5275
assert_eq ! ( blocks_after, blocks_before) ;
5282
- assert_eq ! ( info_after, info_before) ;
5276
+ assert_eq ! ( info_after. stacks_tip , info_before. stacks_tip ) ;
5283
5277
// Ensure that the block was NOT accepted globally so the stacks tip has NOT advanced to N+1'
5284
5278
let nakamoto_blocks = test_observer:: get_mined_nakamoto_blocks ( ) ;
5285
5279
let block_n_1_prime = nakamoto_blocks. last ( ) . unwrap ( ) ;
0 commit comments