zkevm-circuits icon indicating copy to clipboard operation
zkevm-circuits copied to clipboard

Improve error handling

Open ChihChengLiang opened this issue 2 years ago • 0 comments

Describe the feature you would like

We have an off-the-band discussion in a private channel. We summarize the points here.

Error::Synthesis is a big pain point we heard from the external individual contributor to the zkevm-circuits project.

In our assignment functions, we throw Error::Synthesis but with no context, making it hard to pin down the location of the error.

  • We band-aid the problem with error logs, but requires manually reading the logs to pin down the error, not a good solution.
  • A helpful context should tell the failure comes from the code_hash word assignment, from the bytecode circuit, and from the super circuit.

Additional context

  • https://mmapped.blog/posts/12-rust-error-handling.html
  • https://github.com/privacy-scaling-explorations/zkevm-circuits/pull/1638/files#diff-df0e992b158b1e733cd07a1e9674b0f7b3fd23d7610a97c7cee6b9c4956858d4R250

ChihChengLiang avatar Oct 24 '23 16:10 ChihChengLiang