You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When debugging circuits, it is very useful to see what constraints haven't been met and why.
Details
This should be possible with ConstraintLayer but I haven't managed to get to work properly:
In poseidon_tornado with
RUST_LOG="poseidon_tornado=TRACE,ark_relations=TRACE" cargo run
We get
Constraint trace requires enabling `ConstraintLayer`
thread 'main' panicked at 'assertion failed: {\n use ark_relations::r1cs::{ConstraintSynthesizer, ConstraintSystem};\n let cs = ConstraintSystem::<E::Fr>::new_ref();\n circom.clone().generate_constraints(cs.clone()).unwrap();\n cs.is_satisfied().unwrap()\n}', /home/oskarth/repos/github.com/gakonst/ark-circom/src/circom/builder.rs:82:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
This is actually quite a big problem, e.g. a typo "nullifer" vs "nullifier" had me stumped for quite a while. Right now there's zero useful feedback here. Some kind of type assertions would be useful here? Probably requires looking into proof/witness WASM format a bit more.
Problem
When debugging circuits, it is very useful to see what constraints haven't been met and why.
Details
This should be possible with
ConstraintLayer
but I haven't managed to get to work properly:In
poseidon_tornado
withWe get
The panic happens because constraints aren't met, which is expected. This then panics because of the
debug_assert
here https://github.com/gakonst/ark-circom/blob/master/src/circom/builder.rs#L82-L87The problem is the lack of tracing, even with 9b1fa85
Tracing instrumentation based on example here https://github.com/arkworks-rs/r1cs-tutorial/blob/main/merkle-tree-example/src/constraints.rs#L109-L113
Same when trying to do tracing instrumentation in various ways directly in ark-circom etc.
Error from https://github.com/arkworks-rs/snark/blob/master/relations/src/r1cs/constraint_system.rs#L609
Probably missing something simple here but haven't been to figure out what's wrong.
Acceptance criteria
Failing constraints should produce some form of useful debugging information re which constraints are failing.
The text was updated successfully, but these errors were encountered: