Skip to content

Commit e7b49dc

Browse files
authored
chore: Add type casts reducing the diff for #3697 (#3734)
1 parent 186c943 commit e7b49dc

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

specs/_features/eip7594/das-core.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,11 +105,11 @@ class DataColumnSidecar(Container):
105105
def get_custody_columns(node_id: NodeID, custody_subnet_count: uint64) -> Sequence[ColumnIndex]:
106106
assert custody_subnet_count <= DATA_COLUMN_SIDECAR_SUBNET_COUNT
107107

108-
subnet_ids = []
108+
subnet_ids: List[uint64] = []
109109
i = 0
110110
while len(subnet_ids) < custody_subnet_count:
111111
if node_id == UINT256_MAX:
112-
node_id = 0
112+
node_id = NodeID(0)
113113

114114
subnet_id = (
115115
bytes_to_uint64(hash(uint_to_bytes(uint256(node_id + i)))[0:8])
@@ -154,10 +154,10 @@ def recover_matrix(cells_dict: Dict[Tuple[BlobIndex, CellID], Cell], blob_count:
154154
This helper demonstrates how to apply ``recover_all_cells``.
155155
The data structure for storing cells is implementation-dependent.
156156
"""
157-
extended_matrix = []
157+
extended_matrix: List[Cell] = []
158158
for blob_index in range(blob_count):
159159
cell_ids = [cell_id for b_index, cell_id in cells_dict.keys() if b_index == blob_index]
160-
cells = [cells_dict[(blob_index, cell_id)] for cell_id in cell_ids]
160+
cells = [cells_dict[(BlobIndex(blob_index), cell_id)] for cell_id in cell_ids]
161161

162162
all_cells_for_row = recover_all_cells(cell_ids, cells)
163163
extended_matrix.extend(all_cells_for_row)

specs/_features/eip7594/p2p-interface.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,11 +75,11 @@ def verify_data_column_sidecar_kzg_proofs(sidecar: DataColumnSidecar) -> bool:
7575

7676
# KZG batch verifies that the cells match the corresponding commitments and proofs
7777
return verify_cell_kzg_proof_batch(
78-
row_commitments=sidecar.kzg_commitments,
78+
row_commitments_bytes=sidecar.kzg_commitments,
7979
row_indices=row_ids, # all rows
8080
column_indices=[sidecar.index],
8181
cells=sidecar.column,
82-
proofs=sidecar.kzg_proofs,
82+
proofs_bytes=sidecar.kzg_proofs,
8383
)
8484
```
8585

specs/_features/eip7594/polynomial-commitments-sampling.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ def divide_polynomialcoeff(a: PolynomialCoeff, b: PolynomialCoeff) -> Polynomial
243243
Long polynomial division for two coefficient form polynomials ``a`` and ``b``
244244
"""
245245
a = a.copy() # Make a copy since `a` is passed by reference
246-
o = []
246+
o: List[BLSFieldElement] = []
247247
apos = len(a) - 1
248248
bpos = len(b) - 1
249249
diff = apos - bpos
@@ -441,7 +441,7 @@ def compute_cells_and_kzg_proofs(blob: Blob) -> Tuple[
441441
proofs = []
442442

443443
for i in range(CELLS_PER_EXT_BLOB):
444-
coset = coset_for_cell(i)
444+
coset = coset_for_cell(CellID(i))
445445
proof, ys = compute_kzg_proof_multi_impl(polynomial_coeff, coset)
446446
cells.append(coset_evals_to_cell(ys))
447447
proofs.append(proof)
@@ -470,7 +470,7 @@ def compute_cells(blob: Blob) -> Vector[Cell, CELLS_PER_EXT_BLOB]:
470470
for cell_id in range(CELLS_PER_EXT_BLOB):
471471
start = cell_id * FIELD_ELEMENTS_PER_CELL
472472
end = (cell_id + 1) * FIELD_ELEMENTS_PER_CELL
473-
cells.append(coset_evals_to_cell(extended_data_rbo[start:end]))
473+
cells.append(coset_evals_to_cell(CosetEvals(extended_data_rbo[start:end])))
474474
return cells
475475
```
476476

@@ -572,7 +572,7 @@ def construct_vanishing_polynomial(missing_cell_ids: Sequence[CellID]) -> Tuple[
572572
])
573573

574574
# Extend vanishing polynomial to full domain using the closed form of the vanishing polynomial over a coset
575-
zero_poly_coeff = [0] * FIELD_ELEMENTS_PER_EXT_BLOB
575+
zero_poly_coeff = [BLSFieldElement(0)] * FIELD_ELEMENTS_PER_EXT_BLOB
576576
for i, coeff in enumerate(short_zero_poly):
577577
zero_poly_coeff[i * FIELD_ELEMENTS_PER_CELL] = coeff
578578

@@ -690,7 +690,7 @@ def recover_all_cells(cell_ids: Sequence[CellID], cells: Sequence[Cell]) -> Sequ
690690
# Convert cells to coset evals
691691
cosets_evals = [cell_to_coset_evals(cell) for cell in cells]
692692

693-
missing_cell_ids = [cell_id for cell_id in range(CELLS_PER_EXT_BLOB) if cell_id not in cell_ids]
693+
missing_cell_ids = [CellID(cell_id) for cell_id in range(CELLS_PER_EXT_BLOB) if cell_id not in cell_ids]
694694
zero_poly_coeff, zero_poly_eval = construct_vanishing_polynomial(missing_cell_ids)
695695

696696
eval_shifted_extended_evaluation, eval_shifted_zero_poly, shift_inv = recover_shifted_data(

0 commit comments

Comments
 (0)