From b2d6e68e62fe783787d546b91010edc5bd7fd91f Mon Sep 17 00:00:00 2001 From: Hsiao-Wei Wang Date: Wed, 3 Jul 2024 20:49:56 +0800 Subject: [PATCH] Fix and add `EIP7732_FORK_EPOCH` and `EIP7594_FORK_VERSION` --- configs/mainnet.yaml | 3 +++ configs/minimal.yaml | 3 +++ specs/_features/eip7732/fork.md | 14 +++++++------- specs/_features/eip7732/p2p-interface.md | 8 ++++---- 4 files changed, 17 insertions(+), 11 deletions(-) diff --git a/configs/mainnet.yaml b/configs/mainnet.yaml index 7051873ce..cf761c60c 100644 --- a/configs/mainnet.yaml +++ b/configs/mainnet.yaml @@ -59,6 +59,9 @@ EIP7594_FORK_EPOCH: 18446744073709551615 # WHISK WHISK_FORK_VERSION: 0x08000000 # temporary stub WHISK_FORK_EPOCH: 18446744073709551615 +# EIP7732 +EIP7732_FORK_VERSION: 0x09000000 # temporary stub +EIP7732_FORK_EPOCH: 18446744073709551615 # Time parameters # --------------------------------------------------------------- diff --git a/configs/minimal.yaml b/configs/minimal.yaml index 8e2a222d4..dbc46afc1 100644 --- a/configs/minimal.yaml +++ b/configs/minimal.yaml @@ -58,6 +58,9 @@ EIP7594_FORK_EPOCH: 18446744073709551615 # WHISK WHISK_FORK_VERSION: 0x08000001 WHISK_FORK_EPOCH: 18446744073709551615 +# EIP7732 +EIP7732_FORK_VERSION: 0x09000001 +EIP7732_FORK_EPOCH: 18446744073709551615 # Time parameters # --------------------------------------------------------------- diff --git a/specs/_features/eip7732/fork.md b/specs/_features/eip7732/fork.md index a41bd32d2..0212f8fce 100644 --- a/specs/_features/eip7732/fork.md +++ b/specs/_features/eip7732/fork.md @@ -28,8 +28,8 @@ Warning: this configuration is not definitive. | Name | Value | |---------------------| - | -| `EPBS_FORK_VERSION` | `Version('0x06000000')` | -| `EPBS_FORK_EPOCH` | `Epoch(18446744073709551615)` **TBD** | +| `EIP7732_FORK_VERSION` | `Version('0x09000000')` | +| `EIP7732_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 >= EPBS_FORK_EPOCH: - return EPBS_FORK_VERSION + if epoch >= EIP7732_FORK_EPOCH: + return EIP7732_FORK_VERSION if epoch >= ELECTRA_FORK_EPOCH: return ELECTRA_FORK_VERSION if epoch >= DENEB_FORK_EPOCH: @@ -63,11 +63,11 @@ def compute_fork_version(epoch: Epoch) -> Version: 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 `EPBS_FORK_EPOCH`. +For now, we assume the condition will be triggered at epoch `EIP7732_FORK_EPOCH`. ### Upgrading the state -If `state.slot % SLOTS_PER_EPOCH == 0` and `compute_epoch_at_slot(state.slot) == EPBS_FORK_EPOCH`, +If `state.slot % SLOTS_PER_EPOCH == 0` and `compute_epoch_at_slot(state.slot) == EIP7732_FORK_EPOCH`, an irregular state change is made to upgrade to ePBS. ```python @@ -81,7 +81,7 @@ def upgrade_to_epbs(pre: electra.BeaconState) -> BeaconState: slot=pre.slot, fork=Fork( previous_version=pre.fork.current_version, - current_version=EPBS_FORK_EPOCH, # [Modified in ePBS] + current_version=EIP7732_FORK_EPOCH, # [Modified in ePBS] epoch=epoch, ), # History diff --git a/specs/_features/eip7732/p2p-interface.md b/specs/_features/eip7732/p2p-interface.md index 099b40a20..1bb2d19e5 100644 --- a/specs/_features/eip7732/p2p-interface.md +++ b/specs/_features/eip7732/p2p-interface.md @@ -184,7 +184,7 @@ The following validations MUST pass before forwarding the `signed_execution_payl | `BELLATRIX_FORK_VERSION` | `bellatrix.SignedBeaconBlock` | | `CAPELLA_FORK_VERSION` | `capella.SignedBeaconBlock` | | `DENEB_FORK_VERSION` | `deneb.SignedBeaconBlock` | -| `EPBS_FORK_VERSION` | `epbs.SignedBeaconBlock` | +| `EIP7732_FORK_VERSION` | `epbs.SignedBeaconBlock` | ##### BeaconBlocksByRoot v3 @@ -201,7 +201,7 @@ Per `context = compute_fork_digest(fork_version, genesis_validators_root)`: | `BELLATRIX_FORK_VERSION` | `bellatrix.SignedBeaconBlock` | | `CAPELLA_FORK_VERSION` | `capella.SignedBeaconBlock` | | `DENEB_FORK_VERSION` | `deneb.SignedBeaconBlock` | -| `EPBS_FORK_VERSION` | `epbs.SignedBeaconBlock` | +| `EIP7732_FORK_VERSION` | `epbs.SignedBeaconBlock` | ##### BlobSidecarsByRoot v2 @@ -213,7 +213,7 @@ Per `context = compute_fork_digest(fork_version, genesis_validators_root)`: | `fork_version` | Chunk SSZ type | |--------------------------|-------------------------------| | `DENEB_FORK_VERSION` | `deneb.BlobSidecar` | -| `EPBS_FORK_VERSION` | `epbs.BlobSidecar` | +| `EIP7732_FORK_VERSION` | `epbs.BlobSidecar` | ##### ExecutionPayloadEnvelopeByRoot v1 @@ -226,7 +226,7 @@ The `` field is calculated as `context = compute_fork_digest(fork | `fork_version` | Chunk SSZ type | |---------------------|---------------------------------------| -| `EPBS_FORK_VERSION` | `epbs.SignedExecutionPayloadEnvelope` | +| `EIP7732_FORK_VERSION` | `epbs.SignedExecutionPayloadEnvelope` | Request Content: