diff --git a/.cargo/config b/.cargo/config index 8d3b83b5b..4f1a60f3b 100644 --- a/.cargo/config +++ b/.cargo/config @@ -7,7 +7,6 @@ xclippy = [ "clippy", "--all-targets", "--", "-Wclippy::all", - "-Wclippy::all", "-Wclippy::match_same_arms", "-Wclippy::cast_lossless", "-Wclippy::dbg_macro", diff --git a/src/supernova/circuit.rs b/src/supernova/circuit.rs index 0d70d90c1..e120a007f 100644 --- a/src/supernova/circuit.rs +++ b/src/supernova/circuit.rs @@ -315,16 +315,16 @@ impl<'a, G: Group, SC: StepCircuit> SuperNovaAugmentedCircuit<'a, G, SC fn synthesize_non_base_case::Base>>( &self, mut cs: CS, - params: AllocatedNum, - i: AllocatedNum, - z_0: Vec>, - z_i: Vec>, + params: &AllocatedNum, + i: &AllocatedNum, + z_0: &[AllocatedNum], + z_i: &[AllocatedNum], U: &[AllocatedRelaxedR1CSInstance], - u: AllocatedR1CSInstance, - T: AllocatedPoint, + u: &AllocatedR1CSInstance, + T: &AllocatedPoint, arity: usize, last_augmented_circuit_index: &AllocatedNum, - program_counter: Option>, + program_counter: &Option>, num_augmented_circuits: usize, ) -> Result< ( @@ -344,8 +344,8 @@ impl<'a, G: Group, SC: StepCircuit> SuperNovaAugmentedCircuit<'a, G, SC + 2 * arity // zo, z1 + num_augmented_circuits * (7 + 2 * self.params.n_limbs), // #num_augmented_circuits * (7 + [X0, X1]*#num_limb) ); - ro.absorb(¶ms); - ro.absorb(&i); + ro.absorb(params); + ro.absorb(i); if self.params.is_primary_circuit { if let Some(program_counter) = program_counter.as_ref() { @@ -355,10 +355,10 @@ impl<'a, G: Group, SC: StepCircuit> SuperNovaAugmentedCircuit<'a, G, SC } } - for e in &z_0 { + for e in z_0 { ro.absorb(e); } - for e in &z_i { + for e in z_i { ro.absorb(e); } @@ -382,9 +382,9 @@ impl<'a, G: Group, SC: StepCircuit> SuperNovaAugmentedCircuit<'a, G, SC )?; let U_fold = U_to_fold.fold_with_r1cs( cs.namespace(|| "compute fold of U and u"), - ¶ms, - &u, - &T, + params, + u, + T, self.ro_consts.clone(), self.params.limb_width, self.params.n_limbs, @@ -488,16 +488,16 @@ impl<'a, G: Group, SC: StepCircuit> SuperNovaAugmentedCircuit<'a, G, SC let (last_augmented_circuit_index_checked, U_next_non_base, check_non_base_pass) = self .synthesize_non_base_case( cs.namespace(|| "synthesize non base case"), - params.clone(), - i.clone(), - z_0.clone(), - z_i.clone(), + ¶ms, + &i, + &z_0, + &z_i, &U, - u.clone(), - T, + &u, + &T, arity, &last_augmented_circuit_index, - program_counter.clone(), + &program_counter, num_augmented_circuits, )?; diff --git a/src/supernova/test.rs b/src/supernova/test.rs index 80b0dd15d..205c5aa67 100644 --- a/src/supernova/test.rs +++ b/src/supernova/test.rs @@ -228,7 +228,7 @@ where } fn print_constraints_name_on_error_index( - err: SuperNovaError, + err: &SuperNovaError, running_claim: &RunningClaim, num_augmented_circuits: usize, ) where @@ -238,7 +238,7 @@ fn print_constraints_name_on_error_index( Cb: StepCircuit, { match err { - SuperNovaError::UnSatIndex(msg, index) if msg == "r_primary" => { + SuperNovaError::UnSatIndex(msg, index) if *msg == "r_primary" => { let circuit_primary: SuperNovaAugmentedCircuit<'_, G2, Ca> = SuperNovaAugmentedCircuit::new( &running_claim.params.augmented_circuit_params_primary, None, @@ -249,10 +249,10 @@ fn print_constraints_name_on_error_index( let mut cs: TestShapeCS = TestShapeCS::new(); let _ = circuit_primary.synthesize(&mut cs); cs.constraints - .get(index) + .get(*index) .tap_some(|constraint| debug!("{msg} failed at constraint {}", constraint.3)); } - SuperNovaError::UnSatIndex(msg, index) if msg == "r_secondary" || msg == "l_secondary" => { + SuperNovaError::UnSatIndex(msg, index) if *msg == "r_secondary" || *msg == "l_secondary" => { let circuit_secondary: SuperNovaAugmentedCircuit<'_, G1, Cb> = SuperNovaAugmentedCircuit::new( &running_claim.params.augmented_circuit_params_secondary, None, @@ -263,7 +263,7 @@ fn print_constraints_name_on_error_index( let mut cs: TestShapeCS = TestShapeCS::new(); let _ = circuit_secondary.synthesize(&mut cs); cs.constraints - .get(index) + .get(*index) .tap_some(|constraint| debug!("{msg} failed at constraint {}", constraint.3)); } _ => (), @@ -440,7 +440,7 @@ where ) .map_err(|err| { print_constraints_name_on_error_index( - err, + &err, &running_claims[augmented_circuit_index], test_rom.num_circuits(), ) @@ -478,8 +478,8 @@ fn test_trivial_nivc() { // In the following we use 1 to refer to the primary, and 2 to refer to the secondary circuit fn test_recursive_circuit_with( - primary_params: SuperNovaAugmentedCircuitParams, - secondary_params: SuperNovaAugmentedCircuitParams, + primary_params: &SuperNovaAugmentedCircuitParams, + secondary_params: &SuperNovaAugmentedCircuitParams, ro_consts1: ROConstantsCircuit, ro_consts2: ROConstantsCircuit, num_constraints_primary: usize, @@ -492,7 +492,7 @@ fn test_recursive_circuit_with( let step_circuit1 = TrivialTestCircuit::default(); let arity1 = step_circuit1.arity(); let circuit1: SuperNovaAugmentedCircuit<'_, G2, TrivialTestCircuit<::Base>> = - SuperNovaAugmentedCircuit::new(&primary_params, None, &step_circuit1, ro_consts1.clone(), 2); + SuperNovaAugmentedCircuit::new(primary_params, None, &step_circuit1, ro_consts1.clone(), 2); let mut cs: ShapeCS = ShapeCS::new(); if let Err(e) = circuit1.synthesize(&mut cs) { panic!("{}", e) @@ -505,7 +505,7 @@ fn test_recursive_circuit_with( let arity2 = step_circuit2.arity(); let circuit2: SuperNovaAugmentedCircuit<'_, G1, TrivialSecondaryCircuit<::Base>> = SuperNovaAugmentedCircuit::new( - &secondary_params, + secondary_params, None, &step_circuit2, ro_consts2.clone(), @@ -535,7 +535,7 @@ fn test_recursive_circuit_with( ); let step_circuit = TrivialTestCircuit::default(); let circuit1: SuperNovaAugmentedCircuit<'_, G2, TrivialTestCircuit<::Base>> = - SuperNovaAugmentedCircuit::new(&primary_params, Some(inputs1), &step_circuit, ro_consts1, 2); + SuperNovaAugmentedCircuit::new(primary_params, Some(inputs1), &step_circuit, ro_consts1, 2); if let Err(e) = circuit1.synthesize(&mut cs1) { panic!("{}", e) } @@ -561,7 +561,7 @@ fn test_recursive_circuit_with( let step_circuit = TrivialSecondaryCircuit::default(); let circuit2: SuperNovaAugmentedCircuit<'_, G1, TrivialSecondaryCircuit<::Base>> = SuperNovaAugmentedCircuit::new( - &secondary_params, + secondary_params, Some(inputs2), &step_circuit, ro_consts2, @@ -584,5 +584,5 @@ fn test_recursive_circuit() { let ro_consts1: ROConstantsCircuit = PoseidonConstantsCircuit::default(); let ro_consts2: ROConstantsCircuit = PoseidonConstantsCircuit::default(); - test_recursive_circuit_with::(params1, params2, ro_consts1, ro_consts2, 9835, 12035); + test_recursive_circuit_with::(¶ms1, ¶ms2, ro_consts1, ro_consts2, 9835, 12035); }