Skip to content

Commit f7bdcae

Browse files
authored
Revert "Merge starkware-development (#2172)"
This reverts commit 5878bc3.
1 parent 5878bc3 commit f7bdcae

26 files changed

+222
-739
lines changed

.github/workflows/rust.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -737,6 +737,7 @@ jobs:
737737
path: lcov-test-no_std#4-cairo-0-secp-hints.info
738738
key: codecov-cache-test-no_std#4-cairo-0-secp-hints-${{ github.sha }}
739739
fail-on-cache-miss: true
740+
740741
- name: Upload coverage to codecov.io
741742
uses: codecov/codecov-action@v3
742743
with:

CHANGELOG.md

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -2,32 +2,6 @@
22

33
#### Upcoming Changes
44

5-
* feat: Use BTreeMap in PIE additional data [#2162](https://github.com/lambdaclass/cairo-vm/pull/2162)
6-
7-
* feat: Remove prover input info struct and add getters instead [#2149](https://github.com/lambdaclass/cairo-vm/pull/2149)
8-
9-
* feat: Added support for large files in PIE [#2136](https://github.com/lambdaclass/cairo-vm/pull/2136)
10-
11-
* feat: Disable relocate trace with flag [#2133](https://github.com/lambdaclass/cairo-vm/pull/2133)
12-
13-
* feat: Enable using secure run in proof mode [#2113](https://github.com/lambdaclass/cairo-vm/pull/2113)
14-
15-
* [BREAKING] Compute missing builtin cells only in proof mode [#2088](https://github.com/lambdaclass/cairo-vm/pull/2088)
16-
17-
* test: Add test for filling holes in builtin segments [#2087](https://github.com/lambdaclass/cairo-vm/pull/2087)
18-
19-
* 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)
20-
21-
* refactor: Use BTreeMap for deterministic order of PIE keys [#2085](https://github.com/lambdaclass/cairo-vm/pull/2085)
22-
23-
* fix: Fix zero offset output base assumption [#2068](https://github.com/lambdaclass/cairo-vm/pull/2068)
24-
25-
* feat: Add perpetual and dex with bitwise layouts [#2067](https://github.com/lambdaclass/cairo-vm/pull/2067)
26-
27-
* feat: Fill holes in builtins segments to save computation in the prover [#2036](https://github.com/lambdaclass/cairo-vm/pull/2036)
28-
29-
* feat: Added hints felt unpacking for blake [#2032](https://github.com/lambdaclass/cairo-vm/pull/2032)
30-
315
* dev: make `VirtualMachine::get_traceback_entries` pub
326

337
* chore: Pin types-rs version to the one set in lockfile [#2140](https://github.com/lambdaclass/cairo-vm/pull/2140)

cairo-vm-cli/src/main.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,13 +180,12 @@ fn run(args: impl Iterator<Item = String>) -> Result<(), Error> {
180180
entrypoint: &args.entrypoint,
181181
trace_enabled,
182182
relocate_mem: args.memory_file.is_some() || args.air_public_input.is_some(),
183-
relocate_trace: trace_enabled,
184183
layout: args.layout,
185184
proof_mode: args.proof_mode,
186185
secure_run: args.secure_run,
187186
allow_missing_builtins: args.allow_missing_builtins,
188187
dynamic_layout_params: cairo_layout_params,
189-
disable_trace_padding: false,
188+
..Default::default()
190189
};
191190

192191
let mut cairo_runner = match if args.run_from_cairo_pie {

cairo1-run/src/cairo_run.rs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -267,12 +267,7 @@ pub fn cairo_run_program(
267267
runner.run_for_steps(1, &mut hint_processor)?;
268268
}
269269

270-
runner.end_run(
271-
false,
272-
false,
273-
&mut hint_processor,
274-
cairo_run_config.proof_mode,
275-
)?;
270+
runner.end_run(false, false, &mut hint_processor)?;
276271

277272
let result_inner_type_size =
278273
result_inner_type_size(return_type_id, &sierra_program_registry, &type_sizes);
@@ -341,7 +336,7 @@ pub fn cairo_run_program(
341336
}
342337
}
343338

344-
runner.relocate(true, true)?;
339+
runner.relocate(true)?;
345340

346341
Ok((runner, return_values, serialized_output))
347342
}

cairo_programs/poseidon_builtin_hole.cairo

Lines changed: 0 additions & 13 deletions
This file was deleted.

vm/src/cairo_run.rs

Lines changed: 11 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,7 @@ pub struct CairoRunConfig<'a> {
2727
#[cfg_attr(feature = "test_utils", arbitrary(value = "main"))]
2828
pub entrypoint: &'a str,
2929
pub trace_enabled: bool,
30-
/// Relocate memory if `true`, otherwise memory is not relocated.
3130
pub relocate_mem: bool,
32-
// When `relocate_trace` is set to `false`, the trace will not be relocated even if `trace_enabled` is `true`.
33-
pub relocate_trace: bool,
3431
pub layout: LayoutName,
3532
/// The `dynamic_layout_params` argument should only be used with dynamic layout.
3633
/// It is ignored otherwise.
@@ -54,8 +51,6 @@ impl Default for CairoRunConfig<'_> {
5451
entrypoint: "main",
5552
trace_enabled: false,
5653
relocate_mem: false,
57-
// Set to true to match expected behavior: trace is relocated only if trace_enabled is true.
58-
relocate_trace: true,
5954
layout: LayoutName::plain,
6055
proof_mode: false,
6156
secure_run: None,
@@ -109,20 +104,17 @@ pub fn cairo_run_program_with_initial_scope(
109104
cairo_run_config.disable_trace_padding,
110105
false,
111106
hint_processor,
112-
cairo_run_config.proof_mode,
113107
)?;
114108

109+
cairo_runner.vm.verify_auto_deductions()?;
115110
cairo_runner.read_return_values(allow_missing_builtins)?;
116111
if cairo_run_config.proof_mode {
117112
cairo_runner.finalize_segments()?;
118113
}
119114
if secure_run {
120115
verify_secure_runner(&cairo_runner, true, None)?;
121116
}
122-
cairo_runner.relocate(
123-
cairo_run_config.relocate_mem,
124-
cairo_run_config.relocate_trace,
125-
)?;
117+
cairo_runner.relocate(cairo_run_config.relocate_mem)?;
126118

127119
Ok(cairo_runner)
128120
}
@@ -221,20 +213,17 @@ pub fn cairo_run_pie(
221213
cairo_run_config.disable_trace_padding,
222214
false,
223215
hint_processor,
224-
cairo_run_config.proof_mode,
225216
)?;
226217

218+
cairo_runner.vm.verify_auto_deductions()?;
227219
cairo_runner.read_return_values(allow_missing_builtins)?;
228220

229221
if secure_run {
230222
verify_secure_runner(&cairo_runner, true, None)?;
231223
// Check that the Cairo PIE produced by this run is compatible with the Cairo PIE received
232224
cairo_runner.get_cairo_pie()?.check_pie_compatibility(pie)?;
233225
}
234-
cairo_runner.relocate(
235-
cairo_run_config.relocate_mem,
236-
cairo_run_config.relocate_trace,
237-
)?;
226+
cairo_runner.relocate(cairo_run_config.relocate_mem)?;
238227

239228
Ok(cairo_runner)
240229
}
@@ -275,19 +264,17 @@ pub fn cairo_run_fuzzed_program(
275264

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

278-
cairo_runner.end_run(false, false, hint_processor, cairo_run_config.proof_mode)?;
267+
cairo_runner.end_run(false, false, hint_processor)?;
279268

269+
cairo_runner.vm.verify_auto_deductions()?;
280270
cairo_runner.read_return_values(allow_missing_builtins)?;
281271
if cairo_run_config.proof_mode {
282272
cairo_runner.finalize_segments()?;
283273
}
284274
if secure_run {
285275
verify_secure_runner(&cairo_runner, true, None)?;
286276
}
287-
cairo_runner.relocate(
288-
cairo_run_config.relocate_mem,
289-
cairo_run_config.relocate_trace,
290-
)?;
277+
cairo_runner.relocate(cairo_run_config.relocate_mem)?;
291278

292279
Ok(cairo_runner)
293280
}
@@ -388,7 +375,7 @@ mod tests {
388375

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

457-
assert!(cairo_runner.relocate(false, true).is_ok());
444+
assert!(cairo_runner.relocate(false).is_ok());
458445

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

480467
// relocate memory so we can dump it to file
481-
assert!(cairo_runner.relocate(true, true).is_ok());
468+
assert!(cairo_runner.relocate(true).is_ok());
482469

483470
let mut buffer = [0; 120];
484471
let mut buff_writer = SliceWriter::new(&mut buffer);
@@ -502,7 +489,7 @@ mod tests {
502489
let mut cairo_runner = cairo_runner!(program);
503490
let end = cairo_runner.initialize(false).unwrap();
504491
assert!(cairo_runner.run_until_pc(end, &mut hint_processor).is_ok());
505-
assert!(cairo_runner.relocate(false, false).is_ok());
492+
assert!(cairo_runner.relocate(false).is_ok());
506493
assert!(cairo_runner.relocated_trace.is_none());
507494
}
508495

0 commit comments

Comments
 (0)