From 0f61b089031ed3de818832a1c59a447fbc935c03 Mon Sep 17 00:00:00 2001 From: Meshi Peled <141231558+meship-starkware@users.noreply.github.com> Date: Sun, 12 Jan 2025 19:41:47 +0200 Subject: [PATCH] fix(blockifier): remove stacker --- Cargo.lock | 23 ------------------- Cargo.toml | 1 - crates/blockifier/Cargo.toml | 3 +-- .../src/execution/execution_utils.rs | 14 +++++------ .../execution/native/entry_point_execution.rs | 17 ++++++-------- 5 files changed, 15 insertions(+), 43 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 04cefd04e5..411500a011 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1664,7 +1664,6 @@ dependencies = [ "serde", "serde_json", "sha2", - "stacker", "starknet-types-core", "starknet_api", "starknet_infra_utils", @@ -8780,15 +8779,6 @@ version = "2.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "33cb294fe86a74cbcf50d4445b37da762029549ebeea341421c7c70370f86cac" -[[package]] -name = "psm" -version = "0.1.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "200b9ff220857e53e184257720a14553b2f4aa02577d2ed9842d45d4b9654810" -dependencies = [ - "cc", -] - [[package]] name = "publicsuffix" version = "2.3.0" @@ -10436,19 +10426,6 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" -[[package]] -name = "stacker" -version = "0.1.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "799c883d55abdb5e98af1a7b3f23b9b6de8ecada0ecac058672d7635eb48ca7b" -dependencies = [ - "cc", - "cfg-if", - "libc", - "psm", - "windows-sys 0.59.0", -] - [[package]] name = "starknet-core" version = "0.6.1" diff --git a/Cargo.toml b/Cargo.toml index c38f516366..d37f0cd0f8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -212,7 +212,6 @@ serde_yaml = "0.9.16" sha2 = "0.10.8" sha3 = "0.10.8" simple_logger = "4.0.0" -stacker = "0.1.17" starknet-core = "0.6.0" starknet-crypto = "0.7.1" starknet-types-core = "0.1.6" diff --git a/crates/blockifier/Cargo.toml b/crates/blockifier/Cargo.toml index 56ae7f49e6..95598ad8bc 100644 --- a/crates/blockifier/Cargo.toml +++ b/crates/blockifier/Cargo.toml @@ -10,7 +10,7 @@ description = "The transaction-executing component in the Starknet sequencer." workspace = true [features] -cairo_native = ["dep:cairo-native", "dep:stacker", "starknet_sierra_compile/cairo_native"] +cairo_native = ["dep:cairo-native", "starknet_sierra_compile/cairo_native"] jemalloc = ["dep:tikv-jemallocator"] native_blockifier = [] reexecution = ["transaction_serde"] @@ -50,7 +50,6 @@ semver.workspace = true serde = { workspace = true, features = ["derive"] } serde_json = { workspace = true, features = ["arbitrary_precision"] } sha2.workspace = true -stacker = { workspace = true, optional = true } starknet-types-core.workspace = true starknet_api.workspace = true starknet_infra_utils.workspace = true diff --git a/crates/blockifier/src/execution/execution_utils.rs b/crates/blockifier/src/execution/execution_utils.rs index a7b3e50f73..528e1645dc 100644 --- a/crates/blockifier/src/execution/execution_utils.rs +++ b/crates/blockifier/src/execution/execution_utils.rs @@ -139,13 +139,13 @@ pub fn execute_entry_point_call( context, ) } else { - log::debug!( - "Using Cairo Native execution. Block Number: {}, Transaction Hash: {}, Class \ - Hash: {}.", - context.tx_context.block_context.block_info.block_number, - context.tx_context.tx_info.transaction_hash(), - call.class_hash.expect("Missing Class Hash") - ); + // log::debug!( + // "Using Cairo Native execution. Block Number: {}, Transaction Hash: {}, Class + // \ Hash: {}.", + // context.tx_context.block_context.block_info.block_number, + // context.tx_context.tx_info.transaction_hash(), + // call.class_hash.expect("Missing Class Hash") + // ); native_entry_point_execution::execute_entry_point_call( call, compiled_class, diff --git a/crates/blockifier/src/execution/native/entry_point_execution.rs b/crates/blockifier/src/execution/native/entry_point_execution.rs index d0ca87b173..8d4eca495a 100644 --- a/crates/blockifier/src/execution/native/entry_point_execution.rs +++ b/crates/blockifier/src/execution/native/entry_point_execution.rs @@ -1,7 +1,6 @@ use cairo_native::execution_result::ContractExecutionResult; use cairo_native::utils::BuiltinCosts; use num_rational::Ratio; -use stacker; use crate::execution::call_info::{CallExecution, CallInfo, Retdata}; use crate::execution::contract_class::TrackedResource; @@ -81,15 +80,13 @@ pub fn execute_entry_point_call( .unwrap_or_else(|e| panic!("Failed to convert stack size red zone to usize: {}", e)); // Use `maybe_grow` and not `grow` for performance, since in happy flows, only the main call // should trigger the growth. - let execution_result = stacker::maybe_grow(stack_size_red_zone, target_stack_size, || { - compiled_class.executor.run( - entry_point.selector.0, - &syscall_handler.base.call.calldata.0.clone(), - call_initial_gas, - Some(builtin_costs), - &mut syscall_handler, - ) - }); + let execution_result = compiled_class.executor.run( + entry_point.selector.0, + &syscall_handler.base.call.calldata.0.clone(), + call_initial_gas, + Some(builtin_costs), + &mut syscall_handler, + ); syscall_handler.finalize(); let call_result = execution_result.map_err(EntryPointExecutionError::NativeUnexpectedError)?;