Skip to content

Commit fb5bffa

Browse files
committed
comments
1 parent 4d3b61e commit fb5bffa

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

circuit-prover/src/batch_stark_prover.rs

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,12 @@ pub struct RowCounts([usize; NUM_TABLES]);
4040

4141
impl RowCounts {
4242
/// Creates a new RowCounts with the given row counts for each table.
43-
pub fn new(rows: [usize; NUM_TABLES]) -> Self {
43+
pub const fn new(rows: [usize; NUM_TABLES]) -> Self {
4444
// Validate that all row counts are non-zero
45-
for (i, &count) in rows.iter().enumerate() {
46-
assert!(count > 0, "Table {i} has zero rows, which is not supported");
45+
let mut i = 0;
46+
while i < rows.len() {
47+
assert!(rows[i] > 0);
48+
i += 1;
4749
}
4850
Self(rows)
4951
}
@@ -73,12 +75,17 @@ pub struct BatchStarkProof<SC>
7375
where
7476
SC: MSGC,
7577
{
78+
/// The core cryptographic proof generated by `p3-multi-stark`.
7679
pub proof: MultiProof<SC>,
77-
// Metadata to re-construct AIRs on verifier side.
80+
/// Packing configuration used for the Add and Mul tables.
7881
pub table_packing: TablePacking,
82+
/// The number of rows in each of the circuit tables.
7983
pub rows: RowCounts,
84+
/// The degree of the field extension (`D`) used for the proof.
8085
pub ext_degree: usize,
86+
/// The binomial coefficient `W` for extension field multiplication, if `ext_degree > 1`.
8187
pub w_binomial: Option<MVal<SC>>,
88+
/// The configuration for the MMCS table.
8289
pub mmcs_config: MmcsTableConfig,
8390
}
8491

@@ -241,6 +248,7 @@ where
241248
where
242249
EF: Field + BasedVectorSpace<MVal<SC>>,
243250
{
251+
// TODO: Consider parallelizing AIR construction and trace-to-matrix conversions.
244252
// Build matrices and AIRs per table.
245253
let packing = self.table_packing;
246254
let add_lanes = packing.add_lanes();

0 commit comments

Comments
 (0)