o1-labs / snarky

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

Add callback-oriented versions of `constraint_system` and `generate_witness` #836

Closed mrmr1993 closed 5 months ago

mrmr1993 commented 6 months ago

This PR refactors the internals of snarky to expose a callback-oriented version of the functions constraint_system and generate_witness. As the core entrypoints used by pickles, this allows us to use these callbacks to handle async witness generation.

This PR is structured as a series of refactoring commits, plus a final commit that implements the new functions. Each refactoring is deliberately structured so that there is no behavioural change, except for a few small performance optimisations as a result of removing duplicated/redundant computations.