-
Notifications
You must be signed in to change notification settings - Fork 36
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
[Design Discussion] Zk Accel API via extra function parameter [Don't merge] #14
base: taiko/unstable
Are you sure you want to change the base?
Conversation
Deprecate pre-ZAL API Insert patch in `Cargo.toml` for `../halo2curves`
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like this approach a lot more than the prev two.
I thought about moving the engine to the Circuit
trait as an associated type. But it would be missing create_proof
and verify_proof
functions.
Otherwise, if we add it to the prover, we are missing keygen.
Unsure if we need a better abstraction or something. Or we should simply settle for this.
Maybe we can discuss more during the next days.
Also, I highly suggest to start looking at privacy-scaling-explorations#243 to see how this will fit-in and if we should have anything in mind.
@@ -116,7 +118,7 @@ where | |||
if P::QUERY_INSTANCE { | |||
let instance_commitments_projective: Vec<_> = instance_values | |||
.iter() | |||
.map(|poly| params.commit_lagrange(poly, Blind::default())) | |||
.map(|poly| params.commit_lagrange(engine, poly, Blind::default())) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We were thinking on removing the poly definitions/utilities from this crate and move them to an external one where we can have MV and UV as well as optimizations like parallelism and maybe ZAL then too.
I'll follow-up on this. But would be nice to coordinate.
First round of thoughts from @ed255 and me: https://hackmd.io/F6W1U6X8SLCqTciJt0nfiQ?edit Happy to discuss more in a meeting or whatever works best |
A followup on #12 and #13.
The changes required were surprisingly reasonable. No lifetime issues, no type pollution, no Send+Sync requirements.
Only the prover side has been updated to use Zal as on the verifier it's supposedly cheap and also there is a parallel iteration part when batch verification that would be incompatible with ZAL backend that use thead-local sxtorage:
halo2/halo2_proofs/src/plonk/verifier/batch.rs
Lines 107 to 130 in fb69aa2
In terms of API, users just need to pass engine to
create_proof
so breakage is minimal on external API and contained in halo2.cc @CPerezz re our chat a couple hours ago