Skip to content

Commit 96a9115

Browse files
authored
Added more span logs to stwo_run_and_prove (#264)
1 parent 1815697 commit 96a9115

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
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: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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)