Skip to content

Commit 594daf4

Browse files
authored
Merge pull request #3725 from ethereum/dev
release v1.5.0-alpha.1
2 parents 7bf43d1 + 3c96d41 commit 594daf4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+2203
-506
lines changed

configs/mainnet.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,14 +52,13 @@ DENEB_FORK_VERSION: 0x04000000
5252
DENEB_FORK_EPOCH: 269568 # March 13, 2024, 01:55:35pm UTC
5353
# Electra
5454
ELECTRA_FORK_VERSION: 0x05000000
55-
ELECTRA_FORK_EPOCH: 18446744073709551615
55+
ELECTRA_FORK_EPOCH: 18446744073709551615 # temporary stub
56+
# EIP7594
57+
EIP7594_FORK_VERSION: 0x06000000 # temporary stub
58+
EIP7594_FORK_EPOCH: 18446744073709551615
5659
# WHISK
5760
WHISK_FORK_VERSION: 0x08000000 # temporary stub
5861
WHISK_FORK_EPOCH: 18446744073709551615
59-
# EIP7594
60-
EIP7594_FORK_VERSION: 0x06000001
61-
EIP7594_FORK_EPOCH: 18446744073709551615
62-
6362

6463
# Time parameters
6564
# ---------------------------------------------------------------
@@ -157,6 +156,7 @@ WHISK_PROPOSER_SELECTION_GAP: 2
157156

158157
# EIP7594
159158
NUMBER_OF_COLUMNS: 128
159+
MAX_CELLS_IN_EXTENDED_MATRIX: 768
160160
DATA_COLUMN_SIDECAR_SUBNET_COUNT: 32
161161
MAX_REQUEST_DATA_COLUMN_SIDECARS: 16384
162162

configs/minimal.yaml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,12 @@ DENEB_FORK_EPOCH: 18446744073709551615
5252
# Electra
5353
ELECTRA_FORK_VERSION: 0x05000001
5454
ELECTRA_FORK_EPOCH: 18446744073709551615
55-
# WHISK
56-
WHISK_FORK_VERSION: 0x08000001
57-
WHISK_FORK_EPOCH: 18446744073709551615
5855
# EIP7594
5956
EIP7594_FORK_VERSION: 0x06000001
6057
EIP7594_FORK_EPOCH: 18446744073709551615
58+
# WHISK
59+
WHISK_FORK_VERSION: 0x08000001
60+
WHISK_FORK_EPOCH: 18446744073709551615
6161

6262
# Time parameters
6363
# ---------------------------------------------------------------
@@ -155,6 +155,7 @@ WHISK_PROPOSER_SELECTION_GAP: 1
155155

156156
# EIP7594
157157
NUMBER_OF_COLUMNS: 128
158+
MAX_CELLS_IN_EXTENDED_MATRIX: 768
158159
DATA_COLUMN_SIDECAR_SUBNET_COUNT: 32
159160
MAX_REQUEST_DATA_COLUMN_SIDECARS: 16384
160161

pysetup/spec_builders/deneb.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ def imports(cls, preset_name: str):
1717
def preparations(cls):
1818
return '''
1919
T = TypeVar('T') # For generic function
20+
TPoint = TypeVar('TPoint') # For generic function. G1 or G2 point.
2021
'''
2122

2223
@classmethod

pysetup/spec_builders/eip7594.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ def hardcoded_custom_type_dep_constants(cls, spec_object) -> str:
1919
'FIELD_ELEMENTS_PER_CELL': spec_object.preset_vars['FIELD_ELEMENTS_PER_CELL'].value,
2020
'FIELD_ELEMENTS_PER_EXT_BLOB': spec_object.preset_vars['FIELD_ELEMENTS_PER_EXT_BLOB'].value,
2121
'NUMBER_OF_COLUMNS': spec_object.config_vars['NUMBER_OF_COLUMNS'].value,
22+
'MAX_CELLS_IN_EXTENDED_MATRIX': spec_object.config_vars['MAX_CELLS_IN_EXTENDED_MATRIX'].value,
2223
}
2324

2425
@classmethod

specs/_features/eip7594/das-core.md

Lines changed: 26 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
99
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
1010

11+
- [Constants](#constants)
12+
- [Misc](#misc)
1113
- [Custom types](#custom-types)
1214
- [Configuration](#configuration)
1315
- [Data size](#data-size)
@@ -39,22 +41,33 @@
3941
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
4042
<!-- /TOC -->
4143

44+
## Constants
45+
46+
The following values are (non-configurable) constants used throughout the specification.
47+
48+
### Misc
49+
50+
| Name | Value |
51+
| - | - |
52+
| `UINT256_MAX` | `uint256(2**256 - 1)` |
53+
4254
## Custom types
4355

4456
We define the following Python custom types for type hinting and readability:
4557

4658
| Name | SSZ equivalent | Description |
4759
| - | - | - |
4860
| `DataColumn` | `List[Cell, MAX_BLOB_COMMITMENTS_PER_BLOCK]` | The data of each column in EIP-7594 |
49-
| `ExtendedMatrix` | `List[Cell, MAX_BLOBS_PER_BLOCK * NUMBER_OF_COLUMNS]` | The full data of one-dimensional erasure coding extended blobs (in row major format) |
61+
| `ExtendedMatrix` | `List[Cell, MAX_CELLS_IN_EXTENDED_MATRIX]` | The full data of one-dimensional erasure coding extended blobs (in row major format). |
5062

5163
## Configuration
5264

5365
### Data size
5466

5567
| Name | Value | Description |
5668
| - | - | - |
57-
| `NUMBER_OF_COLUMNS` | `uint64(FIELD_ELEMENTS_PER_EXT_BLOB // FIELD_ELEMENTS_PER_CELL)` (= 128) | Number of columns in the extended data matrix. |
69+
| `NUMBER_OF_COLUMNS` | `uint64(CELLS_PER_EXT_BLOB)` (= 128) | Number of columns in the extended data matrix. |
70+
| `MAX_CELLS_IN_EXTENDED_MATRIX` | `uint64(MAX_BLOBS_PER_BLOCK * NUMBER_OF_COLUMNS)` (= 768) | The data size of `ExtendedMatrix`. |
5871

5972
### Networking
6073

@@ -95,8 +108,11 @@ def get_custody_columns(node_id: NodeID, custody_subnet_count: uint64) -> Sequen
95108
subnet_ids = []
96109
i = 0
97110
while len(subnet_ids) < custody_subnet_count:
111+
if node_id == UINT256_MAX:
112+
node_id = 0
113+
98114
subnet_id = (
99-
bytes_to_uint64(hash(uint_to_bytes(uint64(node_id + i)))[0:8])
115+
bytes_to_uint64(hash(uint_to_bytes(uint256(node_id + i)))[0:8])
100116
% DATA_COLUMN_SIDECAR_SUBNET_COUNT
101117
)
102118
if subnet_id not in subnet_ids:
@@ -105,11 +121,11 @@ def get_custody_columns(node_id: NodeID, custody_subnet_count: uint64) -> Sequen
105121
assert len(subnet_ids) == len(set(subnet_ids))
106122

107123
columns_per_subnet = NUMBER_OF_COLUMNS // DATA_COLUMN_SIDECAR_SUBNET_COUNT
108-
return [
124+
return sorted([
109125
ColumnIndex(DATA_COLUMN_SIDECAR_SUBNET_COUNT * i + subnet_id)
110126
for i in range(columns_per_subnet)
111127
for subnet_id in subnet_ids
112-
]
128+
])
113129
```
114130

115131
#### `compute_extended_matrix`
@@ -135,21 +151,16 @@ def recover_matrix(cells_dict: Dict[Tuple[BlobIndex, CellID], Cell], blob_count:
135151
"""
136152
Return the recovered ``ExtendedMatrix``.
137153
138-
This helper demonstrates how to apply ``recover_polynomial``.
154+
This helper demonstrates how to apply ``recover_all_cells``.
139155
The data structure for storing cells is implementation-dependent.
140156
"""
141157
extended_matrix = []
142158
for blob_index in range(blob_count):
143159
cell_ids = [cell_id for b_index, cell_id in cells_dict.keys() if b_index == blob_index]
144160
cells = [cells_dict[(blob_index, cell_id)] for cell_id in cell_ids]
145-
cells_bytes = [[bls_field_to_bytes(element) for element in cell] for cell in cells]
146-
147-
full_polynomial = recover_polynomial(cell_ids, cells_bytes)
148-
cells_from_full_polynomial = [
149-
full_polynomial[i * FIELD_ELEMENTS_PER_CELL:(i + 1) * FIELD_ELEMENTS_PER_CELL]
150-
for i in range(CELLS_PER_BLOB)
151-
]
152-
extended_matrix.extend(cells_from_full_polynomial)
161+
162+
all_cells_for_row = recover_all_cells(cell_ids, cells)
163+
extended_matrix.extend(all_cells_for_row)
153164
return ExtendedMatrix(extended_matrix)
154165
```
155166

@@ -164,7 +175,7 @@ def get_data_column_sidecars(signed_block: SignedBeaconBlock,
164175
block.body,
165176
get_generalized_index(BeaconBlockBody, 'blob_kzg_commitments'),
166177
)
167-
cells_and_proofs = [compute_cells_and_proofs(blob) for blob in blobs]
178+
cells_and_proofs = [compute_cells_and_kzg_proofs(blob) for blob in blobs]
168179
blob_count = len(blobs)
169180
cells = [cells_and_proofs[i][0] for i in range(blob_count)]
170181
proofs = [cells_and_proofs[i][1] for i in range(blob_count)]

specs/_features/eip7594/fork.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Warning: this configuration is not definitive.
2828

2929
| Name | Value |
3030
| - | - |
31-
| `EIP7594_FORK_VERSION` | `Version('0x05000000')` |
31+
| `EIP7594_FORK_VERSION` | `Version('0x06000000')` |
3232
| `EIP7594_FORK_EPOCH` | `Epoch(18446744073709551615)` **TBD** |
3333

3434
## Helper functions

specs/_features/eip7594/p2p-interface.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ def verify_data_column_sidecar_kzg_proofs(sidecar: DataColumnSidecar) -> bool:
7474
row_ids = [RowIndex(i) for i in range(len(sidecar.column))]
7575

7676
# KZG batch verifies that the cells match the corresponding commitments and proofs
77-
return verify_cell_proof_batch(
77+
return verify_cell_kzg_proof_batch(
7878
row_commitments=sidecar.kzg_commitments,
7979
row_indices=row_ids, # all rows
8080
column_indices=[sidecar.index],

0 commit comments

Comments
 (0)