Enable eip7668 pytest

This commit is contained in:
Hsiao-Wei Wang 2023-09-12 21:48:35 +08:00
parent fd37ffcb61
commit cc3ced5965
No known key found for this signature in database
GPG Key ID: AE3D6B174F971DE4
6 changed files with 25 additions and 3 deletions

View File

@ -56,6 +56,9 @@ EIP6110_FORK_EPOCH: 18446744073709551615
# EIP7002
EIP7002_FORK_VERSION: 0x05000000 # temporary stub
EIP7002_FORK_EPOCH: 18446744073709551615
# EIP7668
EIP7668_FORK_VERSION: 0x05000000 # temporary stub
EIP7668_FORK_EPOCH: 18446744073709551615
# WHISK
WHISK_FORK_VERSION: 0x06000000 # temporary stub
WHISK_FORK_EPOCH: 18446744073709551615
@ -146,3 +149,6 @@ BLOB_SIDECAR_SUBNET_COUNT: 6
WHISK_EPOCHS_PER_SHUFFLING_PHASE: 256
# `Epoch(2)`
WHISK_PROPOSER_SELECTION_GAP: 2
# EIP7668
MAX_PER_EPOCH_INBOUND_CHURN_LIMIT: 12

View File

@ -55,6 +55,9 @@ EIP6110_FORK_EPOCH: 18446744073709551615
# EIP7002
EIP7002_FORK_VERSION: 0x05000001
EIP7002_FORK_EPOCH: 18446744073709551615
# EIP7668
EIP7668_FORK_VERSION: 0x05000001 # temporary stub
EIP7668_FORK_EPOCH: 18446744073709551615
# WHISK
WHISK_FORK_VERSION: 0x06000001
WHISK_FORK_EPOCH: 18446744073709551615
@ -145,3 +148,6 @@ BLOB_SIDECAR_SUBNET_COUNT: 6
# Whisk
WHISK_EPOCHS_PER_SHUFFLING_PHASE: 4
WHISK_PROPOSER_SELECTION_GAP: 1
# EIP7668
MAX_PER_EPOCH_INBOUND_CHURN_LIMIT: 12

View File

@ -10,12 +10,13 @@ from eth2spec.capella import mainnet as spec_capella_mainnet, minimal as spec_ca
from eth2spec.deneb import mainnet as spec_deneb_mainnet, minimal as spec_deneb_minimal
from eth2spec.eip6110 import mainnet as spec_eip6110_mainnet, minimal as spec_eip6110_minimal
from eth2spec.eip7002 import mainnet as spec_eip7002_mainnet, minimal as spec_eip7002_minimal
from eth2spec.eip7668 import mainnet as spec_eip7668_mainnet, minimal as spec_eip7668_minimal
from eth2spec.utils import bls
from .exceptions import SkippedTest
from .helpers.constants import (
PHASE0, ALTAIR, BELLATRIX, CAPELLA, DENEB,
EIP6110, EIP7002,
EIP6110, EIP7002, EIP7668,
MINIMAL, MAINNET,
ALL_PHASES,
ALL_FORK_UPGRADES,
@ -85,6 +86,7 @@ spec_targets: Dict[PresetBaseName, Dict[SpecForkName, Spec]] = {
DENEB: spec_deneb_minimal,
EIP6110: spec_eip6110_minimal,
EIP7002: spec_eip7002_minimal,
EIP7668: spec_eip7668_minimal,
},
MAINNET: {
PHASE0: spec_phase0_mainnet,
@ -94,6 +96,7 @@ spec_targets: Dict[PresetBaseName, Dict[SpecForkName, Spec]] = {
DENEB: spec_deneb_mainnet,
EIP6110: spec_eip6110_mainnet,
EIP7002: spec_eip7002_mainnet,
EIP7668: spec_eip7668_mainnet,
},
}

View File

@ -18,6 +18,7 @@ CUSTODY_GAME = SpecForkName('custody_game')
DAS = SpecForkName('das')
EIP6110 = SpecForkName('eip6110')
EIP7002 = SpecForkName('eip7002')
EIP7668 = SpecForkName('eip7668')
#
# SpecFork settings
@ -34,6 +35,7 @@ ALL_PHASES = (
# Experimental patches
EIP6110,
EIP7002,
EIP7668,
)
# The forks that have light client specs
LIGHT_CLIENT_TESTING_FORKS = (*[item for item in MAINNET_FORKS if item != PHASE0], DENEB)

View File

@ -1,10 +1,12 @@
from .constants import (
PHASE0, ALTAIR, BELLATRIX, CAPELLA, DENEB,
EIP6110, EIP7002,
EIP6110, EIP7002, EIP7668,
)
def is_post_fork(a, b):
if a == EIP7668:
return b in [PHASE0, ALTAIR, BELLATRIX, CAPELLA, EIP7668]
if a == EIP7002:
return b in [PHASE0, ALTAIR, BELLATRIX, CAPELLA, EIP7002]
if a == EIP6110:

View File

@ -1,5 +1,5 @@
from eth2spec.test.helpers.constants import (
ALTAIR, BELLATRIX, CAPELLA, DENEB, EIP6110, EIP7002,
ALTAIR, BELLATRIX, CAPELLA, DENEB, EIP6110, EIP7002, EIP7668,
)
from eth2spec.test.helpers.execution_payload import (
compute_el_header_block_hash,
@ -93,6 +93,9 @@ def create_genesis_state(spec, validator_balances, activation_threshold):
elif spec.fork == EIP7002:
previous_version = spec.config.CAPELLA_FORK_VERSION
current_version = spec.config.EIP7002_FORK_VERSION
elif spec.fork == EIP7668:
previous_version = spec.config.CAPELLA_FORK_VERSION
current_version = spec.config.EIP7668_FORK_VERSION
state = spec.BeaconState(
genesis_time=0,