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

Check for correct bit-size in ACVM solver #5793

Closed
michaeljklein opened this issue Aug 22, 2024 · 1 comment · Fixed by #5864
Closed

Check for correct bit-size in ACVM solver #5793

michaeljklein opened this issue Aug 22, 2024 · 1 comment · Fixed by #5864
Assignees
Labels
enhancement New feature or request

Comments

@michaeljklein
Copy link
Contributor

michaeljklein commented Aug 22, 2024

Problem

Several of the blackbox functions fail in a variety of ways on inputs with too many bits. See #5614 for examples.

NOTE: this is currently causing non-deterministic failures, see Maxim's comment below

Happy Case

As per Maxim's comments on #5614:

  • We should have a clearer ban on the bit size for these functions so this isn't possible at all.
  • Let's make sure we are setting up the input bits correctly here and update the issue accordingly.
  • At a minimum we should panic if the incorrect bit size is provided (e.g. 254 instead of 8 for keccak256) so that we know codegen is incorrect.
  • We could probably just return an OpcodeResolutionError<F>::BlackBoxFunctionFailed

Workaround

None

Workaround Description

No response

Additional Context

No response

Project Impact

Nice-to-have

Blocker Context

It's similar to overflow checks for blackbox function inputs

Would you like to submit a PR for this Issue?

None

Support Needs

No response

@michaeljklein michaeljklein added the enhancement New feature or request label Aug 22, 2024
@github-project-automation github-project-automation bot moved this to 📋 Backlog in Noir Aug 22, 2024
@vezenovm
Copy link
Contributor

@michaeljklein michaeljklein self-assigned this Aug 27, 2024
github-merge-queue bot pushed a commit that referenced this issue Sep 11, 2024
# Description

- [x] Convert `FunctionInput::constant/witness` assertions to solver
errors

## Problem\*

- Resolves #5793

## Summary\*

- Adds assertions 

## Additional Context



## Documentation\*

Check one:
- [x] No documentation needed.
- [ ] Documentation included in this PR.
- [ ] **[For Experimental Features]** Documentation to be submitted in a
separate PR.

# PR Checklist\*

- [x] I have tested the changes locally.
- [x] I have formatted the changes with [Prettier](https://prettier.io/)
and/or `cargo fmt` on default settings.

---------

Co-authored-by: Tom French <tom@tomfren.ch>
Co-authored-by: Tom French <15848336+TomAFrench@users.noreply.github.com>
@github-project-automation github-project-automation bot moved this from 📋 Backlog to ✅ Done in Noir Sep 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: ✅ Done
Development

Successfully merging a pull request may close this issue.

2 participants