disallow non-(genesis, far-future) equal transition epochs (#3691)
This commit is contained in:
parent
7492f99f35
commit
ea113fc420
|
@ -673,8 +673,18 @@ proc init*(T: type ChainDAGRef, cfg: RuntimeConfig, db: BeaconChainDB,
|
|||
for j in i+1 ..< forkVersions.len:
|
||||
doAssert forkVersions[i] != forkVersions[j]
|
||||
|
||||
doAssert cfg.ALTAIR_FORK_EPOCH <= cfg.BELLATRIX_FORK_EPOCH
|
||||
doAssert cfg.BELLATRIX_FORK_EPOCH <= cfg.SHARDING_FORK_EPOCH
|
||||
template assertForkEpochOrder(
|
||||
firstForkEpoch: Epoch, secondForkEpoch: Epoch) =
|
||||
doAssert firstForkEpoch <= secondForkEpoch
|
||||
|
||||
# TODO https://github.com/ethereum/consensus-specs/issues/2902 multiple
|
||||
# fork transitions per epoch don't work in a well-defined way.
|
||||
doAssert firstForkEpoch < secondForkEpoch or
|
||||
firstForkEpoch in [GENESIS_EPOCH, FAR_FUTURE_EPOCH]
|
||||
|
||||
assertForkEpochOrder(cfg.ALTAIR_FORK_EPOCH, cfg.BELLATRIX_FORK_EPOCH)
|
||||
assertForkEpochorder(cfg.BELLATRIX_FORK_EPOCH, cfg.SHARDING_FORK_EPOCH)
|
||||
|
||||
doAssert updateFlags in [{}, {verifyFinalization}],
|
||||
"Other flags not supported in ChainDAG"
|
||||
|
||||
|
|
|
@ -617,6 +617,8 @@ proc push*[T](sq: SyncQueue[T], sr: SyncRequest[T],
|
|||
missingParentSlot: Option[Slot]
|
||||
|
||||
# compiler segfault if this is moved into the for loop, at time of writing
|
||||
# TODO this does segfault in 1.2 but not 1.6, so remove workaround when 1.2
|
||||
# is dropped.
|
||||
res: Result[void, BlockError]
|
||||
|
||||
for blk in sq.blocks(item):
|
||||
|
|
Loading…
Reference in New Issue