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

feat: Use oink in IVC #8161

Merged
merged 11 commits into from
Aug 26, 2024
Merged

feat: Use oink in IVC #8161

merged 11 commits into from
Aug 26, 2024

Conversation

ledwards2225
Copy link
Contributor

@ledwards2225 ledwards2225 commented Aug 23, 2024

Prior to this work the first call to IVC accumulate initialized an incomplete (un-oinked) instance for the circuit. The second round then executed folding on two incomplete instances, requiring a call to oink for each. Subsequent folding rounds only required a single oink since the instance being folded into is a "complete" accumulator. This pattern creates additional special case handling in IVC/databus. It also results in the first folding proof having a complicated structure (two internal oink proofs) which makes acir constraint construction and the corresponding proof surgery quite complicated. (The current noir framework can't even support this since recursive verification of the first fold proof involves a single proof but two verification keys).

With the present work, the first round of accumulation now uses oink to complete the instance and create an oink proof. The first kernel (instead of doing no recursive work) now does a single recursive oink verification. This allows for all subsequent rounds to have identical structure - they fold two instances where only the new one is incomplete and thus only one oink proof is contained in the fold proof. It also allows every recursive verification (there are now two types: oink and PG) to be associated with a single proof and a single verification key, in line with how recursion is currently specified from noir.

Note: This change also simplifies the databus consistency checks since there is no longer any need to treat the first round of folding as a special case.

@ledwards2225 ledwards2225 self-assigned this Aug 23, 2024
@ledwards2225 ledwards2225 marked this pull request as ready for review August 26, 2024 19:23
struct FoldingVerifierInputs {
FoldProof proof;
std::shared_ptr<VerificationKey> instance_vk;
QUEUE_TYPE type;
Copy link
Contributor

Choose a reason for hiding this comment

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

Seems like this struct and the proof type inside should be renamed now because it's not about folding in the Oink case, right?

Copy link
Contributor

Choose a reason for hiding this comment

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

Also, why not handle the merge steps using this queue as well?

Copy link
Contributor Author

@ledwards2225 ledwards2225 Aug 26, 2024

Choose a reason for hiding this comment

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

Thanks, updated the naming. You're right that the merge stuff could be handled in the same way. I didn't do it because there are no verification keys for the merge protocol and also because I'm hoping that the merge recursive verifier goes away altogether. If it doesn't tho, you're right that it should probably be made to conform

Copy link
Contributor

@codygunton codygunton left a comment

Choose a reason for hiding this comment

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

Two small requests, one containing a question

*/
void execute(RecursiveVerifierInstances& instances)
void execute(WitnessCommitments& commitments,
Copy link
Contributor

Choose a reason for hiding this comment

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

Will you please make this const correct if it's not?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good call, thanks. consts added to basically everything

@ledwards2225 ledwards2225 enabled auto-merge (squash) August 26, 2024 21:30
@ledwards2225 ledwards2225 merged commit 3540f8e into master Aug 26, 2024
36 checks passed
@ledwards2225 ledwards2225 deleted the lde/oink_in_ivc branch August 26, 2024 21:37
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