Skip to content

Commit b47fdbf

Browse files
committed
Merge branch 'main' into n-steps-no-trace
2 parents 7eac15b + 8e022a1 commit b47fdbf

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66

77
* `CairoRunner::get_execution_resources` return's `n_steps` field value is now set to `vm.current_step` instead of `0` if both `original_steps` and `trace` are set to `None`
88

9+
* Add `RunResources::get_n_steps` method [#1225](https://github.com/lambdaclass/cairo-rs/pull/1225)
10+
911
* fix: pin Cairo compiler version [#1220](https://github.com/lambdaclass/cairo-rs/pull/1220)
1012

1113
* perf: make `inner_rc_bound` a constant, improving performance of the range-check builtin

bench/run_benchmarks.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ for file in $(ls $tests_path | grep .cairo | sed -E 's/\.cairo//'); do
99
export PATH="$(pyenv root)/shims:$PATH"
1010

1111
hyperfine \
12-
-n "Cairo VM (CPython)" "PYENV_VERSION=3.9.15 cairo-run --layout starknet_with_keccak --program $tests_path/$file.json" \
13-
-n "Cairo VM (PyPy)" "PYENV_VERSION=pypy3.9-7.3.9 cairo-run --layout starknet_with_keccak --program $tests_path/$file.json" \
14-
-n "cairo-rs (Rust)" "../target/release/cairo-vm-cli $tests_path/$file.json --layout starknet_with_keccak"
12+
-n "Cairo VM (CPython)" "PYENV_VERSION=3.9.15 cairo-run --proof_mode --memory_file /dev/null --trace_file /dev/null --layout starknet_with_keccak --program $tests_path/$file.json" \
13+
-n "Cairo VM (PyPy)" "PYENV_VERSION=pypy3.9-7.3.9 cairo-run --proof_mode --memory_file /dev/null --trace_file /dev/null --layout starknet_with_keccak --program $tests_path/$file.json" \
14+
-n "cairo-rs (Rust)" "../target/release/cairo-vm-cli $tests_path/$file.json --proof_mode --memory_file /dev/null --trace_file /dev/null --layout starknet_with_keccak"
1515
done

src/vm/runners/cairo_runner.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,10 @@ impl RunResources {
9494
pub fn consume_steps(&mut self) {
9595
self.n_steps -= 1;
9696
}
97+
98+
pub fn get_n_steps(&self) -> usize {
99+
self.n_steps
100+
}
97101
}
98102

99103
#[derive(Debug)]
@@ -5018,7 +5022,7 @@ mod tests {
50185022
Ok(())
50195023
);
50205024

5021-
assert_eq!(run_resources, Some(RunResources::new(1)));
5025+
assert_eq!(run_resources.unwrap().get_n_steps(), 1);
50225026
}
50235027

50245028
#[test]

0 commit comments

Comments
 (0)