Skip to main content

get_cairo_run_config

Function get_cairo_run_config 

Source
pub fn get_cairo_run_config(
    dynamic_params_file: &Option<PathBuf>,
    layout: LayoutName,
    proof_mode: bool,
    disable_trace_padding: bool,
    allow_missing_builtins: bool,
    relocate_mem: bool,
) -> Result<CairoRunConfig<'static>>
Expand description

Creates a Cairo run configuration based on the provided parameters.

Depending on the proof_mode flag, this function creates a run configuration for either proof or validation. If a dynamic parameters file is provided, the layout must be LayoutName::dynamic, and the dynamic layout parameters are read from the file.

§Arguments

  • dynamic_params_file - An optional file path containing dynamic layout parameters.
  • layout - The layout name to use for the run configuration.
  • proof_mode - A boolean flag indicating whether to generate a proof (true) or run in validation mode (false).
  • disable_trace_padding - A boolean flag to disable trace padding (used in proof mode).
  • allow_missing_builtins - A boolean flag to allow missing built-ins (used in validation mode).
  • relocate_mem - A boolean flag indicating whether to relocate memory in the VM (used in proof mode).

§Returns

Returns a CairoRunConfig instance configured according to the provided parameters.

§Errors

Returns an io::Error if there is an issue reading the dynamic layout parameters file.

§Panics

Panics if dynamic_params_file is provided but layout is not LayoutName::dynamic.