mirror of
https://github.com/status-im/nimbus-eth2.git
synced 2025-01-22 12:30:08 +00:00
v1.1.3 tests; re-enable minimal-preset altair transition tests (#2993)
This commit is contained in:
parent
9381ad352f
commit
b66e7c8573
@ -6,10 +6,23 @@ ConsensusSpecPreset-mainnet
|
||||
+ Ethereum Foundation - Altair - Transition - transition_missing_first_post_block [Preset: m OK
|
||||
+ Ethereum Foundation - Altair - Transition - transition_missing_last_pre_fork_block [Preset OK
|
||||
+ Ethereum Foundation - Altair - Transition - transition_only_blocks_post_fork [Preset: main OK
|
||||
+ Ethereum Foundation - Altair - Transition - transition_with_activation_at_fork_epoch [Pres OK
|
||||
+ Ethereum Foundation - Altair - Transition - transition_with_attester_slashing_right_after_ OK
|
||||
+ Ethereum Foundation - Altair - Transition - transition_with_attester_slashing_right_before OK
|
||||
+ Ethereum Foundation - Altair - Transition - transition_with_deposit_right_after_fork [Pres OK
|
||||
+ Ethereum Foundation - Altair - Transition - transition_with_deposit_right_before_fork [Pre OK
|
||||
+ Ethereum Foundation - Altair - Transition - transition_with_finality [Preset: mainnet] OK
|
||||
+ Ethereum Foundation - Altair - Transition - transition_with_leaking_at_fork [Preset: mainn OK
|
||||
+ Ethereum Foundation - Altair - Transition - transition_with_leaking_pre_fork [Preset: main OK
|
||||
+ Ethereum Foundation - Altair - Transition - transition_with_no_attestations_until_after_fo OK
|
||||
+ Ethereum Foundation - Altair - Transition - transition_with_non_empty_activation_queue [Pr OK
|
||||
+ Ethereum Foundation - Altair - Transition - transition_with_one_fourth_exiting_validators_ OK
|
||||
+ Ethereum Foundation - Altair - Transition - transition_with_proposer_slashing_right_after_ OK
|
||||
+ Ethereum Foundation - Altair - Transition - transition_with_proposer_slashing_right_before OK
|
||||
+ Ethereum Foundation - Altair - Transition - transition_with_random_half_participation [Pre OK
|
||||
+ Ethereum Foundation - Altair - Transition - transition_with_random_three_quarters_particip OK
|
||||
+ Ethereum Foundation - Altair - Transition - transition_with_voluntary_exit_right_after_for OK
|
||||
+ Ethereum Foundation - Altair - Transition - transition_with_voluntary_exit_right_before_fo OK
|
||||
+ Rewards - all_balances_too_low_for_reward [Preset: mainnet] OK
|
||||
+ Rewards - duplicate_attestations_at_later_slots [Preset: mainnet] OK
|
||||
+ Rewards - empty [Preset: mainnet] OK
|
||||
@ -407,7 +420,7 @@ ConsensusSpecPreset-mainnet
|
||||
+ fork_random_misc_balances OK
|
||||
+ next_sync_committee_merkle_proof OK
|
||||
```
|
||||
OK: 404/404 Fail: 0/404 Skip: 0/404
|
||||
OK: 417/417 Fail: 0/417 Skip: 0/417
|
||||
## Ethereum Foundation - Altair - Epoch Processing - Effective balance updates [Preset: mainnet]
|
||||
```diff
|
||||
+ Effective balance updates - effective_balance_hysteresis [Preset: mainnet] OK
|
||||
@ -799,4 +812,4 @@ OK: 1/1 Fail: 0/1 Skip: 0/1
|
||||
OK: 27/27 Fail: 0/27 Skip: 0/27
|
||||
|
||||
---TOTAL---
|
||||
OK: 661/661 Fail: 0/661 Skip: 0/661
|
||||
OK: 674/674 Fail: 0/674 Skip: 0/674
|
||||
|
@ -2,6 +2,29 @@ ConsensusSpecPreset-minimal
|
||||
===
|
||||
##
|
||||
```diff
|
||||
+ Ethereum Foundation - Altair - Transition - normal_transition [Preset: minimal] OK
|
||||
+ Ethereum Foundation - Altair - Transition - transition_missing_first_post_block [Preset: m OK
|
||||
+ Ethereum Foundation - Altair - Transition - transition_missing_last_pre_fork_block [Preset OK
|
||||
+ Ethereum Foundation - Altair - Transition - transition_only_blocks_post_fork [Preset: mini OK
|
||||
+ Ethereum Foundation - Altair - Transition - transition_with_activation_at_fork_epoch [Pres OK
|
||||
+ Ethereum Foundation - Altair - Transition - transition_with_attester_slashing_right_after_ OK
|
||||
+ Ethereum Foundation - Altair - Transition - transition_with_attester_slashing_right_before OK
|
||||
+ Ethereum Foundation - Altair - Transition - transition_with_deposit_right_after_fork [Pres OK
|
||||
+ Ethereum Foundation - Altair - Transition - transition_with_deposit_right_before_fork [Pre OK
|
||||
+ Ethereum Foundation - Altair - Transition - transition_with_finality [Preset: minimal] OK
|
||||
+ Ethereum Foundation - Altair - Transition - transition_with_leaking_at_fork [Preset: minim OK
|
||||
+ Ethereum Foundation - Altair - Transition - transition_with_leaking_pre_fork [Preset: mini OK
|
||||
+ Ethereum Foundation - Altair - Transition - transition_with_no_attestations_until_after_fo OK
|
||||
+ Ethereum Foundation - Altair - Transition - transition_with_non_empty_activation_queue [Pr OK
|
||||
+ Ethereum Foundation - Altair - Transition - transition_with_one_fourth_exiting_validators_ OK
|
||||
+ Ethereum Foundation - Altair - Transition - transition_with_one_fourth_exiting_validators_ OK
|
||||
+ Ethereum Foundation - Altair - Transition - transition_with_one_fourth_slashed_active_vali OK
|
||||
+ Ethereum Foundation - Altair - Transition - transition_with_proposer_slashing_right_after_ OK
|
||||
+ Ethereum Foundation - Altair - Transition - transition_with_proposer_slashing_right_before OK
|
||||
+ Ethereum Foundation - Altair - Transition - transition_with_random_half_participation [Pre OK
|
||||
+ Ethereum Foundation - Altair - Transition - transition_with_random_three_quarters_particip OK
|
||||
+ Ethereum Foundation - Altair - Transition - transition_with_voluntary_exit_right_after_for OK
|
||||
+ Ethereum Foundation - Altair - Transition - transition_with_voluntary_exit_right_before_fo OK
|
||||
+ Rewards - all_balances_too_low_for_reward [Preset: minimal] OK
|
||||
+ Rewards - duplicate_attestations_at_later_slots [Preset: minimal] OK
|
||||
+ Rewards - empty [Preset: minimal] OK
|
||||
@ -403,7 +426,7 @@ ConsensusSpecPreset-minimal
|
||||
+ finality_root_merkle_proof OK
|
||||
+ next_sync_committee_merkle_proof OK
|
||||
```
|
||||
OK: 400/400 Fail: 0/400 Skip: 0/400
|
||||
OK: 423/423 Fail: 0/423 Skip: 0/423
|
||||
## Ethereum Foundation - Altair - Epoch Processing - Effective balance updates [Preset: minimal]
|
||||
```diff
|
||||
+ Effective balance updates - effective_balance_hysteresis [Preset: minimal] OK
|
||||
@ -829,4 +852,4 @@ OK: 1/1 Fail: 0/1 Skip: 0/1
|
||||
OK: 27/27 Fail: 0/27 Skip: 0/27
|
||||
|
||||
---TOTAL---
|
||||
OK: 683/683 Fail: 0/683 Skip: 0/683
|
||||
OK: 706/706 Fail: 0/706 Skip: 0/706
|
||||
|
@ -56,7 +56,7 @@ export
|
||||
# Eventually, we could also differentiate between user/tainted data and
|
||||
# internal state that's gone through sanity checks already.
|
||||
|
||||
const SPEC_VERSION* = "1.1.2"
|
||||
const SPEC_VERSION* = "1.1.3"
|
||||
## Spec version we're aiming to be compatible with, right now
|
||||
|
||||
const
|
||||
|
@ -25,19 +25,20 @@ const
|
||||
TransitionDir = SszTestsDir/const_preset/"altair"/"transition"/"core"/"pyspec_tests"
|
||||
|
||||
type
|
||||
TransitionEpoch = object
|
||||
TransitionInfo = object
|
||||
post_fork: string
|
||||
fork_epoch: int
|
||||
blocks_count: int
|
||||
fork_block {.defaultVal: 0.}: int
|
||||
fork_block {.defaultVal: -1.}: int
|
||||
bls_setting {.defaultVal: 1.}: int
|
||||
|
||||
proc runTest(testName, testDir, unitTestName: string) =
|
||||
let testPath = testDir / unitTestName
|
||||
|
||||
var transitionEpoch: TransitionEpoch
|
||||
var transitionInfo: TransitionInfo
|
||||
var s = openFileStream(testPath/"meta.yaml")
|
||||
defer: close(s)
|
||||
yaml.load(s, transitionEpoch)
|
||||
yaml.load(s, transitionInfo)
|
||||
|
||||
proc `testImpl _ blck _ testName`() =
|
||||
test testName & " - " & unitTestName & preset():
|
||||
@ -48,14 +49,13 @@ proc runTest(testName, testDir, unitTestName: string) =
|
||||
cache = StateCache()
|
||||
info = ForkedEpochInfo()
|
||||
cfg = defaultRuntimeConfig
|
||||
cfg.ALTAIR_FORK_EPOCH = transitionEpoch.fork_epoch.Epoch
|
||||
cfg.ALTAIR_FORK_EPOCH = transitionInfo.fork_epoch.Epoch
|
||||
|
||||
# In test cases with more than 10 blocks the first 10 aren't 0-prefixed,
|
||||
# so purely lexicographic sorting wouldn't sort properly.
|
||||
let numBlocks = toSeq(walkPattern(testPath/"blocks_*.ssz_snappy")).len
|
||||
for i in 0 ..< numBlocks:
|
||||
let inBeforeTimes = i <= transitionEpoch.fork_block and transitionEpoch.fork_block > 0
|
||||
if inBeforeTimes:
|
||||
if i <= transitionInfo.fork_block:
|
||||
let blck = parseTest(testPath/"blocks_" & $i & ".ssz_snappy", SSZ, phase0.SignedBeaconBlock)
|
||||
|
||||
let success = state_transition(
|
||||
@ -78,7 +78,5 @@ proc runTest(testName, testDir, unitTestName: string) =
|
||||
`testImpl _ blck _ testName`()
|
||||
|
||||
suite "Ethereum Foundation - Altair - Transition " & preset():
|
||||
# TODO investigate why this isn't working in minimal preset
|
||||
when const_preset == "mainnet":
|
||||
for kind, path in walkDir(TransitionDir, relative = true, checkDir = true):
|
||||
runTest("Ethereum Foundation - Altair - Transition", TransitionDir, path)
|
||||
for kind, path in walkDir(TransitionDir, relative = true, checkDir = true):
|
||||
runTest("Ethereum Foundation - Altair - Transition", TransitionDir, path)
|
||||
|
@ -38,7 +38,7 @@ type
|
||||
const
|
||||
FixturesDir* =
|
||||
currentSourcePath.rsplit(DirSep, 1)[0] / ".." / ".." / "vendor" / "nim-eth2-scenarios"
|
||||
SszTestsDir* = FixturesDir / "tests-v1.1.2"
|
||||
SszTestsDir* = FixturesDir / "tests-v1.1.3"
|
||||
MaxObjectSize* = 3_000_000
|
||||
|
||||
proc parseTest*(path: string, Format: typedesc[Json], T: typedesc): T =
|
||||
|
2
vendor/nim-eth2-scenarios
vendored
2
vendor/nim-eth2-scenarios
vendored
@ -1 +1 @@
|
||||
Subproject commit 739eb3ba48d07b42f545ec27548a90fadaf7327e
|
||||
Subproject commit f13448a27bd8cbe4da4b5c7ace2db3e33dc040eb
|
Loading…
x
Reference in New Issue
Block a user