Skip to content

Commit bc7fe9e

Browse files
authored
Merge pull request #5353 from stacks-network/fix/multiple-miners
Have get nakamoto headers return only the unique block ids and increase reward cycle length
2 parents ab73c37 + 23e00c8 commit bc7fe9e

File tree

1 file changed

+5
-5
lines changed
  • testnet/stacks-node/src/tests/signer

1 file changed

+5
-5
lines changed

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1460,6 +1460,7 @@ fn multiple_miners() {
14601460
let node_2_rpc_bind = format!("{localhost}:{node_2_rpc}");
14611461
let mut node_2_listeners = Vec::new();
14621462

1463+
let max_nakamoto_tenures = 30;
14631464
// partition the signer set so that ~half are listening and using node 1 for RPC and events,
14641465
// and the rest are using node 2
14651466

@@ -1481,6 +1482,7 @@ fn multiple_miners() {
14811482
config.node.p2p_address = format!("{localhost}:{node_1_p2p}");
14821483
config.miner.wait_on_interim_blocks = Duration::from_secs(5);
14831484
config.node.pox_sync_sample_secs = 30;
1485+
config.burnchain.pox_reward_length = Some(max_nakamoto_tenures);
14841486

14851487
config.node.seed = btc_miner_1_seed.clone();
14861488
config.node.local_peer_seed = btc_miner_1_seed.clone();
@@ -1560,8 +1562,6 @@ fn multiple_miners() {
15601562

15611563
info!("------------------------- Reached Epoch 3.0 -------------------------");
15621564

1563-
let max_nakamoto_tenures = 20;
1564-
15651565
// due to the random nature of mining sortitions, the way this test is structured
15661566
// is that we keep track of how many tenures each miner produced, and once enough sortitions
15671567
// have been produced such that each miner has produced 3 tenures, we stop and check the
@@ -1645,11 +1645,11 @@ fn multiple_miners() {
16451645
assert_eq!(peer_1_height, peer_2_height);
16461646
assert_eq!(
16471647
peer_1_height,
1648-
pre_nakamoto_peer_1_height + btc_blocks_mined - 1
1648+
pre_nakamoto_peer_1_height + btc_blocks_mined as u64 - 1
16491649
);
16501650
assert_eq!(
16511651
btc_blocks_mined,
1652-
u64::try_from(miner_1_tenures + miner_2_tenures).unwrap()
1652+
u32::try_from(miner_1_tenures + miner_2_tenures).unwrap()
16531653
);
16541654

16551655
rl2_coord_channels
@@ -1664,7 +1664,7 @@ fn multiple_miners() {
16641664
/// Read processed nakamoto block IDs from the test observer, and use `config` to open
16651665
/// a chainstate DB and returns their corresponding StacksHeaderInfos
16661666
fn get_nakamoto_headers(config: &Config) -> Vec<StacksHeaderInfo> {
1667-
let nakamoto_block_ids: Vec<_> = test_observer::get_blocks()
1667+
let nakamoto_block_ids: HashSet<_> = test_observer::get_blocks()
16681668
.into_iter()
16691669
.filter_map(|block_json| {
16701670
if block_json

0 commit comments

Comments
 (0)