Skip to content

Commit

Permalink
use EF consensus spec v1.5.0-beta.0 test vectors (#6832)
Browse files Browse the repository at this point in the history
  • Loading branch information
tersec authored Jan 10, 2025
1 parent 15f17db commit 046c379
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 59 deletions.
18 changes: 9 additions & 9 deletions AllTests-mainnet.md
Original file line number Diff line number Diff line change
Expand Up @@ -513,15 +513,15 @@ OK: 253/253 Fail: 0/253 Skip: 0/253
OK: 56/56 Fail: 0/56 Skip: 0/56
## EF - PeerDAS - Networking [Preset: mainnet]
```diff
+ Networking - Get Custody Groups - mainnet/fulu/networking/get_custody_columns/pyspec_tests OK
+ Networking - Get Custody Groups - mainnet/fulu/networking/get_custody_columns/pyspec_tests OK
+ Networking - Get Custody Groups - mainnet/fulu/networking/get_custody_columns/pyspec_tests OK
+ Networking - Get Custody Groups - mainnet/fulu/networking/get_custody_columns/pyspec_tests OK
+ Networking - Get Custody Groups - mainnet/fulu/networking/get_custody_columns/pyspec_tests OK
+ Networking - Get Custody Groups - mainnet/fulu/networking/get_custody_columns/pyspec_tests OK
+ Networking - Get Custody Groups - mainnet/fulu/networking/get_custody_columns/pyspec_tests OK
+ Networking - Get Custody Groups - mainnet/fulu/networking/get_custody_columns/pyspec_tests OK
+ Networking - Get Custody Groups - mainnet/fulu/networking/get_custody_columns/pyspec_tests OK
+ Networking - Get Custody Groups - mainnet/fulu/networking/get_custody_groups/pyspec_tests/ OK
+ Networking - Get Custody Groups - mainnet/fulu/networking/get_custody_groups/pyspec_tests/ OK
+ Networking - Get Custody Groups - mainnet/fulu/networking/get_custody_groups/pyspec_tests/ OK
+ Networking - Get Custody Groups - mainnet/fulu/networking/get_custody_groups/pyspec_tests/ OK
+ Networking - Get Custody Groups - mainnet/fulu/networking/get_custody_groups/pyspec_tests/ OK
+ Networking - Get Custody Groups - mainnet/fulu/networking/get_custody_groups/pyspec_tests/ OK
+ Networking - Get Custody Groups - mainnet/fulu/networking/get_custody_groups/pyspec_tests/ OK
+ Networking - Get Custody Groups - mainnet/fulu/networking/get_custody_groups/pyspec_tests/ OK
+ Networking - Get Custody Groups - mainnet/fulu/networking/get_custody_groups/pyspec_tests/ OK
```
OK: 9/9 Fail: 0/9 Skip: 0/9
## EF - SSZ generic types
Expand Down
5 changes: 3 additions & 2 deletions ConsensusSpecPreset-mainnet.md
Original file line number Diff line number Diff line change
Expand Up @@ -2608,6 +2608,7 @@ OK: 5/5 Fail: 0/5 Skip: 0/5
+ EF - Electra - Fork - fork_earliest_exit_epoch_less_than_current_epoch [Preset: mainnet] OK
+ EF - Electra - Fork - fork_earliest_exit_epoch_no_validator_exits [Preset: mainnet] OK
+ EF - Electra - Fork - fork_has_compounding_withdrawal_credential [Preset: mainnet] OK
+ EF - Electra - Fork - fork_inactive_compounding_validator_with_excess_balance [Preset: mai OK
+ EF - Electra - Fork - fork_many_next_epoch [Preset: mainnet] OK
+ EF - Electra - Fork - fork_next_epoch [Preset: mainnet] OK
+ EF - Electra - Fork - fork_next_epoch_with_block [Preset: mainnet] OK
Expand All @@ -2616,7 +2617,7 @@ OK: 5/5 Fail: 0/5 Skip: 0/5
+ EF - Electra - Fork - fork_random_low_balances [Preset: mainnet] OK
+ EF - Electra - Fork - fork_random_misc_balances [Preset: mainnet] OK
```
OK: 18/18 Fail: 0/18 Skip: 0/18
OK: 19/19 Fail: 0/19 Skip: 0/19
## EF - Electra - Operations - Attestation [Preset: mainnet]
```diff
+ [Invalid] EF - Electra - Operations - Attestation - invalid_after_max_inclusion_slot OK
Expand Down Expand Up @@ -3852,4 +3853,4 @@ OK: 69/88 Fail: 0/88 Skip: 19/88
OK: 3/3 Fail: 0/3 Skip: 0/3

---TOTAL---
OK: 3127/3146 Fail: 0/3146 Skip: 19/3146
OK: 3128/3147 Fail: 0/3147 Skip: 19/3147
18 changes: 16 additions & 2 deletions ConsensusSpecPreset-minimal.md
Original file line number Diff line number Diff line change
Expand Up @@ -2737,6 +2737,7 @@ OK: 5/5 Fail: 0/5 Skip: 0/5
+ EF - Electra - Fork - fork_earliest_exit_epoch_less_than_current_epoch [Preset: minimal] OK
+ EF - Electra - Fork - fork_earliest_exit_epoch_no_validator_exits [Preset: minimal] OK
+ EF - Electra - Fork - fork_has_compounding_withdrawal_credential [Preset: minimal] OK
+ EF - Electra - Fork - fork_inactive_compounding_validator_with_excess_balance [Preset: min OK
+ EF - Electra - Fork - fork_many_next_epoch [Preset: minimal] OK
+ EF - Electra - Fork - fork_next_epoch [Preset: minimal] OK
+ EF - Electra - Fork - fork_next_epoch_with_block [Preset: minimal] OK
Expand All @@ -2746,7 +2747,7 @@ OK: 5/5 Fail: 0/5 Skip: 0/5
+ EF - Electra - Fork - fork_random_low_balances [Preset: minimal] OK
+ EF - Electra - Fork - fork_random_misc_balances [Preset: minimal] OK
```
OK: 20/20 Fail: 0/20 Skip: 0/20
OK: 21/21 Fail: 0/21 Skip: 0/21
## EF - Electra - Operations - Attestation [Preset: minimal]
```diff
+ [Invalid] EF - Electra - Operations - Attestation - invalid_after_max_inclusion_slot OK
Expand Down Expand Up @@ -3484,6 +3485,19 @@ OK: 4/4 Fail: 0/4 Skip: 0/4
+ Testing WithdrawalRequest OK
```
OK: 59/59 Fail: 0/59 Skip: 0/59
## EF - Light client - Data collection [Preset: minimal]
```diff
+ Light client - Data collection - minimal/altair/light_client/data_collection/pyspec_tests/ OK
+ Light client - Data collection - minimal/bellatrix/light_client/data_collection/pyspec_tes OK
+ Light client - Data collection - minimal/bellatrix/light_client/data_collection/pyspec_tes OK
+ Light client - Data collection - minimal/bellatrix/light_client/data_collection/pyspec_tes OK
+ Light client - Data collection - minimal/capella/light_client/data_collection/pyspec_tests OK
+ Light client - Data collection - minimal/capella/light_client/data_collection/pyspec_tests OK
+ Light client - Data collection - minimal/capella/light_client/data_collection/pyspec_tests OK
+ Light client - Data collection - minimal/deneb/light_client/data_collection/pyspec_tests/l OK
+ Light client - Data collection - minimal/electra/light_client/data_collection/pyspec_tests OK
```
OK: 9/9 Fail: 0/9 Skip: 0/9
## EF - Light client - Single merkle proof [Preset: minimal]
```diff
+ Light client - Single merkle proof - minimal/altair/light_client/single_merkle_proof/Beaco OK
Expand Down Expand Up @@ -4198,4 +4212,4 @@ OK: 185/207 Fail: 0/207 Skip: 22/207
OK: 3/3 Fail: 0/3 Skip: 0/3

---TOTAL---
OK: 3442/3464 Fail: 0/3464 Skip: 22/3464
OK: 3452/3474 Fail: 0/3474 Skip: 22/3474
2 changes: 1 addition & 1 deletion beacon_chain/spec/datatypes/base.nim
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export
tables, results, endians2, json_serialization, sszTypes, beacon_time, crypto,
digest, presets

const SPEC_VERSION* = "1.5.0-alpha.10"
const SPEC_VERSION* = "1.5.0-beta.0"
## Spec version we're aiming to be compatible with, right now

const
Expand Down
43 changes: 0 additions & 43 deletions beacon_chain/sync/sync_protocol.nim
Original file line number Diff line number Diff line change
Expand Up @@ -374,49 +374,6 @@ p2pProtocol BeaconSync(version = 1,
"1", peer, peer.networkState.dag, response, startSlot, reqCount,
MAX_BLOBS_PER_BLOCK, MAX_REQUEST_BLOB_SIDECARS)

# https://github.com/ethereum/consensus-specs/blob/v1.3.0/specs/deneb/p2p-interface.md#blobsidecarsbyroot-v1
# https://github.com/ethereum/consensus-specs/blob/v1.5.0-alpha.10/specs/electra/p2p-interface.md#blobsidecarsbyroot-v2
proc blobSidecarsByRoot_v2(
peer: Peer,
blobIds: BlobIdentifierList,
response: MultipleChunksResponse[
ref BlobSidecar, Limit(MAX_REQUEST_BLOB_SIDECARS_ELECTRA)])
{.async, libp2pProtocol("blob_sidecars_by_root", 2).} =
# TODO Semantically, this request should return a non-ref, but doing so
# runs into extreme inefficiency due to the compiler introducing
# hidden copies - in future nim versions with move support, this should
# be revisited
# TODO This code is more complicated than it needs to be, since the type
# of the multiple chunks response is not actually used in this server
# implementation (it's used to derive the signature of the client
# function, not in the code below!)
# TODO although you can't tell from this function definition, a magic
# client call that returns `seq[ref BlobSidecar]` will
# will be generated by the libp2p macro - we guarantee that seq items
# are `not-nil` in the implementation
getBlobSidecarsByRoot("2", peer, peer.networkState.dag, response, blobIds)

# https://github.com/ethereum/consensus-specs/blob/v1.3.0/specs/deneb/p2p-interface.md#blobsidecarsbyrange-v1
# https://github.com/ethereum/consensus-specs/blob/v1.5.0-alpha.10/specs/electra/p2p-interface.md#blobsidecarsbyrange-v2
proc blobSidecarsByRange_v2(
peer: Peer,
startSlot: Slot,
reqCount: uint64,
response: MultipleChunksResponse[
ref BlobSidecar, Limit(MAX_REQUEST_BLOB_SIDECARS_ELECTRA)])
{.async, libp2pProtocol("blob_sidecars_by_range", 2).} =
# TODO This code is more complicated than it needs to be, since the type
# of the multiple chunks response is not actually used in this server
# implementation (it's used to derive the signature of the client
# function, not in the code below!)
# TODO although you can't tell from this function definition, a magic
# client call that returns `seq[ref BlobSidecar]` will
# will be generated by the libp2p macro - we guarantee that seq items
# are `not-nil` in the implementation
getBlobSidecarsByRange(
"2", peer, peer.networkState.dag, response, startSlot, reqCount,
MAX_BLOBS_PER_BLOCK_ELECTRA, MAX_REQUEST_BLOB_SIDECARS_ELECTRA)

# https://github.com/ethereum/consensus-specs/blob/v1.5.0-alpha.10/specs/fulu/p2p-interface.md#datacolumnsidecarsbyroot-v1
proc dataColumnSidecarsByRoot(
peer: Peer,
Expand Down
2 changes: 1 addition & 1 deletion tests/consensus_spec/test_fixture_networking.nim
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,6 @@ suite "EF - PeerDAS - Networking" & preset():
const presetPath = SszTestsDir/const_preset
# foldering to be resolved in alpha 11 release of consensus spec tests
let basePath =
presetPath/"fulu"/"networking"/"get_custody_columns"/"pyspec_tests"
presetPath/"fulu"/"networking"/"get_custody_groups"/"pyspec_tests"
for kind, path in walkDir(basePath, relative = true, checkDir = true):
runGetCustodyColumns(suiteName, basePath/path)
2 changes: 1 addition & 1 deletion vendor/nim-eth2-scenarios

0 comments on commit 046c379

Please sign in to comment.