Skip to content

Commit 31cd9cb

Browse files
authored
Merge pull request ethereum#4023 from ethereum/electra-blob-count
Add EIP-7691: Blob throughput increase
2 parents 554189d + 77cacaa commit 31cd9cb

File tree

13 files changed

+258
-43
lines changed

13 files changed

+258
-43
lines changed

configs/mainnet.yaml

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -144,14 +144,28 @@ ATTESTATION_SUBNET_PREFIX_BITS: 6
144144
# Deneb
145145
# `2**7` (=128)
146146
MAX_REQUEST_BLOCKS_DENEB: 128
147-
# MAX_REQUEST_BLOCKS_DENEB * MAX_BLOBS_PER_BLOCK
148-
MAX_REQUEST_BLOB_SIDECARS: 768
149147
# `2**12` (= 4096 epochs, ~18 days)
150148
MIN_EPOCHS_FOR_BLOB_SIDECARS_REQUESTS: 4096
151149
# `6`
152150
BLOB_SIDECAR_SUBNET_COUNT: 6
153-
## `uint64(6)`
151+
# `uint64(6)`
154152
MAX_BLOBS_PER_BLOCK: 6
153+
# MAX_REQUEST_BLOCKS_DENEB * MAX_BLOBS_PER_BLOCK
154+
MAX_REQUEST_BLOB_SIDECARS: 768
155+
156+
# Electra
157+
# 2**7 * 10**9 (= 128,000,000,000)
158+
MIN_PER_EPOCH_CHURN_LIMIT_ELECTRA: 128000000000
159+
# 2**8 * 10**9 (= 256,000,000,000)
160+
MAX_PER_EPOCH_ACTIVATION_EXIT_CHURN_LIMIT: 256000000000
161+
# `9`
162+
BLOB_SIDECAR_SUBNET_COUNT_ELECTRA: 9
163+
# `uint64(6)`
164+
TARGET_BLOBS_PER_BLOCK_ELECTRA: 6
165+
# `uint64(9)`
166+
MAX_BLOBS_PER_BLOCK_ELECTRA: 9
167+
# MAX_REQUEST_BLOCKS_DENEB * MAX_BLOBS_PER_BLOCK_ELECTRA
168+
MAX_REQUEST_BLOB_SIDECARS_ELECTRA: 1152
155169

156170
# Whisk
157171
# `Epoch(2**8)`
@@ -166,13 +180,10 @@ DATA_COLUMN_SIDECAR_SUBNET_COUNT: 128
166180
MAX_REQUEST_DATA_COLUMN_SIDECARS: 16384
167181
SAMPLES_PER_SLOT: 8
168182
CUSTODY_REQUIREMENT: 4
169-
MAX_BLOBS_PER_BLOCK_EIP7594: 8
183+
TARGET_BLOBS_PER_BLOCK_EIP7594: 9
184+
MAX_BLOBS_PER_BLOCK_EIP7594: 12
170185
# `MAX_REQUEST_BLOCKS_DENEB * MAX_BLOBS_PER_BLOCK_EIP7594`
171-
MAX_REQUEST_BLOB_SIDECARS_EIP7594: 1024
172-
173-
# [New in Electra:EIP7251]
174-
MIN_PER_EPOCH_CHURN_LIMIT_ELECTRA: 128000000000 # 2**7 * 10**9 (= 128,000,000,000)
175-
MAX_PER_EPOCH_ACTIVATION_EXIT_CHURN_LIMIT: 256000000000 # 2**8 * 10**9 (= 256,000,000,000)
186+
MAX_REQUEST_BLOB_SIDECARS_EIP7594: 1536
176187

177188
# EIP7732
178189
MAX_REQUEST_PAYLOADS: 128

configs/minimal.yaml

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -145,14 +145,28 @@ ATTESTATION_SUBNET_PREFIX_BITS: 6
145145
# Deneb
146146
# `2**7` (=128)
147147
MAX_REQUEST_BLOCKS_DENEB: 128
148-
# MAX_REQUEST_BLOCKS_DENEB * MAX_BLOBS_PER_BLOCK
149-
MAX_REQUEST_BLOB_SIDECARS: 768
150148
# `2**12` (= 4096 epochs, ~18 days)
151149
MIN_EPOCHS_FOR_BLOB_SIDECARS_REQUESTS: 4096
152150
# `6`
153151
BLOB_SIDECAR_SUBNET_COUNT: 6
154152
## `uint64(6)`
155153
MAX_BLOBS_PER_BLOCK: 6
154+
# MAX_REQUEST_BLOCKS_DENEB * MAX_BLOBS_PER_BLOCK
155+
MAX_REQUEST_BLOB_SIDECARS: 768
156+
157+
# Electra
158+
# [customized] 2**6 * 10**9 (= 64,000,000,000)
159+
MIN_PER_EPOCH_CHURN_LIMIT_ELECTRA: 64000000000
160+
# [customized] 2**7 * 10**9 (= 128,000,000,000)
161+
MAX_PER_EPOCH_ACTIVATION_EXIT_CHURN_LIMIT: 128000000000
162+
# `9`
163+
BLOB_SIDECAR_SUBNET_COUNT_ELECTRA: 9
164+
# `uint64(6)`
165+
TARGET_BLOBS_PER_BLOCK_ELECTRA: 6
166+
# `uint64(9)`
167+
MAX_BLOBS_PER_BLOCK_ELECTRA: 9
168+
# MAX_REQUEST_BLOCKS_DENEB * MAX_BLOBS_PER_BLOCK_ELECTRA
169+
MAX_REQUEST_BLOB_SIDECARS_ELECTRA: 1152
156170

157171
# Whisk
158172
WHISK_EPOCHS_PER_SHUFFLING_PHASE: 4
@@ -165,13 +179,10 @@ DATA_COLUMN_SIDECAR_SUBNET_COUNT: 128
165179
MAX_REQUEST_DATA_COLUMN_SIDECARS: 16384
166180
SAMPLES_PER_SLOT: 8
167181
CUSTODY_REQUIREMENT: 4
168-
MAX_BLOBS_PER_BLOCK_EIP7594: 8
182+
TARGET_BLOBS_PER_BLOCK_EIP7594: 9
183+
MAX_BLOBS_PER_BLOCK_EIP7594: 12
169184
# `MAX_REQUEST_BLOCKS_DENEB * MAX_BLOBS_PER_BLOCK_EIP7594`
170-
MAX_REQUEST_BLOB_SIDECARS_EIP7594: 1024
171-
172-
# [New in Electra:EIP7251]
173-
MIN_PER_EPOCH_CHURN_LIMIT_ELECTRA: 64000000000 # 2**6 * 10**9 (= 64,000,000,000)
174-
MAX_PER_EPOCH_ACTIVATION_EXIT_CHURN_LIMIT: 128000000000 # 2**7 * 10**9 (= 128,000,000,000)
185+
MAX_REQUEST_BLOB_SIDECARS_EIP7594: 1536
175186

176187
# EIP7732
177188
MAX_REQUEST_PAYLOADS: 128

presets/minimal/deneb.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@
55
# `uint64(4096)`
66
FIELD_ELEMENTS_PER_BLOB: 4096
77
# [customized]
8-
MAX_BLOB_COMMITMENTS_PER_BLOCK: 16
9-
# [customized] `floorlog2(get_generalized_index(BeaconBlockBody, 'blob_kzg_commitments')) + 1 + ceillog2(MAX_BLOB_COMMITMENTS_PER_BLOCK)` = 4 + 1 + 4 = 9
10-
KZG_COMMITMENT_INCLUSION_PROOF_DEPTH: 9
8+
MAX_BLOB_COMMITMENTS_PER_BLOCK: 32
9+
# [customized] `floorlog2(get_generalized_index(BeaconBlockBody, 'blob_kzg_commitments')) + 1 + ceillog2(MAX_BLOB_COMMITMENTS_PER_BLOCK)` = 4 + 1 + 5 = 10
10+
KZG_COMMITMENT_INCLUSION_PROOF_DEPTH: 10

specs/_features/eip7594/beacon-chain.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@
2727

2828
| Name | Value | Description |
2929
| - | - | - |
30-
| `MAX_BLOBS_PER_BLOCK_EIP7594` | `uint64(8)` | *[New in EIP7594]* Maximum number of blobs in a single block limited by `MAX_BLOB_COMMITMENTS_PER_BLOCK` |
30+
| `TARGET_BLOBS_PER_BLOCK_EIP7594` | `uint64(9)` | *[New in EIP7594]* Target number of blobs in a single block limited by `MAX_BLOBS_PER_BLOCK_EIP7594` |
31+
| `MAX_BLOBS_PER_BLOCK_EIP7594` | `uint64(12)` | *[New in EIP7594]* Maximum number of blobs in a single block limited by `MAX_BLOB_COMMITMENTS_PER_BLOCK` |
3132

3233
#### Execution payload
3334

@@ -53,7 +54,7 @@ def process_execution_payload(state: BeaconState, body: BeaconBlockBody, executi
5354
versioned_hashes=versioned_hashes,
5455
parent_beacon_block_root=state.latest_block_header.parent_root,
5556
execution_requests=body.execution_requests,
56-
target_blobs_per_block=MAX_BLOBS_PER_BLOCK // 2,
57+
target_blobs_per_block=TARGET_BLOBS_PER_BLOCK_EIP7594, # [Modified in EIP7594]
5758
)
5859
)
5960
# Cache execution payload header

specs/_features/eip7594/p2p-interface.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@
2929
- [`data_column_sidecar_{subnet_id}`](#data_column_sidecar_subnet_id)
3030
- [The Req/Resp domain](#the-reqresp-domain)
3131
- [Messages](#messages)
32-
- [BlobSidecarsByRoot v2](#blobsidecarsbyroot-v2)
33-
- [BlobSidecarsByRange v2](#blobsidecarsbyrange-v2)
32+
- [BlobSidecarsByRoot v3](#blobsidecarsbyroot-v3)
33+
- [BlobSidecarsByRange v3](#blobsidecarsbyrange-v3)
3434
- [DataColumnSidecarsByRoot v1](#datacolumnsidecarsbyroot-v1)
3535
- [DataColumnSidecarsByRange v1](#datacolumnsidecarsbyrange-v1)
3636
- [GetMetaData v3](#getmetadata-v3)
@@ -211,11 +211,11 @@ The following validations MUST pass before forwarding the `sidecar: DataColumnSi
211211

212212
#### Messages
213213

214-
##### BlobSidecarsByRoot v2
214+
##### BlobSidecarsByRoot v3
215215

216-
**Protocol ID:** `/eth2/beacon_chain/req/blob_sidecars_by_root/2/`
216+
**Protocol ID:** `/eth2/beacon_chain/req/blob_sidecars_by_root/3/`
217217

218-
*[Updated in EIP7594]*
218+
*[Modified in EIP7594]*
219219

220220
The `<context-bytes>` field is calculated as `context = compute_fork_digest(fork_version, genesis_validators_root)`:
221221

@@ -245,11 +245,11 @@ Response Content:
245245

246246
No more than `MAX_REQUEST_BLOB_SIDECARS_EIP7594` may be requested at a time.
247247

248-
##### BlobSidecarsByRange v2
248+
##### BlobSidecarsByRange v3
249249

250-
**Protocol ID:** `/eth2/beacon_chain/req/blob_sidecars_by_range/2/`
250+
**Protocol ID:** `/eth2/beacon_chain/req/blob_sidecars_by_range/3/`
251251

252-
*[Updated in EIP7594]*
252+
*[Modified in EIP7594]*
253253

254254
The `<context-bytes>` field is calculated as `context = compute_fork_digest(fork_version, genesis_validators_root)`:
255255

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
# EIP7594 -- Honest Validator
2+
3+
## Table of contents
4+
5+
<!-- TOC -->
6+
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
7+
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
8+
9+
- [Introduction](#introduction)
10+
- [Prerequisites](#prerequisites)
11+
- [Block proposal](#block-proposal)
12+
- [Constructing the `BeaconBlockBody`](#constructing-the-beaconblockbody)
13+
- [Execution payload](#execution-payload)
14+
15+
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
16+
<!-- /TOC -->
17+
18+
## Introduction
19+
20+
This document represents the changes to be made in the code of an "honest validator" to implement EIP7594.
21+
22+
## Prerequisites
23+
24+
This document is an extension of the [Electra -- Honest Validator](../electra/validator.md) guide.
25+
All behaviors and definitions defined in this document, and documents it extends, carry over unless explicitly noted or overridden.
26+
27+
All terminology, constants, functions, and protocol mechanics defined in the updated Beacon Chain doc of [EIP7594](./beacon-chain.md) are requisite for this document and used throughout.
28+
Please see related Beacon Chain doc before continuing and use them as a reference throughout.
29+
30+
## Block proposal
31+
32+
### Constructing the `BeaconBlockBody`
33+
34+
#### Execution payload
35+
36+
`prepare_execution_payload` is updated from the Electra specs.
37+
38+
*Note*: In this section, `state` is the state of the slot for the block proposal _without_ the block yet applied.
39+
That is, `state` is the `previous_state` processed through any empty slots up to the assigned slot using `process_slots(previous_state, slot)`.
40+
41+
``python
42+
def prepare_execution_payload(state: BeaconState,
43+
safe_block_hash: Hash32,
44+
finalized_block_hash: Hash32,
45+
suggested_fee_recipient: ExecutionAddress,
46+
execution_engine: ExecutionEngine) -> Optional[PayloadId]:
47+
# Verify consistency of the parent hash with respect to the previous execution payload header
48+
parent_hash = state.latest_execution_payload_header.block_hash
49+
50+
# Set the forkchoice head and initiate the payload build process
51+
withdrawals, _ = get_expected_withdrawals(state)
52+
53+
payload_attributes = PayloadAttributes(
54+
timestamp=compute_timestamp_at_slot(state, state.slot),
55+
prev_randao=get_randao_mix(state, get_current_epoch(state)),
56+
suggested_fee_recipient=suggested_fee_recipient,
57+
withdrawals=withdrawals,
58+
parent_beacon_block_root=hash_tree_root(state.latest_block_header),
59+
target_blobs_per_block=TARGET_BLOBS_PER_BLOCK_EIP7594, # [Modified in EIP7594]
60+
max_blobs_per_block=MAX_BLOBS_PER_BLOCK_EIP7594, # [Modified in EIP7594]
61+
)
62+
return execution_engine.notify_forkchoice_updated(
63+
head_block_hash=parent_hash,
64+
safe_block_hash=safe_block_hash,
65+
finalized_block_hash=finalized_block_hash,
66+
payload_attributes=payload_attributes,
67+
)
68+
```

specs/_features/eip7732/beacon-chain.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -705,7 +705,7 @@ def process_execution_payload(state: BeaconState,
705705
versioned_hashes=versioned_hashes,
706706
parent_beacon_block_root=state.latest_block_header.parent_root,
707707
execution_requests=requests,
708-
target_blobs_per_block=MAX_BLOBS_PER_BLOCK // 2,
708+
target_blobs_per_block=TARGET_BLOBS_PER_BLOCK_ELECTRA,
709709
)
710710
)
711711

specs/electra/beacon-chain.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
- [Withdrawals processing](#withdrawals-processing)
2323
- [Pending deposits processing](#pending-deposits-processing)
2424
- [Configuration](#configuration)
25+
- [Execution](#execution-1)
2526
- [Validator cycle](#validator-cycle)
2627
- [Containers](#containers)
2728
- [New containers](#new-containers)
@@ -119,6 +120,7 @@ Electra is a consensus-layer upgrade containing a number of features. Including:
119120
* [EIP-7002](https://eips.ethereum.org/EIPS/eip-7002): Execution layer triggerable exits
120121
* [EIP-7251](https://eips.ethereum.org/EIPS/eip-7251): Increase the MAX_EFFECTIVE_BALANCE
121122
* [EIP-7549](https://eips.ethereum.org/EIPS/eip-7549): Move committee index outside Attestation
123+
* [EIP-7691](https://eips.ethereum.org/EIPS/eip-7691): Blob throughput increase
122124

123125
*Note:* This specification is built upon [Deneb](../deneb/beacon-chain.md) and is under active development.
124126

@@ -200,6 +202,13 @@ The following values are (non-configurable) constants used throughout the specif
200202

201203
## Configuration
202204

205+
### Execution
206+
207+
| Name | Value | Description |
208+
| - | - | - |
209+
| `TARGET_BLOBS_PER_BLOCK_ELECTRA` | `uint64(6)` | *[New in Electra:EIP7691]* Target number of blobs in a single block limited by `MAX_BLOBS_PER_BLOCK_ELECTRA` |
210+
| `MAX_BLOBS_PER_BLOCK_ELECTRA` | `uint64(9)` | *[New in Electra:EIP7691]* Maximum number of blobs in a single block limited by `MAX_BLOB_COMMITMENTS_PER_BLOCK` |
211+
203212
### Validator cycle
204213

205214
| Name | Value |
@@ -1233,7 +1242,7 @@ def process_execution_payload(state: BeaconState, body: BeaconBlockBody, executi
12331242
# Verify timestamp
12341243
assert payload.timestamp == compute_timestamp_at_slot(state, state.slot)
12351244
# Verify commitments are under limit
1236-
assert len(body.blob_kzg_commitments) <= MAX_BLOBS_PER_BLOCK
1245+
assert len(body.blob_kzg_commitments) <= MAX_BLOBS_PER_BLOCK_ELECTRA # [Modified in Electra:EIP7691]
12371246
# Verify the execution payload is valid
12381247
versioned_hashes = [kzg_commitment_to_versioned_hash(commitment) for commitment in body.blob_kzg_commitments]
12391248
assert execution_engine.verify_and_notify_new_payload(
@@ -1242,7 +1251,7 @@ def process_execution_payload(state: BeaconState, body: BeaconBlockBody, executi
12421251
versioned_hashes=versioned_hashes,
12431252
parent_beacon_block_root=state.latest_block_header.parent_root,
12441253
execution_requests=body.execution_requests, # [New in Electra]
1245-
target_blobs_per_block=MAX_BLOBS_PER_BLOCK // 2, # [New in Electra:EIP7742]
1254+
target_blobs_per_block=TARGET_BLOBS_PER_BLOCK_ELECTRA, # [New in Electra:EIP7691:EIP7742]
12461255
)
12471256
)
12481257
# Cache execution payload header

0 commit comments

Comments
 (0)