diff --git a/plonky2/examples/bench_recursion.rs b/plonky2/examples/bench_recursion.rs index ec4a67f9..b45904e9 100644 --- a/plonky2/examples/bench_recursion.rs +++ b/plonky2/examples/bench_recursion.rs @@ -25,7 +25,7 @@ use plonky2::plonk::circuit_builder::CircuitBuilder; use plonky2::plonk::circuit_data::{CircuitConfig, CommonCircuitData, VerifierOnlyCircuitData}; use plonky2::plonk::config::{AlgebraicHasher, GenericConfig, PoseidonGoldilocksConfig}; use plonky2::plonk::proof::{CompressedProofWithPublicInputs, ProofWithPublicInputs}; -use plonky2::plonk::prover::prove; +use plonky2::plonk::prover::{prove,prove_with_options,ProverOptions}; use plonky2::util::serialization::DefaultGateSerializer; use plonky2::util::timing::TimingTree; use plonky2_field::extension::Extendable; @@ -205,6 +205,7 @@ fn recursive_proof< InnerC: GenericConfig, const D: usize, >( + name: &str, inner: &ProofTuple, config: &CircuitConfig, min_degree_bits: Option, @@ -238,8 +239,12 @@ where pw.set_proof_with_pis_target(&pt, inner_proof)?; pw.set_verifier_data_target(&inner_data, inner_vd)?; + let prover_opts = ProverOptions { + export_witness: Some(format!("{}_witness.json",name)), + }; + let mut timing = TimingTree::new("prove", Level::Debug); - let proof = prove::(&data.prover_only, &data.common, pw, &mut timing)?; + let proof = prove_with_options::(&data.prover_only, &data.common, pw, &mut timing, &prover_opts)?; timing.print(); data.verify(proof.clone())?; @@ -324,7 +329,7 @@ pub fn benchmark_function( ); // Recursively verify the proof - let middle = recursive_proof::(&inner, config, None)?; + let middle = recursive_proof::(&String::from("middle"), &inner, config, None)?; let (_, _, common_data) = &middle; info!( "Single recursion {} degree {} = 2^{}", @@ -334,7 +339,7 @@ pub fn benchmark_function( ); // Add a second layer of recursion to shrink the proof size further - let outer = recursive_proof::(&middle, config, None)?; + let outer = recursive_proof::(&String::from("outer"), &middle, config, None)?; let (proof, vd, common_data) = &outer; info!( "Double recursion {} degree {} = 2^{}", diff --git a/tooling/web/index.html b/tooling/web/index.html index 3d685a5a..6dfbbe3e 100644 --- a/tooling/web/index.html +++ b/tooling/web/index.html @@ -15,6 +15,7 @@ console.log("onload!"); // let fname = "json/fibonacci_witness.json"; let fname = "json/lookup_witness.json"; + // let fname = "json/outer_witness.json"; load_witness(fname); }