Skip to content

Commit f51afba

Browse files
fix syscall counting
1 parent 608105d commit f51afba

File tree

4 files changed

+11
-15
lines changed

4 files changed

+11
-15
lines changed

Cargo.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,8 @@ cairo-lang-sierra = "2.12.0-dev.1"
100100
cairo-lang-sierra-to-casm = "2.12.0-dev.1"
101101
cairo-lang-starknet-classes = "2.12.0-dev.1"
102102
cairo-lang-utils = "2.12.0-dev.1"
103-
cairo-native = { git = "https://github.com/lambdaclass/cairo_native", rev = "a51d1b527a235a51dcdb6168c881eafa76bf15e1" }
104-
sierra-emu = { git = "https://github.com/lambdaclass/cairo_native", rev = "a51d1b527a235a51dcdb6168c881eafa76bf15e1" }
103+
cairo-native = { git = "https://github.com/lambdaclass/cairo_native", rev = "52cf76f469e4b4efe92203d31ff374b7d2c539ee" }
104+
sierra-emu = { git = "https://github.com/lambdaclass/cairo_native", rev = "52cf76f469e4b4efe92203d31ff374b7d2c539ee" }
105105
cairo-vm = "2.0.1"
106106
camelpaste = "0.1.0"
107107
chrono = "0.4.26"

crates/blockifier/src/execution/native/entry_point_execution.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,12 @@ pub fn execute_entry_point_call(
6767
return Err(EntryPointExecutionError::NativeUnrecoverableError(Box::new(error)));
6868
}
6969

70-
create_callinfo(call_result, syscall_handler)
70+
let result = create_callinfo(call_result, syscall_handler);
71+
72+
#[cfg(feature = "block-composition")]
73+
SYSCALL_COUNTER.fetch_and(0, Ordering::Relaxed);
74+
75+
result
7176
}
7277

7378
fn create_callinfo(

crates/blockifier/src/execution/native/executor.rs

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ use std::fs::{self, File};
22
use std::io::Write;
33
use std::path::PathBuf;
44
use std::sync::atomic::AtomicU64;
5-
#[cfg(feature = "block-composition")]
6-
use std::sync::atomic::Ordering;
75
use std::sync::Arc;
86

97
use cairo_lang_sierra::program::Program;
@@ -18,7 +16,6 @@ use sierra_emu::VirtualMachine;
1816
use starknet_types_core::felt::Felt;
1917

2018
use super::syscall_handler::NativeSyscallHandler;
21-
use crate::execution::native::syscall_handler::SYSCALL_COUNTER;
2219

2320
#[derive(Debug)]
2421
pub enum ContractExecutor {
@@ -51,13 +48,7 @@ impl ContractExecutor {
5148
) -> cairo_native::error::Result<ContractExecutionResult> {
5249
match self {
5350
ContractExecutor::Aot(aot_contract_executor) => {
54-
let result =
55-
aot_contract_executor.run(selector, args, gas, builtin_costs, syscall_handler);
56-
57-
#[cfg(feature = "block-composition")]
58-
SYSCALL_COUNTER.fetch_and(0, Ordering::Relaxed);
59-
60-
result
51+
aot_contract_executor.run(selector, args, gas, builtin_costs, syscall_handler)
6152
}
6253
ContractExecutor::Emu((program, entrypoints, version)) => {
6354
let mut virtual_machine =

0 commit comments

Comments
 (0)