-
Notifications
You must be signed in to change notification settings - Fork 0
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(debugger): improve output when constrain fails #5
fix(debugger): improve output when constrain fails #5
Conversation
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. |
dda35c7
to
54c45a3
Compare
acvm-repo/acvm/src/pwg/brillig.rs
Outdated
@@ -206,18 +214,14 @@ impl<'b, B: BlackBoxFunctionSolver<F>, F: AcirField> BrilligSolver<'b, F, B> { | |||
})) | |||
} | |||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if it doesn't throw you into borrow checker hell, maybe it's a good idea to move the left hand side of let payload = ...
to a function, for readability
acvm-repo/acvm/src/pwg/brillig.rs
Outdated
}) | ||
.collect(), | ||
call_stack, | ||
found_trap, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Having a boolean capture this doesn't feel right, have you considered just adding the FailureReason here? (so instead of found_trap: bool
, you'd end up with reason: FailureReason
)
a322e9c
to
d47f33c
Compare
58e8fb4
to
370a610
Compare
* Abstract `extract_failure_payload` function for improving readability
370a610
to
51d1193
Compare
d47f33c
to
a8928dd
Compare
Closing this PR in favor of #6 |
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::BrilligFunctionFailed
to track whether the function failed due to a trap opcode or notBrilligFunctionFailed
Display
implementation when function failed due to a TrapError
derive macro, to have a conditional messageObservations
TODO:
should we return solver ownership in all Err scenarios>?Documentation
Check one:
PR Checklist
cargo fmt
on default settings.