forked from zcash/halo2
-
Notifications
You must be signed in to change notification settings - Fork 129
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
Include instances in the Circuit trait #255
Comments
zemse
changed the title
ELI15: Include instances in the Circuit trait
Include instances in the Circuit trait
Jan 29, 2024
I think an approach could be adding the 2 methods in And perhaps after the backend-frontend splitting is finished, the new backend can start to user this instance API. Tho not sure if the default implementation would be a footgun or not.. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Currently, we have to calculate the instances in a separate code. However, it would be great if we required defining instance calculation function in the Circuit trait.
It is already in the snark-verifier SDK in a CircuitExt trait.
https://github.com/privacy-scaling-explorations/snark-verifier/blob/c400ffcd629c337111c4e3cbf95acfe1230b068b/snark-verifier-sdk/src/lib.rs#L111-L115
As well as on the SubCircuit trait in zkevm
https://github.com/privacy-scaling-explorations/zkevm-circuits/blob/d97258872bbe14547465b984343b1e359217281b/zkevm-circuits/src/util.rs#L156
I think upstreaming the
instances
function andnum_instances
to the pse halo2's Circuit trait can be beneficial to all projects, i.e. organise the code that computes the instance that is to be passed on mock prover or verifier.But yeah it would be a breaking change and annoying to implement when someone is upgrading to latest halo2 but I believe it can be worth it. Happy to make a PR for this if it is okay.
The text was updated successfully, but these errors were encountered: