include capella fork version in fork consistency check (#3772)

* include capella fork version in fork consistency check

* Update tests/test_conf.nim

Co-authored-by: Etan Kissling <etan@status.im>

Co-authored-by: Etan Kissling <etan@status.im>
This commit is contained in:
tersec 2022-06-18 10:05:33 +00:00 committed by GitHub
parent 8eb5d5de09
commit cbb0b8142f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 26 additions and 5 deletions

View File

@ -553,6 +553,19 @@ OK: 1/1 Fail: 0/1 Skip: 0/1
+ should register stability subnets on attester duties OK + should register stability subnets on attester duties OK
``` ```
OK: 1/1 Fail: 0/1 Skip: 0/1 OK: 1/1 Fail: 0/1 Skip: 0/1
## weak-subjectivity-checkpoint
```diff
+ Correct values OK
+ invalid characters in root OK
+ longer root OK
+ missing epoch OK
+ missing root OK
+ missing separator OK
+ negative epoch OK
+ non-number epoch OK
+ shorter root OK
```
OK: 9/9 Fail: 0/9 Skip: 0/9
---TOTAL--- ---TOTAL---
OK: 308/313 Fail: 0/313 Skip: 5/313 OK: 317/322 Fail: 0/322 Skip: 5/322

View File

@ -960,15 +960,13 @@ func clear*(cache: var StateCache) =
cache.sync_committees.clear cache.sync_committees.clear
func checkForkConsistency*(cfg: RuntimeConfig) = func checkForkConsistency*(cfg: RuntimeConfig) =
# TODO add cfg.CAPELLA_FORK_VERSION once merge-testnets repo includes it and
# fixes SHARDING_FORK_VERSION to be a new FORK_VERSION. Until then make sure
# that it will never actually use the Capella fork.
doAssert cfg.CAPELLA_FORK_EPOCH == FAR_FUTURE_EPOCH doAssert cfg.CAPELLA_FORK_EPOCH == FAR_FUTURE_EPOCH
doAssert cfg.SHARDING_FORK_EPOCH == FAR_FUTURE_EPOCH doAssert cfg.SHARDING_FORK_EPOCH == FAR_FUTURE_EPOCH
let forkVersions = let forkVersions =
[cfg.GENESIS_FORK_VERSION, cfg.ALTAIR_FORK_VERSION, [cfg.GENESIS_FORK_VERSION, cfg.ALTAIR_FORK_VERSION,
cfg.BELLATRIX_FORK_VERSION, cfg.SHARDING_FORK_VERSION] cfg.BELLATRIX_FORK_VERSION, cfg.CAPELLA_FORK_VERSION,
cfg.SHARDING_FORK_VERSION]
for i in 0 ..< forkVersions.len: for i in 0 ..< forkVersions.len:
for j in i+1 ..< forkVersions.len: for j in i+1 ..< forkVersions.len:
doAssert distinctBase(forkVersions[i]) != distinctBase(forkVersions[j]) doAssert distinctBase(forkVersions[i]) != distinctBase(forkVersions[j])

View File

@ -1,3 +1,13 @@
# beacon_chain
# Copyright (c) 2022 Status Research & Development GmbH
# Licensed and distributed under either of
# * MIT license (license terms in the root directory or at https://opensource.org/licenses/MIT).
# * Apache v2 license (license terms in the root directory or at https://www.apache.org/licenses/LICENSE-2.0).
# at your option. This file may not be copied, modified, or distributed except according to those terms.
{.push raises: [Defect].}
{.used.}
import import
unittest2, unittest2,
../beacon_chain/conf ../beacon_chain/conf