use definitive EIP number

This commit is contained in:
Potuz 2024-07-03 08:27:20 -03:00
parent 181ce5e9dc
commit a11ffb5278
15 changed files with 68 additions and 68 deletions

View File

@ -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 electra whisk eip6800 eipxxxx
ALL_EXECUTABLE_SPEC_NAMES = phase0 altair bellatrix capella deneb electra whisk eip6800 eip7732
# 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)

View File

@ -1,8 +1,8 @@
# Mainnet preset - EIPXXXX
# Mainnet preset - EIP7732
# Execution
# ---------------------------------------------------------------
# 2**9 (= 512)
PTC_SIZE: 512
# 2**2 (= 4)
MAX_PAYLOAD_ATTESTATIONS: 4
MAX_PAYLOAD_ATTESTATIONS: 4

View File

@ -1,4 +1,4 @@
# Minimal preset - EIPXXXX
# Minimal preset - EIP7732
# Execution
# ---------------------------------------------------------------

View File

@ -8,7 +8,7 @@ ELECTRA = 'electra'
EIP7594 = 'eip7594'
EIP6800 = 'eip6800'
WHISK = 'whisk'
EIPXXXX = 'eipxxxx'
EIP7732 = 'eip7732'
# The helper functions that are used when defining constants

View File

@ -10,7 +10,7 @@ from .constants import (
WHISK,
EIP7594,
EIP6800,
EIPXXXX,
EIP7732,
)
@ -24,7 +24,7 @@ PREVIOUS_FORK_OF = {
WHISK: CAPELLA,
EIP7594: DENEB,
EIP6800: DENEB,
EIPXXXX: ELECTRA,
EIP7732: ELECTRA,
}
ALL_FORKS = list(PREVIOUS_FORK_OF.keys())

View File

@ -7,13 +7,13 @@ from .electra import ElectraSpecBuilder
from .whisk import WhiskSpecBuilder
from .eip7594 import EIP7594SpecBuilder
from .eip6800 import EIP6800SpecBuilder
from .eipxxxx import EIPXXXXSpecBuilder
from .eip7732 import EIP7732SpecBuilder
spec_builders = {
builder.fork: builder
for builder in (
Phase0SpecBuilder, AltairSpecBuilder, BellatrixSpecBuilder, CapellaSpecBuilder, DenebSpecBuilder,
ElectraSpecBuilder, WhiskSpecBuilder, EIP7594SpecBuilder, EIP6800SpecBuilder, EIPXXXXSpecBuilder,
ElectraSpecBuilder, WhiskSpecBuilder, EIP7594SpecBuilder, EIP6800SpecBuilder, EIP7732SpecBuilder,
)
}

View File

@ -1,11 +1,11 @@
from typing import Dict
from .base import BaseSpecBuilder
from ..constants import EIPXXXX
from ..constants import EIP7732
class EIPXXXXSpecBuilder(BaseSpecBuilder):
fork: str = EIPXXXX
class EIP7732SpecBuilder(BaseSpecBuilder):
fork: str = EIP7732
@classmethod
def imports(cls, preset_name: str):
@ -18,4 +18,4 @@ from eth2spec.electra import {preset_name} as electra
return {
'PTC_SIZE': spec_object.preset_vars['PTC_SIZE'].value,
'MAX_PAYLOAD_ATTESTATIONS': spec_object.preset_vars['MAX_PAYLOAD_ATTESTATIONS'].value,
}
}

View File

@ -1,4 +1,4 @@
# EIP-XXXX -- The Beacon Chain
# EIP-7732 -- The Beacon Chain
## Table of contents
@ -80,20 +80,20 @@ At any given slot, the status of the blockchain's head may be either
| Name | Value |
| - | - |
| `PTC_SIZE` | `uint64(2**9)` (=512) # (New in EIP-XXXX) |
| `PTC_SIZE` | `uint64(2**9)` (=512) # (New in EIP-7732) |
### Domain types
| Name | Value |
| - | - |
| `DOMAIN_BEACON_BUILDER` | `DomainType('0x1B000000')` # (New in EIP-XXXX)|
| `DOMAIN_PTC_ATTESTER` | `DomainType('0x0C000000')` # (New in EIP-XXXX)|
| `DOMAIN_BEACON_BUILDER` | `DomainType('0x1B000000')` # (New in EIP-7732)|
| `DOMAIN_PTC_ATTESTER` | `DomainType('0x0C000000')` # (New in EIP-7732)|
### Max operations per block
| Name | Value |
| - | - |
| `MAX_PAYLOAD_ATTESTATIONS` | `2**2` (= 4) # (New in EIP-XXXX) |
| `MAX_PAYLOAD_ATTESTATIONS` | `2**2` (= 4) # (New in EIP-7732) |
## Containers
@ -182,12 +182,12 @@ class BeaconBlockBody(Container):
voluntary_exits: List[SignedVoluntaryExit, MAX_VOLUNTARY_EXITS]
sync_aggregate: SyncAggregate
# Execution
# Removed execution_payload [Removed in EIP-XXXX]
# Removed blob_kzg_commitments [Removed in EIP-XXXX]
# Removed execution_payload [Removed in EIP-7732]
# Removed blob_kzg_commitments [Removed in EIP-7732]
bls_to_execution_changes: List[SignedBLSToExecutionChange, MAX_BLS_TO_EXECUTION_CHANGES]
# PBS
signed_execution_payload_header: SignedExecutionPayloadHeader # [New in EIP-XXXX]
payload_attestations: List[PayloadAttestation, MAX_PAYLOAD_ATTESTATIONS] # [New in EIP-XXXX]
signed_execution_payload_header: SignedExecutionPayloadHeader # [New in EIP-7732]
payload_attestations: List[PayloadAttestation, MAX_PAYLOAD_ATTESTATIONS] # [New in EIP-7732]
```
#### `ExecutionPayloadHeader`
@ -262,9 +262,9 @@ class BeaconState(Container):
pending_partial_withdrawals: List[PendingPartialWithdrawal, PENDING_PARTIAL_WITHDRAWALS_LIMIT]
pending_consolidations: List[PendingConsolidation, PENDING_CONSOLIDATIONS_LIMIT]
# PBS
latest_block_hash: Hash32 # [New in EIP-XXXX]
latest_full_slot: Slot # [New in EIP-XXXX]
latest_withdrawals_root: Root # [New in EIP-XXXX]
latest_block_hash: Hash32 # [New in EIP-7732]
latest_full_slot: Slot # [New in EIP-7732]
latest_withdrawals_root: Root # [New in EIP-7732]
```
## Helper functions
@ -394,7 +394,7 @@ def get_indexed_payload_attestation(state: BeaconState, slot: Slot,
## Beacon chain state transition function
*Note*: state transition is fundamentally modified in EIP-XXXX. The full state transition is broken in two parts, first importing a signed block and then importing an execution payload.
*Note*: state transition is fundamentally modified in EIP-7732. The full state transition is broken in two parts, first importing a signed block and then importing an execution payload.
The post-state corresponding to a pre-state `state` and a signed beacon block `signed_block` is defined as `state_transition(state, signed_block)`. State transitions that trigger an unhandled exception (e.g. a failed `assert` or an out-of-range list access) are considered invalid. State transitions that cause a `uint64` overflow or underflow are also considered invalid.
@ -405,11 +405,11 @@ The post-state corresponding to a pre-state `state` and a signed execution paylo
```python
def process_block(state: BeaconState, block: BeaconBlock) -> None:
process_block_header(state, block)
process_withdrawals(state) # [Modified in EIP-XXXX]
process_execution_payload_header(state, block) # [Modified in EIP-XXXX, removed process_execution_payload]
process_withdrawals(state) # [Modified in EIP-7732]
process_execution_payload_header(state, block) # [Modified in EIP-7732, removed process_execution_payload]
process_randao(state, block.body)
process_eth1_data(state, block.body)
process_operations(state, block.body) # [Modified in EIP-XXXX]
process_operations(state, block.body) # [Modified in EIP-7732]
process_sync_aggregate(state, block.body.sync_aggregate)
```
@ -505,10 +505,10 @@ def process_operations(state: BeaconState, body: BeaconBlockBody) -> None:
for_ops(body.deposits, process_deposit)
for_ops(body.voluntary_exits, process_voluntary_exit)
for_ops(body.bls_to_execution_changes, process_bls_to_execution_change)
# Removed `process_deposit_request` in EIP-XXXX
# Removed `process_withdrawal_request` in EIP-XXXX
# Removed `process_consolidation_request` in EIP-XXXX
for_ops(body.payload_attestations, process_payload_attestation) # [New in EIP-XXXX]
# Removed `process_deposit_request` in EIP-7732
# Removed `process_withdrawal_request` in EIP-7732
# Removed `process_consolidation_request` in EIP-7732
for_ops(body.payload_attestations, process_payload_attestation) # [New in EIP-7732]
```
##### Payload Attestations

View File

@ -52,7 +52,7 @@ The builder assembles then `signed_execution_payload_header = SignedExecutionPay
### Constructing the `BlobSidecar`s
[Modified in EIP-XXXX]
[Modified in EIP-7732]
The `BlobSidecar` container is modified indirectly because the constant `KZG_COMMITMENT_INCLUSION_PROOF_DEPTH` is modified. Each sidecar is obtained from the modified

View File

@ -45,8 +45,8 @@ This is the modification of the fork choice accompanying the ePBS upgrade.
| Name | Value |
| -------------------- | ----------- |
| `PAYLOAD_TIMELY_THRESHOLD` | `PTC_SIZE / 2` (=`uint64(256)`) |
| `INTERVALS_PER_SLOT` | `4` # [modified in EIP-XXXX] |
| `PROPOSER_SCORE_BOOST` | `20` # [modified in EIP-XXXX] |
| `INTERVALS_PER_SLOT` | `4` # [modified in EIP-7732] |
| `PROPOSER_SCORE_BOOST` | `20` # [modified in EIP-7732] |
| `PAYLOAD_WITHHOLD_BOOST` | `40` |
| `PAYLOAD_REVEAL_BOOST` | `40` |
@ -100,9 +100,9 @@ class Store(object):
unrealized_justified_checkpoint: Checkpoint
unrealized_finalized_checkpoint: Checkpoint
proposer_boost_root: Root
payload_withhold_boost_root: Root # [New in EIP-XXXX]
payload_withhold_boost_full: boolean # [New in EIP-XXXX]
payload_reveal_boost_root: Root # [New in EIP-XXXX]
payload_withhold_boost_root: Root # [New in EIP-7732]
payload_withhold_boost_full: boolean # [New in EIP-7732]
payload_reveal_boost_root: Root # [New in EIP-7732]
equivocating_indices: Set[ValidatorIndex]
blocks: Dict[Root, BeaconBlock] = field(default_factory=dict)
block_states: Dict[Root, BeaconState] = field(default_factory=dict)
@ -110,8 +110,8 @@ class Store(object):
checkpoint_states: Dict[Checkpoint, BeaconState] = field(default_factory=dict)
latest_messages: Dict[ValidatorIndex, LatestMessage] = field(default_factory=dict)
unrealized_justifications: Dict[Root, Checkpoint] = field(default_factory=dict)
execution_payload_states: Dict[Root, BeaconState] = field(default_factory=dict) # [New in EIP-XXXX]
ptc_vote: Dict[Root, Vector[uint8, PTC_SIZE]] = field(default_factory=dict) # [New in EIP-XXXX]
execution_payload_states: Dict[Root, BeaconState] = field(default_factory=dict) # [New in EIP-7732]
ptc_vote: Dict[Root, Vector[uint8, PTC_SIZE]] = field(default_factory=dict) # [New in EIP-7732]
```
### Modified `get_forkchoice_store`
@ -132,9 +132,9 @@ def get_forkchoice_store(anchor_state: BeaconState, anchor_block: BeaconBlock) -
unrealized_justified_checkpoint=justified_checkpoint,
unrealized_finalized_checkpoint=finalized_checkpoint,
proposer_boost_root=proposer_boost_root,
payload_withhold_boost_root=proposer_boost_root, # [New in EIP-XXXX]
payload_withhold_boost_full=True, # [New in EIP-XXXX]
payload_reveal_boost_root=proposer_boost_root, # [New in EIP-XXXX]
payload_withhold_boost_root=proposer_boost_root, # [New in EIP-7732]
payload_withhold_boost_full=True, # [New in EIP-7732]
payload_reveal_boost_root=proposer_boost_root, # [New in EIP-7732]
equivocating_indices=set(),
blocks={anchor_root: copy(anchor_block)},
block_states={anchor_root: copy(anchor_state)},

View File

@ -12,7 +12,7 @@
- [Helper functions](#helper-functions)
- [Misc](#misc)
- [Modified `compute_fork_version`](#modified-compute_fork_version)
- [Fork to EIP-XXXX](#fork-to-eip-xxxx)
- [Fork to EIP-7732](#fork-to-eip-7732)
- [Fork trigger](#fork-trigger)
- [Upgrading the state](#upgrading-the-state)
@ -20,7 +20,7 @@
## Introduction
This document describes the process of the EIP-XXXX upgrade.
This document describes the process of the EIP-7732 upgrade.
## Configuration
@ -57,7 +57,7 @@ def compute_fork_version(epoch: Epoch) -> Version:
return GENESIS_FORK_VERSION
```
## Fork to EIP-XXXX
## Fork to EIP-7732
### Fork trigger
@ -114,7 +114,7 @@ def upgrade_to_epbs(pre: electra.BeaconState) -> BeaconState:
current_sync_committee=pre.current_sync_committee,
next_sync_committee=pre.next_sync_committee,
# Execution-layer
latest_execution_payload_header=ExecutionPayloadHeader(), # [Modified in EIP-XXXX]
latest_execution_payload_header=ExecutionPayloadHeader(), # [Modified in EIP-7732]
# Withdrawals
next_withdrawal_index=pre.next_withdrawal_index,
next_withdrawal_validator_index=pre.next_withdrawal_validator_index,
@ -130,9 +130,9 @@ def upgrade_to_epbs(pre: electra.BeaconState) -> BeaconState:
pending_partial_withdrawals=pre.pending_partial_withdrawals,
pending_consolidations=pre.pending_consolidations,
# ePBS
latest_block_hash=pre.latest_execution_payload_header.block_hash, # [New in EIP-XXXX]
latest_full_slot=pre.slot, # [New in EIP-XXXX]
last_withdrawals_root=Root(), # [New in EIP-XXXX]
latest_block_hash=pre.latest_execution_payload_header.block_hash, # [New in EIP-7732]
latest_full_slot=pre.slot, # [New in EIP-7732]
last_withdrawals_root=Root(), # [New in EIP-7732]
)
return post

View File

@ -5,7 +5,7 @@ This document contains the consensus-layer networking specification for ePBS.
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
- [Modification in EIP-XXXX](#modification-in-eip-xxxx)
- [Modification in EIP-7732](#modification-in-eip-7732)
- [Preset](#preset)
- [Containers](#containers)
- [`BlobSidecar`](#blobsidecar)
@ -27,11 +27,11 @@ This document contains the consensus-layer networking specification for ePBS.
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
## Modification in EIP-XXXX
## Modification in EIP-7732
### Preset
*[Modified in EIP-XXXX]*
*[Modified in EIP-7732]*
| Name | Value | Description |
|------------------------------------------|-----------------------------------|---------------------------------------------------------------------|
@ -58,7 +58,7 @@ class BlobSidecar(Container):
##### Modified `verify_blob_sidecar_inclusion_proof`
`verify_blob_sidecar_inclusion_proof` is modified in EIP-XXXX to account for the fact that the KZG commitments are included in the `ExecutionPayloadEnvelope` and no longer in the beacon block body.
`verify_blob_sidecar_inclusion_proof` is modified in EIP-7732 to account for the fact that the KZG commitments are included in the `ExecutionPayloadEnvelope` and no longer in the beacon block body.
```python
def verify_blob_sidecar_inclusion_proof(blob_sidecar: BlobSidecar) -> bool:
@ -76,7 +76,7 @@ def verify_blob_sidecar_inclusion_proof(blob_sidecar: BlobSidecar) -> bool:
### The gossip domain: gossipsub
Some gossip meshes are upgraded in the fork of EIP-XXXX to support upgraded types.
Some gossip meshes are upgraded in the fork of EIP-7732 to support upgraded types.
#### Topics and messages
@ -85,23 +85,23 @@ Topics follow the same specification as in prior upgrades.
The `beacon_block` topic is updated to support the modified type
| Name | Message Type |
| --- | --- |
| `beacon_block` | `SignedBeaconBlock` [modified in EIP-XXXX] |
| `beacon_block` | `SignedBeaconBlock` [modified in EIP-7732] |
The new topics along with the type of the `data` field of a gossipsub message are given in this table:
| Name | Message Type |
|-------------------------------|------------------------------------------------------|
| `execution_payload_header` | `SignedExecutionPayloadHeader` [New in EIP-XXXX] |
| `execution_payload` | `SignedExecutionPayloadEnvelope` [New in EIP-XXXX] |
| `payload_attestation_message` | `PayloadAttestationMessage` [New in EIP-XXXX] |
| `execution_payload_header` | `SignedExecutionPayloadHeader` [New in EIP-7732] |
| `execution_payload` | `SignedExecutionPayloadEnvelope` [New in EIP-7732] |
| `payload_attestation_message` | `PayloadAttestationMessage` [New in EIP-7732] |
##### Global topics
EIP-XXXX introduces new global topics for execution header, execution payload and payload attestation.
EIP-7732 introduces new global topics for execution header, execution payload and payload attestation.
###### `beacon_block`
[Modified in EIP-XXXX]
[Modified in EIP-7732]
The *type* of the payload of this topic changes to the (modified) `SignedBeaconBlock` found in [the Beacon Chain changes](./beacon-chain.md).

View File

@ -47,7 +47,7 @@ def get_ptc_assignment(
### Lookahead
[New in EIP-XXXX]
[New in EIP-7732]
`get_ptc_assignment` should be called at the start of each epoch to get the assignment for the next epoch (`current_epoch + 1`). A validator should plan for future assignments by noting their assigned PTC slot.

View File

@ -20,7 +20,7 @@ DAS = SpecForkName('das')
ELECTRA = SpecForkName('electra')
WHISK = SpecForkName('whisk')
EIP7594 = SpecForkName('eip7594')
EIPXXXX = SpecForkName('eipxxxx')
EIP7732 = SpecForkName('eip7732')
#
# SpecFork settings
@ -38,12 +38,12 @@ ALL_PHASES = (
ELECTRA,
# Experimental patches
EIP7594,
EIPXXXX,
EIP7732,
)
# The forks that have light client specs
LIGHT_CLIENT_TESTING_FORKS = (*[item for item in MAINNET_FORKS if item != PHASE0],)
# The forks that output to the test vectors.
TESTGEN_FORKS = (*MAINNET_FORKS, ELECTRA, EIP7594, WHISK, EIPXXXX)
TESTGEN_FORKS = (*MAINNET_FORKS, ELECTRA, EIP7594, WHISK, EIP7732)
# Forks allowed in the test runner `--fork` flag, to fail fast in case of typos
ALLOWED_TEST_RUNNER_FORKS = (*ALL_PHASES, WHISK)
@ -59,7 +59,7 @@ PREVIOUS_FORK_OF = {
# Experimental patches
WHISK: CAPELLA,
EIP7594: DENEB,
EIPXXXX: ELECTRA,
EIP7732: ELECTRA,
}
# For fork transition tests
@ -70,7 +70,7 @@ POST_FORK_OF = {
BELLATRIX: CAPELLA,
CAPELLA: DENEB,
DENEB: ELECTRA,
ELECTRA: EIPXXXX,
ELECTRA: EIP7732,
}
ALL_PRE_POST_FORKS = POST_FORK_OF.items()