o1-labs / snarky

OCaml DSL for verifiable computation
MIT License
492 stars 73 forks source link

Avoid costly errors in JS witness generation #830

Closed mitschabaude closed 10 months ago

mitschabaude commented 1 year ago

Instead of throwing JS errors, which are costly because they collect a full stack trace, this changes some core parts of snarky to throw strings instead. Throwing strings is very fast, and this change leads to a huge speedup during witrness generation, see https://github.com/o1-labs/o1js/pull/1092