From 483cb1139fe1b38b757f1b740b92d41049fc33c5 Mon Sep 17 00:00:00 2001 From: Kris Nuttycombe Date: Wed, 23 Dec 2020 09:47:19 -0700 Subject: [PATCH] Remove rotations from ConstraintSystem --- src/plonk/circuit.rs | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/src/plonk/circuit.rs b/src/plonk/circuit.rs index 17673bf..052e9af 100644 --- a/src/plonk/circuit.rs +++ b/src/plonk/circuit.rs @@ -1,7 +1,6 @@ use core::cmp::max; use core::ops::{Add, Mul}; use ff::Field; -use std::collections::BTreeMap; use std::convert::TryFrom; use super::{lookup, permutation, Error}; @@ -307,9 +306,6 @@ pub struct ConstraintSystem { pub(crate) aux_queries: Vec<(Column, Rotation)>, pub(crate) fixed_queries: Vec<(Column, Rotation)>, - // Mapping from a witness vector rotation to the index in the point vector. - pub(crate) rotations: BTreeMap, - // Vector of permutation arguments, where each corresponds to a sequence of columns // that are involved in a permutation argument. pub(crate) permutations: Vec, @@ -321,9 +317,6 @@ pub struct ConstraintSystem { impl Default for ConstraintSystem { fn default() -> ConstraintSystem { - let mut rotations = BTreeMap::new(); - rotations.insert(Rotation::default(), PointIndex(0)); - ConstraintSystem { num_fixed_columns: 0, num_advice_columns: 0, @@ -332,7 +325,6 @@ impl Default for ConstraintSystem { fixed_queries: Vec::new(), advice_queries: Vec::new(), aux_queries: Vec::new(), - rotations, permutations: Vec::new(), lookups: Vec::new(), } @@ -343,9 +335,6 @@ impl ConstraintSystem { /// Add a permutation argument for some advice columns pub fn permutation(&mut self, columns: &[Column]) -> usize { let index = self.permutations.len(); - if self.permutations.is_empty() { - self.add_rotation(Rotation(-1)); - } for column in columns { self.query_advice_index(*column, 0); @@ -367,9 +356,6 @@ impl ConstraintSystem { assert_eq!(input_columns.len(), table_columns.len()); let index = self.lookups.len(); - if self.lookups.is_empty() { - self.add_rotation(Rotation(-1)); - } for input in input_columns { self.query_any_index(*input, 0); @@ -385,7 +371,6 @@ impl ConstraintSystem { fn query_fixed_index(&mut self, column: Column, at: i32) -> usize { let at = Rotation(at); - self.add_rotation(at); // Return existing query, if it exists for (index, fixed_query) in self.fixed_queries.iter().enumerate() { @@ -408,7 +393,6 @@ impl ConstraintSystem { pub(crate) fn query_advice_index(&mut self, column: Column, at: i32) -> usize { let at = Rotation(at); - self.add_rotation(at); // Return existing query, if it exists for (index, advice_query) in self.advice_queries.iter().enumerate() { @@ -431,7 +415,6 @@ impl ConstraintSystem { fn query_aux_index(&mut self, column: Column, at: i32) -> usize { let at = Rotation(at); - self.add_rotation(at); // Return existing query, if it exists for (index, aux_query) in self.aux_queries.iter().enumerate() { @@ -555,9 +538,4 @@ impl ConstraintSystem { self.num_aux_columns += 1; tmp } - - fn add_rotation(&mut self, at: Rotation) { - let len = self.rotations.len(); - self.rotations.entry(at).or_insert(PointIndex(len)); - } }