Skip to content

Commit 55d502d

Browse files
committed
feat: add reward cycle check for 3.0 activation
3.0 can only activate in reward cycle 2 or later.
1 parent 609ad13 commit 55d502d

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

testnet/stacks-node/src/config.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -550,6 +550,16 @@ impl Config {
550550
&burnchain.pox_constants
551551
);
552552
}
553+
let activation_reward_cycle = burnchain
554+
.block_height_to_reward_cycle(epoch_30.start_height)
555+
.expect("FATAL: Epoch 3.0 starts before the first burnchain block");
556+
if activation_reward_cycle < 2 {
557+
panic!(
558+
"FATAL: Epoch 3.0 must start at or after the second reward cycle. Epoch 3.0 start set to: {}. PoX Parameters: {:?}",
559+
epoch_30.start_height,
560+
&burnchain.pox_constants
561+
);
562+
}
553563
}
554564

555565
/// Connect to the MempoolDB using the configured cost estimation

0 commit comments

Comments
 (0)