Skip to content

Conversation

@ivokub
Copy link
Collaborator

@ivokub ivokub commented Jan 20, 2024

Description

Currently we didn't switch on the circuit size and generator when doing multi-proof verification. This PR includes these parts in PLONK verification key in circuit specific VK. Additionally, had to change the exponentiation by the circuit size to use variable instead of a constant.

Related #966

Type of change

  • New feature (non-breaking change which adds functionality)

How has this been tested?

All current tests work.

How has this been benchmarked?

Previously verifying over 10 proofs cost was 291527, now 313833, so approx 7% increase. BUT, for the example circuits the circuits we were aggregating were small and we did fixed exponetiation, so only essentially a few non-native muls. Now we do variable exponentiation for 30-bit exponents. But circuits in practice are actually closer to 30 bits (25-26 bits imo), so the difference shouldn't be that significant.

Checklist:

  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • I did not modify files generated from templates
  • golangci-lint does not output errors locally
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

@ivokub ivokub added the type: consolidate strengthen an existing feature label Jan 20, 2024
@ivokub ivokub self-assigned this Jan 20, 2024
Copy link
Contributor

@yelhousni yelhousni left a comment

Choose a reason for hiding this comment

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

LGTM 👍 Maybe add a comment in plonk/doc.go to say that we assume circuits of maximum size 2**30.

@ivokub
Copy link
Collaborator Author

ivokub commented Jan 22, 2024

LGTM 👍 Maybe add a comment in plonk/doc.go to say that we assume circuits of maximum size 2**30.

Thanks, added!

@ivokub ivokub merged commit 43f3420 into master Jan 22, 2024
@ivokub ivokub deleted the feat/different-plonk-recursion branch January 22, 2024 14:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: consolidate strengthen an existing feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants