Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions crates/cairo-addons/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,17 @@ fn setup_logging() -> Result<(), Box<dyn std::error::Error>> {
.with_ansi(false) // Disable colors
.with_span_events(FmtSpan::ENTER | FmtSpan::CLOSE);

let _ = tracing_subscriber::registry().with(json_layer).with(env_filter).try_init();
tracing_subscriber::registry().with(json_layer).with(env_filter).try_init()
.map_err(|e| Box::new(e) as Box<dyn std::error::Error>)?;
}
_ => {
// Plain text logging with ANSI colors (default)
let fmt_layer = fmt::layer()
.with_ansi(true) // Keep colors for plain text
.with_span_events(FmtSpan::ENTER | FmtSpan::CLOSE);

let _ = tracing_subscriber::registry().with(fmt_layer).with(env_filter).try_init();
tracing_subscriber::registry().with(fmt_layer).with(env_filter).try_init()
.map_err(|e| Box::new(e) as Box<dyn std::error::Error>)?;
}
}

Expand Down
4 changes: 2 additions & 2 deletions crates/cairo-addons/src/stwo_bindings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ pub fn prove(prover_input_path: PathBuf, proof_path: PathBuf, serde_cairo: bool)
#[cfg(feature = "dhat-heap")]
let _profiler = dhat::Profiler::new_heap();

let _ = setup_logging();
setup_logging().map_err(to_pyerr)?;
let prover_input =
read_and_adapt_prover_input_info_file(&prover_input_path).map_err(to_pyerr)?;
prove_with_stwo(prover_input, proof_path, serde_cairo, false).map_err(to_pyerr)
Expand All @@ -42,7 +42,7 @@ pub fn prove(prover_input_path: PathBuf, proof_path: PathBuf, serde_cairo: bool)
/// Python binding to verify a proof
#[pyfunction]
pub fn verify(proof_path: PathBuf) -> PyResult<()> {
let _ = setup_logging();
setup_logging().map_err(to_pyerr)?;
let proof_str = std::fs::read_to_string(&proof_path)?;
let proof: CairoProof<Blake2sMerkleHasher> =
sonic_rs::from_str(&proof_str).map_err(to_pyerr)?;
Expand Down
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ dependencies = [
"colorama>=0.4.6",
"pytest-timeout>=2.3.1",
"pytest-randomly>=3.16.0",
"pytest-timeout>=2.3.1",
"ethereum-execution",
"garaga-zero",
"requests-cache>=1.2.1",
Expand Down