From e86cccc253f496c68a775b8e270f11cef58c1af2 Mon Sep 17 00:00:00 2001 From: Aaron Blankstein Date: Tue, 16 Apr 2024 10:52:09 -0500 Subject: [PATCH] fix: validate epochs must special case 2.5 --- stackslib/src/core/mod.rs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/stackslib/src/core/mod.rs b/stackslib/src/core/mod.rs index 07701d3f55..5c237b90ca 100644 --- a/stackslib/src/core/mod.rs +++ b/stackslib/src/core/mod.rs @@ -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,