Skip to content

Commit 35e52d6

Browse files
committed
Added more span logs to stwo_run_and_prove
1 parent aa1753e commit 35e52d6

File tree

3 files changed

+11
-6
lines changed

3 files changed

+11
-6
lines changed

crates/cairo-program-runner-lib/Cargo.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,16 @@ cairo-lang-runner.workspace = true
1212
cairo-lang-casm.workspace = true
1313
cairo-lang-execute-utils.workspace = true
1414
clap.workspace = true
15+
num-bigint.workspace = true
1516
num-traits.workspace = true
17+
regex.workspace = true
1618
serde.workspace = true
1719
serde_json.workspace = true
1820
starknet-crypto.workspace = true
1921
starknet-types-core.workspace = true
2022
thiserror.workspace = true
2123
thiserror-no-std.workspace = true
22-
regex.workspace = true
23-
num-bigint.workspace = true
24+
tracing.workspace = true
2425

2526
[dev-dependencies]
2627
assert_matches = "1.5.0"

crates/cairo-program-runner-lib/src/lib.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ use cairo_vm::types::program::Program;
44
use cairo_vm::vm::errors::cairo_run_errors::CairoRunError;
55
use cairo_vm::vm::runners::cairo_runner::CairoRunner;
66
pub use hints::*;
7+
use tracing::{span, Level};
78

89
pub mod hints;
910
pub mod tasks;
@@ -37,6 +38,8 @@ pub fn cairo_run_program(
3738
program_input_contents: Option<String>,
3839
cairo_run_config: CairoRunConfig,
3940
) -> Result<CairoRunner, CairoRunError> {
41+
let _span = span!(Level::INFO, "cairo_run_program").entered();
42+
4043
let mut hint_processor = BootloaderHintProcessor::new();
4144

4245
let mut exec_scopes = ExecutionScopes::new();

crates/stwo_run_and_prove/src/main.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@ use anyhow::Result;
22
use cairo_air::utils::ProofFormat;
33
use cairo_program_runner_lib::cairo_run_program;
44
use cairo_program_runner_lib::utils::{get_cairo_run_config, get_program, get_program_input};
5-
use cairo_vm::Felt252;
65
use cairo_vm::types::errors::program_errors::ProgramError;
76
use cairo_vm::types::layout_name::LayoutName;
87
use cairo_vm::vm::errors::cairo_run_errors::CairoRunError;
98
use cairo_vm::vm::errors::runner_errors::RunnerError;
109
use cairo_vm::vm::errors::vm_errors::VirtualMachineError;
1110
use cairo_vm::vm::runners::cairo_runner::CairoRunner;
11+
use cairo_vm::Felt252;
1212
use clap::Parser;
1313
#[cfg(test)]
1414
use mockall::automock;
@@ -17,12 +17,12 @@ use std::env;
1717
use std::fs;
1818
use std::path::PathBuf;
1919
use std::process::ExitCode;
20-
use stwo_cairo_adapter::ProverInput;
2120
use stwo_cairo_adapter::adapter::adapt;
21+
use stwo_cairo_adapter::ProverInput;
2222
use stwo_cairo_prover::prover::create_and_serialize_proof;
2323
use stwo_cairo_utils::binary_utils::run_binary;
2424
use thiserror::Error;
25-
use tracing::{Level, error, info, span};
25+
use tracing::{error, info, span, Level};
2626

2727
static PROVER_INPUT_FILE_NAME: &str = "prover_input.json";
2828

@@ -147,6 +147,7 @@ fn stwo_run_and_prove(
147147
debug_data_dir: Option<PathBuf>,
148148
save_debug_data: bool,
149149
) -> Result<(), StwoRunAndProveError> {
150+
let _span = span!(Level::INFO, "stwo_run_and_prove").entered();
150151
let cairo_run_config = get_cairo_run_config(
151152
// we don't use dynamic layout in stwo
152153
&None,
@@ -476,7 +477,7 @@ mod tests {
476477
assert!(
477478
file_exists(&debug_data_tempdir.path().join(PROVER_INPUT_FILE_NAME)),
478479
"Prover input file was not created in the debug data directory, or was created with an
479-
incorrect name, after running with a proving failure. NOTE: Changing the file name may
480+
incorrect name, after running with a proving failure. NOTE: Changing the file name may
480481
break external dependencies.",
481482
);
482483

0 commit comments

Comments
 (0)