Rename eip7668 to eip7514

This commit is contained in:
dapplion 2023-09-14 13:44:32 +02:00
parent 28286e7e5f
commit 19bf51dd93
15 changed files with 52 additions and 52 deletions

View File

@ -56,9 +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
# EIP7514
EIP7514_FORK_VERSION: 0x05000000 # temporary stub
EIP7514_FORK_EPOCH: 18446744073709551615
# WHISK
WHISK_FORK_VERSION: 0x06000000 # temporary stub
WHISK_FORK_EPOCH: 18446744073709551615
@ -150,5 +150,5 @@ WHISK_EPOCHS_PER_SHUFFLING_PHASE: 256
# `Epoch(2)`
WHISK_PROPOSER_SELECTION_GAP: 2
# EIP7668
# EIP7514
MAX_PER_EPOCH_ACTIVATION_CHURN_LIMIT: 12

View File

@ -55,9 +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
# EIP7514
EIP7514_FORK_VERSION: 0x05000001 # temporary stub
EIP7514_FORK_EPOCH: 18446744073709551615
# WHISK
WHISK_FORK_VERSION: 0x06000001
WHISK_FORK_EPOCH: 18446744073709551615
@ -149,6 +149,6 @@ BLOB_SIDECAR_SUBNET_COUNT: 6
WHISK_EPOCHS_PER_SHUFFLING_PHASE: 4
WHISK_PROPOSER_SELECTION_GAP: 1
# EIP7668
# EIP7514
# [customized]
MAX_PER_EPOCH_ACTIVATION_CHURN_LIMIT: 4

View File

@ -6,7 +6,7 @@ CAPELLA = 'capella'
DENEB = 'deneb'
EIP6110 = 'eip6110'
EIP7002 = 'eip7002'
EIP7668 = 'eip7668'
EIP7514 = 'eip7514'
WHISK = 'whisk'

View File

@ -9,7 +9,7 @@ from .constants import (
EIP6110,
WHISK,
EIP7002,
EIP7668,
EIP7514,
)
@ -22,7 +22,7 @@ PREVIOUS_FORK_OF = {
EIP6110: DENEB,
WHISK: CAPELLA,
EIP7002: CAPELLA,
EIP7668: CAPELLA,
EIP7514: CAPELLA,
}
ALL_FORKS = list(PREVIOUS_FORK_OF.keys())

View File

@ -5,7 +5,7 @@ from .capella import CapellaSpecBuilder
from .deneb import DenebSpecBuilder
from .eip6110 import EIP6110SpecBuilder
from .eip7002 import EIP7002SpecBuilder
from .eip7668 import EIP7668SpecBuilder
from .eip7514 import EIP7514SpecBuilder
from .whisk import WhiskSpecBuilder
@ -13,6 +13,6 @@ spec_builders = {
builder.fork: builder
for builder in (
Phase0SpecBuilder, AltairSpecBuilder, BellatrixSpecBuilder, CapellaSpecBuilder, DenebSpecBuilder,
EIP6110SpecBuilder, EIP7002SpecBuilder, EIP7668SpecBuilder, WhiskSpecBuilder,
EIP6110SpecBuilder, EIP7002SpecBuilder, EIP7514SpecBuilder, WhiskSpecBuilder,
)
}

View File

@ -1,9 +1,9 @@
from .base import BaseSpecBuilder
from ..constants import EIP7668
from ..constants import EIP7514
class EIP7668SpecBuilder(BaseSpecBuilder):
fork: str = EIP7668
class EIP7514SpecBuilder(BaseSpecBuilder):
fork: str = EIP7514
@classmethod
def imports(cls, preset_name: str):

View File

@ -1,4 +1,4 @@
EIP-7668 -- The Beacon Chain
EIP-7514 -- The Beacon Chain
## Table of contents
@ -53,7 +53,7 @@ def get_validator_activation_churn_limit(state: BeaconState) -> uint64:
#### Registry updates
Note: The function `process_registry_updates` is modified to utilize `get_validator_inbound_churn_limit()` the rate limit the activation queue for EIP-7668.
Note: The function `process_registry_updates` is modified to utilize `get_validator_inbound_churn_limit()` the rate limit the activation queue for EIP-7514.
```python
def process_registry_updates(state: BeaconState) -> None:
@ -75,7 +75,7 @@ def process_registry_updates(state: BeaconState) -> None:
# Order by the sequence of activation_eligibility_epoch setting and then index
], key=lambda index: (state.validators[index].activation_eligibility_epoch, index))
# Dequeued validators for activation up to churn limit
# [Modified in EIP7668]
# [Modified in EIP7514]
for index in activation_queue[:get_validator_activation_churn_limit(state)]:
validator = state.validators[index]
validator.activation_epoch = compute_activation_exit_epoch(get_current_epoch(state))

View File

@ -1,4 +1,4 @@
# EIP-7668 -- Fork Logic
# EIP-7514 -- Fork Logic
**Notice**: This document is a work-in-progress for researchers and implementers.
@ -12,7 +12,7 @@
- [Helper functions](#helper-functions)
- [Misc](#misc)
- [Modified `compute_fork_version`](#modified-compute_fork_version)
- [Fork to EIP-7668](#fork-to-eip-7668)
- [Fork to EIP-7514](#fork-to-eip-7514)
- [Fork trigger](#fork-trigger)
- [Upgrading the state](#upgrading-the-state)
@ -20,7 +20,7 @@
## Introduction
This document describes the process of EIP-7668 upgrade.
This document describes the process of EIP-7514 upgrade.
## Configuration
@ -28,8 +28,8 @@ Warning: this configuration is not definitive.
| Name | Value |
| - | - |
| `EIP7668_FORK_VERSION` | `Version('0x05000000')` |
| `EIP7668_FORK_EPOCH` | `Epoch(18446744073709551615)` **TBD** |
| `EIP7514_FORK_VERSION` | `Version('0x05000000')` |
| `EIP7514_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 >= EIP7668_FORK_EPOCH:
return EIP7668_FORK_VERSION
if epoch >= EIP7514_FORK_EPOCH:
return EIP7514_FORK_VERSION
if epoch >= CAPELLA_FORK_EPOCH:
return CAPELLA_FORK_VERSION
if epoch >= BELLATRIX_FORK_EPOCH:
@ -53,22 +53,22 @@ def compute_fork_version(epoch: Epoch) -> Version:
return GENESIS_FORK_VERSION
```
## Fork to EIP-7668
## Fork to EIP-7514
### 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 `EIP7668_FORK_EPOCH`.
For now, we assume the condition will be triggered at epoch `EIP7514_FORK_EPOCH`.
Note that for the pure EIP-7668 networks, we don't apply `upgrade_to_eip7668` since it starts with EIP-7668 version logic.
Note that for the pure EIP-7514 networks, we don't apply `upgrade_to_eip7514` since it starts with EIP-7514 version logic.
### Upgrading the state
If `state.slot % SLOTS_PER_EPOCH == 0` and `compute_epoch_at_slot(state.slot) == EIP7668_FORK_EPOCH`,
an irregular state change is made to upgrade to EIP-7668.
If `state.slot % SLOTS_PER_EPOCH == 0` and `compute_epoch_at_slot(state.slot) == EIP7514_FORK_EPOCH`,
an irregular state change is made to upgrade to EIP-7514.
```python
def upgrade_to_eip7668(pre: capella.BeaconState) -> BeaconState:
def upgrade_to_eip7514(pre: capella.BeaconState) -> BeaconState:
epoch = capella.get_current_epoch(pre)
latest_execution_payload_header = ExecutionPayloadHeader(
parent_hash=pre.latest_execution_payload_header.parent_hash,
@ -94,7 +94,7 @@ def upgrade_to_eip7668(pre: capella.BeaconState) -> BeaconState:
slot=pre.slot,
fork=Fork(
previous_version=pre.fork.current_version,
current_version=EIP7668_FORK_VERSION, # [Modified in EIP-7668]
current_version=EIP7514_FORK_VERSION, # [Modified in EIP-7514]
epoch=epoch,
),
# History

View File

@ -10,13 +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.eip7514 import mainnet as spec_eip7514_mainnet, minimal as spec_eip7514_minimal
from eth2spec.utils import bls
from .exceptions import SkippedTest
from .helpers.constants import (
PHASE0, ALTAIR, BELLATRIX, CAPELLA, DENEB,
EIP6110, EIP7002, EIP7668,
EIP6110, EIP7002, EIP7514,
MINIMAL, MAINNET,
ALL_PHASES,
ALL_FORK_UPGRADES,
@ -86,7 +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,
EIP7514: spec_eip7514_minimal,
},
MAINNET: {
PHASE0: spec_phase0_mainnet,
@ -96,7 +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,
EIP7514: spec_eip7514_mainnet,
},
}
@ -568,7 +568,7 @@ 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_eip7002_and_later = with_all_phases_from(EIP7002)
with_eip7668_and_later = with_all_phases_from(EIP7668)
with_eip7514_and_later = with_all_phases_from(EIP7514)
class quoted_str(str):

View File

@ -1,7 +1,7 @@
from eth2spec.test.helpers.keys import pubkeys
from eth2spec.test.helpers.constants import MINIMAL
from eth2spec.test.context import (
with_eip7668_and_later,
with_eip7514_and_later,
spec_test,
spec_state_test,
single_phase,
@ -54,7 +54,7 @@ def run_test_inbound_churn_limit(spec, state):
assert state.validators[index].activation_epoch == spec.FAR_FUTURE_EPOCH
@with_eip7668_and_later
@with_eip7514_and_later
@with_presets([MINIMAL],
reason="mainnet config leads to larger validator set than limit of public/private keys pre-generated")
@spec_test
@ -67,7 +67,7 @@ def test_inbound_churn_limit__greater_than_inbound_limit(spec, state):
yield from run_test_inbound_churn_limit(spec, state)
@with_eip7668_and_later
@with_eip7514_and_later
@with_presets([MINIMAL],
reason="mainnet config leads to larger validator set than limit of public/private keys pre-generated")
@spec_test
@ -80,7 +80,7 @@ def test_inbound_churn_limit__equal_to_inbound_limit(spec, state):
yield from run_test_inbound_churn_limit(spec, state)
@with_eip7668_and_later
@with_eip7514_and_later
@with_presets([MINIMAL],
reason="mainnet config leads to larger validator set than limit of public/private keys pre-generated")
@spec_state_test

View File

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

View File

@ -1,12 +1,12 @@
from .constants import (
PHASE0, ALTAIR, BELLATRIX, CAPELLA, DENEB,
EIP6110, EIP7002, EIP7668,
EIP6110, EIP7002, EIP7514,
)
def is_post_fork(a, b):
if a == EIP7668:
return b in [PHASE0, ALTAIR, BELLATRIX, CAPELLA, EIP7668]
if a == EIP7514:
return b in [PHASE0, ALTAIR, BELLATRIX, CAPELLA, EIP7514]
if a == EIP7002:
return b in [PHASE0, ALTAIR, BELLATRIX, CAPELLA, EIP7002]
if a == EIP6110:
@ -48,5 +48,5 @@ def is_post_eip7002(spec):
return is_post_fork(spec.fork, EIP7002)
def is_post_eip7668(spec):
return is_post_fork(spec.fork, EIP7668)
def is_post_eip7514(spec):
return is_post_fork(spec.fork, EIP7514)

View File

@ -1,5 +1,5 @@
from eth2spec.test.helpers.constants import (
ALTAIR, BELLATRIX, CAPELLA, DENEB, EIP6110, EIP7002, EIP7668,
ALTAIR, BELLATRIX, CAPELLA, DENEB, EIP6110, EIP7002, EIP7514,
)
from eth2spec.test.helpers.execution_payload import (
compute_el_header_block_hash,
@ -93,9 +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:
elif spec.fork == EIP7514:
previous_version = spec.config.CAPELLA_FORK_VERSION
current_version = spec.config.EIP7668_FORK_VERSION
current_version = spec.config.EIP7514_FORK_VERSION
state = spec.BeaconState(
genesis_time=0,