feat: different PLONK circuit verification #1010
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
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:
golangci-lintdoes not output errors locally