Skip to content
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

hints in gadgets are not registered when packages are not imported #264

Closed
ivokub opened this issue Feb 17, 2022 · 1 comment · Fixed by #272
Closed

hints in gadgets are not registered when packages are not imported #264

ivokub opened this issue Feb 17, 2022 · 1 comment · Fixed by #272

Comments

@ivokub
Copy link
Collaborator

ivokub commented Feb 17, 2022

The problem appears when both the constraint system and witness are obtained by deserializing data.

Maybe add a new package which imports all hints in gadgets (backend/hint/all etc.) which has only a single side-effect of importing all hints from gadgets and registering. This package should then be imported by the compiler and provers.

@gbotrel
Copy link
Collaborator

gbotrel commented Feb 17, 2022

not a big fan of the registry pattern here (well the one for the #245 too :) ).

I think the R1CS / SparseR1CS when it calls solve, should be able to check which hint it was "compiled" with (at least a string name with package) and output an error message to say that said hint is not injected. But I'ld rather have the user do "r1cs.Solve(witness, mygadget.MyHint...)" than to import a package for its sideeffect.

Let's sit on that one a bit, it seems there are couple of refactoring change on the horizon that needs careful thinking 👍

gbotrel added a commit that referenced this issue Mar 1, 2022
@ivokub ivokub linked a pull request Mar 3, 2022 that will close this issue
gbotrel added a commit that referenced this issue Mar 3, 2022
feat: added std.GetHints for convenience. fixes #264
@gbotrel gbotrel closed this as completed Mar 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants