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

fix(sdk): .bytes() inconsistent behavior between groth16 and plonk #1802

Merged
merged 2 commits into from
Nov 20, 2024

Conversation

ratankaliani
Copy link
Member

@ratankaliani ratankaliani commented Nov 19, 2024

Motivation

Inconsistent behavior in bytes between mock PLONK and Groth16 proofs. This caused an issue in op-succinct.

In the future, especially for PR's from external folks, we should have simple tests added in the relevant file to test behavior. This prevents issues such as this which lead to inconsistent API behavior.

Reversion introduced by #1685. Likely because base dev branch was not up to date.

Solution

Return an empty byte array from .bytes() if it's a mock Groth16 proof.

Add testing to confirm that .bytes() returns the correct output in the future.

Note: Did not test SP1Proof::Compressed because constructing an empty ReduceProof was difficult.

PR Checklist

  • Added Tests
  • Added Documentation

@ratankaliani ratankaliani changed the title fix: empty bytes groth16 fix(sdk): .bytes() inconsistent behavior between groth16 and plonk Nov 19, 2024
Copy link
Contributor

github-actions bot commented Nov 19, 2024

SP1 Performance Test Results

Branch: ratan/return-empty-bytes-groth16
Commit: 6475313
Author: ratankaliani

program cycles execute (mHz) core (kHZ) compress (KHz) time success
fibonacci 11291 0.18 2.78 0.46 25s
ssz-withdrawals 2757356 17.48 128.61 35.09 1m19s
tendermint 12593597 6.71 267.42 98.68 2m9s

@ratankaliani ratankaliani merged commit e2cc7af into dev Nov 20, 2024
12 checks passed
@ratankaliani ratankaliani deleted the ratan/return-empty-bytes-groth16 branch November 20, 2024 22:08
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.

2 participants