@@ -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
8485impl 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) ]
98100pub 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 ) ?;
@@ -775,12 +776,12 @@ mod tests {
775776 let program = Program :: from_bytes ( program_content, Some ( "main" ) ) . unwrap ( ) ;
776777 let runner = cairo_run_stwo (
777778 & program,
778- RunnerMode :: ExecutionMode ,
779779 & stwo_allowed_builtins ( ) ,
780780 & mut BuiltinHintProcessor :: new_empty ( ) ,
781781 ExecutionScopes :: new ( ) ,
782782 & StwoCairoRunConfig {
783783 disable_trace_padding : false ,
784+ runner_mode : RunnerMode :: ExecutionMode ,
784785 ..Default :: default ( )
785786 } ,
786787 )
0 commit comments