From 817fe1e3a356fef87da102952f0a89aa75d7402c Mon Sep 17 00:00:00 2001 From: wborgeaud Date: Thu, 2 Dec 2021 16:53:25 +0100 Subject: [PATCH 1/2] Remove obsolete todos --- src/field/cosets.rs | 2 -- src/gadgets/arithmetic.rs | 1 - src/plonk/prover.rs | 1 - 3 files changed, 4 deletions(-) diff --git a/src/field/cosets.rs b/src/field/cosets.rs index 4ad9ba38..62be67dc 100644 --- a/src/field/cosets.rs +++ b/src/field/cosets.rs @@ -31,8 +31,6 @@ mod tests { #[test] fn distinct_cosets() { - // TODO: Switch to a smaller test field so that collision rejection is likely to occur. - type F = GoldilocksField; const SUBGROUP_BITS: usize = 5; const NUM_SHIFTS: usize = 50; diff --git a/src/gadgets/arithmetic.rs b/src/gadgets/arithmetic.rs index 0931cc88..63f149cd 100644 --- a/src/gadgets/arithmetic.rs +++ b/src/gadgets/arithmetic.rs @@ -184,7 +184,6 @@ impl, const D: usize> CircuitBuilder { } /// Add `n` `Target`s. - // TODO: Can be made `D` times more efficient by using all wires of an `ArithmeticExtensionGate`. pub fn add_many(&mut self, terms: &[Target]) -> Target { let terms_ext = terms .iter() diff --git a/src/plonk/prover.rs b/src/plonk/prover.rs index 4f281f06..94c2fa29 100644 --- a/src/plonk/prover.rs +++ b/src/plonk/prover.rs @@ -146,7 +146,6 @@ pub(crate) fn prove, const D: usize>( .into_par_iter() .flat_map(|mut quotient_poly| { quotient_poly.trim(); - // TODO: Return Result instead of panicking. quotient_poly.pad(quotient_degree).expect( "Quotient has failed, the vanishing polynomial is not divisible by `Z_H", ); From c2ca106a29f4e778fac265872ce25b34bb7a03b4 Mon Sep 17 00:00:00 2001 From: wborgeaud Date: Thu, 2 Dec 2021 16:56:58 +0100 Subject: [PATCH 2/2] Rewrite `add_many` --- src/gadgets/arithmetic.rs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/gadgets/arithmetic.rs b/src/gadgets/arithmetic.rs index 63f149cd..3d54bdc3 100644 --- a/src/gadgets/arithmetic.rs +++ b/src/gadgets/arithmetic.rs @@ -185,11 +185,7 @@ impl, const D: usize> CircuitBuilder { /// Add `n` `Target`s. pub fn add_many(&mut self, terms: &[Target]) -> Target { - let terms_ext = terms - .iter() - .map(|&t| self.convert_to_ext(t)) - .collect::>(); - self.add_many_extension(&terms_ext).to_target_array()[0] + terms.iter().fold(self.zero(), |acc, &t| self.add(acc, t)) } /// Computes `x - y`.