diff --git a/CHANGELOG.md b/CHANGELOG.md index f2b2b1c2a4..43a3ac5e7f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ #### VM Internals - Simplified range checker and removed 1 main and 1 auxiliary trace column (#949). - Added `get_mapped_values()` and `get_store_subset()` methods to the `AdviceProvider` trait (#987). +- [BREAKING] Added options to specify maximum number of cycles and expected number of cycles for a program (#998). - Improved handling of invalid/incomplete parameters in `StackOutputs` constructors (#1010). ## 0.6.1 (2023-06-29) diff --git a/air/src/errors.rs b/air/src/errors.rs index b8c9114653..ce9c50b8be 100644 --- a/air/src/errors.rs +++ b/air/src/errors.rs @@ -1,4 +1,5 @@ use super::String; +use crate::trace::MIN_TRACE_LEN; use core::fmt::{Display, Formatter}; // EXECUTION ERROR @@ -7,6 +8,7 @@ use core::fmt::{Display, Formatter}; #[derive(Debug)] pub enum ExecutionOptionsError { ExpectedCyclesTooBig(u32, u32), + MaxCycleNumTooSmall(u32), OtherErrors(String), } @@ -18,6 +20,9 @@ impl Display for ExecutionOptionsError { ExpectedCyclesTooBig(max, expected) => { write!(f, "The expected number of cycles must be smaller than the maximum number of cycles: maximum is {max}, but expectd is {expected}") } + MaxCycleNumTooSmall(max) => { + write!(f, "The maximum number of cycles must be greater than the minimum number of cycles: minimum is {MIN_TRACE_LEN}, but maximum is {max}") + } OtherErrors(error) => write!(f, "{error}"), } } diff --git a/air/src/options.rs b/air/src/options.rs index b94e3536c4..4cbc995a60 100644 --- a/air/src/options.rs +++ b/air/src/options.rs @@ -1,4 +1,5 @@ use super::{ExecutionOptionsError, HashFunction}; +use crate::trace::MIN_TRACE_LEN; use winter_air::{FieldExtension, ProofOptions as WinterProofOptions}; // PROVING OPTIONS @@ -133,15 +134,15 @@ impl From for WinterProofOptions { /// - `expected_cycles` specifies the number of cycles a program is expected to execute. #[derive(Debug, Clone, Copy, PartialEq, Eq)] pub struct ExecutionOptions { - max_cycles: Option, + max_cycles: u32, expected_cycles: u32, } impl Default for ExecutionOptions { fn default() -> Self { ExecutionOptions { - max_cycles: None, - expected_cycles: 64, + max_cycles: u32::MAX, + expected_cycles: MIN_TRACE_LEN as u32, } } } @@ -151,19 +152,37 @@ impl ExecutionOptions { // -------------------------------------------------------------------------------------------- /// Creates a new instance of [ExecutionOptions] from the specified parameters. + /// + /// If the `max_cycles` is `None` the maximum number of cycles will be set to `u32::MAX` pub fn new( max_cycles: Option, expected_cycles: u32, ) -> Result { - if max_cycles.is_some_and(|max_cycles| max_cycles < expected_cycles) { - return Err(ExecutionOptionsError::ExpectedCyclesTooBig( - max_cycles.unwrap(), - expected_cycles, - )); + let max_cycles = max_cycles.unwrap_or(u32::MAX); + if max_cycles < MIN_TRACE_LEN as u32 { + return Err(ExecutionOptionsError::MaxCycleNumTooSmall(expected_cycles)); + } + if max_cycles < expected_cycles { + return Err(ExecutionOptionsError::ExpectedCyclesTooBig(max_cycles, expected_cycles)); } + + // Round up the expected number of cycles to the next power of two. If it is smaller than + // MIN_TRACE_LEN -- pad expected number to it. + let expected_cycles = expected_cycles.next_power_of_two().max(MIN_TRACE_LEN as u32); + Ok(ExecutionOptions { max_cycles, expected_cycles, }) } + + /// Returns maximum number of cycles + pub fn max_cycles(&self) -> u32 { + self.max_cycles + } + + /// Returns number of the expected cycles + pub fn expected_cycles(&self) -> u32 { + self.expected_cycles + } } diff --git a/miden/src/cli/prove.rs b/miden/src/cli/prove.rs index 2f90800e57..11e37893a7 100644 --- a/miden/src/cli/prove.rs +++ b/miden/src/cli/prove.rs @@ -25,8 +25,8 @@ pub struct ProveCmd { library_paths: Vec, /// Maximum number of cycles a program is allowed to consume - #[structopt(short = "m", long = "max-cycles")] - max_cycles: Option, + #[structopt(short = "m", long = "max-cycles", default_value = "4294967295")] + max_cycles: u32, /// Number of outputs #[structopt(short = "n", long = "num-outputs", default_value = "16")] @@ -51,14 +51,13 @@ pub struct ProveCmd { impl ProveCmd { pub fn get_proof_options(&self) -> Result { - let exec_options = ExecutionOptions::new(self.max_cycles, self.expected_cycles)?; - match self.security.as_str() { - "96bits" => Ok(ProvingOptions::with_96_bit_security(self.recursive) - .with_execution_options(exec_options)), - "128bits" => Ok(ProvingOptions::with_128_bit_security(self.recursive) - .with_execution_options(exec_options)), + let exec_options = ExecutionOptions::new(Some(self.max_cycles), self.expected_cycles)?; + Ok(match self.security.as_str() { + "96bits" => ProvingOptions::with_96_bit_security(self.recursive), + "128bits" => ProvingOptions::with_128_bit_security(self.recursive), other => panic!("{} is not a valid security setting", other), } + .with_execution_options(exec_options)) } pub fn execute(&self) -> Result<(), String> { diff --git a/miden/src/cli/run.rs b/miden/src/cli/run.rs index 78535d63e9..c7fe6aba46 100644 --- a/miden/src/cli/run.rs +++ b/miden/src/cli/run.rs @@ -23,8 +23,8 @@ pub struct RunCmd { library_paths: Vec, /// Maximum number of cycles a program is allowed to consume - #[structopt(short = "m", long = "max-cycles")] - max_cycles: Option, + #[structopt(short = "m", long = "max-cycles", default_value = "4294967295")] + max_cycles: u32, /// Number of ouptuts #[structopt(short = "n", long = "num-outputs", default_value = "16")] @@ -51,7 +51,7 @@ impl RunCmd { let input_data = InputFile::read(&self.input_file, &self.assembly_file)?; // get execution options - let execution_options = ExecutionOptions::new(self.max_cycles, self.expected_cycles) + let execution_options = ExecutionOptions::new(Some(self.max_cycles), self.expected_cycles) .map_err(|err| format!("{err}"))?; // fetch the stack and program inputs from the arguments @@ -64,7 +64,7 @@ impl RunCmd { // execute program and generate outputs let trace = processor::execute(&program, stack_inputs, advice_provider, execution_options) - .map_err(|err| format!("Failed to generate exection trace = {:?}", err))?; + .map_err(|err| format!("Failed to generate execution trace = {:?}", err))?; println!("done ({} steps in {} ms)", trace.get_trace_len(), now.elapsed().as_millis()); diff --git a/miden/src/examples/mod.rs b/miden/src/examples/mod.rs index 93c0c50b9b..f22d92ccad 100644 --- a/miden/src/examples/mod.rs +++ b/miden/src/examples/mod.rs @@ -1,4 +1,5 @@ use miden::{AdviceProvider, ExecutionProof, Program, ProgramInfo, ProvingOptions, StackInputs}; +use processor::{ExecutionOptions, ExecutionOptionsError}; use std::io::Write; use std::time::Instant; use structopt::StructOpt; @@ -28,13 +29,21 @@ pub struct ExampleOptions { #[structopt(subcommand)] pub example: ExampleType, - /// Security level for execution proofs generated by the VM - #[structopt(short = "s", long = "security", default_value = "96bits")] - security: String, + /// Number of cycles the program is expected to consume + #[structopt(short = "e", long = "exp-cycles", default_value = "64")] + expected_cycles: u32, + + /// Maximum number of cycles a program is allowed to consume + #[structopt(short = "m", long = "max-cycles", default_value = "4294967295")] + max_cycles: u32, /// Enable generation of proofs suitable for recursive verification #[structopt(short = "r", long = "recursive")] recursive: bool, + + /// Security level for execution proofs generated by the VM + #[structopt(short = "s", long = "security", default_value = "96bits")] + security: String, } #[derive(StructOpt, Debug)] @@ -49,12 +58,14 @@ pub enum ExampleType { } impl ExampleOptions { - pub fn get_proof_options(&self) -> ProvingOptions { - match self.security.as_str() { + pub fn get_proof_options(&self) -> Result { + let exec_options = ExecutionOptions::new(Some(self.max_cycles), self.expected_cycles)?; + Ok(match self.security.as_str() { "96bits" => ProvingOptions::with_96_bit_security(self.recursive), "128bits" => ProvingOptions::with_128_bit_security(self.recursive), other => panic!("{} is not a valid security level", other), } + .with_execution_options(exec_options)) } pub fn execute(&self) -> Result<(), String> { @@ -66,7 +77,7 @@ impl ExampleOptions { .filter_level(log::LevelFilter::Debug) .init(); - let proof_options = self.get_proof_options(); + let proof_options = self.get_proof_options().map_err(|err| format!("{err}"))?; // instantiate and prepare the example let example = match self.example { diff --git a/miden/tests/integration/cli/cli_test.rs b/miden/tests/integration/cli/cli_test.rs index eda1172ad1..9a304d2cba 100644 --- a/miden/tests/integration/cli/cli_test.rs +++ b/miden/tests/integration/cli/cli_test.rs @@ -16,7 +16,15 @@ fn cli_run() -> Result<(), Box> { let mut cmd = bin_under_test.command(); - cmd.arg("run").arg("-a").arg("examples/fib/fib.masm").arg("-n").arg("1"); + cmd.arg("run") + .arg("-a") + .arg("examples/fib/fib.masm") + .arg("-n") + .arg("1") + .arg("-m") + .arg("4096") + .arg("-e") + .arg("4096"); let output = cmd.unwrap(); diff --git a/processor/src/chiplets/tests.rs b/processor/src/chiplets/tests.rs index 545c9d3f16..aec54bd884 100644 --- a/processor/src/chiplets/tests.rs +++ b/processor/src/chiplets/tests.rs @@ -1,6 +1,6 @@ use crate::{ - utils::get_trace_len, CodeBlock, ExecutionTrace, Kernel, MemAdviceProvider, Operation, Process, - StackInputs, Vec, + utils::get_trace_len, CodeBlock, ExecutionOptions, ExecutionTrace, Kernel, MemAdviceProvider, + Operation, Process, StackInputs, Vec, }; use miden_air::trace::{ chiplets::{ @@ -112,7 +112,8 @@ fn build_trace( ) -> (ChipletsTrace, usize) { let stack_inputs = StackInputs::try_from_values(stack_inputs.iter().copied()).unwrap(); let advice_provider = MemAdviceProvider::default(); - let mut process = Process::new(kernel, stack_inputs, advice_provider); + let mut process = + Process::new(kernel, stack_inputs, advice_provider, ExecutionOptions::default()); let program = CodeBlock::new_span(operations); process.execute_code_block(&program, &CodeBlockTable::default()).unwrap(); diff --git a/processor/src/decoder/tests.rs b/processor/src/decoder/tests.rs index df3b9b21e5..e65d346680 100644 --- a/processor/src/decoder/tests.rs +++ b/processor/src/decoder/tests.rs @@ -1,7 +1,7 @@ use super::{ super::{ - utils::get_trace_len, ExecutionTrace, Felt, Kernel, MemAdviceProvider, Operation, Process, - StackInputs, Word, + utils::get_trace_len, ExecutionOptions, ExecutionTrace, Felt, Kernel, MemAdviceProvider, + Operation, Process, StackInputs, Word, }, build_op_group, AuxTraceHints, BlockHashTableRow, BlockStackTableRow, BlockTableUpdate, ExecutionContextInfo, OpGroupTableRow, OpGroupTableUpdate, @@ -1500,7 +1500,8 @@ fn set_user_op_helpers_many() { fn build_trace(stack_inputs: &[u64], program: &CodeBlock) -> (DecoderTrace, AuxTraceHints, usize) { let stack_inputs = StackInputs::try_from_values(stack_inputs.iter().copied()).unwrap(); let advice_provider = MemAdviceProvider::default(); - let mut process = Process::new(Kernel::default(), stack_inputs, advice_provider); + let mut process = + Process::new(Kernel::default(), stack_inputs, advice_provider, ExecutionOptions::default()); process.execute_code_block(program, &CodeBlockTable::default()).unwrap(); let (trace, aux_hints) = ExecutionTrace::test_finalize_trace(process); @@ -1527,7 +1528,8 @@ fn build_call_trace( }; let advice_provider = MemAdviceProvider::default(); let stack_inputs = crate::StackInputs::default(); - let mut process = Process::new(kernel, stack_inputs, advice_provider); + let mut process = + Process::new(kernel, stack_inputs, advice_provider, ExecutionOptions::default()); // build code block table let mut cb_table = CodeBlockTable::default(); diff --git a/processor/src/decorators/tests.rs b/processor/src/decorators/tests.rs index 88623cd7c7..17aee7542c 100644 --- a/processor/src/decorators/tests.rs +++ b/processor/src/decorators/tests.rs @@ -1,5 +1,5 @@ use super::{ - super::{AdviceInputs, Felt, FieldElement, Kernel, Operation, StarkField}, + super::{AdviceInputs, ExecutionOptions, Felt, FieldElement, Kernel, Operation, StarkField}, Process, }; use crate::{MemAdviceProvider, StackInputs, Word}; @@ -30,7 +30,8 @@ fn push_merkle_node() { let stack_inputs = StackInputs::try_from_values(stack_inputs).unwrap(); let advice_inputs = AdviceInputs::default().with_merkle_store(store); let advice_provider = MemAdviceProvider::from(advice_inputs); - let mut process = Process::new(Kernel::default(), stack_inputs, advice_provider); + let mut process = + Process::new(Kernel::default(), stack_inputs, advice_provider, ExecutionOptions::default()); process.execute_op(Operation::Noop).unwrap(); // push the node onto the advice stack @@ -185,7 +186,8 @@ fn assert_case_smtget( .with_merkle_store(store) .with_map([(node.into_bytes(), mapped)]); let advice_provider = MemAdviceProvider::from(advice_inputs); - let mut process = Process::new(Kernel::default(), stack_inputs, advice_provider); + let mut process = + Process::new(Kernel::default(), stack_inputs, advice_provider, ExecutionOptions::default()); // call the injector and clear the stack process.execute_op(Operation::Noop).unwrap(); diff --git a/processor/src/errors.rs b/processor/src/errors.rs index d6a10de95a..e95c0c5649 100644 --- a/processor/src/errors.rs +++ b/processor/src/errors.rs @@ -19,6 +19,7 @@ pub enum ExecutionError { AdviceStackReadFailed(u32), CallerNotInSyscall, CodeBlockNotFound(Digest), + CycleLimitExceeded(u32), DivideByZero(u32), Ext2InttError(Ext2InttError), FailedAssertion(u32), @@ -61,6 +62,9 @@ impl Display for ExecutionError { "Failed to execute code block with root {hex}; the block could not be found" ) } + CycleLimitExceeded(max_cycles) => { + write!(f, "Exceeded the allowed number of cycles (max cycles = {max_cycles})") + } DivideByZero(clk) => write!(f, "Division by zero at clock cycle {clk}"), Ext2InttError(err) => write!(f, "Failed to execute Ext2Intt operation: {err}"), FailedAssertion(clk) => write!(f, "Assertion failed at clock cycle {clk}"), diff --git a/processor/src/lib.rs b/processor/src/lib.rs index c6eb96107f..ecedcddea1 100644 --- a/processor/src/lib.rs +++ b/processor/src/lib.rs @@ -112,13 +112,13 @@ pub fn execute( program: &Program, stack_inputs: StackInputs, advice_provider: A, - _options: ExecutionOptions, + options: ExecutionOptions, ) -> Result where A: AdviceProvider, { - let mut process = Process::new(program.kernel().clone(), stack_inputs, advice_provider); - // TODO: use ExecutionOptions to limit program execution + let mut process = + Process::new(program.kernel().clone(), stack_inputs, advice_provider, options); let stack_outputs = process.execute(program)?; let trace = ExecutionTrace::new(process, stack_outputs); assert_eq!(&program.hash(), trace.program_hash(), "inconsistent program hash"); @@ -161,6 +161,7 @@ where range: RangeChecker, chiplets: Chiplets, advice_provider: A, + max_cycles: u32, } impl Process @@ -170,13 +171,18 @@ where // CONSTRUCTORS // -------------------------------------------------------------------------------------------- /// Creates a new process with the provided inputs. - pub fn new(kernel: Kernel, stack_inputs: StackInputs, advice_provider: A) -> Self { - Self::initialize(kernel, stack_inputs, advice_provider, false) + pub fn new( + kernel: Kernel, + stack_inputs: StackInputs, + advice_provider: A, + execution_options: ExecutionOptions, + ) -> Self { + Self::initialize(kernel, stack_inputs, advice_provider, false, execution_options) } /// Creates a new process with provided inputs and debug options enabled. pub fn new_debug(kernel: Kernel, stack_inputs: StackInputs, advice_provider: A) -> Self { - Self::initialize(kernel, stack_inputs, advice_provider, true) + Self::initialize(kernel, stack_inputs, advice_provider, true, ExecutionOptions::default()) } fn initialize( @@ -184,14 +190,16 @@ where stack: StackInputs, advice_provider: A, in_debug_mode: bool, + execution_options: ExecutionOptions, ) -> Self { Self { - system: System::new(MIN_TRACE_LEN), + system: System::new(execution_options.expected_cycles() as usize), decoder: Decoder::new(in_debug_mode), - stack: Stack::new(&stack, MIN_TRACE_LEN, in_debug_mode), + stack: Stack::new(&stack, execution_options.expected_cycles() as usize, in_debug_mode), range: RangeChecker::new(), chiplets: Chiplets::new(kernel), advice_provider, + max_cycles: execution_options.max_cycles(), } } @@ -473,4 +481,5 @@ where pub range: RangeChecker, pub chiplets: Chiplets, pub advice_provider: A, + pub max_cycles: u32, } diff --git a/processor/src/operations/mod.rs b/processor/src/operations/mod.rs index f4fe6e95a7..75bd3dfe71 100644 --- a/processor/src/operations/mod.rs +++ b/processor/src/operations/mod.rs @@ -149,17 +149,18 @@ where Operation::FriE2F4 => self.op_fri_ext2fold4()?, } - self.advance_clock(); + self.advance_clock()?; Ok(()) } /// Increments the clock cycle for all components of the process. - fn advance_clock(&mut self) { - self.system.advance_clock(); + fn advance_clock(&mut self) -> Result<(), ExecutionError> { + self.system.advance_clock(self.max_cycles)?; self.stack.advance_clock(); self.chiplets.advance_clock(); self.advice_provider.advance_clock(); + Ok(()) } /// Makes sure there is enough memory allocated for the trace to accommodate a new clock cycle. @@ -178,7 +179,12 @@ impl Process { /// initialized with the provided values. fn new_dummy(stack_inputs: super::StackInputs) -> Self { let advice_provider = super::MemAdviceProvider::default(); - let mut process = Self::new(Kernel::default(), stack_inputs, advice_provider); + let mut process = Self::new( + Kernel::default(), + stack_inputs, + advice_provider, + super::ExecutionOptions::default(), + ); process.execute_op(Operation::Noop).unwrap(); process } @@ -196,7 +202,12 @@ impl Process { .with_stack_values(advice_stack.iter().copied()) .unwrap(); let advice_provider = super::MemAdviceProvider::from(advice_inputs); - let mut process = Self::new(Kernel::default(), stack_inputs, advice_provider); + let mut process = Self::new( + Kernel::default(), + stack_inputs, + advice_provider, + super::ExecutionOptions::default(), + ); process.execute_op(Operation::Noop).unwrap(); process } @@ -224,7 +235,12 @@ impl Process { advice_inputs: super::AdviceInputs, ) -> Self { let advice_provider = super::MemAdviceProvider::from(advice_inputs); - let mut process = Self::new(Kernel::default(), stack_inputs, advice_provider); + let mut process = Self::new( + Kernel::default(), + stack_inputs, + advice_provider, + super::ExecutionOptions::default(), + ); process.decoder.add_dummy_trace_row(); process.execute_op(Operation::Noop).unwrap(); process diff --git a/processor/src/system/mod.rs b/processor/src/system/mod.rs index 37268516c2..93836af078 100644 --- a/processor/src/system/mod.rs +++ b/processor/src/system/mod.rs @@ -1,4 +1,7 @@ -use super::{Felt, FieldElement, StarkField, SysTrace, Vec, Word, ONE, ZERO}; +use super::{ExecutionError, Felt, FieldElement, StarkField, SysTrace, Vec, Word, ONE, ZERO}; + +#[cfg(test)] +mod tests; // CONSTANTS // ================================================================================================ @@ -132,9 +135,14 @@ impl System { // -------------------------------------------------------------------------------------------- /// Increments the clock cycle. - pub fn advance_clock(&mut self) { + pub fn advance_clock(&mut self, max_cycles: u32) -> Result<(), ExecutionError> { self.clk += 1; + // Check that maximum number of cycles is not exceeded. + if self.clk > max_cycles { + return Err(ExecutionError::CycleLimitExceeded(max_cycles)); + } + let clk = self.clk as usize; self.clk_trace[clk] = Felt::from(self.clk); @@ -146,6 +154,8 @@ impl System { self.fn_hash_trace[1][clk] = self.fn_hash[1]; self.fn_hash_trace[2][clk] = self.fn_hash[2]; self.fn_hash_trace[3][clk] = self.fn_hash[3]; + + Ok(()) } /// Sets the value of free memory pointer for the next clock cycle. diff --git a/processor/src/system/tests.rs b/processor/src/system/tests.rs new file mode 100644 index 0000000000..a6c4688d57 --- /dev/null +++ b/processor/src/system/tests.rs @@ -0,0 +1,21 @@ +#[cfg(test)] +mod tests { + use crate::{ExecutionOptions, Kernel, MemAdviceProvider, Operation, Process, StackInputs}; + + // Check that process returns an error if a maximum number of cycles is exceeded. + #[test] + fn cycles_num_exceeded() { + let stack = StackInputs::default(); + let advice_provider = MemAdviceProvider::default(); + let mut process = Process::new( + Kernel::default(), + stack, + advice_provider, + ExecutionOptions::new(Some(64), 64).unwrap(), + ); + for _ in 0..64 { + process.execute_op(Operation::Noop).unwrap(); + } + assert!(process.execute_op(Operation::Noop).is_err()); + } +} diff --git a/processor/src/trace/tests/mod.rs b/processor/src/trace/tests/mod.rs index ba7c880299..1a81e9296b 100644 --- a/processor/src/trace/tests/mod.rs +++ b/processor/src/trace/tests/mod.rs @@ -2,7 +2,7 @@ use super::{ super::chiplets::init_state_from_words, ExecutionTrace, Felt, FieldElement, LookupTableRow, Process, Trace, Vec, NUM_RAND_ROWS, }; -use crate::{AdviceInputs, MemAdviceProvider, StackInputs}; +use crate::{AdviceInputs, ExecutionOptions, MemAdviceProvider, StackInputs}; use rand_utils::rand_array; use vm_core::{ code_blocks::CodeBlock, CodeBlockTable, Kernel, Operation, StackOutputs, Word, ONE, ZERO, @@ -20,7 +20,8 @@ mod stack; pub fn build_trace_from_block(program: &CodeBlock, stack_inputs: &[u64]) -> ExecutionTrace { let stack_inputs = StackInputs::try_from_values(stack_inputs.iter().copied()).unwrap(); let advice_provider = MemAdviceProvider::default(); - let mut process = Process::new(Kernel::default(), stack_inputs, advice_provider); + let mut process = + Process::new(Kernel::default(), stack_inputs, advice_provider, ExecutionOptions::default()); process.execute_code_block(program, &CodeBlockTable::default()).unwrap(); ExecutionTrace::new(process, StackOutputs::default()) } @@ -41,7 +42,8 @@ pub fn build_trace_from_ops_with_inputs( advice_inputs: AdviceInputs, ) -> ExecutionTrace { let advice_provider = MemAdviceProvider::from(advice_inputs); - let mut process = Process::new(Kernel::default(), stack_inputs, advice_provider); + let mut process = + Process::new(Kernel::default(), stack_inputs, advice_provider, ExecutionOptions::default()); let program = CodeBlock::new_span(operations); process.execute_code_block(&program, &CodeBlockTable::default()).unwrap(); ExecutionTrace::new(process, StackOutputs::default()) diff --git a/stdlib/tests/mem/mod.rs b/stdlib/tests/mem/mod.rs index c390a2644a..b61aa4e915 100644 --- a/stdlib/tests/mem/mod.rs +++ b/stdlib/tests/mem/mod.rs @@ -1,6 +1,6 @@ use test_utils::{ - build_expected_hash, build_expected_perm, stack_to_ints, AdviceInputs, MemAdviceProvider, - Process, StackInputs, ONE, ZERO, + build_expected_hash, build_expected_perm, stack_to_ints, AdviceInputs, ExecutionOptions, + MemAdviceProvider, Process, StackInputs, ONE, ZERO, }; #[test] @@ -31,6 +31,7 @@ fn test_memcopy() { program.kernel().clone(), StackInputs::default(), MemAdviceProvider::from(AdviceInputs::default()), + ExecutionOptions::default(), ); process.execute(&program).unwrap(); diff --git a/test-utils/src/lib.rs b/test-utils/src/lib.rs index 1846f2a7ef..1c3249f8a7 100644 --- a/test-utils/src/lib.rs +++ b/test-utils/src/lib.rs @@ -164,8 +164,12 @@ impl Test { let advice_provider = MemAdviceProvider::from(self.advice_inputs.clone()); // execute the test - let mut process = - Process::new(program.kernel().clone(), self.stack_inputs.clone(), advice_provider); + let mut process = Process::new( + program.kernel().clone(), + self.stack_inputs.clone(), + advice_provider, + ExecutionOptions::default(), + ); process.execute(&program).unwrap(); // validate the memory state @@ -236,8 +240,12 @@ impl Test { pub fn execute_process(&self) -> Result, ExecutionError> { let program = self.compile(); let advice_provider = MemAdviceProvider::from(self.advice_inputs.clone()); - let mut process = - Process::new(program.kernel().clone(), self.stack_inputs.clone(), advice_provider); + let mut process = Process::new( + program.kernel().clone(), + self.stack_inputs.clone(), + advice_provider, + ExecutionOptions::default(), + ); process.execute(&program)?; Ok(process) }