arkworks-rs / snark

Interfaces for Relations and SNARKs for these relations
https://www.arkworks.rs
Apache License 2.0
769 stars 203 forks source link

Constraint system that panics when an invalid constraint is added #353

Open weikengchen opened 2 years ago

weikengchen commented 2 years ago

Summary

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.

Proposal

A potential solution for debugging is as follows:

Since such checking has an overhead, it is only turned on when debug mode is on, which by default is off.


For Admin Use