Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: validate epochs must special case 2.5 #4690

Merged
merged 1 commit into from
Apr 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 8 additions & 4 deletions stackslib/src/core/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1431,10 +1431,14 @@ impl StacksEpochExtension for StacksEpoch {
.iter()
.max()
.expect("FATAL: expect at least one epoch");
assert!(
max_epoch.network_epoch as u32 <= PEER_NETWORK_EPOCH,
"stacks-blockchain static network epoch should be greater than or equal to the max epoch's"
);
if max_epoch.epoch_id == StacksEpochId::Epoch30 {
assert!(PEER_NETWORK_EPOCH >= u32::from(PEER_VERSION_EPOCH_2_5));
} else {
assert!(
max_epoch.network_epoch as u32 <= PEER_NETWORK_EPOCH,
"stacks-blockchain static network epoch should be greater than or equal to the max epoch's"
);
}

assert!(
StacksEpochId::latest() >= max_epoch.epoch_id,
Expand Down