add Electra slot sanity tests (#6230)

This commit is contained in:
tersec 2024-04-23 07:58:32 +00:00 committed by GitHub
parent eb997f4e1f
commit e6e95cbab7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 35 additions and 3 deletions

View File

@ -2674,6 +2674,16 @@ OK: 50/50 Fail: 0/50 Skip: 0/50
+ Testing Withdrawal OK
```
OK: 55/55 Fail: 0/55 Skip: 0/55
## EF - Electra - Sanity - Slots [Preset: mainnet]
```diff
+ EF - Electra - Slots - double_empty_epoch [Preset: mainnet] OK
+ EF - Electra - Slots - empty_epoch [Preset: mainnet] OK
+ EF - Electra - Slots - historical_accumulator [Preset: mainnet] OK
+ EF - Electra - Slots - over_epoch_boundary [Preset: mainnet] OK
+ EF - Electra - Slots - slots_1 [Preset: mainnet] OK
+ EF - Electra - Slots - slots_2 [Preset: mainnet] OK
```
OK: 6/6 Fail: 0/6 Skip: 0/6
## EF - Light client - Single merkle proof [Preset: mainnet]
```diff
+ Light client - Single merkle proof - mainnet/altair/light_client/single_merkle_proof/Beaco OK
@ -3202,4 +3212,4 @@ OK: 69/88 Fail: 0/88 Skip: 19/88
OK: 3/3 Fail: 0/3 Skip: 0/3
---TOTAL---
OK: 2561/2580 Fail: 0/2580 Skip: 19/2580
OK: 2567/2586 Fail: 0/2586 Skip: 19/2586

View File

@ -2793,6 +2793,16 @@ OK: 51/51 Fail: 0/51 Skip: 0/51
+ Testing Withdrawal OK
```
OK: 55/55 Fail: 0/55 Skip: 0/55
## EF - Electra - Sanity - Slots [Preset: minimal]
```diff
+ EF - Electra - Slots - double_empty_epoch [Preset: minimal] OK
+ EF - Electra - Slots - empty_epoch [Preset: minimal] OK
+ EF - Electra - Slots - historical_accumulator [Preset: minimal] OK
+ EF - Electra - Slots - over_epoch_boundary [Preset: minimal] OK
+ EF - Electra - Slots - slots_1 [Preset: minimal] OK
+ EF - Electra - Slots - slots_2 [Preset: minimal] OK
```
OK: 6/6 Fail: 0/6 Skip: 0/6
## EF - Light client - Single merkle proof [Preset: minimal]
```diff
+ Light client - Single merkle proof - minimal/altair/light_client/single_merkle_proof/Beaco OK
@ -3482,4 +3492,4 @@ OK: 185/207 Fail: 0/207 Skip: 22/207
OK: 3/3 Fail: 0/3 Skip: 0/3
---TOTAL---
OK: 2810/2832 Fail: 0/2832 Skip: 22/2832
OK: 2816/2838 Fail: 0/2838 Skip: 22/2838

View File

@ -617,7 +617,6 @@ template PayloadAttributes*(
static: doAssert ConsensusFork.high == ConsensusFork.Electra,
"eth2_merkleization has been checked and `hash_tree_root` is up to date"
# TODO are these used?
# TODO when https://github.com/nim-lang/Nim/issues/21086 fixed, use return type
# `ref T`
func new*(T: type ForkedHashedBeaconState, data: phase0.BeaconState):
@ -640,6 +639,10 @@ func new*(T: type ForkedHashedBeaconState, data: deneb.BeaconState):
ref ForkedHashedBeaconState =
(ref T)(kind: ConsensusFork.Deneb, denebData: deneb.HashedBeaconState(
data: data, root: hash_tree_root(data)))
func new*(T: type ForkedHashedBeaconState, data: electra.BeaconState):
ref ForkedHashedBeaconState =
(ref T)(kind: ConsensusFork.Electra, electraData: electra.HashedBeaconState(
data: data, root: hash_tree_root(data)))
template init*(T: type ForkedBeaconBlock, blck: phase0.BeaconBlock): T =
T(kind: ConsensusFork.Phase0, phase0Data: blck)

View File

@ -89,3 +89,12 @@ suite "EF - Deneb - Sanity - Slots " & preset():
for kind, path in walkDir(
denebSanitySlotsDir, relative = true, checkDir = true):
runTest(deneb.BeaconState, denebSanitySlotsDir, "Deneb", suiteName, path)
from ../../beacon_chain/spec/datatypes/electra import BeaconState
suite "EF - Electra - Sanity - Slots " & preset():
const electraSanitySlotsDir = sanitySlotsDir("electra")
for kind, path in walkDir(
electraSanitySlotsDir, relative = true, checkDir = true):
runTest(
electra.BeaconState, electraSanitySlotsDir, "Electra", suiteName, path)