From 6679b8a1ae65a1afbdfc600ab0b4356c381e572b Mon Sep 17 00:00:00 2001 From: djrtwo Date: Thu, 18 May 2023 10:49:57 -0600 Subject: [PATCH] attslotrange -> eip-7045 --- .circleci/config.yml | 6 ++--- .gitignore | 2 +- Makefile | 2 +- configs/mainnet.yaml | 6 ++--- configs/minimal.yaml | 6 ++--- setup.py | 26 +++++++++---------- .../{attslotrange => eip7045}/beacon-chain.md | 12 ++++----- .../{attslotrange => eip7045}/fork.md | 24 ++++++++--------- .../p2p-interface.md | 8 +++--- tests/core/pyspec/eth2spec/test/context.py | 12 ++++----- .../eth2spec/test/helpers/attestations.py | 4 +-- .../pyspec/eth2spec/test/helpers/constants.py | 4 +-- .../eth2spec/test/helpers/fork_transition.py | 10 +++---- .../pyspec/eth2spec/test/helpers/forks.py | 10 +++---- .../pyspec/eth2spec/test/helpers/genesis.py | 6 ++--- 15 files changed, 69 insertions(+), 69 deletions(-) rename specs/_features/{attslotrange => eip7045}/beacon-chain.md (94%) rename specs/_features/{attslotrange => eip7045}/fork.md (81%) rename specs/_features/{attslotrange => eip7045}/p2p-interface.md (95%) diff --git a/.circleci/config.yml b/.circleci/config.yml index c3d6540ad..89a7487c8 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -168,7 +168,7 @@ jobs: command: make citest fork=eip6110 - store_test_results: path: tests/core/pyspec/test-reports - test-attslotrange: + test-eip7045: docker: - image: circleci/python:3.8 working_directory: ~/specs-repo @@ -178,7 +178,7 @@ jobs: - restore_pyspec_cached_venv - run: name: Run py-tests - command: make citest fork=attslotrange + command: make citest fork=eip7045 - store_test_results: path: tests/core/pyspec/test-reports @@ -305,7 +305,7 @@ workflows: - test-eip6110: requires: - install_pyspec_test - - test-attslotrange: + - test-eip7045: requires: - install_pyspec_test - table_of_contents diff --git a/.gitignore b/.gitignore index c8cd7a15a..55bf1d176 100644 --- a/.gitignore +++ b/.gitignore @@ -22,7 +22,7 @@ tests/core/pyspec/eth2spec/bellatrix/ tests/core/pyspec/eth2spec/capella/ tests/core/pyspec/eth2spec/deneb/ tests/core/pyspec/eth2spec/eip6110/ -tests/core/pyspec/eth2spec/attslotrange/ +tests/core/pyspec/eth2spec/eip7045/ # coverage reports .htmlcov diff --git a/Makefile b/Makefile index b0990bd51..55f77ed4a 100644 --- a/Makefile +++ b/Makefile @@ -34,7 +34,7 @@ MARKDOWN_FILES = $(wildcard $(SPEC_DIR)/*/*.md) \ $(wildcard $(SPEC_DIR)/_features/*/*/*.md) \ $(wildcard $(SSZ_DIR)/*.md) -ALL_EXECUTABLE_SPECS = phase0 altair bellatrix capella deneb eip6110 attslotrange +ALL_EXECUTABLE_SPECS = phase0 altair bellatrix capella deneb eip6110 eip7045 # The parameters for commands. Use `foreach` to avoid listing specs again. COVERAGE_SCOPE := $(foreach S,$(ALL_EXECUTABLE_SPECS), --cov=eth2spec.$S.$(TEST_PRESET_TYPE)) PYLINT_SCOPE := $(foreach S,$(ALL_EXECUTABLE_SPECS), ./eth2spec/$S) diff --git a/configs/mainnet.yaml b/configs/mainnet.yaml index 1fee9abf6..05cd2c035 100644 --- a/configs/mainnet.yaml +++ b/configs/mainnet.yaml @@ -53,9 +53,9 @@ DENEB_FORK_EPOCH: 18446744073709551615 # EIP6110 EIP6110_FORK_VERSION: 0x05000000 # temporary stub EIP6110_FORK_EPOCH: 18446744073709551615 -# AttSlotRange -ATTSLOTRANGE_FORK_VERSION: 0x05000000 # temporary stub -ATTSLOTRANGE_FORK_EPOCH: 18446744073709551615 +# EIP7045 +EIP7045_FORK_VERSION: 0x05000000 # temporary stub +EIP7045_FORK_EPOCH: 18446744073709551615 # Time parameters diff --git a/configs/minimal.yaml b/configs/minimal.yaml index acc685480..0c3df50c5 100644 --- a/configs/minimal.yaml +++ b/configs/minimal.yaml @@ -52,9 +52,9 @@ DENEB_FORK_EPOCH: 18446744073709551615 # EIP6110 EIP6110_FORK_VERSION: 0x05000001 EIP6110_FORK_EPOCH: 18446744073709551615 -# AttSlotRange -ATTSLOTRANGE_FORK_VERSION: 0x05000001 -ATTSLOTRANGE_FORK_EPOCH: 18446744073709551615 +# EIP7045 +EIP7045_FORK_VERSION: 0x05000001 +EIP7045_FORK_EPOCH: 18446744073709551615 diff --git a/setup.py b/setup.py index 23c4ac19c..5492c7c47 100644 --- a/setup.py +++ b/setup.py @@ -48,7 +48,7 @@ BELLATRIX = 'bellatrix' CAPELLA = 'capella' DENEB = 'deneb' EIP6110 = 'eip6110' -ATTSLOTRANGE= 'attslotrange' +EIP7045= 'eip7045' # The helper functions that are used when defining constants @@ -682,10 +682,10 @@ from eth2spec.deneb import {preset_name} as deneb ''' # -# AttSlotRangeSpecBuilder +# EIP7045SpecBuilder # -class AttSlotRangeSpecBuilder(DenebSpecBuilder): - fork: str = ATTSLOTRANGE +class EIP7045SpecBuilder(DenebSpecBuilder): + fork: str = EIP7045 @classmethod def imports(cls, preset_name: str): @@ -695,7 +695,7 @@ from eth2spec.deneb import {preset_name} as deneb all_builders = ( Phase0SpecBuilder, AltairSpecBuilder, BellatrixSpecBuilder, CapellaSpecBuilder, DenebSpecBuilder, - EIP6110SpecBuilder, AttSlotRangeSpecBuilder, + EIP6110SpecBuilder, EIP7045SpecBuilder, ) spec_builders = {builder.fork: builder for builder in all_builders} @@ -995,14 +995,14 @@ class PySpecCommand(Command): if len(self.md_doc_paths) == 0: print("no paths were specified, using default markdown file paths for pyspec" " build (spec fork: %s)" % self.spec_fork) - if self.spec_fork in (PHASE0, ALTAIR, BELLATRIX, CAPELLA, DENEB, EIP6110, ATTSLOTRANGE): + if self.spec_fork in (PHASE0, ALTAIR, BELLATRIX, CAPELLA, DENEB, EIP6110, EIP7045): self.md_doc_paths = """ specs/phase0/beacon-chain.md specs/phase0/fork-choice.md specs/phase0/validator.md specs/phase0/weak-subjectivity.md """ - if self.spec_fork in (ALTAIR, BELLATRIX, CAPELLA, DENEB, EIP6110, ATTSLOTRANGE): + if self.spec_fork in (ALTAIR, BELLATRIX, CAPELLA, DENEB, EIP6110, EIP7045): self.md_doc_paths += """ specs/altair/light-client/full-node.md specs/altair/light-client/light-client.md @@ -1014,7 +1014,7 @@ class PySpecCommand(Command): specs/altair/validator.md specs/altair/p2p-interface.md """ - if self.spec_fork in (BELLATRIX, CAPELLA, DENEB, EIP6110, ATTSLOTRANGE): + if self.spec_fork in (BELLATRIX, CAPELLA, DENEB, EIP6110, EIP7045): self.md_doc_paths += """ specs/bellatrix/beacon-chain.md specs/bellatrix/fork.md @@ -1023,7 +1023,7 @@ class PySpecCommand(Command): specs/bellatrix/p2p-interface.md sync/optimistic.md """ - if self.spec_fork in (CAPELLA, DENEB, EIP6110, ATTSLOTRANGE): + if self.spec_fork in (CAPELLA, DENEB, EIP6110, EIP7045): self.md_doc_paths += """ specs/capella/light-client/fork.md specs/capella/light-client/full-node.md @@ -1035,7 +1035,7 @@ class PySpecCommand(Command): specs/capella/validator.md specs/capella/p2p-interface.md """ - if self.spec_fork in (DENEB, EIP6110, ATTSLOTRANGE): + if self.spec_fork in (DENEB, EIP6110, EIP7045): self.md_doc_paths += """ specs/deneb/light-client/fork.md specs/deneb/light-client/full-node.md @@ -1057,10 +1057,10 @@ class PySpecCommand(Command): specs/_features/eip6110/beacon-chain.md specs/_features/eip6110/fork.md """ - if self.spec_fork == ATTSLOTRANGE: + if self.spec_fork == EIP7045: self.md_doc_paths += """ - specs/_features/attslotrange/beacon-chain.md - specs/_features/attslotrange/fork.md + specs/_features/eip7045/beacon-chain.md + specs/_features/eip7045/fork.md """ if len(self.md_doc_paths) == 0: diff --git a/specs/_features/attslotrange/beacon-chain.md b/specs/_features/eip7045/beacon-chain.md similarity index 94% rename from specs/_features/attslotrange/beacon-chain.md rename to specs/_features/eip7045/beacon-chain.md index 7ab6475ff..9429b102e 100644 --- a/specs/_features/attslotrange/beacon-chain.md +++ b/specs/_features/eip7045/beacon-chain.md @@ -59,7 +59,7 @@ def get_attestation_participation_flag_indices(state: BeaconState, participation_flag_indices = [] if is_matching_source and inclusion_delay <= integer_squareroot(SLOTS_PER_EPOCH): participation_flag_indices.append(TIMELY_SOURCE_FLAG_INDEX) - if is_matching_target: # [Modified in AttSlotRange] + if is_matching_target: # [Modified in EIP7045] participation_flag_indices.append(TIMELY_TARGET_FLAG_INDEX) if is_matching_head and inclusion_delay == MIN_ATTESTATION_INCLUSION_DELAY: participation_flag_indices.append(TIMELY_HEAD_FLAG_INDEX) @@ -80,7 +80,7 @@ def process_attestation(state: BeaconState, attestation: Attestation) -> None: data = attestation.data assert data.target.epoch in (get_previous_epoch(state), get_current_epoch(state)) assert data.target.epoch == compute_epoch_at_slot(data.slot) - assert data.slot + MIN_ATTESTATION_INCLUSION_DELAY <= state.slot # [Modified in AttSlotRange] + assert data.slot + MIN_ATTESTATION_INCLUSION_DELAY <= state.slot # [Modified in EIP7045] assert data.index < get_committee_count_per_slot(state, data.target.epoch) committee = get_beacon_committee(state, data.slot, data.index) @@ -113,9 +113,9 @@ def process_attestation(state: BeaconState, attestation: Attestation) -> None: ## Testing -*Note*: The function `initialize_beacon_state_from_eth1` is modified for pure AttSlotRange testing only. +*Note*: The function `initialize_beacon_state_from_eth1` is modified for pure EIP7045 testing only. Modifications include: -1. Use `ATTSLOTRANGE_FORK_VERSION` as the previous and current fork version. +1. Use `EIP7045_FORK_VERSION` as the previous and current fork version. ```python def initialize_beacon_state_from_eth1(eth1_block_hash: Hash32, @@ -124,8 +124,8 @@ def initialize_beacon_state_from_eth1(eth1_block_hash: Hash32, execution_payload_header: ExecutionPayloadHeader=ExecutionPayloadHeader() ) -> BeaconState: fork = Fork( - previous_version=ATTSLOTRANGE_FORK_VERSION, # [Modified in AttSlotRange] for testing only - current_version=ATTSLOTRANGE_FORK_VERSION, # [Modified in AttSlotRange] + previous_version=EIP7045_FORK_VERSION, # [Modified in EIP7045] for testing only + current_version=EIP7045_FORK_VERSION, # [Modified in EIP7045] epoch=GENESIS_EPOCH, ) state = BeaconState( diff --git a/specs/_features/attslotrange/fork.md b/specs/_features/eip7045/fork.md similarity index 81% rename from specs/_features/attslotrange/fork.md rename to specs/_features/eip7045/fork.md index 3d8454c2a..42b14b170 100644 --- a/specs/_features/attslotrange/fork.md +++ b/specs/_features/eip7045/fork.md @@ -12,7 +12,7 @@ - [Helper functions](#helper-functions) - [Misc](#misc) - [Modified `compute_fork_version`](#modified-compute_fork_version) -- [Fork to AttSlotRange](#fork-to-attslotrange) +- [Fork to EIP7045](#fork-to-eip7045) - [Fork trigger](#fork-trigger) - [Upgrading the state](#upgrading-the-state) @@ -28,8 +28,8 @@ Warning: this configuration is not definitive. | Name | Value | | - | - | -| `ATTSLOTRANGE_FORK_VERSION` | `Version('0x05000000')` | -| `ATTSLOTRANGE_FORK_EPOCH` | `Epoch(18446744073709551615)` **TBD** | +| `EIP7045_FORK_VERSION` | `Version('0x05000000')` | +| `EIP7045_FORK_EPOCH` | `Epoch(18446744073709551615)` **TBD** | ## Helper functions @@ -42,8 +42,8 @@ def compute_fork_version(epoch: Epoch) -> Version: """ Return the fork version at the given ``epoch``. """ - if epoch >= ATTSLOTRANGE_FORK_EPOCH: - return ATTSLOTRANGE_FORK_VERSION + if epoch >= EIP7045_FORK_EPOCH: + return EIP7045_FORK_VERSION if epoch >= DENEB_FORK_EPOCH: return DENEB_FORK_VERSION if epoch >= CAPELLA_FORK_EPOCH: @@ -55,22 +55,22 @@ def compute_fork_version(epoch: Epoch) -> Version: return GENESIS_FORK_VERSION ``` -## Fork to AttSlotRange +## Fork to EIP7045 ### Fork trigger TBD. This fork is defined for testing purposes, the EIP may be combined with other consensus-layer upgrade. -For now, we assume the condition will be triggered at epoch `ATTSLOTRANGE_FORK_EPOCH`. +For now, we assume the condition will be triggered at epoch `EIP7045_FORK_EPOCH`. -Note that for the pure AttSlotRange networks, we don't apply `upgrade_to_attslotrange` since it starts with AttSlotRange version logic. +Note that for the pure EIP7045 networks, we don't apply `upgrade_to_eip7045` since it starts with EIP7045 version logic. ### Upgrading the state -If `state.slot % SLOTS_PER_EPOCH == 0` and `compute_epoch_at_slot(state.slot) == ATTSLOTRANGE_FORK_EPOCH, -an irregular state change is made to upgrade to AttSlotRange. +If `state.slot % SLOTS_PER_EPOCH == 0` and `compute_epoch_at_slot(state.slot) == EIP7045_FORK_EPOCH, +an irregular state change is made to upgrade to EIP7045. ```python -def upgrade_to_attslotrange(pre: deneb.BeaconState) -> BeaconState: +def upgrade_to_eip7045(pre: deneb.BeaconState) -> BeaconState: post = BeaconState( # Versioning genesis_time=pre.genesis_time, @@ -78,7 +78,7 @@ def upgrade_to_attslotrange(pre: deneb.BeaconState) -> BeaconState: slot=pre.slot, fork=Fork( previous_version=pre.fork.current_version, - current_version=ATTSLOTRANGE_FORK_VERSION, # [Modified in Att-Slot-Range] + current_version=EIP7045_FORK_VERSION, # [Modified in Att-Slot-Range] epoch=deneb.get_current_epoch(pre), ), # History diff --git a/specs/_features/attslotrange/p2p-interface.md b/specs/_features/eip7045/p2p-interface.md similarity index 95% rename from specs/_features/attslotrange/p2p-interface.md rename to specs/_features/eip7045/p2p-interface.md index c21da01ff..8e263bcee 100644 --- a/specs/_features/attslotrange/p2p-interface.md +++ b/specs/_features/eip7045/p2p-interface.md @@ -1,6 +1,6 @@ -# AttSlotRange -- Networking +# EIP7045 -- Networking -This document contains the consensus-layer networking specification for AttSlotRange. +This document contains the consensus-layer networking specification for EIP7045. The specification of these changes continues in the same format as the network specifications of previous upgrades, and assumes them as pre-requisite. @@ -10,7 +10,7 @@ The specification of these changes continues in the same format as the network s -- [Modifications in AttSlotRange](#modifications-in-attslotrange) +- [Modifications in EIP7045](#modifications-in-eip7045) - [The gossip domain: gossipsub](#the-gossip-domain-gossipsub) - [Topics and messages](#topics-and-messages) - [Global topics](#global-topics) @@ -21,7 +21,7 @@ The specification of these changes continues in the same format as the network s -## Modifications in AttSlotRange +## Modifications in EIP7045 ### The gossip domain: gossipsub diff --git a/tests/core/pyspec/eth2spec/test/context.py b/tests/core/pyspec/eth2spec/test/context.py index 37a6e6eab..f3241fd56 100644 --- a/tests/core/pyspec/eth2spec/test/context.py +++ b/tests/core/pyspec/eth2spec/test/context.py @@ -9,13 +9,13 @@ from eth2spec.bellatrix import mainnet as spec_bellatrix_mainnet, minimal as spe from eth2spec.capella import mainnet as spec_capella_mainnet, minimal as spec_capella_minimal 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.attslotrange import mainnet as spec_attslotrange_mainnet, minimal as spec_attslotrange_minimal +from eth2spec.eip7045 import mainnet as spec_eip7045_mainnet, minimal as spec_eip7045_minimal from eth2spec.utils import bls from .exceptions import SkippedTest from .helpers.constants import ( PHASE0, ALTAIR, BELLATRIX, CAPELLA, DENEB, - EIP6110, ATTSLOTRANGE, + EIP6110, EIP7045, MINIMAL, MAINNET, ALL_PHASES, ALL_FORK_UPGRADES, @@ -83,7 +83,7 @@ spec_targets: Dict[PresetBaseName, Dict[SpecForkName, Spec]] = { CAPELLA: spec_capella_minimal, DENEB: spec_deneb_minimal, EIP6110: spec_eip6110_minimal, - ATTSLOTRANGE: spec_attslotrange_minimal, + EIP7045: spec_eip7045_minimal, }, MAINNET: { PHASE0: spec_phase0_mainnet, @@ -92,7 +92,7 @@ spec_targets: Dict[PresetBaseName, Dict[SpecForkName, Spec]] = { CAPELLA: spec_capella_mainnet, DENEB: spec_deneb_mainnet, EIP6110: spec_eip6110_mainnet, - ATTSLOTRANGE: spec_attslotrange_mainnet, + EIP7045: spec_eip7045_mainnet, }, } @@ -436,9 +436,9 @@ with_bellatrix_and_later = with_all_phases_from(BELLATRIX) with_capella_and_later = with_all_phases_from(CAPELLA) with_deneb_and_later = with_all_phases_from(DENEB) with_eip6110_and_later = with_all_phases_from(EIP6110) -with_attslotrange_and_later = with_all_phases_from(ATTSLOTRANGE) +with_eip7045_and_later = with_all_phases_from(EIP7045) -with_all_phases_except_attslotrange = with_all_phases_except(ATTSLOTRANGE) +with_all_phases_except_eip7045 = with_all_phases_except(EIP7045) def _get_preset_targets(kw): diff --git a/tests/core/pyspec/eth2spec/test/helpers/attestations.py b/tests/core/pyspec/eth2spec/test/helpers/attestations.py index ffa0c6c6c..b1f60feb4 100644 --- a/tests/core/pyspec/eth2spec/test/helpers/attestations.py +++ b/tests/core/pyspec/eth2spec/test/helpers/attestations.py @@ -5,7 +5,7 @@ from typing import List from eth2spec.test.context import expect_assertion_error from eth2spec.test.helpers.state import state_transition_and_sign_block, next_epoch, next_slot from eth2spec.test.helpers.block import build_empty_block_for_next_slot -from eth2spec.test.helpers.forks import is_post_altair, is_post_attslotrange +from eth2spec.test.helpers.forks import is_post_altair, is_post_eip7045 from eth2spec.test.helpers.keys import privkeys from eth2spec.utils import bls from eth2spec.utils.ssz.ssz_typing import Bitlist @@ -159,7 +159,7 @@ def get_attestation_signature(spec, state, attestation_data, privkey): def compute_max_inclusion_slot(spec, attestation): - if is_post_attslotrange(spec): + if is_post_eip7045(spec): next_epoch = spec.compute_epoch_at_slot(attestation.data.slot) + 1 end_of_next_epoch = spec.compute_start_slot_at_epoch(next_epoch + 1) - 1 return end_of_next_epoch diff --git a/tests/core/pyspec/eth2spec/test/helpers/constants.py b/tests/core/pyspec/eth2spec/test/helpers/constants.py index a3339305e..7882a15eb 100644 --- a/tests/core/pyspec/eth2spec/test/helpers/constants.py +++ b/tests/core/pyspec/eth2spec/test/helpers/constants.py @@ -16,14 +16,14 @@ SHARDING = SpecForkName('sharding') CUSTODY_GAME = SpecForkName('custody_game') DAS = SpecForkName('das') EIP6110 = SpecForkName('eip6110') -ATTSLOTRANGE = SpecForkName('attslotrange') +EIP7045 = SpecForkName('eip7045') # The forks that pytest can run with. ALL_PHASES = ( # Formal forks PHASE0, ALTAIR, BELLATRIX, CAPELLA, DENEB, # Experimental patches - EIP6110, ATTSLOTRANGE, + EIP6110, EIP7045, ) # The forks that output to the test vectors. TESTGEN_FORKS = (PHASE0, ALTAIR, BELLATRIX, CAPELLA, DENEB, EIP6110) diff --git a/tests/core/pyspec/eth2spec/test/helpers/fork_transition.py b/tests/core/pyspec/eth2spec/test/helpers/fork_transition.py index 76b332728..cf7aeb93a 100644 --- a/tests/core/pyspec/eth2spec/test/helpers/fork_transition.py +++ b/tests/core/pyspec/eth2spec/test/helpers/fork_transition.py @@ -16,7 +16,7 @@ from eth2spec.test.helpers.constants import ( CAPELLA, DENEB, EIP6110, - ATTSLOTRANGE, + EIP7045, ) from eth2spec.test.helpers.deposits import ( prepare_state_and_deposit, @@ -162,8 +162,8 @@ def do_fork(state, spec, post_spec, fork_epoch, with_block=True, sync_aggregate= state = post_spec.upgrade_to_deneb(state) elif post_spec.fork == EIP6110: state = post_spec.upgrade_to_eip6110(state) - elif post_spec.fork == ATTSLOTRANGE: - state = post_spec.upgrade_to_attslotrange(state) + elif post_spec.fork == EIP7045: + state = post_spec.upgrade_to_eip7045(state) assert state.fork.epoch == fork_epoch @@ -182,9 +182,9 @@ def do_fork(state, spec, post_spec, fork_epoch, with_block=True, sync_aggregate= elif post_spec.fork == EIP6110: assert state.fork.previous_version == post_spec.config.DENEB_FORK_VERSION assert state.fork.current_version == post_spec.config.EIP6110_FORK_VERSION - elif post_spec.fork == ATTSLOTRANGE: + elif post_spec.fork == EIP7045: assert state.fork.previous_version == post_spec.config.DENEB_FORK_VERSION - assert state.fork.current_version == post_spec.config.ATTSLOTRANGE_FORK_VERSION + assert state.fork.current_version == post_spec.config.EIP7045_FORK_VERSION if with_block: return state, _state_transition_and_sign_block_at_slot( diff --git a/tests/core/pyspec/eth2spec/test/helpers/forks.py b/tests/core/pyspec/eth2spec/test/helpers/forks.py index 35c265ebb..ddd3b795b 100644 --- a/tests/core/pyspec/eth2spec/test/helpers/forks.py +++ b/tests/core/pyspec/eth2spec/test/helpers/forks.py @@ -1,12 +1,12 @@ from .constants import ( PHASE0, ALTAIR, BELLATRIX, CAPELLA, DENEB, - EIP6110, ATTSLOTRANGE, + EIP6110, EIP7045, ) def is_post_fork(a, b): - if a == ATTSLOTRANGE: - return b in [PHASE0, ALTAIR, BELLATRIX, CAPELLA, DENEB, ATTSLOTRANGE] + if a == EIP7045: + return b in [PHASE0, ALTAIR, BELLATRIX, CAPELLA, DENEB, EIP7045] if a == EIP6110: return b in [PHASE0, ALTAIR, BELLATRIX, CAPELLA, DENEB, EIP6110] if a == DENEB: @@ -42,5 +42,5 @@ def is_post_eip6110(spec): return is_post_fork(spec.fork, EIP6110) -def is_post_attslotrange(spec): - return is_post_fork(spec.fork, ATTSLOTRANGE) +def is_post_eip7045(spec): + return is_post_fork(spec.fork, EIP7045) diff --git a/tests/core/pyspec/eth2spec/test/helpers/genesis.py b/tests/core/pyspec/eth2spec/test/helpers/genesis.py index e3649b8e9..eab4abec8 100644 --- a/tests/core/pyspec/eth2spec/test/helpers/genesis.py +++ b/tests/core/pyspec/eth2spec/test/helpers/genesis.py @@ -1,5 +1,5 @@ from eth2spec.test.helpers.constants import ( - ALTAIR, BELLATRIX, CAPELLA, DENEB, EIP6110, ATTSLOTRANGE, + ALTAIR, BELLATRIX, CAPELLA, DENEB, EIP6110, EIP7045, ) from eth2spec.test.helpers.execution_payload import ( compute_el_header_block_hash, @@ -86,9 +86,9 @@ def create_genesis_state(spec, validator_balances, activation_threshold): elif spec.fork == EIP6110: previous_version = spec.config.DENEB_FORK_VERSION current_version = spec.config.EIP6110_FORK_VERSION - elif spec.fork == ATTSLOTRANGE: + elif spec.fork == EIP7045: previous_version = spec.config.DENEB_FORK_VERSION - current_version = spec.config.ATTSLOTRANGE_FORK_VERSION + current_version = spec.config.EIP7045_FORK_VERSION state = spec.BeaconState( genesis_time=0,