mirror of
https://github.com/logos-storage/plonky2.git
synced 2026-01-03 14:23:07 +00:00
Minor
This commit is contained in:
parent
7dec6efc6c
commit
2e12ee8e82
@ -51,7 +51,7 @@ pub struct CircuitBuilder<F: Extendable<D>, const D: usize> {
|
||||
pub marked_targets: Vec<MarkedTargets<D>>,
|
||||
|
||||
/// Generators used to generate the witness.
|
||||
pub generators: Vec<Box<dyn WitnessGenerator<F>>>,
|
||||
generators: Vec<Box<dyn WitnessGenerator<F>>>,
|
||||
|
||||
constants_to_targets: HashMap<F, Target>,
|
||||
targets_to_constants: HashMap<Target, F>,
|
||||
@ -361,7 +361,7 @@ impl<F: Extendable<D>, const D: usize> CircuitBuilder<F, D> {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn blind_and_pad(&mut self) {
|
||||
fn blind_and_pad(&mut self) {
|
||||
let (regular_poly_openings, z_openings) = self.blinding_counts();
|
||||
info!(
|
||||
"Adding {} blinding terms for witness polynomials, and {}*2 for Z polynomials",
|
||||
@ -414,7 +414,7 @@ impl<F: Extendable<D>, const D: usize> CircuitBuilder<F, D> {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn constant_polys(
|
||||
fn constant_polys(
|
||||
&self,
|
||||
gates: &[PrefixedGate<F, D>],
|
||||
num_constants: usize,
|
||||
|
||||
@ -9,7 +9,6 @@ use crate::fri::FriConfig;
|
||||
use crate::gates::gate::{GateInstance, PrefixedGate};
|
||||
use crate::generator::WitnessGenerator;
|
||||
use crate::polynomial::commitment::ListPolynomialCommitment;
|
||||
use crate::polynomial::polynomial::PolynomialValues;
|
||||
use crate::proof::{Hash, HashTarget, Proof};
|
||||
use crate::prover::prove;
|
||||
use crate::target::Target;
|
||||
|
||||
@ -9,7 +9,7 @@ impl From<(Target, Target)> for CopyConstraint {
|
||||
fn from(pair: (Target, Target)) -> Self {
|
||||
Self {
|
||||
pair,
|
||||
name: String::default(),
|
||||
name: String::new(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -190,7 +190,7 @@ impl<F: Extendable<D>, const D: usize> CircuitBuilder<F, D> {
|
||||
.copied()
|
||||
.collect::<Vec<_>>();
|
||||
let mut single_numerator = alpha.reduce(&single_evals, self);
|
||||
// TODO: Precompute the rhs as it is the same in all FRI round.
|
||||
// TODO: Precompute the rhs as it is the same in all FRI rounds.
|
||||
let rhs = alpha.reduce(&single_openings, self);
|
||||
single_numerator = self.sub_extension(single_numerator, rhs);
|
||||
let single_denominator = self.sub_extension(subgroup_x, zeta);
|
||||
|
||||
@ -459,7 +459,7 @@ mod tests {
|
||||
|
||||
let config = CircuitConfig::large_config();
|
||||
|
||||
let mut builder = CircuitBuilder::<F, D>::new(config.clone());
|
||||
let mut builder = CircuitBuilder::<F, D>::new(config);
|
||||
|
||||
let x = FF::rand();
|
||||
let y = FF::rand();
|
||||
|
||||
@ -8,7 +8,6 @@ use crate::field::extension_field::{Extendable, FieldExtension};
|
||||
use crate::field::field::Field;
|
||||
use crate::gates::gate_tree::Tree;
|
||||
use crate::generator::WitnessGenerator;
|
||||
use crate::target::Target;
|
||||
use crate::vars::{EvaluationTargets, EvaluationVars, EvaluationVarsBase};
|
||||
|
||||
/// A custom gate.
|
||||
|
||||
@ -55,12 +55,6 @@ pub(crate) fn generate_partial_witness<F: Field>(
|
||||
|
||||
pending_generator_indices = next_pending_generator_indices;
|
||||
}
|
||||
for i in 0..generators.len() {
|
||||
if !expired_generator_indices.contains(&i) {
|
||||
dbg!(i);
|
||||
break;
|
||||
}
|
||||
}
|
||||
assert_eq!(
|
||||
expired_generator_indices.len(),
|
||||
generators.len(),
|
||||
|
||||
@ -124,6 +124,7 @@ impl<F: Extendable<D>, const D: usize> CircuitBuilder<F, D> {
|
||||
)
|
||||
}
|
||||
|
||||
// TODO: this is far from optimal.
|
||||
let leaf_index_rev = self.reverse_limbs::<2>(leaf_index, height);
|
||||
self.assert_equal(acc_leaf_index, leaf_index_rev);
|
||||
|
||||
|
||||
@ -20,7 +20,6 @@ use crate::util::{log2_ceil, log2_strict, reverse_bits, reverse_index_bits_in_pl
|
||||
pub const SALT_SIZE: usize = 2;
|
||||
|
||||
pub struct ListPolynomialCommitment<F: Field> {
|
||||
pub original_values: Vec<PolynomialValues<F>>, // TODO: Remove when debugging is done.
|
||||
pub polynomials: Vec<PolynomialCoeffs<F>>,
|
||||
pub merkle_tree: MerkleTree<F>,
|
||||
pub degree: usize,
|
||||
@ -42,7 +41,7 @@ impl<F: Field> ListPolynomialCommitment<F> {
|
||||
"to compute LDE"
|
||||
);
|
||||
|
||||
Self::new_from_data(values, polynomials, lde_values, degree, rate_bits, blinding)
|
||||
Self::new_from_data(polynomials, lde_values, degree, rate_bits, blinding)
|
||||
}
|
||||
|
||||
/// Creates a list polynomial commitment for the polynomials `polynomials`.
|
||||
@ -52,17 +51,15 @@ impl<F: Field> ListPolynomialCommitment<F> {
|
||||
blinding: bool,
|
||||
) -> Self {
|
||||
let degree = polynomials[0].len();
|
||||
let values = polynomials.iter().map(|p| p.clone().fft()).collect();
|
||||
let lde_values = timed!(
|
||||
Self::lde_values(&polynomials, rate_bits, blinding),
|
||||
"to compute LDE"
|
||||
);
|
||||
|
||||
Self::new_from_data(values, polynomials, lde_values, degree, rate_bits, blinding)
|
||||
Self::new_from_data(polynomials, lde_values, degree, rate_bits, blinding)
|
||||
}
|
||||
|
||||
fn new_from_data(
|
||||
values: Vec<PolynomialValues<F>>,
|
||||
polynomials: Vec<PolynomialCoeffs<F>>,
|
||||
lde_values: Vec<Vec<F>>,
|
||||
degree: usize,
|
||||
@ -74,7 +71,6 @@ impl<F: Field> ListPolynomialCommitment<F> {
|
||||
let merkle_tree = timed!(MerkleTree::new(leaves, false), "to build Merkle tree");
|
||||
|
||||
Self {
|
||||
original_values: values,
|
||||
polynomials,
|
||||
merkle_tree,
|
||||
degree,
|
||||
|
||||
@ -1,4 +1,3 @@
|
||||
use std::collections::HashMap;
|
||||
use std::time::Instant;
|
||||
|
||||
use log::info;
|
||||
@ -6,7 +5,6 @@ use rayon::prelude::*;
|
||||
|
||||
use crate::circuit_data::{CommonCircuitData, ProverOnlyCircuitData};
|
||||
use crate::field::extension_field::Extendable;
|
||||
use crate::field::field::Field;
|
||||
use crate::generator::generate_partial_witness;
|
||||
use crate::plonk_challenger::Challenger;
|
||||
use crate::plonk_common::{PlonkPolynomials, ZeroPolyOnCoset};
|
||||
@ -14,7 +12,6 @@ use crate::polynomial::commitment::ListPolynomialCommitment;
|
||||
use crate::polynomial::polynomial::{PolynomialCoeffs, PolynomialValues};
|
||||
use crate::proof::Proof;
|
||||
use crate::timed;
|
||||
use crate::util::marking::MarkedTargets;
|
||||
use crate::util::partial_products::partial_products;
|
||||
use crate::util::{log2_ceil, transpose};
|
||||
use crate::vanishing_poly::{
|
||||
|
||||
@ -183,7 +183,6 @@ impl<F: Field> PartialWitness<F> {
|
||||
F: Extendable<D>,
|
||||
{
|
||||
for CopyConstraint { pair: (a, b), name } in copy_constraints {
|
||||
// TODO: Take care of public inputs once they land.
|
||||
let va = self.try_get_target(*a).unwrap_or(F::ZERO);
|
||||
let vb = self.try_get_target(*b).unwrap_or(F::ZERO);
|
||||
let desc = |t: &Target| -> String {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user