Struct ExecutionOptions
pub struct ExecutionOptions { /* private fields */ }Expand description
A set of parameters specifying execution parameters of the VM.
max_cyclesspecifies the maximum number of cycles a program is allowed to execute.expected_cyclesspecifies the number of cycles a program is expected to execute.
Implementations§
§impl ExecutionOptions
impl ExecutionOptions
pub const MAX_CYCLES: u32
pub const MAX_CYCLES: u32
The maximum number of VM cycles a program is allowed to take.
pub const DEFAULT_CORE_TRACE_FRAGMENT_SIZE: usize = 4096
pub const DEFAULT_CORE_TRACE_FRAGMENT_SIZE: usize = 4096
Default fragment size for core trace generation.
pub const DEFAULT_MAX_ADV_MAP_VALUE_SIZE: usize
pub const DEFAULT_MAX_ADV_MAP_VALUE_SIZE: usize
Default maximum number of field elements in a single advice map value inserted via
adv.insert_mem. Set to 2^17 (~1 MB given 8-byte field elements).
pub const DEFAULT_MAX_HASH_LEN_BYTES: usize
pub const DEFAULT_MAX_HASH_LEN_BYTES: usize
Default maximum number of input bytes for a single hash precompile invocation (e.g. keccak256, sha512, etc.). Set to 2^20 (1 MB).
pub const DEFAULT_MAX_NUM_CONTINUATIONS: usize
pub const DEFAULT_MAX_NUM_CONTINUATIONS: usize
Default maximum number of continuations allowed on the continuation stack. Set to 2^16 (65536).
pub fn new(
max_cycles: Option<u32>,
expected_cycles: u32,
core_trace_fragment_size: usize,
enable_tracing: bool,
enable_debugging: bool,
) -> Result<ExecutionOptions, ExecutionOptionsError>
pub fn new( max_cycles: Option<u32>, expected_cycles: u32, core_trace_fragment_size: usize, enable_tracing: bool, enable_debugging: bool, ) -> Result<ExecutionOptions, ExecutionOptionsError>
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 2^29.
§Errors
Returns an error if:
max_cyclesis outside the valid range- after rounding up to the next power of two,
expected_cyclesexceedsmax_cycles core_trace_fragment_sizeis zero
pub fn with_core_trace_fragment_size(
self,
size: usize,
) -> Result<ExecutionOptions, ExecutionOptionsError>
pub fn with_core_trace_fragment_size( self, size: usize, ) -> Result<ExecutionOptions, ExecutionOptionsError>
Sets the fragment size for core trace generation.
Returns an error if the size is zero.
pub fn with_tracing(self, enable_tracing: bool) -> ExecutionOptions
pub fn with_tracing(self, enable_tracing: bool) -> ExecutionOptions
Enables execution of the trace instructions.
pub fn with_debugging(self, enable_debugging: bool) -> ExecutionOptions
pub fn with_debugging(self, enable_debugging: bool) -> ExecutionOptions
Enables execution of programs in debug mode when the enable_debugging flag is set to true;
otherwise, debug mode is disabled.
In debug mode the VM does the following:
- Executes
debuginstructions (these are ignored in regular mode). - Records additional info about program execution (e.g., keeps track of stack state at every cycle of the VM) which enables stepping through the program forward and backward.
pub fn max_cycles(&self) -> u32
pub fn max_cycles(&self) -> u32
Returns maximum number of cycles a program is allowed to execute for.
pub fn expected_cycles(&self) -> u32
pub fn expected_cycles(&self) -> u32
Returns the number of cycles a program is expected to take.
This will serve as a hint to the VM for how much memory to allocate for a program’s execution trace and may result in performance improvements when the number of expected cycles is equal to the number of actual cycles.
pub fn core_trace_fragment_size(&self) -> usize
pub fn core_trace_fragment_size(&self) -> usize
Returns the fragment size for core trace generation.
pub fn enable_tracing(&self) -> bool
pub fn enable_tracing(&self) -> bool
Returns a flag indicating whether the VM should execute trace instructions.
pub fn enable_debugging(&self) -> bool
pub fn enable_debugging(&self) -> bool
Returns a flag indicating whether the VM should execute a program in debug mode.
pub fn max_adv_map_value_size(&self) -> usize
pub fn max_adv_map_value_size(&self) -> usize
Returns the maximum number of field elements allowed in a single advice map value
inserted via adv.insert_mem.
pub fn max_hash_len_bytes(&self) -> usize
pub fn max_hash_len_bytes(&self) -> usize
Returns the maximum number of input bytes allowed for a single hash precompile invocation.
pub fn with_max_adv_map_value_size(self, size: usize) -> ExecutionOptions
pub fn with_max_adv_map_value_size(self, size: usize) -> ExecutionOptions
Sets the maximum number of field elements allowed in a single advice map value
inserted via adv.insert_mem.
pub fn with_max_hash_len_bytes(self, size: usize) -> ExecutionOptions
pub fn with_max_hash_len_bytes(self, size: usize) -> ExecutionOptions
Sets the maximum number of input bytes allowed for a single hash precompile invocation.
pub fn max_num_continuations(&self) -> usize
pub fn max_num_continuations(&self) -> usize
Returns the maximum number of continuations allowed on the continuation stack.
pub fn with_max_num_continuations(
self,
max_num_continuations: usize,
) -> ExecutionOptions
pub fn with_max_num_continuations( self, max_num_continuations: usize, ) -> ExecutionOptions
Sets the maximum number of continuations allowed on the continuation stack.
Trait Implementations§
§impl Clone for ExecutionOptions
impl Clone for ExecutionOptions
§fn clone(&self) -> ExecutionOptions
fn clone(&self) -> ExecutionOptions
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more§impl Debug for ExecutionOptions
impl Debug for ExecutionOptions
§impl Default for ExecutionOptions
impl Default for ExecutionOptions
§fn default() -> ExecutionOptions
fn default() -> ExecutionOptions
§impl PartialEq for ExecutionOptions
impl PartialEq for ExecutionOptions
impl Copy for ExecutionOptions
impl Eq for ExecutionOptions
impl StructuralPartialEq for ExecutionOptions
Auto Trait Implementations§
impl Freeze for ExecutionOptions
impl RefUnwindSafe for ExecutionOptions
impl Send for ExecutionOptions
impl Sync for ExecutionOptions
impl Unpin for ExecutionOptions
impl UnsafeUnpin for ExecutionOptions
impl UnwindSafe for ExecutionOptions
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<D> OwoColorize for D
impl<D> OwoColorize for D
§fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
§fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
§fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>
fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>
§fn default_color(&self) -> FgColorDisplay<'_, Default, Self>
fn default_color(&self) -> FgColorDisplay<'_, Default, Self>
§fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>
fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>
§fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>
fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>
§fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>
fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>
§fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>
fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>
§fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>
fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>
§fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>
fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>
§fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>
fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>
§fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>
fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>
§fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>
fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>
§fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>
fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>
§fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>
fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>
§fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
§fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
§fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
§fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
§fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>
fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>
§fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>
fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>
§fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>
fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>
§fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>
fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>
§fn blink_fast(&self) -> BlinkFastDisplay<'_, Self>
fn blink_fast(&self) -> BlinkFastDisplay<'_, Self>
§fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>
fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>
§fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::fg] or
a color-specific method, such as [OwoColorize::green], Read more§fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::bg] or
a color-specific method, such as [OwoColorize::on_yellow], Read more