Skip to content

Commit 24ad61d

Browse files
fix syscall counting
1 parent 608105d commit 24ad61d

File tree

2 files changed

+7
-11
lines changed

2 files changed

+7
-11
lines changed

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)