noir-lang / noir

Noir is a domain specific language for zero knowledge proofs
https://noir-lang.org
Apache License 2.0
854 stars 185 forks source link

Have nargo prove use pre-compiled circuit #5365

Closed gnull closed 2 months ago

gnull commented 2 months ago

Problem

Running nargo prove causes the circuit to be re-compiled on-the-fly, ignoring whether it was already built with nargo compile. I'd like to have nargo prove use the json file produced by nargo compile to save proving time and avoid doing unnecessary work.

I investigated this by running nargo prove under strace. It shows that about 30-50% of the whole execution is spent before nargo accesses Prover.toml data. I'm assuming it's recompiling the circuit during that time.

Happy Case

Running nargo prove should use target/circuits.json and not recompile the circuit.

Project Impact

Nice-to-have

Impact Context

No response

Workaround

None

Workaround Description

No response

Additional Context

No response

Would you like to submit a PR for this Issue?

Yes

Support Needs

I could use some pointers to relevant pieces of code to implement this.

TomAFrench commented 2 months ago

Hi, we no longer have a nargo prove command and proving acts on build artifacts as suggested.

https://noir-lang.org/docs/dev/getting_started/hello_noir/#prove-our-noir-program