-
Notifications
You must be signed in to change notification settings - Fork 373
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
bug: Go 1.22 alternates naming of anonymous functions #1045
Comments
Indeed #1043 breaks compatibility between pre- and post 1043 circuits. So if we have a circuit compiled pre-1043, then solver/prover post-1043 fails as the hints are not found. But still, I think 1043 is better for long-term as ensures more consistency. Instead of reverting I think it would better to add explicit hint overrides (for both Go <1.22 and =1.22 naming convention) to keep the backwards compatibility. I'd be happy to do it if makes sense. |
Mmhhh no for the hint overhide, I think it's dirty ^^. |
Yup, didn't change the constraints. Only changed hints defined as var Hint = func(mod *big.Int, inputs []*big.Int, outputs []*big.Int) error {
//
} to func Hint(mod *big.Int, inputs []*big.Int, outputs []*big.Int) error {
//
} in |
So to summarize - I'll only add the rewrite from "new-style anonymous functions" to old-style and a regression test which ensures that |
Description
For tracking which hints to be used we construct function name and hash it to get a short identifier for the function. However, for anonymous functions
var func = func( ...)
the naming convention changed fromgithub.com/consensys/gnark/std/...pkg..glob.func1
togithub.com/consensys/gnark/std/...pkg.init.func1
. As the hint IDs are also embedded inside the compiled circuits then this means that the solver may not resolve the hint implementation.This issue tracks the process and to let the users know of the potential bugs.
We already have implemented PR #1043 to not use anonymous function as hints. But I guess for more safer approach we could add a rewrite in gnark to rewrite
.init.funcN
to..glob.funcN
.The text was updated successfully, but these errors were encountered: