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

chore: Add correct type casts to eip7594 functions #3697

Closed
wants to merge 26 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
8ad8b69
add eip7594 to pylint checks
kevaundray Apr 18, 2024
006cfe6
fix pylint errors
kevaundray Apr 18, 2024
9c9f8f1
temp fix
kevaundray Apr 18, 2024
3554d79
Merge branch 'dev' into pr3697
hwwhww Apr 19, 2024
d5b4e6c
workaround: add a new config `MAX_EXTENDED_MATRIX_SIZE` to avoid `cla…
hwwhww Apr 19, 2024
ec0dc1f
ensure that value is in the correct range
kevaundray Apr 19, 2024
2a49ce2
Merge branch 'dev' into kw/add-eip7594-to-pylint
kevaundray Apr 19, 2024
2c32877
fix new lint errors
kevaundray Apr 19, 2024
b031a80
try: adding back line
kevaundray Apr 22, 2024
0dc414b
try: type ignore
kevaundray Apr 22, 2024
864e45a
Merge branch 'dev' into kw/add-eip7594-to-pylint
kevaundray Apr 22, 2024
0f8b0b4
add copy
kevaundray Apr 22, 2024
d2a8cb5
fix lint
kevaundray Apr 22, 2024
13d73ff
Merge branch 'dev' into kw/add-eip7594-to-pylint
kevaundray Apr 22, 2024
783899c
fix new linter errors
kevaundray Apr 22, 2024
47ef8ff
remove check from CI
kevaundray Apr 22, 2024
ac26ed2
Merge branch 'dev' into kw/add-eip7594-to-pylint
kevaundray Apr 23, 2024
31be7bf
Merge branch 'dev' into kw/add-eip7594-to-pylint
kevaundray Apr 25, 2024
97ce095
remove extra modulus reduction
kevaundray Apr 25, 2024
62ce140
append and reverse list
kevaundray Apr 25, 2024
8c10508
fix new linter error
kevaundray Apr 25, 2024
e5ad8b7
re-arrange BLS_MODULUS to be before b[i]
kevaundray Apr 25, 2024
1cc7e1a
Avoid underflow
asn-d6 Apr 29, 2024
6eb5756
Correctly handle CosetEvals in compute_cells()
asn-d6 Apr 29, 2024
92b25e6
lint
kevaundray Apr 29, 2024
4de4625
Merge branch 'dev' into kw/add-eip7594-to-pylint
kevaundray Apr 29, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Merge branch 'dev' into kw/add-eip7594-to-pylint
  • Loading branch information
kevaundray committed Apr 22, 2024
commit 864e45ae1213c52cc41e77fb1803ac3ef8b5556d
2 changes: 1 addition & 1 deletion configs/mainnet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ WHISK_PROPOSER_SELECTION_GAP: 2

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

Expand Down
2 changes: 1 addition & 1 deletion configs/minimal.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ WHISK_PROPOSER_SELECTION_GAP: 1

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

Expand Down
2 changes: 1 addition & 1 deletion pysetup/spec_builders/eip7594.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +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_EXTENDED_MATRIX_SIZE': spec_object.config_vars['MAX_EXTENDED_MATRIX_SIZE'].value,
'MAX_CELLS_IN_EXTENDED_MATRIX': spec_object.config_vars['MAX_CELLS_IN_EXTENDED_MATRIX'].value,
}

@classmethod
Expand Down
4 changes: 2 additions & 2 deletions specs/_features/eip7594/das-core.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ 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_EXTENDED_MATRIX_SIZE]` | 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

Expand All @@ -55,7 +55,7 @@ We define the following Python custom types for type hinting and readability:
| 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. |
| `MAX_EXTENDED_MATRIX_SIZE` | `uint64(MAX_BLOBS_PER_BLOCK * NUMBER_OF_COLUMNS)` (= 768) | The data size of `ExtendedMatrix`. |
| `MAX_CELLS_IN_EXTENDED_MATRIX` | `uint64(MAX_BLOBS_PER_BLOCK * NUMBER_OF_COLUMNS)` (= 768) | The data size of `ExtendedMatrix`. |

### Networking

Expand Down
4 changes: 2 additions & 2 deletions specs/_features/eip7594/polynomial-commitments-sampling.md
Original file line number Diff line number Diff line change
Expand Up @@ -643,8 +643,8 @@ def recover_all_cells(cell_ids: Sequence[CellID],
# Convert from bytes to cells
cells = [bytes_to_cell(cell_bytes) for cell_bytes in cells_bytes]

missing_cell_ids = [CellID(cell_id) for cell_id in range(CELLS_PER_EXT_BLOB) if cell_id not in cell_ids]
zero_poly_coeff, zero_poly_eval, zero_poly_eval_brp = construct_vanishing_polynomial(missing_cell_ids)
missing_cell_ids = [cell_id for cell_id in range(CELLS_PER_EXT_BLOB) if cell_id not in cell_ids]
zero_poly_coeff, zero_poly_eval = construct_vanishing_polynomial(missing_cell_ids)

eval_shifted_extended_evaluation, eval_shifted_zero_poly, shift_inv = recover_shifted_data(
cell_ids,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def test_invariants(spec):
assert spec.config.MAX_REQUEST_DATA_COLUMN_SIDECARS == (
spec.config.MAX_REQUEST_BLOCKS_DENEB * spec.config.NUMBER_OF_COLUMNS
)
assert spec.config.MAX_EXTENDED_MATRIX_SIZE == spec.MAX_BLOBS_PER_BLOCK * spec.config.NUMBER_OF_COLUMNS
assert spec.config.MAX_CELLS_IN_EXTENDED_MATRIX == spec.MAX_BLOBS_PER_BLOCK * spec.config.NUMBER_OF_COLUMNS


@with_eip7594_and_later
Expand Down
Loading
You are viewing a condensed version of this merge commit. You can view the full changes here.