From e468cce64ff1bf75d5aceecb493961c40a7bb4f9 Mon Sep 17 00:00:00 2001 From: guorong009 Date: Fri, 6 Dec 2024 15:57:57 +0800 Subject: [PATCH] doc: add comments to more structs in "halo2_backend" --- halo2_backend/src/plonk/circuit.rs | 3 +++ halo2_backend/src/plonk/keygen.rs | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/halo2_backend/src/plonk/circuit.rs b/halo2_backend/src/plonk/circuit.rs index de9c6973f..d3208a9dd 100644 --- a/halo2_backend/src/plonk/circuit.rs +++ b/halo2_backend/src/plonk/circuit.rs @@ -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 @@ -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 @@ -230,6 +232,7 @@ impl ConstraintSystemBack { } } +/// A minimum version of `Gates`, which contains the constraint polynomial identities used in circuit. struct PinnedGates<'a, F: Field>(&'a Vec>); impl<'a, F: Field> std::fmt::Debug for PinnedGates<'a, F> { diff --git a/halo2_backend/src/plonk/keygen.rs b/halo2_backend/src/plonk/keygen.rs index 028812dd1..c9869dbbe 100644 --- a/halo2_backend/src/plonk/keygen.rs +++ b/halo2_backend/src/plonk/keygen.rs @@ -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)>,