From a80a7775896c7cd8d9ae077be383ac23c3e68a4b Mon Sep 17 00:00:00 2001 From: Alex Stokes Date: Sat, 6 Apr 2024 11:15:03 -0600 Subject: [PATCH] add missing extended types for EIP-7251 --- specs/_features/eip7251/beacon-chain.md | 55 +++++++++++++++++++++++++ 1 file changed, 55 insertions(+) diff --git a/specs/_features/eip7251/beacon-chain.md b/specs/_features/eip7251/beacon-chain.md index 5a99ad4d4..8434e8378 100644 --- a/specs/_features/eip7251/beacon-chain.md +++ b/specs/_features/eip7251/beacon-chain.md @@ -30,6 +30,8 @@ - [Extended Containers](#extended-containers) - [`BeaconState`](#beaconstate) - [`BeaconBlockBody`](#beaconblockbody) + - [`ExecutionPayload`](#executionpayload) + - [`ExecutionPayloadHeader`](#executionpayloadheader) - [Helpers](#helpers) - [Predicates](#predicates) - [Updated `is_eligible_for_activation_queue`](#updated-is_eligible_for_activation_queue) @@ -136,6 +138,7 @@ The following values are (non-configurable) constants used throughout the specif | Name | Value | Description | | - | - | - | +| `MAX_WITHDRAWAL_REQUESTS_PER_PAYLOAD` | `uint64(16)` | | `MAX_PARTIAL_WITHDRAWALS_PER_PAYLOAD` | `uint64(2**3)` (= 8) | Maximum amount of partial withdrawals allowed in each payload | ### State list lengths @@ -288,6 +291,58 @@ class BeaconBlockBody(Container): consolidations: List[SignedConsolidation, MAX_CONSOLIDATIONS] # [New in EIP-7251] ``` +#### `ExecutionPayload` + +```python +class ExecutionPayload(Container): + # Execution block header fields + parent_hash: Hash32 + fee_recipient: ExecutionAddress # 'beneficiary' in the yellow paper + state_root: Bytes32 + receipts_root: Bytes32 + logs_bloom: ByteVector[BYTES_PER_LOGS_BLOOM] + prev_randao: Bytes32 # 'difficulty' in the yellow paper + block_number: uint64 # 'number' in the yellow paper + gas_limit: uint64 + gas_used: uint64 + timestamp: uint64 + extra_data: ByteList[MAX_EXTRA_DATA_BYTES] + base_fee_per_gas: uint256 + # Extra payload fields + block_hash: Hash32 # Hash of execution block + transactions: List[Transaction, MAX_TRANSACTIONS_PER_PAYLOAD] + withdrawals: List[Withdrawal, MAX_WITHDRAWALS_PER_PAYLOAD] + blob_gas_used: uint64 + excess_blob_gas: uint64 + withdraw_requests: List[ExecutionLayerWithdrawRequest, MAX_WITHDRAWAL_REQUESTS_PER_PAYLOAD] # [New in EIP-7251] +``` + +#### `ExecutionPayloadHeader` + +```python +class ExecutionPayloadHeader(Container): + # Execution block header fields + parent_hash: Hash32 + fee_recipient: ExecutionAddress + state_root: Bytes32 + receipts_root: Bytes32 + logs_bloom: ByteVector[BYTES_PER_LOGS_BLOOM] + prev_randao: Bytes32 + block_number: uint64 + gas_limit: uint64 + gas_used: uint64 + timestamp: uint64 + extra_data: ByteList[MAX_EXTRA_DATA_BYTES] + base_fee_per_gas: uint256 + # Extra payload fields + block_hash: Hash32 # Hash of execution block + transactions_root: Root + withdrawals_root: Root + blob_gas_used: uint64 + excess_blob_gas: uint64 + withdraw_requests_root: Root # [New in EIP-7251] +``` + ## Helpers ### Predicates