Skip to content

Commit

Permalink
Rename EIP6110 to Electra
Browse files Browse the repository at this point in the history
  • Loading branch information
hwwhww committed Mar 6, 2024
1 parent 1a33bf8 commit 6ffd27b
Show file tree
Hide file tree
Showing 37 changed files with 109 additions and 109 deletions.
6 changes: 3 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ jobs:
command: make citest fork=deneb
- store_test_results:
path: tests/core/pyspec/test-reports
test-eip6110:
test-electra:
docker:
- image: circleci/python:3.9
working_directory: ~/specs-repo
Expand All @@ -165,7 +165,7 @@ jobs:
- restore_pyspec_cached_venv
- run:
name: Run py-tests
command: make citest fork=eip6110
command: make citest fork=electra
- store_test_results:
path: tests/core/pyspec/test-reports
test-eip7002:
Expand Down Expand Up @@ -327,7 +327,7 @@ workflows:
- test-deneb:
requires:
- install_pyspec_test
- test-eip6110:
- test-electra:
requires:
- install_pyspec_test
- test-eip7002:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ jobs:
needs: [preclear,lint,codespell,table_of_contents]
strategy:
matrix:
version: ["phase0", "altair", "bellatrix", "capella", "deneb", "eip6110", "eip7002", "whisk", "eip7594"]
version: ["phase0", "altair", "bellatrix", "capella", "deneb", "electra", "eip7002", "whisk", "eip7594"]
steps:
- name: Checkout this repo
uses: actions/[email protected]
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ tests/core/pyspec/eth2spec/altair/
tests/core/pyspec/eth2spec/bellatrix/
tests/core/pyspec/eth2spec/capella/
tests/core/pyspec/eth2spec/deneb/
tests/core/pyspec/eth2spec/eip6110/
tests/core/pyspec/eth2spec/electra/
tests/core/pyspec/eth2spec/eip7002/
tests/core/pyspec/eth2spec/whisk/
tests/core/pyspec/eth2spec/eip7594/
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ MARKDOWN_FILES = $(wildcard $(SPEC_DIR)/*/*.md) \
$(wildcard $(SPEC_DIR)/_features/*/*/*.md) \
$(wildcard $(SSZ_DIR)/*.md)

ALL_EXECUTABLE_SPEC_NAMES = phase0 altair bellatrix capella deneb eip6110 eip7002 whisk
ALL_EXECUTABLE_SPEC_NAMES = phase0 altair bellatrix capella deneb electra eip7002 whisk
# The parameters for commands. Use `foreach` to avoid listing specs again.
COVERAGE_SCOPE := $(foreach S,$(ALL_EXECUTABLE_SPEC_NAMES), --cov=eth2spec.$S.$(TEST_PRESET_TYPE))
PYLINT_SCOPE := $(foreach S,$(ALL_EXECUTABLE_SPEC_NAMES), ./eth2spec/$S)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Features are researched and developed in parallel, and then consolidated into se
| Sharding (outdated) | <ul><li>Core</li><ul><li>[Beacon Chain changes](specs/_features/sharding/beacon-chain.md)</li></ul><li>Additions</li><ul><li>[P2P networking](specs/_features/sharding/p2p-interface.md)</li></ul></ul> |
| Custody Game (outdated) | <ul><li>Core</li><ul><li>[Beacon Chain changes](specs/_features/custody_game/beacon-chain.md)</li></ul><li>Additions</li><ul><li>[Honest validator guide changes](specs/_features/custody_game/validator.md)</li></ul></ul> | Dependent on sharding |
| Data Availability Sampling (outdated) | <ul><li>Core</li><ul><li>[Core types and functions](specs/_features/das/das-core.md)</li><li>[Fork choice changes](specs/_features/das/fork-choice.md)</li></ul><li>Additions</li><ul><li>[P2P Networking](specs/_features/das/p2p-interface.md)</li><li>[Sampling process](specs/_features/das/sampling.md)</li></ul></ul> | <ul><li> Dependent on sharding</li><li>[Technical explainer](https://hackmd.io/@HWeNw8hNRimMm2m2GH56Cw/B1YJPGkpD)</li></ul> |
| EIP-6110 | <ul><li>Core</li><ul><li>[Beacon Chain changes](specs/_features/eip6110//beacon-chain.md)</li><li>[EIP-6110 fork](specs/_features/eip6110/fork.md)</li></ul><li>Additions</li><ul><li>[Honest validator guide changes](specs/_features/eip6110/validator.md)</li></ul></ul> |
| EIP-6110 | <ul><li>Core</li><ul><li>[Beacon Chain changes](specs/_features/electra//beacon-chain.md)</li><li>[EIP-6110 fork](specs/_features/electra/fork.md)</li></ul><li>Additions</li><ul><li>[Honest validator guide changes](specs/_features/electra/validator.md)</li></ul></ul> |

### Accompanying documents can be found in [specs](specs) and include:

Expand Down
6 changes: 3 additions & 3 deletions configs/mainnet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ CAPELLA_FORK_EPOCH: 194048 # April 12, 2023, 10:27:35pm UTC
# Deneb
DENEB_FORK_VERSION: 0x04000000
DENEB_FORK_EPOCH: 269568 # March 13, 2024, 01:55:35pm UTC
# EIP6110
EIP6110_FORK_VERSION: 0x05000000 # temporary stub
EIP6110_FORK_EPOCH: 18446744073709551615
# Electra
ELECTRA_FORK_VERSION: 0x05000000 # temporary stub
ELECTRA_FORK_EPOCH: 18446744073709551615
# EIP7002
EIP7002_FORK_VERSION: 0x05000000 # temporary stub
EIP7002_FORK_EPOCH: 18446744073709551615
Expand Down
6 changes: 3 additions & 3 deletions configs/minimal.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ CAPELLA_FORK_EPOCH: 18446744073709551615
# DENEB
DENEB_FORK_VERSION: 0x04000001
DENEB_FORK_EPOCH: 18446744073709551615
# EIP6110
EIP6110_FORK_VERSION: 0x05000001
EIP6110_FORK_EPOCH: 18446744073709551615
# ELECTRA
ELECTRA_FORK_VERSION: 0x05000001
ELECTRA_FORK_EPOCH: 18446744073709551615
# EIP7002
EIP7002_FORK_VERSION: 0x05000001
EIP7002_FORK_EPOCH: 18446744073709551615
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Mainnet preset - EIP6110
# Mainnet preset - ELECTRA

# Execution
# ---------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Minimal preset - EIP6110
# Minimal preset - Electra

# Execution
# ---------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion pysetup/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
BELLATRIX = 'bellatrix'
CAPELLA = 'capella'
DENEB = 'deneb'
EIP6110 = 'eip6110'
ELECTRA = 'electra'
EIP7002 = 'eip7002'
WHISK = 'whisk'
EIP7594 = 'eip7594'
Expand Down
4 changes: 2 additions & 2 deletions pysetup/md_doc_paths.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
BELLATRIX,
CAPELLA,
DENEB,
EIP6110,
ELECTRA,
WHISK,
EIP7002,
EIP7594,
Expand All @@ -19,7 +19,7 @@
BELLATRIX: ALTAIR,
CAPELLA: BELLATRIX,
DENEB: CAPELLA,
EIP6110: DENEB,
ELECTRA: DENEB,
WHISK: CAPELLA,
EIP7002: CAPELLA,
EIP7594: DENEB,
Expand Down
4 changes: 2 additions & 2 deletions pysetup/spec_builders/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from .bellatrix import BellatrixSpecBuilder
from .capella import CapellaSpecBuilder
from .deneb import DenebSpecBuilder
from .eip6110 import EIP6110SpecBuilder
from .electra import ElectraSpecBuilder
from .eip7002 import EIP7002SpecBuilder
from .whisk import WhiskSpecBuilder
from .eip7594 import EIP7594SpecBuilder
Expand All @@ -13,6 +13,6 @@
builder.fork: builder
for builder in (
Phase0SpecBuilder, AltairSpecBuilder, BellatrixSpecBuilder, CapellaSpecBuilder, DenebSpecBuilder,
EIP6110SpecBuilder, EIP7002SpecBuilder, WhiskSpecBuilder, EIP7594SpecBuilder,
ElectraSpecBuilder, EIP7002SpecBuilder, WhiskSpecBuilder, EIP7594SpecBuilder,
)
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
from .base import BaseSpecBuilder
from ..constants import EIP6110
from ..constants import ELECTRA


class EIP6110SpecBuilder(BaseSpecBuilder):
fork: str = EIP6110
class ElectraSpecBuilder(BaseSpecBuilder):
fork: str = ELECTRA

@classmethod
def imports(cls, preset_name: str):
Expand Down
2 changes: 1 addition & 1 deletion scripts/build_run_docker_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@


# Set variables
ALL_EXECUTABLE_SPECS=("phase0" "altair" "bellatrix" "capella" "deneb" "eip6110" "whisk")
ALL_EXECUTABLE_SPECS=("phase0" "altair" "bellatrix" "capella" "deneb" "electra" "whisk")
TEST_PRESET_TYPE=minimal
FORK_TO_TEST=phase0
NUMBER_OF_CORES=4
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ def process_execution_payload(state: BeaconState, body: BeaconBlockBody, executi

*Note*: The function `initialize_beacon_state_from_eth1` is modified for pure EIP-6110 testing only.
Modifications include:
1. Use `EIP6110_FORK_VERSION` as the previous and current fork version.
1. Use `ELECTRA_FORK_VERSION` as the previous and current fork version.
2. Utilize the EIP-6110 `BeaconBlockBody` when constructing the initial `latest_block_header`.
3. Add `deposit_receipts_start_index` variable to the genesis state initialization.

Expand All @@ -295,8 +295,8 @@ def initialize_beacon_state_from_eth1(eth1_block_hash: Hash32,
execution_payload_header: ExecutionPayloadHeader=ExecutionPayloadHeader()
) -> BeaconState:
fork = Fork(
previous_version=EIP6110_FORK_VERSION, # [Modified in EIP6110] for testing only
current_version=EIP6110_FORK_VERSION, # [Modified in EIP6110]
previous_version=ELECTRA_FORK_VERSION, # [Modified in EIP6110] for testing only
current_version=ELECTRA_FORK_VERSION, # [Modified in EIP6110]
epoch=GENESIS_EPOCH,
)
state = BeaconState(
Expand Down
18 changes: 9 additions & 9 deletions specs/_features/eip6110/fork.md → specs/electra/fork.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ Warning: this configuration is not definitive.

| Name | Value |
| - | - |
| `EIP6110_FORK_VERSION` | `Version('0x05000000')` |
| `EIP6110_FORK_EPOCH` | `Epoch(18446744073709551615)` **TBD** |
| `ELECTRA_FORK_VERSION` | `Version('0x05000000')` |
| `ELECTRA_FORK_EPOCH` | `Epoch(18446744073709551615)` **TBD** |

## Helper functions

Expand All @@ -42,8 +42,8 @@ def compute_fork_version(epoch: Epoch) -> Version:
"""
Return the fork version at the given ``epoch``.
"""
if epoch >= EIP6110_FORK_EPOCH:
return EIP6110_FORK_VERSION
if epoch >= ELECTRA_FORK_EPOCH:
return ELECTRA_FORK_VERSION
if epoch >= DENEB_FORK_EPOCH:
return DENEB_FORK_VERSION
if epoch >= CAPELLA_FORK_EPOCH:
Expand All @@ -60,17 +60,17 @@ def compute_fork_version(epoch: Epoch) -> Version:
### 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 `EIP6110_FORK_EPOCH`.
For now, we assume the condition will be triggered at epoch `ELECTRA_FORK_EPOCH`.

Note that for the pure EIP-6110 networks, we don't apply `upgrade_to_eip6110` since it starts with EIP-6110 version logic.
Note that for the pure EIP-6110 networks, we don't apply `upgrade_to_electra` since it starts with EIP-6110 version logic.

### Upgrading the state

If `state.slot % SLOTS_PER_EPOCH == 0` and `compute_epoch_at_slot(state.slot) == EIP6110_FORK_EPOCH`,
If `state.slot % SLOTS_PER_EPOCH == 0` and `compute_epoch_at_slot(state.slot) == ELECTRA_FORK_EPOCH`,
an irregular state change is made to upgrade to EIP-6110.

```python
def upgrade_to_eip6110(pre: deneb.BeaconState) -> BeaconState:
def upgrade_to_electra(pre: deneb.BeaconState) -> BeaconState:
epoch = deneb.get_current_epoch(pre)
latest_execution_payload_header = ExecutionPayloadHeader(
parent_hash=pre.latest_execution_payload_header.parent_hash,
Expand Down Expand Up @@ -99,7 +99,7 @@ def upgrade_to_eip6110(pre: deneb.BeaconState) -> BeaconState:
slot=pre.slot,
fork=Fork(
previous_version=pre.fork.current_version,
current_version=EIP6110_FORK_VERSION, # [Modified in EIP-6110]
current_version=ELECTRA_FORK_VERSION, # [Modified in EIP-6110]
epoch=epoch,
),
# History
Expand Down
File renamed without changes.
6 changes: 3 additions & 3 deletions tests/core/pyspec/eth2spec/test/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@

from .exceptions import SkippedTest
from .helpers.constants import (
PHASE0, ALTAIR, BELLATRIX, CAPELLA, DENEB,
EIP6110, EIP7002, EIP7594,
PHASE0, ALTAIR, BELLATRIX, CAPELLA, DENEB, ELECTRA,
EIP7002, EIP7594,
WHISK,
MINIMAL,
ALL_PHASES,
Expand Down Expand Up @@ -507,7 +507,7 @@ def wrapper(*args, spec: Spec, **kw):
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_electra_and_later = with_all_phases_from(ELECTRA)
with_eip7002_and_later = with_all_phases_from(EIP7002)
with_whisk_and_later = with_all_phases_from(WHISK, all_phases=ALLOWED_TEST_RUNNER_FORKS)
with_eip7594_and_later = with_all_phases_from(EIP7594, all_phases=ALLOWED_TEST_RUNNER_FORKS)
Expand Down
Loading

0 comments on commit 6ffd27b

Please sign in to comment.