axiom-crypto / snark-verifier

Apache License 2.0
94 stars 34 forks source link

Unable to run tests of `snark-verifier` #66

Closed guha-rahul closed 2 weeks ago

guha-rahul commented 2 weeks ago

I am trying to run the tests of snark-verifer folder. I added a file in snark-verifier/configs called verify_circuit.config and added this configuration

{"strategy":"Simple","degree":21,"num_advice":4,"num_lookup_advice":1,"num_fixed":1,"lookup_bits":20,"limb_bits":88,"num_limbs":3}

I ran

cargo run --example recursion --release

to run the recursion example. The error i am receiving is

read params from ./params/kzg_bn254_5.srs
thread 'main' panicked at snark-verifier/examples/recursion.rs:791:82:
called `Result::unwrap()` on an `Err` value: Os { code: 2, kind: NotFound, message: "No such file or directory" }
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
[1]    37750 abort      cargo run --example recursion --release
yi-sun commented 2 weeks ago

The error is here, you need to rename your config file.

guha-rahul commented 2 weeks ago

Thank you @yi-sun . Also another question i had was the example in snark-verifier-sdk is using https://github.com/axiom-crypto/halo2/blob/a4140d7129759c995e29ed203350a90a3c57d896/halo2_proofs/src/plonk/verifier.rs#L24 as its proof verification while the snark-verifier one uses https://github.com/axiom-crypto/snark-verifier/blob/343c89e416ff7320a0bca30cc24f2a873c56ce11/snark-verifier/src/verifier/plonk.rs#L61. Why is that?

jonathanpwang commented 2 weeks ago

The one in snark-verifier does an additional check that the KZG accumulator in the proof passes a pairing check. In the snark-verifier-sdk examples we use the halo2 verifier for debugging purposes because it is easier to invoke. The verifier circuits and EVM verifier contract all use the verify in snark-verifier's plonk.rs.

jonathanpwang commented 2 weeks ago

Closing because the original issue was resolved.