Skip to content

Commit 640ed94

Browse files
authored
Merge pull request #4690 from stacks-network/fix/net-epoch-version
Fix: validate epochs must special case 2.5
2 parents 099539b + e86cccc commit 640ed94

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

stackslib/src/core/mod.rs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1431,10 +1431,14 @@ impl StacksEpochExtension for StacksEpoch {
14311431
.iter()
14321432
.max()
14331433
.expect("FATAL: expect at least one epoch");
1434-
assert!(
1435-
max_epoch.network_epoch as u32 <= PEER_NETWORK_EPOCH,
1436-
"stacks-blockchain static network epoch should be greater than or equal to the max epoch's"
1437-
);
1434+
if max_epoch.epoch_id == StacksEpochId::Epoch30 {
1435+
assert!(PEER_NETWORK_EPOCH >= u32::from(PEER_VERSION_EPOCH_2_5));
1436+
} else {
1437+
assert!(
1438+
max_epoch.network_epoch as u32 <= PEER_NETWORK_EPOCH,
1439+
"stacks-blockchain static network epoch should be greater than or equal to the max epoch's"
1440+
);
1441+
}
14381442

14391443
assert!(
14401444
StacksEpochId::latest() >= max_epoch.epoch_id,

0 commit comments

Comments
 (0)