diff --git a/Cargo.lock b/Cargo.lock index cc1c27df5c..08759fee04 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1486,7 +1486,7 @@ dependencies = [ [[package]] name = "neptune" version = "10.0.0" -source = "git+https://github.com/lurk-lab/neptune?branch=dev#79d1b84c2d8ef8e593ad912bcb3b21408fe697c9" +source = "git+https://github.com/lurk-lab/neptune?branch=dev#b3dc59efcd4c2628bcdb78b5d188d4e1bbaa40c9" dependencies = [ "abomonation", "abomonation_derive", @@ -1547,7 +1547,7 @@ checksum = "61807f77802ff30975e01f4f071c8ba10c022052f98b3294119f3e615d13e5be" [[package]] name = "nova-snark" version = "0.21.0" -source = "git+https://github.com/lurk-lab/nova?branch=dev#2c0f1afa821550c9ecbd2b4ac9cfa11ec1ce8c81" +source = "git+https://github.com/lurk-lab/nova?branch=dev#001202ff6636b9cb1d4de3b2d47c88b04b4c5b1d" dependencies = [ "abomonation", "abomonation_derive", diff --git a/src/proof/nova.rs b/src/proof/nova.rs index 176c00d22d..07c76f3573 100644 --- a/src/proof/nova.rs +++ b/src/proof/nova.rs @@ -292,17 +292,25 @@ impl<'a: 'b, 'b, C: Coprocessor> Proof<'a, C> { assert!(cs.is_satisfied()); } - - let res = RecursiveSNARK::prove_step( - &pp.pp, - recursive_snark, - circuit_primary.clone(), - circuit_secondary.clone(), - z0_primary.clone(), - z0_secondary.clone(), - ); - assert!(res.is_ok()); - recursive_snark = Some(res?); + let mut r_snark = recursive_snark.unwrap_or_else(|| { + RecursiveSNARK::new( + &pp.pp, + circuit_primary, + &circuit_secondary, + z0_primary.clone(), + z0_secondary.clone(), + ) + }); + r_snark + .prove_step( + &pp.pp, + circuit_primary, + &circuit_secondary, + z0_primary.clone(), + z0_secondary.clone(), + ) + .expect("failure to prove Nova step"); + recursive_snark = Some(r_snark); } Ok(Self::Recursive(Box::new(recursive_snark.unwrap()))) @@ -340,7 +348,7 @@ impl<'a: 'b, 'b, C: Coprocessor> Proof<'a, C> { let zi_secondary = z0_secondary.clone(); let (zi_primary_verified, zi_secondary_verified) = match self { - Self::Recursive(p) => p.verify(&pp.pp, num_steps, z0_primary, z0_secondary), + Self::Recursive(p) => p.verify(&pp.pp, num_steps, &z0_primary, &z0_secondary), Self::Compressed(p) => p.verify(&pp.vk, num_steps, z0_primary, z0_secondary), }?;