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

In batch cell verification, check if there are zero cells #3835

Merged
merged 2 commits into from
Jul 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 1 addition & 2 deletions specs/_features/eip7594/polynomial-commitments-sampling.md
Original file line number Diff line number Diff line change
Expand Up @@ -540,7 +540,7 @@ def verify_cell_kzg_proof_batch_impl(row_commitments: Sequence[KZGCommitment],

# Step 4.2: Compute RLI = [sum_k r^k interpolation_poly_k(s)]
# Note: an efficient implementation would use the IDFT based method explained in the blog post
sum_interp_polys_coeff = [0]
sum_interp_polys_coeff = [0] * n
for k in range(num_cells):
interp_poly_coeff = interpolate_polynomialcoeff(coset_for_cell(column_indices[k]), cosets_evals[k])
interp_poly_scaled_coeff = multiply_polynomialcoeff([r_powers[k]], interp_poly_coeff)
Expand All @@ -567,7 +567,6 @@ def verify_cell_kzg_proof_batch_impl(row_commitments: Sequence[KZGCommitment],
]))
```


### Cell cosets

#### `coset_shift_for_cell`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,20 @@ def test_verify_cell_kzg_proof(spec):
assert spec.verify_cell_kzg_proof(commitment, cell_index, cells[cell_index], proofs[cell_index])


@with_eip7594_and_later
@spec_test
@single_phase
def test_verify_cell_kzg_proof_batch_zero_cells(spec):
# Verify with zero cells should return true
assert spec.verify_cell_kzg_proof_batch(
row_commitments_bytes=[],
row_indices=[],
column_indices=[],
cells=[],
proofs_bytes=[],
)


@with_eip7594_and_later
@spec_test
@single_phase
Expand Down