privacy-scaling-explorations / halo2

https://privacy-scaling-explorations.github.io/halo2/
Other
201 stars 121 forks source link

Add `ParamsVerifierKZG` #318

Closed davidnevadoc closed 3 months ago

davidnevadoc commented 4 months ago

This is a small refactor around the PCS parameters, proposed as an alternative to this PR : #301

Changes

  1. Add new struct: ParamsVerifierKZG. This struct only contains s_g2 and the domain size k. Since it does not contain the SRS the verifier that uses these params is not able to commit to the public inputs. Commitment to the public inputs is currently disabled for both kzg-based versions of the verifier gwc and shplonk). In case the verifier wants to commit to the PI it should use the original ParamsKZG, which remain unchanged.

    1. Attempt at cleaning up. Methods that were exclusive for the verifier or the prover have been moved from Params to ParamsVerifier and ParamsProver respectively. Some structs and traits no longer contain the parameters and as a result, no longer need the explicit 'params lifetime.

Closes #280

davidnevadoc commented 4 months ago

I've addressed the comments and updated the PR description with the changes. Can you give this another pass, pls? @ed255

codecov-commenter commented 3 months ago

Codecov Report

Attention: Patch coverage is 64.05229% with 55 lines in your changes are missing coverage. Please review.

Project coverage is 80.86%. Comparing base (0513fb4) to head (61f55e6).

Files Patch % Lines
halo2_backend/src/poly/kzg/commitment.rs 21.66% 47 Missing :warning:
halo2_backend/src/poly/kzg/strategy.rs 64.70% 6 Missing :warning:
halo2_backend/src/plonk/verifier/batch.rs 0.00% 1 Missing :warning:
halo2_backend/src/poly/kzg/msm.rs 80.00% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #318 +/- ## ========================================== - Coverage 80.98% 80.86% -0.13% ========================================== Files 80 80 Lines 16532 16567 +35 ========================================== + Hits 13389 13397 +8 - Misses 3143 3170 +27 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.