@@ -20,13 +20,13 @@ use std::{fmt, io};
2020
2121use crate :: stwo:: circuit_builder:: {
2222 gen_stwo_circle_column, get_constant_with_next_list, PowdrComponent , PowdrEval ,
23- STAGE0_TRACE_IDX , STAGE1_TRACE_IDX ,
23+ PREPROCESSED_TRACE_IDX , STAGE0_TRACE_IDX , STAGE1_TRACE_IDX ,
2424} ;
2525use crate :: stwo:: proof:: {
2626 Proof , SerializableStarkProvingKey , StarkProvingKey , TableProvingKey , TableProvingKeyCollection ,
2727} ;
2828
29- use stwo_prover:: constraint_framework:: { TraceLocationAllocator , PREPROCESSED_TRACE_IDX } ;
29+ use stwo_prover:: constraint_framework:: TraceLocationAllocator ;
3030
3131use stwo_prover:: core:: air:: { Component , ComponentProver } ;
3232use stwo_prover:: core:: backend:: { Backend , BackendForChannel } ;
@@ -459,6 +459,7 @@ where
459459 let mut stage0_witness_col_log_sizes = vec ! [ ] ;
460460 let mut stage1_witness_col_log_sizes = vec ! [ ] ;
461461
462+ // get the column sizes for stage 0 and stage 1, used by verifier to read the commitments from the proof
462463 self . split
463464 . iter ( )
464465 . zip_eq ( proof. machine_log_sizes . iter ( ) )
@@ -477,6 +478,7 @@ where
477478 } ,
478479 ) ;
479480
481+ // Verifier gets the commitments of the constant columns and stage 0 witness columns (two Merkle tree roots)
480482 commitment_scheme. commit (
481483 proof. stark_proof . commitments [ PREPROCESSED_TRACE_IDX ] ,
482484 & constant_col_log_sizes,
@@ -489,10 +491,10 @@ where
489491 verifier_channel,
490492 ) ;
491493
492- // TODO: make the challenge sound, now the challenge is built the same way in prover.
494+ // Get challenges based on the commitments of constant columns and stage 0 witness columns
493495 let stage0_challenges = get_challenges :: < MC > ( & self . analyzed , verifier_channel) ;
494496
495- let mut components = self
497+ let components = self
496498 . split
497499 . iter ( )
498500 . zip_eq ( proof. machine_log_sizes . iter ( ) )
@@ -519,13 +521,11 @@ where
519521 )
520522 . collect :: < Vec < _ > > ( ) ;
521523
522- let mut components_slice: Vec < & dyn Component > = components
523- . iter_mut ( )
524+ let components_slice: Vec < & dyn Component > = components
525+ . iter ( )
524526 . map ( |component| component as & dyn Component )
525527 . collect ( ) ;
526528
527- let components_slice = components_slice. as_mut_slice ( ) ;
528-
529529 if self . analyzed . stage_count ( ) > 1 {
530530 commitment_scheme. commit (
531531 proof. stark_proof . commitments [ STAGE1_TRACE_IDX ] ,
@@ -535,7 +535,7 @@ where
535535 }
536536
537537 stwo_prover:: core:: prover:: verify (
538- components_slice,
538+ & components_slice,
539539 verifier_channel,
540540 commitment_scheme,
541541 proof. stark_proof ,
0 commit comments