@@ -3567,7 +3567,7 @@ fn partial_tenure_fork() {
3567
3567
}
3568
3568
3569
3569
let num_signers = 5 ;
3570
- let max_nakamoto_tenures = 20 ;
3570
+ let max_nakamoto_tenures = 30 ;
3571
3571
let inter_blocks_per_tenure = 5 ;
3572
3572
3573
3573
// setup sender + recipient for a test stx transfer
@@ -3611,13 +3611,18 @@ fn partial_tenure_fork() {
3611
3611
config. burnchain . local_mining_public_key = Some ( btc_miner_1_pk. to_hex ( ) ) ;
3612
3612
config. miner . mining_key = Some ( Secp256k1PrivateKey :: from_seed ( & [ 1 ] ) ) ;
3613
3613
3614
+ // Increase the reward cycle length to avoid missing a prepare phase
3615
+ // while we are intentionally forking.
3616
+ config. burnchain . pox_reward_length = Some ( 40 ) ;
3617
+ config. burnchain . pox_prepare_length = Some ( 10 ) ;
3618
+
3614
3619
// Move epoch 2.5 and 3.0 earlier, so we have more time for the
3615
3620
// test before re-stacking is required.
3616
3621
if let Some ( epochs) = config. burnchain . epochs . as_mut ( ) {
3617
- epochs[ 6 ] . end_height = 121 ;
3618
- epochs[ 7 ] . start_height = 121 ;
3619
- epochs[ 7 ] . end_height = 151 ;
3620
- epochs[ 8 ] . start_height = 151 ;
3622
+ epochs[ 6 ] . end_height = 131 ;
3623
+ epochs[ 7 ] . start_height = 131 ;
3624
+ epochs[ 7 ] . end_height = 166 ;
3625
+ epochs[ 8 ] . start_height = 166 ;
3621
3626
} else {
3622
3627
panic ! ( "Expected epochs to be set" ) ;
3623
3628
}
@@ -3694,8 +3699,8 @@ fn partial_tenure_fork() {
3694
3699
let mut min_miner_2_tenures = u64:: MAX ;
3695
3700
let mut ignore_block = 0 ;
3696
3701
3697
- while ! ( miner_1_tenures >= min_miner_1_tenures && miner_2_tenures >= min_miner_2_tenures) {
3698
- if btc_blocks_mined > max_nakamoto_tenures {
3702
+ while miner_1_tenures < min_miner_1_tenures || miner_2_tenures < min_miner_2_tenures {
3703
+ if btc_blocks_mined >= max_nakamoto_tenures {
3699
3704
panic ! ( "Produced {btc_blocks_mined} sortitions, but didn't cover the test scenarios, aborting" ) ;
3700
3705
}
3701
3706
@@ -3851,7 +3856,7 @@ fn partial_tenure_fork() {
3851
3856
Err ( e) => {
3852
3857
if e. to_string ( ) . contains ( "TooMuchChaining" ) {
3853
3858
info ! ( "TooMuchChaining error, skipping block" ) ;
3854
- continue ;
3859
+ break ;
3855
3860
} else {
3856
3861
panic ! ( "Failed to submit tx: {}" , e) ;
3857
3862
}
0 commit comments