Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -737,6 +737,7 @@ jobs:
path: lcov-test-no_std#4-cairo-0-secp-hints.info
key: codecov-cache-test-no_std#4-cairo-0-secp-hints-${{ github.sha }}
fail-on-cache-miss: true

- name: Upload coverage to codecov.io
uses: codecov/codecov-action@v3
with:
Expand Down
26 changes: 0 additions & 26 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,6 @@

#### Upcoming Changes

* feat: Use BTreeMap in PIE additional data [#2162](https://github.com/lambdaclass/cairo-vm/pull/2162)

* feat: Remove prover input info struct and add getters instead [#2149](https://github.com/lambdaclass/cairo-vm/pull/2149)

* feat: Added support for large files in PIE [#2136](https://github.com/lambdaclass/cairo-vm/pull/2136)

* feat: Disable relocate trace with flag [#2133](https://github.com/lambdaclass/cairo-vm/pull/2133)

* feat: Enable using secure run in proof mode [#2113](https://github.com/lambdaclass/cairo-vm/pull/2113)

* [BREAKING] Compute missing builtin cells only in proof mode [#2088](https://github.com/lambdaclass/cairo-vm/pull/2088)

* test: Add test for filling holes in builtin segments [#2087](https://github.com/lambdaclass/cairo-vm/pull/2087)

* fix: Removed memory comparison test with Python VM in proof mode, since the new hole-filling logic causes divergence.[#2086](https://github.com/lambdaclass/cairo-vm/pull/2086)

* refactor: Use BTreeMap for deterministic order of PIE keys [#2085](https://github.com/lambdaclass/cairo-vm/pull/2085)

* fix: Fix zero offset output base assumption [#2068](https://github.com/lambdaclass/cairo-vm/pull/2068)

* feat: Add perpetual and dex with bitwise layouts [#2067](https://github.com/lambdaclass/cairo-vm/pull/2067)

* feat: Fill holes in builtins segments to save computation in the prover [#2036](https://github.com/lambdaclass/cairo-vm/pull/2036)

* feat: Added hints felt unpacking for blake [#2032](https://github.com/lambdaclass/cairo-vm/pull/2032)

* dev: make `VirtualMachine::get_traceback_entries` pub

* chore: Pin types-rs version to the one set in lockfile [#2140](https://github.com/lambdaclass/cairo-vm/pull/2140)
Expand Down
3 changes: 1 addition & 2 deletions cairo-vm-cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -180,13 +180,12 @@ fn run(args: impl Iterator<Item = String>) -> Result<(), Error> {
entrypoint: &args.entrypoint,
trace_enabled,
relocate_mem: args.memory_file.is_some() || args.air_public_input.is_some(),
relocate_trace: trace_enabled,
layout: args.layout,
proof_mode: args.proof_mode,
secure_run: args.secure_run,
allow_missing_builtins: args.allow_missing_builtins,
dynamic_layout_params: cairo_layout_params,
disable_trace_padding: false,
..Default::default()
};

let mut cairo_runner = match if args.run_from_cairo_pie {
Expand Down
9 changes: 2 additions & 7 deletions cairo1-run/src/cairo_run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -267,12 +267,7 @@ pub fn cairo_run_program(
runner.run_for_steps(1, &mut hint_processor)?;
}

runner.end_run(
false,
false,
&mut hint_processor,
cairo_run_config.proof_mode,
)?;
runner.end_run(false, false, &mut hint_processor)?;

let result_inner_type_size =
result_inner_type_size(return_type_id, &sierra_program_registry, &type_sizes);
Expand Down Expand Up @@ -341,7 +336,7 @@ pub fn cairo_run_program(
}
}

runner.relocate(true, true)?;
runner.relocate(true)?;

Ok((runner, return_values, serialized_output))
}
Expand Down
13 changes: 0 additions & 13 deletions cairo_programs/poseidon_builtin_hole.cairo

This file was deleted.

35 changes: 11 additions & 24 deletions vm/src/cairo_run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,7 @@ pub struct CairoRunConfig<'a> {
#[cfg_attr(feature = "test_utils", arbitrary(value = "main"))]
pub entrypoint: &'a str,
pub trace_enabled: bool,
/// Relocate memory if `true`, otherwise memory is not relocated.
pub relocate_mem: bool,
// When `relocate_trace` is set to `false`, the trace will not be relocated even if `trace_enabled` is `true`.
pub relocate_trace: bool,
pub layout: LayoutName,
/// The `dynamic_layout_params` argument should only be used with dynamic layout.
/// It is ignored otherwise.
Expand All @@ -54,8 +51,6 @@ impl Default for CairoRunConfig<'_> {
entrypoint: "main",
trace_enabled: false,
relocate_mem: false,
// Set to true to match expected behavior: trace is relocated only if trace_enabled is true.
relocate_trace: true,
layout: LayoutName::plain,
proof_mode: false,
secure_run: None,
Expand Down Expand Up @@ -109,20 +104,17 @@ pub fn cairo_run_program_with_initial_scope(
cairo_run_config.disable_trace_padding,
false,
hint_processor,
cairo_run_config.proof_mode,
)?;

cairo_runner.vm.verify_auto_deductions()?;
cairo_runner.read_return_values(allow_missing_builtins)?;
if cairo_run_config.proof_mode {
cairo_runner.finalize_segments()?;
}
if secure_run {
verify_secure_runner(&cairo_runner, true, None)?;
}
cairo_runner.relocate(
cairo_run_config.relocate_mem,
cairo_run_config.relocate_trace,
)?;
cairo_runner.relocate(cairo_run_config.relocate_mem)?;

Ok(cairo_runner)
}
Expand Down Expand Up @@ -221,20 +213,17 @@ pub fn cairo_run_pie(
cairo_run_config.disable_trace_padding,
false,
hint_processor,
cairo_run_config.proof_mode,
)?;

cairo_runner.vm.verify_auto_deductions()?;
cairo_runner.read_return_values(allow_missing_builtins)?;

if secure_run {
verify_secure_runner(&cairo_runner, true, None)?;
// Check that the Cairo PIE produced by this run is compatible with the Cairo PIE received
cairo_runner.get_cairo_pie()?.check_pie_compatibility(pie)?;
}
cairo_runner.relocate(
cairo_run_config.relocate_mem,
cairo_run_config.relocate_trace,
)?;
cairo_runner.relocate(cairo_run_config.relocate_mem)?;

Ok(cairo_runner)
}
Expand Down Expand Up @@ -275,19 +264,17 @@ pub fn cairo_run_fuzzed_program(

res.map_err(|err| VmException::from_vm_error(&cairo_runner, err))?;

cairo_runner.end_run(false, false, hint_processor, cairo_run_config.proof_mode)?;
cairo_runner.end_run(false, false, hint_processor)?;

cairo_runner.vm.verify_auto_deductions()?;
cairo_runner.read_return_values(allow_missing_builtins)?;
if cairo_run_config.proof_mode {
cairo_runner.finalize_segments()?;
}
if secure_run {
verify_secure_runner(&cairo_runner, true, None)?;
}
cairo_runner.relocate(
cairo_run_config.relocate_mem,
cairo_run_config.relocate_trace,
)?;
cairo_runner.relocate(cairo_run_config.relocate_mem)?;

Ok(cairo_runner)
}
Expand Down Expand Up @@ -388,7 +375,7 @@ mod tests {

let end = cairo_runner.initialize(false).unwrap();
assert!(cairo_runner.run_until_pc(end, &mut hint_processor).is_ok());
assert!(cairo_runner.relocate(true, true).is_ok());
assert!(cairo_runner.relocate(true).is_ok());
// `main` returns without doing nothing, but `not_main` sets `[ap]` to `1`
// Memory location was found empirically and simply hardcoded
assert_eq!(cairo_runner.relocated_memory[2], Some(Felt252::from(123)));
Expand Down Expand Up @@ -454,7 +441,7 @@ mod tests {
let mut hint_processor = BuiltinHintProcessor::new_empty();
let mut cairo_runner = run_test_program(program_content, &mut hint_processor).unwrap();

assert!(cairo_runner.relocate(false, true).is_ok());
assert!(cairo_runner.relocate(false).is_ok());

let trace_entries = cairo_runner.relocated_trace.unwrap();
let mut buffer = [0; 24];
Expand All @@ -478,7 +465,7 @@ mod tests {
let mut cairo_runner = run_test_program(program_content, &mut hint_processor).unwrap();

// relocate memory so we can dump it to file
assert!(cairo_runner.relocate(true, true).is_ok());
assert!(cairo_runner.relocate(true).is_ok());

let mut buffer = [0; 120];
let mut buff_writer = SliceWriter::new(&mut buffer);
Expand All @@ -502,7 +489,7 @@ mod tests {
let mut cairo_runner = cairo_runner!(program);
let end = cairo_runner.initialize(false).unwrap();
assert!(cairo_runner.run_until_pc(end, &mut hint_processor).is_ok());
assert!(cairo_runner.relocate(false, false).is_ok());
assert!(cairo_runner.relocate(false).is_ok());
assert!(cairo_runner.relocated_trace.is_none());
}

Expand Down
Loading
Loading