Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/scroll mem reduction #274

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions halo2_backend/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ serde_derive = { version = "1", optional = true}
rayon = "1.8"
halo2_middleware = { path = "../halo2_middleware" }
halo2_common = { path = "../halo2_common" }
itertools = "0.12"

[dev-dependencies]
assert_matches = "1.5"
Expand Down
18 changes: 5 additions & 13 deletions halo2_backend/src/plonk.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,7 @@ use crate::helpers::{
self, polynomial_slice_byte_length, read_polynomial_vec, write_polynomial_slice,
SerdeCurveAffine, SerdePrimeField,
};
use crate::poly::{
Coeff, EvaluationDomain, ExtendedLagrangeCoeff, LagrangeCoeff, PinnedEvaluationDomain,
Polynomial,
};
use crate::poly::{Coeff, EvaluationDomain, LagrangeCoeff, PinnedEvaluationDomain, Polynomial};
use crate::transcript::{ChallengeScalar, EncodedChallenge, Transcript};
use evaluation::Evaluator;
use halo2_common::plonk::{Circuit, ConstraintSystem, PinnedConstraintSystem};
Expand Down Expand Up @@ -323,14 +320,13 @@ pub struct PinnedVerificationKey<'a, C: CurveAffine> {
#[derive(Clone, Debug)]
pub struct ProvingKey<C: CurveAffine> {
vk: VerifyingKey<C>,
l0: Polynomial<C::Scalar, ExtendedLagrangeCoeff>,
l_last: Polynomial<C::Scalar, ExtendedLagrangeCoeff>,
l_active_row: Polynomial<C::Scalar, ExtendedLagrangeCoeff>,
l0: Polynomial<C::Scalar, Coeff>,
l_last: Polynomial<C::Scalar, Coeff>,
l_active_row: Polynomial<C::Scalar, Coeff>,
fixed_values: Vec<Polynomial<C::Scalar, LagrangeCoeff>>,
fixed_polys: Vec<Polynomial<C::Scalar, Coeff>>,
fixed_cosets: Vec<Polynomial<C::Scalar, ExtendedLagrangeCoeff>>,
permutation: permutation::ProvingKey<C>,
ev: Evaluator<C>,
ev: Evaluator<C::ScalarExt>,
}

impl<C: CurveAffine> ProvingKey<C>
Expand All @@ -353,7 +349,6 @@ where
+ scalar_len * (self.l0.len() + self.l_last.len() + self.l_active_row.len())
+ polynomial_slice_byte_length(&self.fixed_values)
+ polynomial_slice_byte_length(&self.fixed_polys)
+ polynomial_slice_byte_length(&self.fixed_cosets)
+ self.permutation.bytes_length()
}
}
Expand All @@ -379,7 +374,6 @@ where
self.l_active_row.write(writer, format)?;
write_polynomial_slice(&self.fixed_values, writer, format)?;
write_polynomial_slice(&self.fixed_polys, writer, format)?;
write_polynomial_slice(&self.fixed_cosets, writer, format)?;
self.permutation.write(writer, format)?;
Ok(())
}
Expand Down Expand Up @@ -411,7 +405,6 @@ where
let l_active_row = Polynomial::read(reader, format)?;
let fixed_values = read_polynomial_vec(reader, format)?;
let fixed_polys = read_polynomial_vec(reader, format)?;
let fixed_cosets = read_polynomial_vec(reader, format)?;
let permutation = permutation::ProvingKey::read(reader, format)?;
let ev = Evaluator::new(vk.cs());
Ok(Self {
Expand All @@ -421,7 +414,6 @@ where
l_active_row,
fixed_values,
fixed_polys,
fixed_cosets,
permutation,
ev,
})
Expand Down
Loading
Loading