@@ -211,11 +211,13 @@ class ConsensusMode(ComparableEnum):
211211 HARD_FORK_2_0 = 1
212212 # the soft fork introduced in Chia 2.6
213213 SOFT_FORK_2_6 = 2
214+ # the soft fork introduced in Chia 2.7
215+ SOFT_FORK_2_7 = 3
214216 # the hard fork introduced in Chia 3.0
215- HARD_FORK_3_0 = 3
217+ HARD_FORK_3_0 = 4
216218 # the hard fork introduced in Chia 3.0 but after v1 plots have been
217219 # phased-out, and no longer valid
218- HARD_FORK_3_0_AFTER_PHASE_OUT = 4
220+ HARD_FORK_3_0_AFTER_PHASE_OUT = 5
219221
220222
221223@pytest .fixture (
@@ -224,6 +226,7 @@ class ConsensusMode(ComparableEnum):
224226 ConsensusMode .PLAIN ,
225227 ConsensusMode .HARD_FORK_2_0 ,
226228 ConsensusMode .SOFT_FORK_2_6 ,
229+ ConsensusMode .SOFT_FORK_2_7 ,
227230 ConsensusMode .HARD_FORK_3_0 ,
228231 ConsensusMode .HARD_FORK_3_0_AFTER_PHASE_OUT ,
229232 ],
@@ -236,14 +239,25 @@ def consensus_mode(request):
236239def blockchain_constants (consensus_mode : ConsensusMode ) -> ConsensusConstants :
237240 ret : ConsensusConstants = test_constants
238241
242+ if consensus_mode >= ConsensusMode .HARD_FORK_2_0 :
243+ ret = ret .replace (
244+ HARD_FORK_HEIGHT = uint32 (2 ),
245+ )
246+
239247 if consensus_mode >= ConsensusMode .SOFT_FORK_2_6 :
240248 ret = ret .replace (
241249 SOFT_FORK8_HEIGHT = uint32 (2 ),
242250 )
243251
244- if consensus_mode >= ConsensusMode .HARD_FORK_3_0_AFTER_PHASE_OUT :
252+ if consensus_mode >= ConsensusMode .SOFT_FORK_2_7 :
245253 ret = ret .replace (
246254 HARD_FORK_HEIGHT = uint32 (0 ),
255+ SOFT_FORK8_HEIGHT = uint32 (0 ),
256+ SOFT_FORK9_HEIGHT = uint32 (0 ),
257+ )
258+
259+ if consensus_mode >= ConsensusMode .HARD_FORK_3_0_AFTER_PHASE_OUT :
260+ ret = ret .replace (
247261 HARD_FORK2_HEIGHT = uint32 (0 ),
248262 PLOT_V1_PHASE_OUT_EPOCH_BITS = uint8 (0 ),
249263 # we don't have very much v2 space, and no phase-out means the
@@ -257,15 +271,13 @@ def blockchain_constants(consensus_mode: ConsensusMode) -> ConsensusConstants:
257271 # activate the hard fork at some height > 0 (e.g. 5)
258272 # and have a shorter phase-out period (e.g. 2 bits). We would have
259273 # to regenerate the test chains and tweak some tests for this
260- HARD_FORK_HEIGHT = uint32 (0 ),
261274 HARD_FORK2_HEIGHT = uint32 (0 ),
262275 # we don't have very much v2 space. We need a lower difficulty
263276 # level to start with
264277 DIFFICULTY_STARTING = uint64 (7 ),
265278 )
266279 elif consensus_mode >= ConsensusMode .HARD_FORK_2_0 :
267280 ret = ret .replace (
268- HARD_FORK_HEIGHT = uint32 (2 ),
269281 PLOT_FILTER_128_HEIGHT = uint32 (10 ),
270282 PLOT_FILTER_64_HEIGHT = uint32 (15 ),
271283 PLOT_FILTER_32_HEIGHT = uint32 (20 ),
@@ -335,6 +347,8 @@ def test_chain_suffix(consensus_mode: ConsensusMode) -> str:
335347 return "3.0"
336348 elif consensus_mode >= ConsensusMode .HARD_FORK_3_0 :
337349 return "3.0_mixed"
350+ elif consensus_mode >= ConsensusMode .SOFT_FORK_2_7 :
351+ return "2.7"
338352 elif consensus_mode >= ConsensusMode .HARD_FORK_2_0 :
339353 return "2.0_hardfork"
340354 else :
0 commit comments