-
Notifications
You must be signed in to change notification settings - Fork 212
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
feat(cli): Verify return
against ABI and Prover.toml
#6765
Conversation
Compilation Sample
|
Peak Memory Sample
|
--check-return
to execute
Is this reading necessary to be honest so it's kind of surprised that we didn't error out when ABI decoding already. If we have a witness map from which we want to decode return values and we find empty witnesses at indices that should hold return values then we should just error and that should avoid the need for this flag I think. |
@TomAFrench the reason it did not complain about the gaps in the witness map is explained here:
You are right that based on the ABI we can tell if the circuit has any return values. I'm not sure if But I'd argue that the flag still has value to easily assert the actual value of what is being returned, not just that something is, at least in the context of integration testing, where we use |
Ok, sorry I didn't read fully as I was on the tube. I'll have a look at this properly tomorrow. |
I added another check to see if the return value is empty when it should be non-empty according to the ABI; all the tests are passing so I suppose that means this is a reasonable expectation. Again doing it after saving the (partial) witness map to file, but could be one earlier if the value cannot be printed. Maybe we could compare |
This sounds good to me. I thought we already compared the return value against the verifier toml by default so it'd be good to have that behavior. |
--check-return
to execute
return
against ABI and Prover.toml
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.
Looks great!
Description
Problem*
Followup to #6757
Related to #6516
Summary*
Modified the
execute
command to:Some
value we can parse from theWitnessMap
return
entry inProver.toml
then it matches the actual value returned by the circuitThese checks are done after the witness is saved, so we can inspect what went into the file if necessary; the main goal is to be able to use this integration testing, since the ABI parser already looks for the
return
key.build.rs
will now check return values inexecution_success
, if present.Added the test case from #6516 as extra coverage in addition to the unit test in #6757
Additional Context
Example of running the test with wrong output in
Prover.toml
:Documentation*
Check one:
PR Checklist*
cargo fmt
on default settings.