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

Improve "range check helper" error messages #901

Open
mitschabaude opened this issue May 8, 2023 · 1 comment
Open

Improve "range check helper" error messages #901

mitschabaude opened this issue May 8, 2023 · 1 comment
Labels
error-messages Issues about making error messages better zkDSL Issues to improve the core experience of writing circuits

Comments

@mitschabaude
Copy link
Member

mitschabaude commented May 8, 2023

rangeCheckHelper: expected XXX to fit in 64 bits

These errors can occur in most UInt64 and UInt32 methods (because they include a "range check").
They should be made more accessible to users and present solutions to the problem.

Example: #895

@mitschabaude mitschabaude changed the title Improve all "range check helper" error messages Improve "range check helper" error messages May 8, 2023
@mitschabaude mitschabaude added the error-messages Issues about making error messages better label May 8, 2023
@nicc nicc added the product-eng For tracking our team's issues label May 8, 2023
@mitschabaude
Copy link
Member Author

Update: with #902, these errors arguably get even worse because rangeCheckHelper will not throw an error anymore. So we get something like

UInt32.from(3).sub(5);
/home/gregor/o1/mina/src/lib/snarkyjs/src/lib/field.ts:156
          throw Error(`Field.assertEquals(): ${this} != ${y}`);
                ^

Error: Field.assertEquals(): 0 != 28948022309329048855892746252171976963363056481941560715954676764349967630336
    at Field.assertEquals (snarkyjs/src/lib/field.ts:156:17)
    at UInt32.sub (snarkyjs/src/lib/int.ts:542:41)

@mitschabaude mitschabaude added zkDSL Issues to improve the core experience of writing circuits and removed product-eng For tracking our team's issues labels Dec 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
error-messages Issues about making error messages better zkDSL Issues to improve the core experience of writing circuits
Projects
None yet
Development

No branches or pull requests

2 participants