-
Notifications
You must be signed in to change notification settings - Fork 274
feat: snark composition #975
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
base: main
Are you sure you want to change the base?
Conversation
|
|
||
| fn scale(&self, k: &Self::Scalar) -> Self { | ||
| Self(self.0.cyclotomic_exp(k.0.into_bigint())) | ||
| Self(self.0.pow(k.0.into_bigint())) |
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.
cyclotomic exp is currently not implemented in our bespoke dory snark (though it could be in future, it would reduce the witness size by about half)
| let sz_proof_fq = unsafe { | ||
| std::mem::transmute::< | ||
| &crate::subprotocols::snark_composition::RecursionProof< | ||
| F, | ||
| ProofTranscript, | ||
| 1, | ||
| >, | ||
| &crate::subprotocols::snark_composition::RecursionProof< | ||
| Fq, | ||
| ProofTranscript, | ||
| 1, | ||
| >, | ||
| >(sz_proof) | ||
| }; |
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.
open to suggestions to avoid jank casts (applies prover side too)
| let commitment_coeffs_for_recursion = if cfg!(feature = "recursion") | ||
| && std::any::TypeId::of::<PCS>() | ||
| == std::any::TypeId::of::<super::commitment::dory::DoryCommitmentScheme>() | ||
| { | ||
| Some( | ||
| rlc_map | ||
| .iter() | ||
| .map(|(polynomial, coeff)| { | ||
| (commitments.get(polynomial).unwrap().clone(), *coeff) | ||
| }) | ||
| .collect::<Vec<_>>(), | ||
| ) | ||
| } else { | ||
| None | ||
| }; | ||
|
|
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.
also jank, suggestions?
adds the initial recursion & snark composition proof machinery. Brings the main dory verification from 1.5B RISC-V cycles down to 330 million:
also does some miscellaneous things:
dev/twist-shoutacross dory and arkworksIn general, I am somewhat OK with the flow of the stage 6 for now. My personal main problem is with the recursion helpers being verbose in the
opening_proof.rsand some jank casts. I am still thinking for better solutions and so just flagging this during the review. Happy to take suggestions for better approaches. If no one has better ideas in this review then a subsequent PR will addressNext steps:
On the last point: we are producing about 50k polys of 4 vars. We should be able to fit everything including all the remaining witnesses from the 330M cycles into a 2^10 x 2^10 matrix, so we have 2^11 Grumpkin G1 (Fr) ops for verifier (2 MSM of 2^10), which should be really fast (few ms) to verify...