Skip to content

Commit

Permalink
Merge pull request #3745 from kevaundray/kw/pad-column-indices
Browse files Browse the repository at this point in the history
chore: Pad column indices when calling `verify_cell_kzg_proof_batch`
  • Loading branch information
asn-d6 committed May 3, 2024
2 parents e0ee280 + fa55021 commit 2abf4ce
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
8 changes: 5 additions & 3 deletions specs/_features/eip7594/p2p-interface.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,15 @@ def verify_data_column_sidecar_kzg_proofs(sidecar: DataColumnSidecar) -> bool:
"""
assert sidecar.index < NUMBER_OF_COLUMNS
assert len(sidecar.column) == len(sidecar.kzg_commitments) == len(sidecar.kzg_proofs)
row_ids = [RowIndex(i) for i in range(len(sidecar.column))]

row_indices = [RowIndex(i) for i in range(len(sidecar.column))]
column_indices = [sidecar.index] * len(sidecar.column)

# KZG batch verifies that the cells match the corresponding commitments and proofs
return verify_cell_kzg_proof_batch(
row_commitments_bytes=sidecar.kzg_commitments,
row_indices=row_ids, # all rows
column_indices=[sidecar.index],
row_indices=row_indices, # all rows
column_indices=column_indices, # specific column
cells=sidecar.column,
proofs_bytes=sidecar.kzg_proofs,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ def _run_blob_kzg_commitments_merkle_proof_test(spec, state, rng=None):
index=spec.get_subtree_index(gindex),
root=column_sidcar.signed_block_header.message.body_root,
)
assert spec.verify_data_column_sidecar_kzg_proofs(column_sidcar)
assert spec.verify_data_column_sidecar_inclusion_proof(column_sidcar)


Expand Down

0 comments on commit 2abf4ce

Please sign in to comment.