Open oskarth opened 2 years ago
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 https://github.com/vacp2p/zerokit/commit/9b1fa85e46fc1d37f2f3e201ea6624940582925a
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.