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

reject invalid proofs when validating blobs #5445

Merged
merged 2 commits into from
Sep 19, 2023
Merged

Conversation

etan-status
Copy link
Contributor

Currently, passing 0xc00000... proof seems to pass verifyProofs. Unsure why such a check is not necessary in spec, and also unsure whether it is correct to reject proof at infinity, or if it could occur, e.g., for a blob containing all 0 bytes. Weird overall...

Currently, passing `0xc00000...` proof seems to pass `verifyProofs`.
Unsure why such a check is not necessary in spec, and also unsure
whether it is correct to reject proof at infinity, or if it could
occur, e.g., for a blob containing all 0 bytes. Weird overall...
@asn-d6
Copy link

asn-d6 commented Sep 19, 2023

Proof being the point at infinity is a valid case for when the blob is all zeroes. A blob being all zeroes is basically the zero polynomial -- its commitment will be the point at infinity and the corresponding proof will also be the point at infinity.

A related edge case can happen for a blob full of twos (or any other constant number): A blob full of twos would correspond to the polynomial p(x) = 2 and it's corresponding KZG proof would be the point at infinity. It's corresponding commitment would be 2G (not the point at infinity).

If these edge cases are spilling out to clients and causing confusion, we should probably document them somewhere.

@github-actions
Copy link

Unit Test Results

         9 files  ±0    1 089 suites  ±0   45m 12s ⏱️ + 5m 15s
  3 847 tests ±0    3 568 ✔️ ±0  279 💤 ±0  0 ±0 
15 892 runs  ±0  15 587 ✔️ ±0  305 💤 ±0  0 ±0 

Results for commit 905ad2e. ± Comparison against base commit ee75d45.

@etan-status
Copy link
Contributor Author

Found the problem. There are two output values, one is a return value, and the other is a bool *. We only checked the first one but not the second. When I check both, the test works fine :)

@etan-status etan-status marked this pull request as ready for review September 19, 2023 19:10
@etan-status
Copy link
Contributor Author

Introduction of problem here: #4732

Was always broken. Nice that the tests caught it 😅

@etan-status etan-status changed the title reject proof at infinity when validating blobs reject invalid proofs when validating blobs Sep 19, 2023
@etan-status etan-status enabled auto-merge (squash) September 19, 2023 20:03
@etan-status etan-status merged commit 1640c45 into unstable Sep 19, 2023
@etan-status etan-status deleted the dev/etan/df-infproof branch September 19, 2023 22:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants