-
Notifications
You must be signed in to change notification settings - Fork 133
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
Add logs to halo2 #134
Comments
I actually have a different suggestion: can we go back to |
After having experimented locally a bit with replacing the error logs from #135 by panics I agree with you! Whenever we encounter a @CPerezz @han0110 @davidnevadoc what do you think about replacing some errors by panics? |
yea I think in most case the |
I've submitted an alternative PR following the "panic" approach. Note that I've used |
When writing circuits in halo2 there are a lot of things that the developer can do wrong that causes errors in the circuit configuration / synthesis. halo2 detects these and reports them via the
Error
type:halo2/halo2_proofs/src/plonk/error.rs
Lines 8 to 40 in c7e42e4
Unfortunately most of the error cases don't contain contextual information, and moreover they can mean different things at the same time.
For example,
Error::NotEnoughRowsAvailable
can happen in these situations:When the developer sees
Error::NotEnoughRowsAvailable
, they don't know which case it was. Moreover, if the error was caused by an assignment, the developer doesn't the row of such assignment, or the range of usable columns (they only know thek
).I think a clean solution would be to extend the Error enum to add more information, nevertheless this would be quite a breaking change in halo2.
We have a similar issue with
Error:Synthesize
which is the error that we can return from the synthesis step: there's no way to add context information. Ideally this error case should contain aString
to add context information of why the synthesis cannot proceed.In the
zkevm-circuits
we resolved this lack of context inError::Synthesize
by adding logs, so I propose we do the same in halo2!This would introduce the
log
crate dependency. A nice thing about this crate is that the user of the library decides how these logs are used, and if there's no logger backend enabled, they have a negligible performance impact.The text was updated successfully, but these errors were encountered: