diff --git a/crates/prover/src/constraint_framework/component.rs b/crates/prover/src/constraint_framework/component.rs index c7d1e3669..5a31dd447 100644 --- a/crates/prover/src/constraint_framework/component.rs +++ b/crates/prover/src/constraint_framework/component.rs @@ -1,4 +1,5 @@ use std::borrow::Cow; +use std::fmt::{self, Display, Formatter}; use std::iter::zip; use std::ops::Deref; @@ -264,3 +265,33 @@ impl Deref for FrameworkComponent { &self.eval } } + +impl Display for FrameworkComponent { + fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result { + let log_n_rows = self.log_size(); + let mut n_cols = vec![]; + self.trace_log_degree_bounds() + .0 + .iter() + .for_each(|interaction| { + n_cols.push(interaction.len()); + }); + writeln!(f, "n_rows 2^{}", log_n_rows)?; + writeln!(f, "n_constraints {}", self.n_constraints())?; + writeln!( + f, + "constraint_log_degree_bound {}", + self.max_constraint_log_degree_bound() + )?; + writeln!( + f, + "total felts: 2^{} * {}", + log_n_rows, + n_cols.iter().sum::() + )?; + for (j, n_cols) in n_cols.into_iter().enumerate() { + writeln!(f, "\t Interaction {}: n_cols {}", j, n_cols)?; + } + Ok(()) + } +} diff --git a/crates/prover/src/examples/poseidon/mod.rs b/crates/prover/src/examples/poseidon/mod.rs index 0cbc3ebbd..80a6c6516 100644 --- a/crates/prover/src/examples/poseidon/mod.rs +++ b/crates/prover/src/examples/poseidon/mod.rs @@ -3,7 +3,7 @@ use std::ops::{Add, AddAssign, Mul, Sub}; use itertools::Itertools; -use tracing::{span, Level}; +use tracing::{info, span, Level}; use crate::constraint_framework::constant_columns::gen_is_first; use crate::constraint_framework::logup::{LogupAtRow, LogupTraceGenerator, LookupElements}; @@ -386,6 +386,7 @@ pub fn prove_poseidon( total_sum, }, ); + info!("Poseidon component info:\n{}", component); let proof = prove(&[&component], channel, commitment_scheme).unwrap(); (component, proof)