-
Notifications
You must be signed in to change notification settings - Fork 420
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: verify commitments in groth16 recursion verifier #1057
Conversation
fix: emulated MarshalG1 for BN254
Thanks for the contribution! I started reviewing the PR, but it takes a bit time. I'm proposing some refactors related to this PR and some which I wanted to include as part of a cleanup of Groth16 verifier (simpler init of groth16 verifier instance for example). I'll have a longer response with specific items/suggestions soon. |
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.
Thanks for the contribution! I refactored to be more aligned with PLONK verifier and allow for independent Pedersen commitment verification.
Could you have a look that I hadn't missed something and the refactored version works for you. If you give a go-ahead, then I'll merge.
test/assert_options.go
Outdated
@@ -139,6 +139,14 @@ func NoSolidityChecks() TestingOption { | |||
} | |||
} | |||
|
|||
// WithProverChecks forces to run prover checks and disables solver checks. | |||
func WithProverChecks() TestingOption { |
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'd not add the test property. The command assert.CheckCircuit
is usually meant for end-to-end testing in CI and its internal behaviour is toggled with build tags:
// default options;
// go test -short --> testEngineOnly
// go test --> constraintOnlyProfile
// go test -tags=prover_checks --> proverOnlyProfile
// go test -tags=release_checks --> releaseProfile
Now, if we define and use WithProverCheck
option, then when running tests with -short
tag or without any tags, we would still be running the prover (which may be really slow).
Better option for testing prover is to use tags=provers_checks
tag like
go test -timeout 10m -tags debug,prover_checks -run ^TestBN254InBN254Commitment$ github.com/consensys/gnark/std/recursion/groth16 -v -count=1
I run our tests with the refactored version. Everything seems fine. I left a comment about |
Description
This PR adds commitment verification to groth16 recursion
AssertProof
method. This implementation only supports at most one commitment.TODO:
go.mod
after that PR mergedType of change
How has this been tested?
TestBN254InBN254Commitment
to test inner circuit with commitmentHow has this been benchmarked?
Checklist:
golangci-lint
does not output errors locally