Skip to content

Commit 804f6f3

Browse files
obycodekantai
authored andcommitted
test: move the 2.5 and 3.0 activation heights earlier for this test
This allows us to avoid hitting block 240, which is when the stackers get unstacked and the chain stalls, making `partial_tenure_fork` less flaky
1 parent 351f9e6 commit 804f6f3

File tree

2 files changed

+27
-3
lines changed

2 files changed

+27
-3
lines changed

testnet/stacks-node/src/tests/signer/mod.rs

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -748,9 +748,22 @@ fn setup_stx_btc_node<G: FnMut(&mut NeonConfig) -> ()>(
748748
info!("Make new BitcoinRegtestController");
749749
let mut btc_regtest_controller = BitcoinRegtestController::new(naka_conf.clone(), None);
750750

751-
info!("Bootstraping...");
752-
// Should be 201 for other tests?
753-
btc_regtest_controller.bootstrap_chain_to_pks(195, btc_miner_pubkeys);
751+
let epoch_2_5_start = usize::try_from(
752+
naka_conf
753+
.burnchain
754+
.epochs
755+
.as_ref()
756+
.unwrap()
757+
.iter()
758+
.find(|epoch| epoch.epoch_id == StacksEpochId::Epoch25)
759+
.unwrap()
760+
.start_height,
761+
)
762+
.expect("Failed to get epoch 2.5 start height");
763+
let bootstrap_block = epoch_2_5_start - 6;
764+
765+
info!("Bootstraping to block {bootstrap_block}...");
766+
btc_regtest_controller.bootstrap_chain_to_pks(bootstrap_block, btc_miner_pubkeys);
754767

755768
info!("Chain bootstrapped...");
756769

testnet/stacks-node/src/tests/signer/v0.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3610,6 +3610,17 @@ fn partial_tenure_fork() {
36103610
config.node.local_peer_seed = btc_miner_1_seed.clone();
36113611
config.burnchain.local_mining_public_key = Some(btc_miner_1_pk.to_hex());
36123612
config.miner.mining_key = Some(Secp256k1PrivateKey::from_seed(&[1]));
3613+
3614+
// Move epoch 2.5 and 3.0 earlier, so we have more time for the
3615+
// test before re-stacking is required.
3616+
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;
3621+
} else {
3622+
panic!("Expected epochs to be set");
3623+
}
36133624
},
36143625
Some(vec![btc_miner_1_pk.clone(), btc_miner_2_pk.clone()]),
36153626
None,

0 commit comments

Comments
 (0)