-
Notifications
You must be signed in to change notification settings - Fork 426
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: handle invalid signature failures in ECRecover precompile #1101
Conversation
Implemented for now, but the increase in the number of constraints is huge. I recon this is due to needing to use |
This approach works. Now can avoid complete arithmetic in |
Optimization pointed out by @yelhousni - instead of using |
And, before we can merge this one, we need to merge Consensys/gnark-crypto#497 and update go.mod here to point to gnark-crypto master. |
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.
great work 🔥
Description
In zkEVM, the signature values for the ECRecover precompile can be invalid in some cases. The failing cases are:
r^3 + ax+b
is not a quadratic residue, preventing computing the y-coordinate of commitment RWe need to be able to check such cases to ensure that we can prove reverts. This PR adds a path to also check invalid inputs when
isFailure
input is given.Type of change
Breaking change due to changing the signature of
ECRecover
function.How has this been tested?
isFailure
argument is falseisFailure
is falseisFailure
is trueHow has this been benchmarked?
ECRecover master 459082, now 465156
Checklist:
golangci-lint
does not output errors locally