Skip to content

Commit

Permalink
Fix pil-helpers
Browse files Browse the repository at this point in the history
  • Loading branch information
RogerTaule committed Sep 9, 2024
1 parent 99bbe1e commit cac73ba
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 9 deletions.
12 changes: 6 additions & 6 deletions cli/src/commands/verify_constraints.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ pub struct VerifyConstraintsCmd {
pub field: Field,

/// Verbosity (-v, -vv)
#[arg(short, long, action = clap::ArgAction::Count, help = "Increase verbosity level")]
#[arg(short, long, action = clap::ArgAction::Count, help = "Increase verbosity level")]
pub verbose: u8, // Using u8 to hold the number of `-v`
}

Expand All @@ -73,12 +73,12 @@ impl VerifyConstraintsCmd {
type GL = Goldilocks;

let debug_mode = match self.verbose {
0 => 1, // Default to Error
1 => 2, // -v
2 => 3, // -vv _ => log::LevelFilter::Trace,
_ => 1
0 => 1, // Default to Error
1 => 2, // -v
2 => 3, // -vv _ => log::LevelFilter::Trace,
_ => 1,
};

let _valid_constraints = match self.field {
Field::Goldilocks => ProofMan::<GL>::generate_proof(
self.witness_lib.clone(),
Expand Down
6 changes: 5 additions & 1 deletion pilout/src/pilout_proxy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,11 @@ impl PilOutProxy {
}

pub fn num_stages(&self) -> u32 {
self.pilout.num_challenges.len() as u32
if self.pilout.num_challenges.is_empty() {
1
} else {
self.pilout.num_challenges.len() as u32
}
}

pub fn num_rows(&self, subproof_id: usize, air_id: usize) -> usize {
Expand Down
6 changes: 4 additions & 2 deletions proofman/src/proofman.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ impl<F: Field + 'static> ProofMan<F> {
log::info!("{}: <-- Verifying constraints", Self::MY_NAME);

witness_lib.debug(&pctx, &ectx, &sctx);

let constraints = Self::verify_constraints(&mut provers, &mut pctx);

let mut valid_constraints = true;
Expand Down Expand Up @@ -227,7 +227,9 @@ impl<F: Field + 'static> ProofMan<F> {
);
}
log::debug!("{}: ··· ", Self::MY_NAME);
if !valid_constraints_prover { valid_constraints = false; }
if !valid_constraints_prover {
valid_constraints = false;
}
}

log::info!("{}: <-- Checking global constraints", Self::MY_NAME);
Expand Down

0 comments on commit cac73ba

Please sign in to comment.