Skip to content

Commit 9478b60

Browse files
feat: move runner_mode to be a field in StwoCairoRunConfig
1 parent e1c2d5a commit 9478b60

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

vm/src/cairo_run.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ pub struct StwoCairoRunConfig {
7979
pub fill_holes: bool,
8080
pub secure_run: bool,
8181
pub disable_trace_padding: bool,
82+
pub runner_mode: RunnerMode,
8283
}
8384

8485
impl Default for StwoCairoRunConfig {
@@ -90,25 +91,25 @@ impl Default for StwoCairoRunConfig {
9091
fill_holes: false,
9192
secure_run: true,
9293
disable_trace_padding: true,
94+
runner_mode: RunnerMode::ProofModeCanonical,
9395
}
9496
}
9597
}
9698

9799
#[allow(clippy::result_large_err)]
98100
pub fn cairo_run_stwo(
99101
program: &Program,
100-
runner_mode: RunnerMode,
101102
allowed_builtins: &[BuiltinName],
102103
hint_processor: &mut dyn HintProcessor,
103104
exec_scopes: ExecutionScopes,
104105
cairo_run_config: &StwoCairoRunConfig,
105106
) -> Result<CairoRunner, CairoRunError> {
106107
let _span = span!(Level::INFO, "cairo run stwo").entered();
107108

108-
let proof_mode = runner_mode != RunnerMode::ExecutionMode;
109+
let proof_mode = cairo_run_config.runner_mode != RunnerMode::ExecutionMode;
109110
let mut cairo_runner = CairoRunner::new_stwo(
110111
program,
111-
runner_mode,
112+
cairo_run_config.runner_mode.clone(),
112113
cairo_run_config.trace_enabled,
113114
cairo_run_config.disable_trace_padding,
114115
)?;
@@ -757,12 +758,12 @@ mod tests {
757758
let program = Program::from_bytes(program_content, Some("main")).unwrap();
758759
let runner = cairo_run_stwo(
759760
&program,
760-
RunnerMode::ExecutionMode,
761761
&stwo_allowed_builtins(),
762762
&mut BuiltinHintProcessor::new_empty(),
763763
ExecutionScopes::new(),
764764
&StwoCairoRunConfig {
765765
disable_trace_padding: false,
766+
runner_mode: RunnerMode::ExecutionMode,
766767
..Default::default()
767768
},
768769
)

vm/src/vm/runners/cairo_runner.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5918,7 +5918,6 @@ mod tests {
59185918
];
59195919
let runner = crate::cairo_run::cairo_run_stwo(
59205920
&program,
5921-
RunnerMode::ProofModeCanonical,
59225921
&allowed,
59235922
&mut hint_processor,
59245923
ExecutionScopes::new(),
@@ -5946,7 +5945,6 @@ mod tests {
59465945
];
59475946
let runner = crate::cairo_run::cairo_run_stwo(
59485947
&program,
5949-
RunnerMode::ProofModeCanonical,
59505948
&allowed,
59515949
&mut hint_processor,
59525950
ExecutionScopes::new(),
@@ -5999,7 +5997,6 @@ mod tests {
59995997
// Stwo run
60005998
let stwo_runner = crate::cairo_run::cairo_run_stwo(
60015999
&program,
6002-
RunnerMode::ProofModeCanonical,
60036000
&allowed,
60046001
&mut BuiltinHintProcessor::new_empty(),
60056002
ExecutionScopes::new(),
@@ -6010,6 +6007,7 @@ mod tests {
60106007
fill_holes: false,
60116008
secure_run: true,
60126009
disable_trace_padding: true,
6010+
runner_mode: RunnerMode::ProofModeCanonical,
60136011
},
60146012
)
60156013
.unwrap();

0 commit comments

Comments
 (0)