attslotrange -> eip-7045

This commit is contained in:
djrtwo 2023-05-18 10:49:57 -06:00
parent f967567ec7
commit 6679b8a1ae
15 changed files with 69 additions and 69 deletions

View File

@ -168,7 +168,7 @@ jobs:
command: make citest fork=eip6110 command: make citest fork=eip6110
- store_test_results: - store_test_results:
path: tests/core/pyspec/test-reports path: tests/core/pyspec/test-reports
test-attslotrange: test-eip7045:
docker: docker:
- image: circleci/python:3.8 - image: circleci/python:3.8
working_directory: ~/specs-repo working_directory: ~/specs-repo
@ -178,7 +178,7 @@ jobs:
- restore_pyspec_cached_venv - restore_pyspec_cached_venv
- run: - run:
name: Run py-tests name: Run py-tests
command: make citest fork=attslotrange command: make citest fork=eip7045
- store_test_results: - store_test_results:
path: tests/core/pyspec/test-reports path: tests/core/pyspec/test-reports
@ -305,7 +305,7 @@ workflows:
- test-eip6110: - test-eip6110:
requires: requires:
- install_pyspec_test - install_pyspec_test
- test-attslotrange: - test-eip7045:
requires: requires:
- install_pyspec_test - install_pyspec_test
- table_of_contents - table_of_contents

2
.gitignore vendored
View File

@ -22,7 +22,7 @@ tests/core/pyspec/eth2spec/bellatrix/
tests/core/pyspec/eth2spec/capella/ tests/core/pyspec/eth2spec/capella/
tests/core/pyspec/eth2spec/deneb/ tests/core/pyspec/eth2spec/deneb/
tests/core/pyspec/eth2spec/eip6110/ tests/core/pyspec/eth2spec/eip6110/
tests/core/pyspec/eth2spec/attslotrange/ tests/core/pyspec/eth2spec/eip7045/
# coverage reports # coverage reports
.htmlcov .htmlcov

View File

@ -34,7 +34,7 @@ MARKDOWN_FILES = $(wildcard $(SPEC_DIR)/*/*.md) \
$(wildcard $(SPEC_DIR)/_features/*/*/*.md) \ $(wildcard $(SPEC_DIR)/_features/*/*/*.md) \
$(wildcard $(SSZ_DIR)/*.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. # The parameters for commands. Use `foreach` to avoid listing specs again.
COVERAGE_SCOPE := $(foreach S,$(ALL_EXECUTABLE_SPECS), --cov=eth2spec.$S.$(TEST_PRESET_TYPE)) COVERAGE_SCOPE := $(foreach S,$(ALL_EXECUTABLE_SPECS), --cov=eth2spec.$S.$(TEST_PRESET_TYPE))
PYLINT_SCOPE := $(foreach S,$(ALL_EXECUTABLE_SPECS), ./eth2spec/$S) PYLINT_SCOPE := $(foreach S,$(ALL_EXECUTABLE_SPECS), ./eth2spec/$S)

View File

@ -53,9 +53,9 @@ DENEB_FORK_EPOCH: 18446744073709551615
# EIP6110 # EIP6110
EIP6110_FORK_VERSION: 0x05000000 # temporary stub EIP6110_FORK_VERSION: 0x05000000 # temporary stub
EIP6110_FORK_EPOCH: 18446744073709551615 EIP6110_FORK_EPOCH: 18446744073709551615
# AttSlotRange # EIP7045
ATTSLOTRANGE_FORK_VERSION: 0x05000000 # temporary stub EIP7045_FORK_VERSION: 0x05000000 # temporary stub
ATTSLOTRANGE_FORK_EPOCH: 18446744073709551615 EIP7045_FORK_EPOCH: 18446744073709551615
# Time parameters # Time parameters

View File

@ -52,9 +52,9 @@ DENEB_FORK_EPOCH: 18446744073709551615
# EIP6110 # EIP6110
EIP6110_FORK_VERSION: 0x05000001 EIP6110_FORK_VERSION: 0x05000001
EIP6110_FORK_EPOCH: 18446744073709551615 EIP6110_FORK_EPOCH: 18446744073709551615
# AttSlotRange # EIP7045
ATTSLOTRANGE_FORK_VERSION: 0x05000001 EIP7045_FORK_VERSION: 0x05000001
ATTSLOTRANGE_FORK_EPOCH: 18446744073709551615 EIP7045_FORK_EPOCH: 18446744073709551615

View File

@ -48,7 +48,7 @@ BELLATRIX = 'bellatrix'
CAPELLA = 'capella' CAPELLA = 'capella'
DENEB = 'deneb' DENEB = 'deneb'
EIP6110 = 'eip6110' EIP6110 = 'eip6110'
ATTSLOTRANGE= 'attslotrange' EIP7045= 'eip7045'
# The helper functions that are used when defining constants # 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): class EIP7045SpecBuilder(DenebSpecBuilder):
fork: str = ATTSLOTRANGE fork: str = EIP7045
@classmethod @classmethod
def imports(cls, preset_name: str): def imports(cls, preset_name: str):
@ -695,7 +695,7 @@ from eth2spec.deneb import {preset_name} as deneb
all_builders = ( all_builders = (
Phase0SpecBuilder, AltairSpecBuilder, BellatrixSpecBuilder, CapellaSpecBuilder, DenebSpecBuilder, Phase0SpecBuilder, AltairSpecBuilder, BellatrixSpecBuilder, CapellaSpecBuilder, DenebSpecBuilder,
EIP6110SpecBuilder, AttSlotRangeSpecBuilder, EIP6110SpecBuilder, EIP7045SpecBuilder,
) )
spec_builders = {builder.fork: builder for builder in all_builders} spec_builders = {builder.fork: builder for builder in all_builders}
@ -995,14 +995,14 @@ class PySpecCommand(Command):
if len(self.md_doc_paths) == 0: if len(self.md_doc_paths) == 0:
print("no paths were specified, using default markdown file paths for pyspec" print("no paths were specified, using default markdown file paths for pyspec"
" build (spec fork: %s)" % self.spec_fork) " 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 = """ self.md_doc_paths = """
specs/phase0/beacon-chain.md specs/phase0/beacon-chain.md
specs/phase0/fork-choice.md specs/phase0/fork-choice.md
specs/phase0/validator.md specs/phase0/validator.md
specs/phase0/weak-subjectivity.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 += """ self.md_doc_paths += """
specs/altair/light-client/full-node.md specs/altair/light-client/full-node.md
specs/altair/light-client/light-client.md specs/altair/light-client/light-client.md
@ -1014,7 +1014,7 @@ class PySpecCommand(Command):
specs/altair/validator.md specs/altair/validator.md
specs/altair/p2p-interface.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 += """ self.md_doc_paths += """
specs/bellatrix/beacon-chain.md specs/bellatrix/beacon-chain.md
specs/bellatrix/fork.md specs/bellatrix/fork.md
@ -1023,7 +1023,7 @@ class PySpecCommand(Command):
specs/bellatrix/p2p-interface.md specs/bellatrix/p2p-interface.md
sync/optimistic.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 += """ self.md_doc_paths += """
specs/capella/light-client/fork.md specs/capella/light-client/fork.md
specs/capella/light-client/full-node.md specs/capella/light-client/full-node.md
@ -1035,7 +1035,7 @@ class PySpecCommand(Command):
specs/capella/validator.md specs/capella/validator.md
specs/capella/p2p-interface.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 += """ self.md_doc_paths += """
specs/deneb/light-client/fork.md specs/deneb/light-client/fork.md
specs/deneb/light-client/full-node.md specs/deneb/light-client/full-node.md
@ -1057,10 +1057,10 @@ class PySpecCommand(Command):
specs/_features/eip6110/beacon-chain.md specs/_features/eip6110/beacon-chain.md
specs/_features/eip6110/fork.md specs/_features/eip6110/fork.md
""" """
if self.spec_fork == ATTSLOTRANGE: if self.spec_fork == EIP7045:
self.md_doc_paths += """ self.md_doc_paths += """
specs/_features/attslotrange/beacon-chain.md specs/_features/eip7045/beacon-chain.md
specs/_features/attslotrange/fork.md specs/_features/eip7045/fork.md
""" """
if len(self.md_doc_paths) == 0: if len(self.md_doc_paths) == 0:

View File

@ -59,7 +59,7 @@ def get_attestation_participation_flag_indices(state: BeaconState,
participation_flag_indices = [] participation_flag_indices = []
if is_matching_source and inclusion_delay <= integer_squareroot(SLOTS_PER_EPOCH): if is_matching_source and inclusion_delay <= integer_squareroot(SLOTS_PER_EPOCH):
participation_flag_indices.append(TIMELY_SOURCE_FLAG_INDEX) 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) participation_flag_indices.append(TIMELY_TARGET_FLAG_INDEX)
if is_matching_head and inclusion_delay == MIN_ATTESTATION_INCLUSION_DELAY: if is_matching_head and inclusion_delay == MIN_ATTESTATION_INCLUSION_DELAY:
participation_flag_indices.append(TIMELY_HEAD_FLAG_INDEX) participation_flag_indices.append(TIMELY_HEAD_FLAG_INDEX)
@ -80,7 +80,7 @@ def process_attestation(state: BeaconState, attestation: Attestation) -> None:
data = attestation.data data = attestation.data
assert data.target.epoch in (get_previous_epoch(state), get_current_epoch(state)) 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.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) assert data.index < get_committee_count_per_slot(state, data.target.epoch)
committee = get_beacon_committee(state, data.slot, data.index) committee = get_beacon_committee(state, data.slot, data.index)
@ -113,9 +113,9 @@ def process_attestation(state: BeaconState, attestation: Attestation) -> None:
## Testing ## 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: 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 ```python
def initialize_beacon_state_from_eth1(eth1_block_hash: Hash32, 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() execution_payload_header: ExecutionPayloadHeader=ExecutionPayloadHeader()
) -> BeaconState: ) -> BeaconState:
fork = Fork( fork = Fork(
previous_version=ATTSLOTRANGE_FORK_VERSION, # [Modified in AttSlotRange] for testing only previous_version=EIP7045_FORK_VERSION, # [Modified in EIP7045] for testing only
current_version=ATTSLOTRANGE_FORK_VERSION, # [Modified in AttSlotRange] current_version=EIP7045_FORK_VERSION, # [Modified in EIP7045]
epoch=GENESIS_EPOCH, epoch=GENESIS_EPOCH,
) )
state = BeaconState( state = BeaconState(

View File

@ -12,7 +12,7 @@
- [Helper functions](#helper-functions) - [Helper functions](#helper-functions)
- [Misc](#misc) - [Misc](#misc)
- [Modified `compute_fork_version`](#modified-compute_fork_version) - [Modified `compute_fork_version`](#modified-compute_fork_version)
- [Fork to AttSlotRange](#fork-to-attslotrange) - [Fork to EIP7045](#fork-to-eip7045)
- [Fork trigger](#fork-trigger) - [Fork trigger](#fork-trigger)
- [Upgrading the state](#upgrading-the-state) - [Upgrading the state](#upgrading-the-state)
@ -28,8 +28,8 @@ Warning: this configuration is not definitive.
| Name | Value | | Name | Value |
| - | - | | - | - |
| `ATTSLOTRANGE_FORK_VERSION` | `Version('0x05000000')` | | `EIP7045_FORK_VERSION` | `Version('0x05000000')` |
| `ATTSLOTRANGE_FORK_EPOCH` | `Epoch(18446744073709551615)` **TBD** | | `EIP7045_FORK_EPOCH` | `Epoch(18446744073709551615)` **TBD** |
## Helper functions ## Helper functions
@ -42,8 +42,8 @@ def compute_fork_version(epoch: Epoch) -> Version:
""" """
Return the fork version at the given ``epoch``. Return the fork version at the given ``epoch``.
""" """
if epoch >= ATTSLOTRANGE_FORK_EPOCH: if epoch >= EIP7045_FORK_EPOCH:
return ATTSLOTRANGE_FORK_VERSION return EIP7045_FORK_VERSION
if epoch >= DENEB_FORK_EPOCH: if epoch >= DENEB_FORK_EPOCH:
return DENEB_FORK_VERSION return DENEB_FORK_VERSION
if epoch >= CAPELLA_FORK_EPOCH: if epoch >= CAPELLA_FORK_EPOCH:
@ -55,22 +55,22 @@ def compute_fork_version(epoch: Epoch) -> Version:
return GENESIS_FORK_VERSION return GENESIS_FORK_VERSION
``` ```
## Fork to AttSlotRange ## Fork to EIP7045
### Fork trigger ### Fork trigger
TBD. This fork is defined for testing purposes, the EIP may be combined with other consensus-layer upgrade. 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 ### Upgrading the state
If `state.slot % SLOTS_PER_EPOCH == 0` and `compute_epoch_at_slot(state.slot) == ATTSLOTRANGE_FORK_EPOCH, 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 AttSlotRange. an irregular state change is made to upgrade to EIP7045.
```python ```python
def upgrade_to_attslotrange(pre: deneb.BeaconState) -> BeaconState: def upgrade_to_eip7045(pre: deneb.BeaconState) -> BeaconState:
post = BeaconState( post = BeaconState(
# Versioning # Versioning
genesis_time=pre.genesis_time, genesis_time=pre.genesis_time,
@ -78,7 +78,7 @@ def upgrade_to_attslotrange(pre: deneb.BeaconState) -> BeaconState:
slot=pre.slot, slot=pre.slot,
fork=Fork( fork=Fork(
previous_version=pre.fork.current_version, 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), epoch=deneb.get_current_epoch(pre),
), ),
# History # History

View File

@ -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. 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
<!-- START doctoc generated TOC please keep comment here to allow auto update --> <!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE --> <!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
- [Modifications in AttSlotRange](#modifications-in-attslotrange) - [Modifications in EIP7045](#modifications-in-eip7045)
- [The gossip domain: gossipsub](#the-gossip-domain-gossipsub) - [The gossip domain: gossipsub](#the-gossip-domain-gossipsub)
- [Topics and messages](#topics-and-messages) - [Topics and messages](#topics-and-messages)
- [Global topics](#global-topics) - [Global topics](#global-topics)
@ -21,7 +21,7 @@ The specification of these changes continues in the same format as the network s
<!-- END doctoc generated TOC please keep comment here to allow auto update --> <!-- END doctoc generated TOC please keep comment here to allow auto update -->
<!-- /TOC --> <!-- /TOC -->
## Modifications in AttSlotRange ## Modifications in EIP7045
### The gossip domain: gossipsub ### The gossip domain: gossipsub

View File

@ -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.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.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.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 eth2spec.utils import bls
from .exceptions import SkippedTest from .exceptions import SkippedTest
from .helpers.constants import ( from .helpers.constants import (
PHASE0, ALTAIR, BELLATRIX, CAPELLA, DENEB, PHASE0, ALTAIR, BELLATRIX, CAPELLA, DENEB,
EIP6110, ATTSLOTRANGE, EIP6110, EIP7045,
MINIMAL, MAINNET, MINIMAL, MAINNET,
ALL_PHASES, ALL_PHASES,
ALL_FORK_UPGRADES, ALL_FORK_UPGRADES,
@ -83,7 +83,7 @@ spec_targets: Dict[PresetBaseName, Dict[SpecForkName, Spec]] = {
CAPELLA: spec_capella_minimal, CAPELLA: spec_capella_minimal,
DENEB: spec_deneb_minimal, DENEB: spec_deneb_minimal,
EIP6110: spec_eip6110_minimal, EIP6110: spec_eip6110_minimal,
ATTSLOTRANGE: spec_attslotrange_minimal, EIP7045: spec_eip7045_minimal,
}, },
MAINNET: { MAINNET: {
PHASE0: spec_phase0_mainnet, PHASE0: spec_phase0_mainnet,
@ -92,7 +92,7 @@ spec_targets: Dict[PresetBaseName, Dict[SpecForkName, Spec]] = {
CAPELLA: spec_capella_mainnet, CAPELLA: spec_capella_mainnet,
DENEB: spec_deneb_mainnet, DENEB: spec_deneb_mainnet,
EIP6110: spec_eip6110_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_capella_and_later = with_all_phases_from(CAPELLA)
with_deneb_and_later = with_all_phases_from(DENEB) with_deneb_and_later = with_all_phases_from(DENEB)
with_eip6110_and_later = with_all_phases_from(EIP6110) 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): def _get_preset_targets(kw):

View File

@ -5,7 +5,7 @@ from typing import List
from eth2spec.test.context import expect_assertion_error 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.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.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.test.helpers.keys import privkeys
from eth2spec.utils import bls from eth2spec.utils import bls
from eth2spec.utils.ssz.ssz_typing import Bitlist 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): 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 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 end_of_next_epoch = spec.compute_start_slot_at_epoch(next_epoch + 1) - 1
return end_of_next_epoch return end_of_next_epoch

View File

@ -16,14 +16,14 @@ SHARDING = SpecForkName('sharding')
CUSTODY_GAME = SpecForkName('custody_game') CUSTODY_GAME = SpecForkName('custody_game')
DAS = SpecForkName('das') DAS = SpecForkName('das')
EIP6110 = SpecForkName('eip6110') EIP6110 = SpecForkName('eip6110')
ATTSLOTRANGE = SpecForkName('attslotrange') EIP7045 = SpecForkName('eip7045')
# The forks that pytest can run with. # The forks that pytest can run with.
ALL_PHASES = ( ALL_PHASES = (
# Formal forks # Formal forks
PHASE0, ALTAIR, BELLATRIX, CAPELLA, DENEB, PHASE0, ALTAIR, BELLATRIX, CAPELLA, DENEB,
# Experimental patches # Experimental patches
EIP6110, ATTSLOTRANGE, EIP6110, EIP7045,
) )
# The forks that output to the test vectors. # The forks that output to the test vectors.
TESTGEN_FORKS = (PHASE0, ALTAIR, BELLATRIX, CAPELLA, DENEB, EIP6110) TESTGEN_FORKS = (PHASE0, ALTAIR, BELLATRIX, CAPELLA, DENEB, EIP6110)

View File

@ -16,7 +16,7 @@ from eth2spec.test.helpers.constants import (
CAPELLA, CAPELLA,
DENEB, DENEB,
EIP6110, EIP6110,
ATTSLOTRANGE, EIP7045,
) )
from eth2spec.test.helpers.deposits import ( from eth2spec.test.helpers.deposits import (
prepare_state_and_deposit, 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) state = post_spec.upgrade_to_deneb(state)
elif post_spec.fork == EIP6110: elif post_spec.fork == EIP6110:
state = post_spec.upgrade_to_eip6110(state) state = post_spec.upgrade_to_eip6110(state)
elif post_spec.fork == ATTSLOTRANGE: elif post_spec.fork == EIP7045:
state = post_spec.upgrade_to_attslotrange(state) state = post_spec.upgrade_to_eip7045(state)
assert state.fork.epoch == fork_epoch 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: elif post_spec.fork == EIP6110:
assert state.fork.previous_version == post_spec.config.DENEB_FORK_VERSION assert state.fork.previous_version == post_spec.config.DENEB_FORK_VERSION
assert state.fork.current_version == post_spec.config.EIP6110_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.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: if with_block:
return state, _state_transition_and_sign_block_at_slot( return state, _state_transition_and_sign_block_at_slot(

View File

@ -1,12 +1,12 @@
from .constants import ( from .constants import (
PHASE0, ALTAIR, BELLATRIX, CAPELLA, DENEB, PHASE0, ALTAIR, BELLATRIX, CAPELLA, DENEB,
EIP6110, ATTSLOTRANGE, EIP6110, EIP7045,
) )
def is_post_fork(a, b): def is_post_fork(a, b):
if a == ATTSLOTRANGE: if a == EIP7045:
return b in [PHASE0, ALTAIR, BELLATRIX, CAPELLA, DENEB, ATTSLOTRANGE] return b in [PHASE0, ALTAIR, BELLATRIX, CAPELLA, DENEB, EIP7045]
if a == EIP6110: if a == EIP6110:
return b in [PHASE0, ALTAIR, BELLATRIX, CAPELLA, DENEB, EIP6110] return b in [PHASE0, ALTAIR, BELLATRIX, CAPELLA, DENEB, EIP6110]
if a == DENEB: if a == DENEB:
@ -42,5 +42,5 @@ def is_post_eip6110(spec):
return is_post_fork(spec.fork, EIP6110) return is_post_fork(spec.fork, EIP6110)
def is_post_attslotrange(spec): def is_post_eip7045(spec):
return is_post_fork(spec.fork, ATTSLOTRANGE) return is_post_fork(spec.fork, EIP7045)

View File

@ -1,5 +1,5 @@
from eth2spec.test.helpers.constants import ( 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 ( from eth2spec.test.helpers.execution_payload import (
compute_el_header_block_hash, compute_el_header_block_hash,
@ -86,9 +86,9 @@ def create_genesis_state(spec, validator_balances, activation_threshold):
elif spec.fork == EIP6110: elif spec.fork == EIP6110:
previous_version = spec.config.DENEB_FORK_VERSION previous_version = spec.config.DENEB_FORK_VERSION
current_version = spec.config.EIP6110_FORK_VERSION current_version = spec.config.EIP6110_FORK_VERSION
elif spec.fork == ATTSLOTRANGE: elif spec.fork == EIP7045:
previous_version = spec.config.DENEB_FORK_VERSION previous_version = spec.config.DENEB_FORK_VERSION
current_version = spec.config.ATTSLOTRANGE_FORK_VERSION current_version = spec.config.EIP7045_FORK_VERSION
state = spec.BeaconState( state = spec.BeaconState(
genesis_time=0, genesis_time=0,