prepare LC update ranking test runner for Capella (#4563)
* prepare LC update ranking test runner for Capella Adds missing Capella/EIP4844 support to LC update ranking runner. * fix uncommitted typo * skip capella / eip4844 tests * cleanup test skip
This commit is contained in:
parent
0fb726c420
commit
258f151594
|
@ -525,8 +525,8 @@ ConsensusSpecPreset-minimal
|
||||||
+ Light client - Sync - minimal/eip4844/light_client/sync/pyspec_tests/supply_sync_committee OK
|
+ Light client - Sync - minimal/eip4844/light_client/sync/pyspec_tests/supply_sync_committee OK
|
||||||
+ Light client - Update ranking - minimal/altair/light_client/update_ranking/pyspec_tests/up OK
|
+ Light client - Update ranking - minimal/altair/light_client/update_ranking/pyspec_tests/up OK
|
||||||
+ Light client - Update ranking - minimal/bellatrix/light_client/update_ranking/pyspec_tests OK
|
+ Light client - Update ranking - minimal/bellatrix/light_client/update_ranking/pyspec_tests OK
|
||||||
+ Light client - Update ranking - minimal/capella/light_client/update_ranking/pyspec_tests/u OK
|
Light client - Update ranking - minimal/capella/light_client/update_ranking/pyspec_tests/u Skip
|
||||||
+ Light client - Update ranking - minimal/eip4844/light_client/update_ranking/pyspec_tests/u OK
|
Light client - Update ranking - minimal/eip4844/light_client/update_ranking/pyspec_tests/u Skip
|
||||||
+ Sync - minimal/bellatrix/sync/optimistic/pyspec_tests/from_syncing_to_invalid OK
|
+ Sync - minimal/bellatrix/sync/optimistic/pyspec_tests/from_syncing_to_invalid OK
|
||||||
+ Sync - minimal/capella/sync/optimistic/pyspec_tests/from_syncing_to_invalid OK
|
+ Sync - minimal/capella/sync/optimistic/pyspec_tests/from_syncing_to_invalid OK
|
||||||
+ Sync - minimal/eip4844/sync/optimistic/pyspec_tests/from_syncing_to_invalid OK
|
+ Sync - minimal/eip4844/sync/optimistic/pyspec_tests/from_syncing_to_invalid OK
|
||||||
|
@ -918,7 +918,7 @@ ConsensusSpecPreset-minimal
|
||||||
+ [Valid] EF - Phase 0 - Sanity - Blocks - slash_and_exit_diff_index [Preset: minimal] OK
|
+ [Valid] EF - Phase 0 - Sanity - Blocks - slash_and_exit_diff_index [Preset: minimal] OK
|
||||||
+ [Valid] EF - Phase 0 - Sanity - Blocks - voluntary_exit [Preset: minimal] OK
|
+ [Valid] EF - Phase 0 - Sanity - Blocks - voluntary_exit [Preset: minimal] OK
|
||||||
```
|
```
|
||||||
OK: 906/915 Fail: 0/915 Skip: 9/915
|
OK: 904/915 Fail: 0/915 Skip: 11/915
|
||||||
## Attestation
|
## Attestation
|
||||||
```diff
|
```diff
|
||||||
+ [Invalid] EF - Altair - Operations - Attestation - invalid_after_epoch_slots OK
|
+ [Invalid] EF - Altair - Operations - Attestation - invalid_after_epoch_slots OK
|
||||||
|
@ -2763,4 +2763,4 @@ OK: 68/68 Fail: 0/68 Skip: 0/68
|
||||||
OK: 102/102 Fail: 0/102 Skip: 0/102
|
OK: 102/102 Fail: 0/102 Skip: 0/102
|
||||||
|
|
||||||
---TOTAL---
|
---TOTAL---
|
||||||
OK: 2444/2453 Fail: 0/2453 Skip: 9/2453
|
OK: 2442/2453 Fail: 0/2453 Skip: 11/2453
|
||||||
|
|
|
@ -57,7 +57,9 @@ suite "EF - Light client - Single merkle proof" & preset():
|
||||||
if kind != pcDir or not dirExists(testsPath):
|
if kind != pcDir or not dirExists(testsPath):
|
||||||
continue
|
continue
|
||||||
let fork = forkForPathComponent(path).valueOr:
|
let fork = forkForPathComponent(path).valueOr:
|
||||||
raiseAssert "Unknown test fork: " & testsPath
|
test "Light client - Single merkle proof - " & path:
|
||||||
|
skip()
|
||||||
|
continue
|
||||||
for kind, path in walkDir(testsPath, relative = true, checkDir = true):
|
for kind, path in walkDir(testsPath, relative = true, checkDir = true):
|
||||||
let suitePath = testsPath/path
|
let suitePath = testsPath/path
|
||||||
if kind != pcDir or not dirExists(suitePath):
|
if kind != pcDir or not dirExists(suitePath):
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
# beacon_chain
|
# beacon_chain
|
||||||
# Copyright (c) 2022 Status Research & Development GmbH
|
# Copyright (c) 2022-2023 Status Research & Development GmbH
|
||||||
# Licensed and distributed under either of
|
# Licensed and distributed under either of
|
||||||
# * MIT license (license terms in the root directory or at https://opensource.org/licenses/MIT).
|
# * 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).
|
# * Apache v2 license (license terms in the root directory or at https://www.apache.org/licenses/LICENSE-2.0).
|
||||||
|
@ -16,7 +16,6 @@ import
|
||||||
yaml,
|
yaml,
|
||||||
# Beacon chain internals
|
# Beacon chain internals
|
||||||
../../../beacon_chain/spec/helpers,
|
../../../beacon_chain/spec/helpers,
|
||||||
../../../beacon_chain/spec/datatypes/altair,
|
|
||||||
# Test utilities
|
# Test utilities
|
||||||
../testutil,
|
../testutil,
|
||||||
./fixtures_utils
|
./fixtures_utils
|
||||||
|
@ -25,8 +24,12 @@ type
|
||||||
TestMeta = object
|
TestMeta = object
|
||||||
updates_count: uint64
|
updates_count: uint64
|
||||||
|
|
||||||
proc runTest(path: string) =
|
proc runTest(path: string, lcDataFork: static LightClientDataFork) =
|
||||||
test "Light client - Update ranking - " & path.relativePath(SszTestsDir):
|
test "Light client - Update ranking - " & path.relativePath(SszTestsDir):
|
||||||
|
when lcDataFork >= LightClientDataFork.Capella:
|
||||||
|
skip()
|
||||||
|
return
|
||||||
|
|
||||||
let meta = block:
|
let meta = block:
|
||||||
var s = openFileStream(path/"meta.yaml")
|
var s = openFileStream(path/"meta.yaml")
|
||||||
defer: close(s)
|
defer: close(s)
|
||||||
|
@ -34,13 +37,13 @@ proc runTest(path: string) =
|
||||||
yaml.load(s, res)
|
yaml.load(s, res)
|
||||||
res
|
res
|
||||||
|
|
||||||
var updates = newSeqOfCap[altair.LightClientUpdate](meta.updates_count)
|
var updates = newSeqOfCap[lcDataFork.LightClientUpdate](meta.updates_count)
|
||||||
for i in 0 ..< meta.updates_count:
|
for i in 0 ..< meta.updates_count:
|
||||||
updates.add parseTest(
|
updates.add parseTest(
|
||||||
path/"updates_" & Base10.toString(i) & ".ssz_snappy",
|
path/"updates_" & Base10.toString(i) & ".ssz_snappy",
|
||||||
SSZ, altair.LightClientUpdate)
|
SSZ, lcDataFork.LightClientUpdate)
|
||||||
|
|
||||||
proc cmp(a, b: altair.LightClientUpdate): int =
|
proc cmp(a, b: lcDataFork.LightClientUpdate): int =
|
||||||
if a.is_better_update(b):
|
if a.is_better_update(b):
|
||||||
check: not b.is_better_update(a)
|
check: not b.is_better_update(a)
|
||||||
-1
|
-1
|
||||||
|
@ -53,9 +56,17 @@ proc runTest(path: string) =
|
||||||
suite "EF - Light client - Update ranking" & preset():
|
suite "EF - Light client - Update ranking" & preset():
|
||||||
const presetPath = SszTestsDir/const_preset
|
const presetPath = SszTestsDir/const_preset
|
||||||
for kind, path in walkDir(presetPath, relative = true, checkDir = true):
|
for kind, path in walkDir(presetPath, relative = true, checkDir = true):
|
||||||
let basePath =
|
let testsPath =
|
||||||
presetPath/path/"light_client"/"update_ranking"/"pyspec_tests"
|
presetPath/path/"light_client"/"update_ranking"/"pyspec_tests"
|
||||||
if kind != pcDir or not dirExists(basePath):
|
if kind != pcDir or not dirExists(testsPath):
|
||||||
continue
|
continue
|
||||||
for kind, path in walkDir(basePath, relative = true, checkDir = true):
|
let fork = forkForPathComponent(path).valueOr:
|
||||||
runTest(basePath/path)
|
test "Light client - Update ranking - " & path:
|
||||||
|
skip()
|
||||||
|
continue
|
||||||
|
for kind, path in walkDir(testsPath, relative = true, checkDir = true):
|
||||||
|
withStateFork(fork):
|
||||||
|
const lcDataFork = lcDataForkAtStateFork(stateFork)
|
||||||
|
when lcDataFork > LightClientDataFork.None:
|
||||||
|
runTest(testsPath/path, lcDataFork)
|
||||||
|
else: raiseAssert "Unreachable"
|
||||||
|
|
Loading…
Reference in New Issue