Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

release v1.5.0-alpha.1 #3725

Merged
merged 81 commits into from
Apr 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
81 commits
Select commit Hold shift + click to select a range
45e7074
Update polynomial-commitments-sampling.md
kevaundray Apr 18, 2024
3b88964
number of cells in an extended blob
kevaundray Apr 18, 2024
7e85c96
change CELLS_PER_BLOB in das-core.md
kevaundray Apr 18, 2024
d913140
fix comments for kzg_proof_multi
kevaundray Apr 18, 2024
4d073f1
remove remainder polynomial when in monomial form
kevaundray Apr 18, 2024
912038b
modify cell proofs comment
kevaundray Apr 18, 2024
6c8955d
chore: fix comment
kevaundray Apr 18, 2024
c9e1291
update tests
kevaundray Apr 18, 2024
b06d431
fix lint
kevaundray Apr 18, 2024
1669723
Update specs/_features/eip7594/polynomial-commitments-sampling.md
kevaundray Apr 18, 2024
8e3500b
Update specs/_features/eip7594/polynomial-commitments-sampling.md
kevaundray Apr 18, 2024
b8eab83
Merge pull request #3694 from kevaundray/kw/cells_per_ext_blob
hwwhww Apr 19, 2024
0b312ca
Merge pull request #3692 from kevaundray/patch-11
hwwhww Apr 19, 2024
9c04cf1
Merge pull request #3695 from kevaundray/kw/fix-kzg-multi-comment
hwwhww Apr 19, 2024
c2b7c0b
Merge branch 'dev' into kw/optimize-compute-kzg-proof-multi
kevaundray Apr 19, 2024
33dfa88
fix bad merge
kevaundray Apr 19, 2024
32cbda9
rename to recover_all_cells
kevaundray Apr 19, 2024
3ddd00e
use recover_all_cells
kevaundray Apr 19, 2024
988412e
modify test
kevaundray Apr 19, 2024
8707a4c
Fix test_recover_all_cells
jtraglia Apr 19, 2024
9279848
Merge pull request #3696 from kevaundray/kw/optimize-compute-kzg-proo…
jtraglia Apr 19, 2024
bc69c35
Merge pull request #3702 from kevaundray/kw/fix_recover_polynomial
jtraglia Apr 19, 2024
4684c57
add comment for verify algorithm
kevaundray Apr 19, 2024
22a9c72
Fix `ExecutionLayerWithdrawalRequest` container to also imply it's fo…
terencechain Apr 19, 2024
0e4fc98
Remove unused return value (#3704)
kevaundray Apr 20, 2024
dca048d
push @asn-d6 suggestions
kevaundray Apr 22, 2024
e46c4c3
workaround: add a new config `MAX_EXTENDED_MATRIX_SIZE` to avoid `cla…
hwwhww Apr 19, 2024
0ffd0ca
Merge pull request #3703 from kevaundray/kw/add-comment-for-verify-kzg
asn-d6 Apr 22, 2024
3f2d498
rename
kevaundray Apr 22, 2024
858f516
Merge pull request #3708 from kevaundray/kw/hww-max-extended-matrix-size
asn-d6 Apr 22, 2024
5c56172
add BLS_MODULUS to places where we subtract two integers (#3709)
kevaundray Apr 22, 2024
79d255b
use CELLS_PER_EXT_BLOB in das-core
kevaundray Apr 22, 2024
bcd0a09
Integrate new Coset/CosetEvals types (#3701)
jtraglia Apr 22, 2024
4fceca2
Merge pull request #3710 from kevaundray/kw/rm-field-elements-from-da…
asn-d6 Apr 22, 2024
e51f7df
chore: make list copy explicit in `divide_polynomialcoeff` (#3706)
kevaundray Apr 22, 2024
b52182c
Refactor `upgrade_to_electra()`
EchoAlice Apr 22, 2024
73637c8
EIP-7594: Add asserts for public functions (#3684)
jtraglia Apr 23, 2024
640675f
add `g1_multi_exp`
kevaundray Apr 23, 2024
57c14e5
Add `get_custody_columns` tests
hwwhww Apr 23, 2024
6aa950e
add g2_multi_exp and lint fixes
kevaundray Apr 23, 2024
e7e49ec
lint fixes
kevaundray Apr 23, 2024
5a74f40
g2_lincomb uses g2_multi_exp
kevaundray Apr 23, 2024
941d9a9
trigger CI again
kevaundray Apr 23, 2024
d55da1b
use one method for both G1 and G2 multiexp
kevaundray Apr 23, 2024
5eb19b3
modify g1_lincomb and g2_lincomb
kevaundray Apr 23, 2024
5230d8e
fix: function description
kevaundray Apr 23, 2024
b580128
check if there are any points
kevaundray Apr 23, 2024
274d013
mke multi_exp polymorphic for pyecc
kevaundray Apr 23, 2024
d28a016
add is_zero check
kevaundray Apr 23, 2024
309979d
add check for multi_exp
kevaundray Apr 23, 2024
f3302a3
- return serialized identity points
kevaundray Apr 23, 2024
e514ac6
Add kzg_7594 test formats
jtraglia Apr 23, 2024
736fe53
Empty commit
kevaundray Apr 23, 2024
bab254b
Add description of `multi_exp`
hwwhww Apr 23, 2024
bd48cef
Update tests/core/pyspec/eth2spec/utils/bls.py
kevaundray Apr 23, 2024
a526cdf
Fix: use TypeVar for "point" rather than bytes
hwwhww Apr 23, 2024
ddee2ce
Merge pull request #3711 from EchoAlice/dev
ralexstokes Apr 23, 2024
830b255
Merge pull request #3718 from jtraglia/kzg-7594-formats
ralexstokes Apr 23, 2024
b13e03e
Merge pull request #3714 from kevaundray/kw/use-optimized-bls-msm
ralexstokes Apr 23, 2024
731caf8
Rename formats/kzg to formats/kzg_4844 (#3716)
jtraglia Apr 23, 2024
b257400
Apply suggestions from code review
hwwhww Apr 24, 2024
24899b7
Apply suggestions from @jtraglia
hwwhww Apr 24, 2024
e793fe2
Add Electra fork tests
hwwhww Apr 24, 2024
f527770
Add initial version of kzg_7594 test generator (#3693)
jtraglia Apr 24, 2024
e1d7121
Merge pull request #3715 from ethereum/das-test-vectors
hwwhww Apr 24, 2024
e973b8d
Add EIP-7594 to `TESTGEN_FORKS`
hwwhww Apr 24, 2024
daea3c0
Merge pull request #3721 from ethereum/testgen_forks
hwwhww Apr 25, 2024
39ec741
Merge pull request #3720 from ethereum/electra-fork-tests
ralexstokes Apr 25, 2024
7819e7f
Fix and move `test_multiple_consolidations_*` tests to sanity block t…
hwwhww Apr 25, 2024
e5ba8bc
Merge pull request #3724 from ethereum/fix-multiple_consolidations-tests
hwwhww Apr 25, 2024
6ecff3e
Bump version to v1.5.0-alpha.1
hwwhww Apr 25, 2024
ac1ce3b
Rename verify_cell_proof to verify_cell_kzg_proof
jtraglia Apr 25, 2024
4f66521
Fix parameter indentations
jtraglia Apr 25, 2024
b418882
Rename compute_cells_and_proofs to compute_cells_and_kzg_proofs
jtraglia Apr 26, 2024
b5f22cd
Merge pull request #3727 from jtraglia/rename-verify-cell-proof
asn-d6 Apr 26, 2024
ef9af0d
Fix consolidation `test_invalid_*_signature` tests
hwwhww Apr 26, 2024
8ca7c03
Merge pull request #3728 from ethereum/fix-sig-tests
hwwhww Apr 26, 2024
b625daf
Merge pull request #3707 from terencechain/patch-145
hwwhww Apr 26, 2024
a4e04eb
Misc fix
hwwhww Apr 27, 2024
53357e3
Merge pull request #3726 from ethereum/bump-version
hwwhww Apr 27, 2024
3c96d41
Merge pull request #3730 from ethereum/misc-fix
hwwhww Apr 27, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 5 additions & 5 deletions configs/mainnet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,13 @@ DENEB_FORK_VERSION: 0x04000000
DENEB_FORK_EPOCH: 269568 # March 13, 2024, 01:55:35pm UTC
# Electra
ELECTRA_FORK_VERSION: 0x05000000
ELECTRA_FORK_EPOCH: 18446744073709551615
ELECTRA_FORK_EPOCH: 18446744073709551615 # temporary stub
# EIP7594
EIP7594_FORK_VERSION: 0x06000000 # temporary stub
EIP7594_FORK_EPOCH: 18446744073709551615
# WHISK
WHISK_FORK_VERSION: 0x08000000 # temporary stub
WHISK_FORK_EPOCH: 18446744073709551615
# EIP7594
EIP7594_FORK_VERSION: 0x06000001
EIP7594_FORK_EPOCH: 18446744073709551615


# Time parameters
# ---------------------------------------------------------------
Expand Down Expand Up @@ -157,6 +156,7 @@ WHISK_PROPOSER_SELECTION_GAP: 2

# EIP7594
NUMBER_OF_COLUMNS: 128
MAX_CELLS_IN_EXTENDED_MATRIX: 768
DATA_COLUMN_SIDECAR_SUBNET_COUNT: 32
MAX_REQUEST_DATA_COLUMN_SIDECARS: 16384

Expand Down
7 changes: 4 additions & 3 deletions configs/minimal.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,12 @@ DENEB_FORK_EPOCH: 18446744073709551615
# Electra
ELECTRA_FORK_VERSION: 0x05000001
ELECTRA_FORK_EPOCH: 18446744073709551615
# WHISK
WHISK_FORK_VERSION: 0x08000001
WHISK_FORK_EPOCH: 18446744073709551615
# EIP7594
EIP7594_FORK_VERSION: 0x06000001
EIP7594_FORK_EPOCH: 18446744073709551615
# WHISK
WHISK_FORK_VERSION: 0x08000001
WHISK_FORK_EPOCH: 18446744073709551615

# Time parameters
# ---------------------------------------------------------------
Expand Down Expand Up @@ -155,6 +155,7 @@ WHISK_PROPOSER_SELECTION_GAP: 1

# EIP7594
NUMBER_OF_COLUMNS: 128
MAX_CELLS_IN_EXTENDED_MATRIX: 768
DATA_COLUMN_SIDECAR_SUBNET_COUNT: 32
MAX_REQUEST_DATA_COLUMN_SIDECARS: 16384

Expand Down
1 change: 1 addition & 0 deletions pysetup/spec_builders/deneb.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ def imports(cls, preset_name: str):
def preparations(cls):
return '''
T = TypeVar('T') # For generic function
TPoint = TypeVar('TPoint') # For generic function. G1 or G2 point.
'''

@classmethod
Expand Down
1 change: 1 addition & 0 deletions pysetup/spec_builders/eip7594.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ def hardcoded_custom_type_dep_constants(cls, spec_object) -> str:
'FIELD_ELEMENTS_PER_CELL': spec_object.preset_vars['FIELD_ELEMENTS_PER_CELL'].value,
'FIELD_ELEMENTS_PER_EXT_BLOB': spec_object.preset_vars['FIELD_ELEMENTS_PER_EXT_BLOB'].value,
'NUMBER_OF_COLUMNS': spec_object.config_vars['NUMBER_OF_COLUMNS'].value,
'MAX_CELLS_IN_EXTENDED_MATRIX': spec_object.config_vars['MAX_CELLS_IN_EXTENDED_MATRIX'].value,
}

@classmethod
Expand Down
41 changes: 26 additions & 15 deletions specs/_features/eip7594/das-core.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->

- [Constants](#constants)
- [Misc](#misc)
- [Custom types](#custom-types)
- [Configuration](#configuration)
- [Data size](#data-size)
Expand Down Expand Up @@ -39,22 +41,33 @@
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
<!-- /TOC -->

## Constants

The following values are (non-configurable) constants used throughout the specification.

### Misc

| Name | Value |
| - | - |
| `UINT256_MAX` | `uint256(2**256 - 1)` |

## Custom types

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

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

## Configuration

### Data size

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

### Networking

Expand Down Expand Up @@ -95,8 +108,11 @@ def get_custody_columns(node_id: NodeID, custody_subnet_count: uint64) -> Sequen
subnet_ids = []
i = 0
while len(subnet_ids) < custody_subnet_count:
if node_id == UINT256_MAX:
node_id = 0

subnet_id = (
bytes_to_uint64(hash(uint_to_bytes(uint64(node_id + i)))[0:8])
bytes_to_uint64(hash(uint_to_bytes(uint256(node_id + i)))[0:8])
% DATA_COLUMN_SIDECAR_SUBNET_COUNT
)
if subnet_id not in subnet_ids:
Expand All @@ -105,11 +121,11 @@ def get_custody_columns(node_id: NodeID, custody_subnet_count: uint64) -> Sequen
assert len(subnet_ids) == len(set(subnet_ids))

columns_per_subnet = NUMBER_OF_COLUMNS // DATA_COLUMN_SIDECAR_SUBNET_COUNT
return [
return sorted([
ColumnIndex(DATA_COLUMN_SIDECAR_SUBNET_COUNT * i + subnet_id)
for i in range(columns_per_subnet)
for subnet_id in subnet_ids
]
])
```

#### `compute_extended_matrix`
Expand All @@ -135,21 +151,16 @@ def recover_matrix(cells_dict: Dict[Tuple[BlobIndex, CellID], Cell], blob_count:
"""
Return the recovered ``ExtendedMatrix``.

This helper demonstrates how to apply ``recover_polynomial``.
This helper demonstrates how to apply ``recover_all_cells``.
The data structure for storing cells is implementation-dependent.
"""
extended_matrix = []
for blob_index in range(blob_count):
cell_ids = [cell_id for b_index, cell_id in cells_dict.keys() if b_index == blob_index]
cells = [cells_dict[(blob_index, cell_id)] for cell_id in cell_ids]
cells_bytes = [[bls_field_to_bytes(element) for element in cell] for cell in cells]

full_polynomial = recover_polynomial(cell_ids, cells_bytes)
cells_from_full_polynomial = [
full_polynomial[i * FIELD_ELEMENTS_PER_CELL:(i + 1) * FIELD_ELEMENTS_PER_CELL]
for i in range(CELLS_PER_BLOB)
]
extended_matrix.extend(cells_from_full_polynomial)

all_cells_for_row = recover_all_cells(cell_ids, cells)
extended_matrix.extend(all_cells_for_row)
return ExtendedMatrix(extended_matrix)
```

Expand All @@ -164,7 +175,7 @@ def get_data_column_sidecars(signed_block: SignedBeaconBlock,
block.body,
get_generalized_index(BeaconBlockBody, 'blob_kzg_commitments'),
)
cells_and_proofs = [compute_cells_and_proofs(blob) for blob in blobs]
cells_and_proofs = [compute_cells_and_kzg_proofs(blob) for blob in blobs]
blob_count = len(blobs)
cells = [cells_and_proofs[i][0] for i in range(blob_count)]
proofs = [cells_and_proofs[i][1] for i in range(blob_count)]
Expand Down
2 changes: 1 addition & 1 deletion specs/_features/eip7594/fork.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Warning: this configuration is not definitive.

| Name | Value |
| - | - |
| `EIP7594_FORK_VERSION` | `Version('0x05000000')` |
| `EIP7594_FORK_VERSION` | `Version('0x06000000')` |
| `EIP7594_FORK_EPOCH` | `Epoch(18446744073709551615)` **TBD** |

## Helper functions
Expand Down
2 changes: 1 addition & 1 deletion specs/_features/eip7594/p2p-interface.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def verify_data_column_sidecar_kzg_proofs(sidecar: DataColumnSidecar) -> bool:
row_ids = [RowIndex(i) for i in range(len(sidecar.column))]

# KZG batch verifies that the cells match the corresponding commitments and proofs
return verify_cell_proof_batch(
return verify_cell_kzg_proof_batch(
row_commitments=sidecar.kzg_commitments,
row_indices=row_ids, # all rows
column_indices=[sidecar.index],
Expand Down