use EF consensus spec v1.5.0-alpha.2 test vectors (#6272)

This commit is contained in:
tersec 2024-05-08 02:43:05 +00:00 committed by GitHub
parent 1b30dcc165
commit 963e0bb92b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 31 additions and 39 deletions

View File

@ -2673,19 +2673,6 @@ OK: 14/14 Fail: 0/14 Skip: 0/14
+ [Valid] EF - Electra - Operations - Block Header - basic_block_header OK + [Valid] EF - Electra - Operations - Block Header - basic_block_header OK
``` ```
OK: 6/6 Fail: 0/6 Skip: 0/6 OK: 6/6 Fail: 0/6 Skip: 0/6
## EF - Electra - Operations - Consolidation [Preset: mainnet]
```diff
+ [Invalid] EF - Electra - Operations - Consolidation - invalid_before_specified_epoch OK
+ [Invalid] EF - Electra - Operations - Consolidation - invalid_different_credentials OK
+ [Invalid] EF - Electra - Operations - Consolidation - invalid_exited_source OK
+ [Invalid] EF - Electra - Operations - Consolidation - invalid_exited_target OK
+ [Invalid] EF - Electra - Operations - Consolidation - invalid_inactive_source OK
+ [Invalid] EF - Electra - Operations - Consolidation - invalid_inactive_target OK
+ [Invalid] EF - Electra - Operations - Consolidation - invalid_no_execution_withdrawal_cred OK
+ [Invalid] EF - Electra - Operations - Consolidation - invalid_not_enough_consolidation_chu OK
+ [Invalid] EF - Electra - Operations - Consolidation - invalid_source_equals_target OK
```
OK: 9/9 Fail: 0/9 Skip: 0/9
## EF - Electra - Operations - Deposit [Preset: mainnet] ## EF - Electra - Operations - Deposit [Preset: mainnet]
```diff ```diff
+ [Invalid] EF - Electra - Operations - Deposit - invalid_bad_merkle_proof OK + [Invalid] EF - Electra - Operations - Deposit - invalid_bad_merkle_proof OK
@ -3688,4 +3675,4 @@ OK: 69/88 Fail: 0/88 Skip: 19/88
OK: 3/3 Fail: 0/3 Skip: 0/3 OK: 3/3 Fail: 0/3 Skip: 0/3
---TOTAL--- ---TOTAL---
OK: 2970/2990 Fail: 0/2990 Skip: 20/2990 OK: 2961/2981 Fail: 0/2981 Skip: 20/2981

View File

@ -74,7 +74,7 @@ export
tables, results, endians2, json_serialization, sszTypes, beacon_time, crypto, tables, results, endians2, json_serialization, sszTypes, beacon_time, crypto,
digest, presets digest, presets
const SPEC_VERSION* = "1.5.0-alpha.1" const SPEC_VERSION* = "1.5.0-alpha.2"
## Spec version we're aiming to be compatible with, right now ## Spec version we're aiming to be compatible with, right now
const const

View File

@ -45,13 +45,17 @@ const
baseDescription = "EF - Electra - Operations - " baseDescription = "EF - Electra - Operations - "
doAssert toHashSet(mapIt(toSeq(walkDir(OpDir, relative = false)), it.path)) ==
toHashSet([ var testDirs = toHashSet([
OpAttestationsDir, OpAttSlashingDir, OpBlockHeaderDir, OpAttestationsDir, OpAttSlashingDir, OpBlockHeaderDir,
OpBlsToExecutionChangeDir, OpConsolidationDir, OpDepositReceiptDir, OpBlsToExecutionChangeDir, OpDepositReceiptDir, OpDepositsDir,
OpDepositsDir, OpExecutionLayerWithdrawalRequestDir, OpExecutionLayerWithdrawalRequestDir, OpExecutionPayloadDir,
OpExecutionPayloadDir, OpProposerSlashingDir, OpSyncAggregateDir, OpProposerSlashingDir, OpSyncAggregateDir, OpVoluntaryExitDir,
OpVoluntaryExitDir, OpWithdrawalsDir]) OpWithdrawalsDir])
when const_preset == "minimal":
testDirs.incl OpConsolidationDir
doAssert toHashSet(
mapIt(toSeq(walkDir(OpDir, relative = false)), it.path)) == testDirs
proc runTest[T, U]( proc runTest[T, U](
testSuiteDir, suiteName, opName, applyFile: string, testSuiteDir, suiteName, opName, applyFile: string,
@ -146,23 +150,24 @@ suite baseDescription & "BLS to execution change " & preset():
OpBlsToExecutionChangeDir, suiteName, "BLS to execution change", "address_change", OpBlsToExecutionChangeDir, suiteName, "BLS to execution change", "address_change",
applyBlsToExecutionChange, path) applyBlsToExecutionChange, path)
suite baseDescription & "Consolidation " & preset(): when const_preset == "minimal":
proc applyConsolidation( suite baseDescription & "Consolidation " & preset():
preState: var electra.BeaconState, proc applyConsolidation(
signed_consolidation: SignedConsolidation): preState: var electra.BeaconState,
Result[void, cstring] = signed_consolidation: SignedConsolidation):
var cache: StateCache Result[void, cstring] =
process_consolidation( var cache: StateCache
defaultRuntimeConfig, preState, signed_consolidation, cache) process_consolidation(
defaultRuntimeConfig, preState, signed_consolidation, cache)
for path in walkTests(OpConsolidationDir): for path in walkTests(OpConsolidationDir):
if path in [ if path in [
"invalid_exceed_pending_consolidations_limit", # apparently invalid prestate SSZ "invalid_exceed_pending_consolidations_limit", # apparently invalid prestate SSZ
]: ]:
continue continue
runTest[SignedConsolidation, typeof applyConsolidation]( runTest[SignedConsolidation, typeof applyConsolidation](
OpConsolidationDir, suiteName, "Consolidation", "consolidation", OpConsolidationDir, suiteName, "Consolidation", "consolidation",
applyConsolidation, path) applyConsolidation, path)
from ".."/".."/".."/beacon_chain/bloomfilter import constructBloomFilter from ".."/".."/".."/beacon_chain/bloomfilter import constructBloomFilter

@ -1 +1 @@
Subproject commit 67f8fa8506e3b97b5e68a9c60e38157507aeec61 Subproject commit 54675b5f1fd8156a508e75991693df57a281642e