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
This issue is about a feature request on ConstraintSystem. Ideally, there is a debug mode. When it is on, it helps the developers find out which constraint is failing.
Problem Definition
After the namespaces disappear from arkworks-rs, it is harder to debug a constraint system that is not satisfactory, which often appears only when the verify function fails.
Summary
This issue is about a feature request on
ConstraintSystem
. Ideally, there is adebug
mode. When it is on, it helps the developers find out which constraint is failing.Problem Definition
After the namespaces disappear from
arkworks-rs
, it is harder to debug a constraint system that is not satisfactory, which often appears only when theverify
function fails.Proposal
A potential solution for debugging is as follows:
When we enforce a constraint (https://github.com/arkworks-rs/snark/blob/master/relations/src/r1cs/constraint_system.rs#L254), we immediately check if this constraint is satisfactory. If not, panic immediately. Note that this cannot be done in the setup mode.
An implementation of such checking has appeared in Aleo's snarkVM, which intentionally checks if a constraint is satisfactory and records the first unsatisfactory constraint. https://github.com/AleoHQ/snarkVM/blob/testnet2/r1cs/src/test_constraint_checker.rs#L120
Since such checking has an overhead, it is only turned on when
debug
mode is on, which by default is off.For Admin Use
The text was updated successfully, but these errors were encountered: