Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
106e5f8
Add starkware-development to CI (like another main) (#2025)
JulianGCalderon Mar 25, 2025
ce73503
Keep None memory cells for the prover input info (#2021)
Stavbe Mar 25, 2025
05fb44f
CI: Fix cache not found error (#2026)
JulianGCalderon Mar 25, 2025
bdd75dd
Remove dependancy in cairo pie when collectiog builtin segments info …
Stavbe Mar 26, 2025
7d7c460
Add Commit Signing section (#2019)
gabrielbosio Mar 26, 2025
92e3188
use btreemap instead of hashmap for deterministic iteration order. (#…
Stavbe Mar 27, 2025
10154c6
Stav/sync starkware dev (#2035)
yuvalsw Mar 27, 2025
2137db8
fill holes is builtins segments
Stavbe Apr 2, 2025
1d70783
fill holes is builtins segments (#2036)
Stavbe Apr 3, 2025
6dfd853
fill holes is builtins segments
Stavbe Apr 2, 2025
2b5ceaf
Rebase starkware-development on top of current main (#2052)
YairVaknin-starkware Apr 7, 2025
895be71
Added hints felt unpacking for blake (#2032)
yuvalsw Apr 7, 2025
d729b9f
add prover input info flag to vm-cli
Stavbe Apr 3, 2025
b9330cd
Stav/add prover input info flag (#2047)
Stavbe Apr 7, 2025
3179708
set disable trace padding for prover input info
Stavbe Apr 10, 2025
ba51705
Stav/disable trace padding for prover input info (#2066)
Stavbe Apr 14, 2025
28f4004
Add_perp_and_dex_w_bitwise_layouts (#2067)
YairVaknin-starkware Apr 14, 2025
9c44e1c
Fix_zero_offset_output_base_assumption (#2068)
YairVaknin-starkware Apr 14, 2025
58174f3
add flag to serialize prover input info into binary files
Stavbe Apr 27, 2025
33d75ca
use bincode for faster writing prover input info (#2074)
Stavbe Apr 29, 2025
dc1c49b
Use_btreemap_for_deterministic_order_of_pie_keys (#2085)
YairVaknin-starkware May 5, 2025
b1a91f9
[BREAKING] Compute_missing_builtin_cells_only_in_proof_mode (#2088)
YairVaknin-starkware May 7, 2025
a5b3c9d
move prover input info to a new seperate file (#2079)
Stavbe May 14, 2025
547dca1
add trace not enabled error
Stavbe Apr 29, 2025
da5dffd
add trace not enabled error (#2080)
Stavbe May 22, 2025
627c1ac
add test to filling holes (#2087)
Stavbe May 22, 2025
41486b5
memory comparision test only for non proof mode cases
Stavbe May 15, 2025
b818326
Stav/remove test compare to python vm (#2086)
Stavbe May 22, 2025
7269a8f
Sync with main (#2116)
gabrielbosio Jun 4, 2025
870fd60
Revert "Sync with main (#2116)" (#2117)
gabrielbosio Jun 4, 2025
bdf604f
Bump cairo-lang to 0.13.5 (#1959) (#2118)
gabrielbosio Jun 5, 2025
15de4b2
Enable_using_secure_run_in_proof_mode (#2113)
YairVaknin-starkware Jun 16, 2025
9277002
take ownershop instad of clone
Stavbe Jun 23, 2025
b85e5c6
Stav/remove clone trace (#2127)
Stavbe Jun 26, 2025
4226352
Fixed bad submodule (#2131)
yuvalsw Jul 3, 2025
b6c2f5a
Added support for large files in PIE (#2136)
yuvalsw Jul 20, 2025
df70ca8
[starkware-development] Pin types-rs version to the one set in lockfi…
gabrielbosio Jul 24, 2025
00406f0
Include_output_builtin_in_prover_input_info (#2138)
YairVaknin-starkware Jul 28, 2025
9d2256f
add relocate trace flag to the runner
Stavbe Jul 31, 2025
1a224f8
Stav/disable relocate trace with flag (#2133)
Stavbe Jul 31, 2025
d3c649c
remove prover input info struct and add getters instead (#2149)
Stavbe Aug 6, 2025
e2c6c91
Use_BTreeMap_in_pie_additional_data (#2162)
YairVaknin-starkware Aug 11, 2025
3f63706
Merge remote-tracking branch 'origin/starkware-development' into stav…
Stavbe Aug 12, 2025
46e40f6
Merge branch 'main' into stav/merge_starkware_development
gabrielbosio Aug 13, 2025
cb86644
Update CHANGELOG for previous PR
JulianGCalderon Aug 12, 2025
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: 0 additions & 1 deletion .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -737,7 +737,6 @@ 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: 26 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,32 @@

#### 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: 2 additions & 1 deletion cairo-vm-cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -180,12 +180,13 @@ 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,
..Default::default()
disable_trace_padding: false,
};

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

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

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

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

Ok((runner, return_values, serialized_output))
}
Expand Down
13 changes: 13 additions & 0 deletions cairo_programs/poseidon_builtin_hole.cairo
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
%builtins poseidon
from starkware.cairo.common.cairo_builtins import PoseidonBuiltin
from starkware.cairo.common.poseidon_state import PoseidonBuiltinState

func main{poseidon_ptr: PoseidonBuiltin*}() {
assert poseidon_ptr[0].input = PoseidonBuiltinState(1, 2, 3);
let result = poseidon_ptr[0].output;
let poseidon_ptr = poseidon_ptr + PoseidonBuiltin.SIZE;
// Note that we are not accesing result.s1.
assert result.s0 = 442682200349489646213731521593476982257703159825582578145778919623645026501;
assert result.s2 = 2512222140811166287287541003826449032093371832913959128171347018667852712082;
return ();
}
35 changes: 24 additions & 11 deletions vm/src/cairo_run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,10 @@ 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 @@ -51,6 +54,8 @@ 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 @@ -104,17 +109,20 @@ 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_runner.relocate(
cairo_run_config.relocate_mem,
cairo_run_config.relocate_trace,
)?;

Ok(cairo_runner)
}
Expand Down Expand Up @@ -213,17 +221,20 @@ 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_runner.relocate(
cairo_run_config.relocate_mem,
cairo_run_config.relocate_trace,
)?;

Ok(cairo_runner)
}
Expand Down Expand Up @@ -264,17 +275,19 @@ 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_runner.end_run(false, 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_runner.relocate(
cairo_run_config.relocate_mem,
cairo_run_config.relocate_trace,
)?;

Ok(cairo_runner)
}
Expand Down Expand Up @@ -375,7 +388,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).is_ok());
assert!(cairo_runner.relocate(true, 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 @@ -441,7 +454,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).is_ok());
assert!(cairo_runner.relocate(false, true).is_ok());

let trace_entries = cairo_runner.relocated_trace.unwrap();
let mut buffer = [0; 24];
Expand All @@ -465,7 +478,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).is_ok());
assert!(cairo_runner.relocate(true, true).is_ok());

let mut buffer = [0; 120];
let mut buff_writer = SliceWriter::new(&mut buffer);
Expand All @@ -489,7 +502,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).is_ok());
assert!(cairo_runner.relocate(false, false).is_ok());
assert!(cairo_runner.relocated_trace.is_none());
}

Expand Down
Loading
Loading