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

relation: traits: Generalize the Circuit trait to work for all provers #30

Merged
merged 1 commit into from
Nov 16, 2023

Conversation

joeykraut
Copy link
Member

@joeykraut joeykraut commented Nov 16, 2023

Purpose

This PR refactors the traits in the constraint system in two ways:

  1. The ConstraintSystem trait, which previously captured shared functionality between proof systems, regardless of wiring types, was removed and merged into Circuit
  2. Circuit is generalized to work over any choice of wiring type: i.e. over a Field as well as an AuthenticatedScalarResult for MPC provers.

This allows us to implement shared functionality as default implementations on the Circuit trait, so that provers may inherit more of the advanced circuitry without reimplementing.

The motivation comes from the previously increasing disparity and overhead of implementing new shared functionality, and bugs that came from disparate implementations.

Testing

  • Unit tests pass

@joeykraut joeykraut marked this pull request as ready for review November 16, 2023 16:06
@joeykraut joeykraut requested a review from akirillo November 16, 2023 16:06
@joeykraut joeykraut force-pushed the joey/shared-gadgets branch 2 times, most recently from 7bd1253 to f7d74ea Compare November 16, 2023 17:02
Copy link

@akirillo akirillo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

super clean, nice. just 2 small suggestions on other things that could be default impls

plonk/src/multiprover/proof_system/constraint_system.rs Outdated Show resolved Hide resolved
relation/src/traits.rs Outdated Show resolved Hide resolved
@joeykraut joeykraut merged commit ed149c2 into main Nov 16, 2023
0 of 2 checks passed
@joeykraut joeykraut deleted the joey/shared-gadgets branch November 16, 2023 19:00
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