diff --git a/CHANGELOG.md b/CHANGELOG.md index 8956f563..b98fe7cd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,6 +24,7 @@ and this project adheres to Rust's notion of ### Removed - `halo2::arithmetic::BatchInvert` (use `ff::BatchInvert` instead). +- `impl Default for halo2::poly::Rotation` (use `Rotation::cur()` instead). ## [0.1.0-beta.1] - 2021-09-24 Initial beta release! diff --git a/examples/simple-example.rs b/examples/simple-example.rs index f75e6f5d..8e69daa5 100644 --- a/examples/simple-example.rs +++ b/examples/simple-example.rs @@ -65,9 +65,6 @@ struct FieldConfig { // This is important when building larger circuits, where columns are used by // multiple sets of instructions. s_mul: Selector, - - /// The fixed column used to load constants. - constant: Column, } impl FieldChip { @@ -125,7 +122,6 @@ impl FieldChip { advice, instance, s_mul, - constant, } } } diff --git a/src/plonk.rs b/src/plonk.rs index a31e6c6d..de916fe2 100644 --- a/src/plonk.rs +++ b/src/plonk.rs @@ -112,6 +112,7 @@ impl VerifyingKey { /// Minimal representation of a verification key that can be used to identify /// its active contents. +#[allow(dead_code)] #[derive(Debug)] pub struct PinnedVerificationKey<'a, C: CurveAffine> { base_modulus: &'static str, diff --git a/src/plonk/circuit.rs b/src/plonk/circuit.rs index f36d52e6..4ca4e16f 100644 --- a/src/plonk/circuit.rs +++ b/src/plonk/circuit.rs @@ -982,6 +982,7 @@ pub struct ConstraintSystem { } /// Represents the minimal parameters that determine a `ConstraintSystem`. +#[allow(dead_code)] #[derive(Debug)] pub struct PinnedConstraintSystem<'a, F: Field> { num_fixed_columns: &'a usize, diff --git a/src/plonk/lookup/prover.rs b/src/plonk/lookup/prover.rs index 33aa36d7..6e7c60d3 100644 --- a/src/plonk/lookup/prover.rs +++ b/src/plonk/lookup/prover.rs @@ -30,14 +30,12 @@ pub(in crate::plonk) struct Permuted { permuted_input_poly: Polynomial, permuted_input_coset: Polynomial, permuted_input_blind: Blind, - permuted_input_commitment: C, unpermuted_table_expressions: Vec>, unpermuted_table_cosets: Vec>, permuted_table_expression: Polynomial, permuted_table_poly: Polynomial, permuted_table_coset: Polynomial, permuted_table_blind: Blind, - permuted_table_commitment: C, } #[derive(Debug)] @@ -46,7 +44,6 @@ pub(in crate::plonk) struct Committed { product_poly: Polynomial, product_coset: Polynomial, product_blind: Blind, - product_commitment: C, } pub(in crate::plonk) struct Constructed { @@ -225,14 +222,12 @@ impl Argument { permuted_input_poly, permuted_input_coset, permuted_input_blind, - permuted_input_commitment, unpermuted_table_expressions, unpermuted_table_cosets, permuted_table_expression, permuted_table_poly, permuted_table_coset, permuted_table_blind, - permuted_table_commitment, }) } } @@ -393,7 +388,6 @@ impl Permuted { permuted: self, product_poly: z, product_coset, - product_commitment, product_blind, }) } diff --git a/src/poly.rs b/src/poly.rs index 8c43ee6c..d38ac729 100644 --- a/src/poly.rs +++ b/src/poly.rs @@ -288,12 +288,6 @@ impl<'a, F: Field, B: Basis> Mul for Polynomial { #[derive(Copy, Clone, Debug, PartialEq)] pub struct Rotation(pub i32); -impl Default for Rotation { - fn default() -> Rotation { - Rotation(0) - } -} - impl Rotation { /// The current location in the evaluation domain pub fn cur() -> Rotation { diff --git a/src/poly/commitment/prover.rs b/src/poly/commitment/prover.rs index 00a6b523..211b60fe 100644 --- a/src/poly/commitment/prover.rs +++ b/src/poly/commitment/prover.rs @@ -143,9 +143,9 @@ pub fn create_proof, T: TranscriptWrite(g: &mut [C], challenge: C::Scalar) { let len = g.len() / 2; - let (mut g_lo, g_hi) = g.split_at_mut(len); + let (g_lo, g_hi) = g.split_at_mut(len); - parallelize(&mut g_lo, |g_lo, start| { + parallelize(g_lo, |g_lo, start| { let g_hi = &g_hi[start..]; let mut tmp = Vec::with_capacity(g_lo.len()); for (g_lo, g_hi) in g_lo.iter().zip(g_hi.iter()) { diff --git a/src/poly/domain.rs b/src/poly/domain.rs index 1c785078..8f449359 100644 --- a/src/poly/domain.rs +++ b/src/poly/domain.rs @@ -409,13 +409,13 @@ impl EvaluationDomain { /// /// `into_coset` should be set to `true` when moving into the coset, /// and `false` when moving out. This toggles the choice of `zeta`. - fn distribute_powers_zeta(&self, mut a: &mut [G], into_coset: bool) { + fn distribute_powers_zeta(&self, a: &mut [G], into_coset: bool) { let coset_powers = if into_coset { [self.g_coset, self.g_coset_inv] } else { [self.g_coset_inv, self.g_coset] }; - parallelize(&mut a, |a, mut index| { + parallelize(a, |a, mut index| { for a in a { // Distribute powers to move into/from coset let i = index % (coset_powers.len() + 1); @@ -544,6 +544,7 @@ impl EvaluationDomain { } /// Represents the minimal parameters that determine an `EvaluationDomain`. +#[allow(dead_code)] #[derive(Debug)] pub struct PinnedEvaluationDomain<'a, G: Group> { k: &'a u32, diff --git a/src/poly/multiopen/prover.rs b/src/poly/multiopen/prover.rs index ba5df952..bea21010 100644 --- a/src/poly/multiopen/prover.rs +++ b/src/poly/multiopen/prover.rs @@ -15,14 +15,6 @@ use group::Curve; use std::io; use std::marker::PhantomData; -#[derive(Debug, Clone)] -struct CommitmentData { - set_index: usize, - blind: Blind, - point_indices: Vec, - evals: Vec, -} - /// Create a multi-opening proof pub fn create_proof<'a, I, C: CurveAffine, E: EncodedChallenge, T: TranscriptWrite>( params: &Params, diff --git a/src/poly/multiopen/verifier.rs b/src/poly/multiopen/verifier.rs index 5fca01fc..ea96a0b8 100644 --- a/src/poly/multiopen/verifier.rs +++ b/src/poly/multiopen/verifier.rs @@ -10,12 +10,6 @@ use super::{ }; use crate::arithmetic::{eval_polynomial, lagrange_interpolate, CurveAffine, FieldExt}; use crate::transcript::{EncodedChallenge, TranscriptRead}; -#[derive(Debug, Clone)] -struct CommitmentData { - set_index: usize, - point_indices: Vec, - evals: Vec, -} /// Verify a multi-opening proof pub fn verify_proof< diff --git a/tests/plonk_api.rs b/tests/plonk_api.rs index 52667cc7..e432c58b 100644 --- a/tests/plonk_api.rs +++ b/tests/plonk_api.rs @@ -218,7 +218,7 @@ fn plonk_api() { layouter.assign_region( || "public_input", |mut region| { - let value = region.assign_advice(|| "value", self.config.a, 0, || f())?; + let value = region.assign_advice(|| "value", self.config.a, 0, &mut f)?; region.assign_fixed(|| "public", self.config.sp, 0, || Ok(FF::one()))?; Ok(value.cell())