Skip to content

Commit 56ae168

Browse files
committed
check that epoch3 start burn block is in the missing blocks
1 parent 33ff38a commit 56ae168

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

testnet/stacks-node/src/tests/nakamoto_integrations.rs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1902,6 +1902,12 @@ fn simple_neon_integration_with_flash_blocks_on_epoch_3() {
19021902
// Check that we have the expected burn blocks
19031903
// We expect to have around the blocks 220-230 and 234 onwards, with a gap of 3 blocks for the flash blocks
19041904
let bhh = u64::from(tip.burn_header_height);
1905+
1906+
// Get the Epoch 3.0 activation height (in terms of Bitcoin block height)
1907+
let epochs = naka_conf.burnchain.epochs.clone().unwrap();
1908+
let epoch_3 = &epochs[StacksEpoch::find_epoch_by_id(&epochs, StacksEpochId::Epoch30).unwrap()];
1909+
let epoch_3_start_height = epoch_3.start_height;
1910+
19051911
// Find the gap in burn blocks
19061912
let mut gap_start = 0;
19071913
let mut gap_end = 0;
@@ -1925,11 +1931,21 @@ fn simple_neon_integration_with_flash_blocks_on_epoch_3() {
19251931
gap_end
19261932
);
19271933

1934+
// Verify that the gap includes the Epoch 3.0 activation height
1935+
assert!(
1936+
gap_start <= epoch_3_start_height && epoch_3_start_height <= gap_end,
1937+
"Expected the gap ({}..={}) to include the Epoch 3.0 activation height ({})",
1938+
gap_start,
1939+
gap_end,
1940+
epoch_3_start_height
1941+
);
1942+
19281943
// Verify blocks before and after the gap
19291944
test_observer::contains_burn_block_range(220..=(gap_start - 1)).unwrap();
19301945
test_observer::contains_burn_block_range((gap_end + 1)..=bhh).unwrap();
19311946

19321947
info!("Verified burn block ranges, including expected gap for flash blocks");
1948+
info!("Confirmed that the gap includes the Epoch 3.0 activation height (Bitcoin block height): {}", epoch_3_start_height);
19331949

19341950
coord_channel
19351951
.lock()

0 commit comments

Comments
 (0)