-
Notifications
You must be signed in to change notification settings - Fork 204
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
fix: add new BrilligFunctionUnsatisfiedConstrain
resolution error variant
#5403
base: master
Are you sure you want to change the base?
fix: add new BrilligFunctionUnsatisfiedConstrain
resolution error variant
#5403
Conversation
…ariant (#6) * Convert BrilligSolver Trap failure into `BrilligFunctionUnsatisfiedConstrain` error * extract extract_failure_payload function to improve readability * Changed the variant checking on ACVM.map_brillig_error from OpcodeResolutionError::BrilligFunctionFailed to OpcodeResolutionError::BrilligFunctionUnsatisfiedConstrain * return ownership of the solver to brillig context when the debugger fails due to `BrilligFunctionUnsatisfiedConstrain`
Thank you for your contribution to the Noir language. Please do not force push to this branch after the Noir team have started review of this PR. Doing so will only delay us merging your PR as we will need to start the review process from scratch. Thanks for your understanding. |
Co-authored by: Ana Perez Ghiglia <[email protected]>
Co-authored-by: Ana Perez Ghiglia <[email protected]>
I would say that replacing the brillig solver in all cases is probably the way to go in this scenario. I think it was probably left off due to an expectation that execution has finished so we can discard the VM. |
# Description ## Problem\* Resolves <!-- Link to GitHub Issue --> ## Summary\* This PR pulls out a modified version of @anaPerezGhiglia's refactoring to how we extract error payloads from the brillig VM's memory from #5403 to separate it from the creation of the new error variant. ## 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: Ana Perez Ghiglia <[email protected]>
I expect that this doesn't require the new error variant now, correct? |
@TomAFrench I guess the need of the new variant is debatable. I left the new variant since with it
|
Description
When an assertion fails on Brillig mode, the debugger fails to indicate the user where the program failed
while when running on ACIR mode it provides enough information 👇
Problem
Resolves
Summary
Context
assert
constraints are translated as "jump to trap" if the condition is not met when running in Brillig modeChanges
OpcodeResolutionError::BrilligFunctionUnsatisfiedConstrain
to represent failed constraints on BrilligTrap
failureACVM.map_brillig_error
fromOpcodeResolutionError::BrilligFunctionFailed
toOpcodeResolutionError::BrilligFunctionUnsatisfiedConstrain
since assertion errors will now fail with the latterBrilligFunctionFailed
for all other casesObservations
Err
scenarios? At first sight it seems that this would be the right thing to do, but I decided to handle only this known scenario in case I'm missing something.Documentation
Check one:
PR Checklist
cargo fmt
on default settings.