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

chore: add more comments #387

Merged
merged 3 commits into from
Dec 17, 2024
Merged
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
15 changes: 15 additions & 0 deletions halo2_backend/src/plonk.rs
Original file line number Diff line number Diff line change
Expand Up @@ -382,22 +382,37 @@ impl<C: CurveAffine> VerifyingKey<C> {
}
}

/// Verifier challenge value, used to keep lookup columns linearly independent
///
/// Ref: https://zcash.github.io/halo2/design/proving-system/circuit-commitments.html
#[derive(Clone, Copy, Debug)]
pub(crate) struct Theta;
pub(crate) type ChallengeTheta<F> = ChallengeScalar<F, Theta>;

/// Verifier challenge value, used to commit permutation polynomials
///
/// Ref: https://zcash.github.io/halo2/design/proving-system/permutation.html
#[derive(Clone, Copy, Debug)]
pub(crate) struct Beta;
pub(crate) type ChallengeBeta<F> = ChallengeScalar<F, Beta>;

/// Verifier challenge value, used to commit permutation polynomials
///
/// Ref: https://zcash.github.io/halo2/design/proving-system/permutation.html
#[derive(Clone, Copy, Debug)]
pub(crate) struct Gamma;
pub(crate) type ChallengeGamma<F> = ChallengeScalar<F, Gamma>;

/// Verifier challenge value, used to build quotient polynomial
///
/// Ref: https://zcash.github.io/halo2/design/proving-system/vanishing.html
#[derive(Clone, Copy, Debug)]
pub(crate) struct Y;
pub(crate) type ChallengeY<F> = ChallengeScalar<F, Y>;

/// Verifier challenge value, used for multipoint opening argument
///
/// Ref: https://zcash.github.io/halo2/design/proving-system/multipoint-opening.html
#[derive(Clone, Copy, Debug)]
pub(crate) struct X;
pub(crate) type ChallengeX<F> = ChallengeScalar<F, X>;
3 changes: 3 additions & 0 deletions halo2_backend/src/plonk/circuit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ use halo2_middleware::expression::{Expression, Variable};
use halo2_middleware::poly::Rotation;
use halo2_middleware::{lookup, permutation::ArgumentMid, shuffle};

/// Represent the index, column and rotation of a query, for backwards compatibility
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub struct QueryBack {
/// Query index
Expand All @@ -14,6 +15,7 @@ pub struct QueryBack {
pub(crate) rotation: Rotation,
}

/// Represent the `Query` and `Challenge`, for backwards compatibility
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub enum VarBack {
/// This is a generic column query
Expand Down Expand Up @@ -230,6 +232,7 @@ impl<F: Field> ConstraintSystemBack<F> {
}
}

/// A minimum version of `Gates`, which contains the constraint polynomial identities used in circuit.
struct PinnedGates<'a, F: Field>(&'a Vec<GateBack<F>>);

impl<'a, F: Field> std::fmt::Debug for PinnedGates<'a, F> {
Expand Down
2 changes: 1 addition & 1 deletion halo2_backend/src/plonk/keygen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ where
ev,
})
}

/// A map of whole queries used in the circuit
struct QueriesMap {
map: HashMap<(ColumnMid, Rotation), usize>,
advice: Vec<(ColumnMid, Rotation)>,
Expand Down
Loading