diff --git a/crates/blockifier/src/state.rs b/crates/blockifier/src/state.rs index 8aa857c963..6ec009d7a8 100644 --- a/crates/blockifier/src/state.rs +++ b/crates/blockifier/src/state.rs @@ -1,5 +1,4 @@ pub mod cached_state; -#[cfg(feature = "cairo_native")] pub mod contract_class_manager; #[cfg(test)] pub mod error_format_test; diff --git a/crates/blockifier/src/state/contract_class_manager.rs b/crates/blockifier/src/state/contract_class_manager.rs index a6c734fae3..4fb03318a8 100644 --- a/crates/blockifier/src/state/contract_class_manager.rs +++ b/crates/blockifier/src/state/contract_class_manager.rs @@ -1,19 +1,37 @@ +#[cfg(feature = "cairo_native")] use std::sync::mpsc::{sync_channel, Receiver, SyncSender, TrySendError}; +#[cfg(feature = "cairo_native")] use std::sync::Arc; +#[cfg(any(feature = "testing", test))] +use cached::Cached; +#[cfg(feature = "cairo_native")] use log::{error, info}; +#[cfg(feature = "cairo_native")] +use starknet_api::contract_class::SierraVersion; use starknet_api::core::ClassHash; +#[cfg(feature = "cairo_native")] use starknet_api::state::SierraContractClass; +#[cfg(feature = "cairo_native")] use starknet_sierra_compile::command_line_compiler::CommandLineCompiler; +#[cfg(feature = "cairo_native")] use starknet_sierra_compile::config::SierraToCasmCompilationConfig; +#[cfg(feature = "cairo_native")] use starknet_sierra_compile::utils::into_contract_class_for_compilation; +#[cfg(feature = "cairo_native")] use starknet_sierra_compile::SierraToNativeCompiler; use crate::blockifier::config::ContractClassManagerConfig; +use crate::execution::contract_class::VersionedRunnableCompiledClass; +#[cfg(feature = "cairo_native")] use crate::execution::contract_class::{CompiledClassV1, RunnableCompiledClass}; +#[cfg(feature = "cairo_native")] use crate::execution::native::contract_class::NativeCompiledClassV1; -use crate::state::global_cache::{CachedCairoNative, ContractCaches}; +#[cfg(feature = "cairo_native")] +use crate::state::global_cache::CachedCairoNative; +use crate::state::global_cache::ContractCaches; +#[cfg(feature = "cairo_native")] const CHANNEL_SIZE: usize = 1000; /// Represents a request to compile a sierra contract class to a native compiled class. @@ -23,46 +41,54 @@ const CHANNEL_SIZE: usize = 1000; /// * `sierra_contract_class` - the sierra contract class to be compiled. /// * `casm_compiled_class` - stored in [`NativeCompiledClassV1`] to allow fallback to cairo_vm /// execution in case of unexpected failure during native execution. +#[cfg(feature = "cairo_native")] type CompilationRequest = (ClassHash, Arc, CompiledClassV1); /// Manages the global cache of contract classes and handles sierra-to-native compilation requests. -struct ContractClassManager { +#[derive(Clone)] +pub struct ContractClassManager { + #[cfg(feature = "cairo_native")] config: ContractClassManagerConfig, /// The global cache of contract classes: casm, sierra, and native. - contract_caches: Arc, + contract_caches: ContractCaches, /// The sending half of the compilation request channel. Set to `None` if native compilation is /// disabled. + #[cfg(feature = "cairo_native")] sender: Option>, } -#[allow(dead_code)] impl ContractClassManager { /// Creates a new contract class manager and spawns a thread that listens for compilation /// requests and processes them (a.k.a. the compilation worker). /// Returns the contract class manager. pub fn start(config: ContractClassManagerConfig) -> ContractClassManager { // TODO(Avi, 15/12/2024): Add the size of the channel to the config. - let contract_caches = Arc::new(ContractCaches::new(config.contract_cache_size)); - if !config.run_cairo_native { - // Native compilation is disabled - no need to start the compilation worker. - return ContractClassManager { config, contract_caches, sender: None }; - } - let (sender, receiver) = sync_channel(CHANNEL_SIZE); - let compiler_config = SierraToCasmCompilationConfig::default(); - let compiler = CommandLineCompiler::new(compiler_config); + let contract_caches = ContractCaches::new(config.contract_cache_size); + #[cfg(not(feature = "cairo_native"))] + return ContractClassManager { contract_caches }; + #[cfg(feature = "cairo_native")] + { + if !config.run_cairo_native { + // Native compilation is disabled - no need to start the compilation worker. + return ContractClassManager { config, contract_caches, sender: None }; + } + let (sender, receiver) = sync_channel(CHANNEL_SIZE); - std::thread::spawn({ - let contract_caches = Arc::clone(&contract_caches); - let compiler = Arc::new(compiler); + std::thread::spawn({ + let contract_caches = contract_caches.clone(); + let compiler_config = SierraToCasmCompilationConfig::default(); + let compiler = CommandLineCompiler::new(compiler_config); - move || run_compilation_worker(contract_caches, receiver, compiler) - }); + move || run_compilation_worker(contract_caches, receiver, compiler) + }); - ContractClassManager { config, contract_caches, sender: Some(sender) } + ContractClassManager { config, contract_caches, sender: Some(sender) } + } } /// Sends a compilation request to the compilation worker. Does not block the sender. Logs an /// error if the channel is full. + #[cfg(feature = "cairo_native")] pub fn send_compilation_request(&self, request: CompilationRequest) { assert!(!self.config.run_cairo_native, "Native compilation is disabled."); let sender = self.sender.as_ref().expect("Compilation channel not available."); @@ -83,41 +109,59 @@ impl ContractClassManager { } /// Returns the native compiled class for the given class hash, if it exists in cache. + #[cfg(feature = "cairo_native")] pub fn get_native(&self, class_hash: &ClassHash) -> Option { self.contract_caches.get_native(class_hash) } /// Returns the Sierra contract class for the given class hash, if it exists in cache. + #[cfg(feature = "cairo_native")] pub fn get_sierra(&self, class_hash: &ClassHash) -> Option> { self.contract_caches.get_sierra(class_hash) } /// Returns the casm compiled class for the given class hash, if it exists in cache. - pub fn get_casm(&self, class_hash: &ClassHash) -> Option { + pub fn get_casm(&self, class_hash: &ClassHash) -> Option { self.contract_caches.get_casm(class_hash) } /// Sets the casm compiled class for the given class hash in the cache. - pub fn set_casm(&self, class_hash: ClassHash, compiled_class: RunnableCompiledClass) { + pub fn set_casm(&self, class_hash: ClassHash, compiled_class: VersionedRunnableCompiledClass) { self.contract_caches.set_casm(class_hash, compiled_class); } + /// Clear the contract caches. + pub fn clear(&mut self) { + self.contract_caches.clear(); + } + /// Caches the sierra and casm contract classes of a compilation request. + #[cfg(feature = "cairo_native")] fn cache_request_contracts(&self, request: &CompilationRequest) { let (class_hash, sierra, casm) = request.clone(); + let sierra_version = SierraVersion::extract_from_program(&sierra.sierra_program).unwrap(); self.contract_caches.set_sierra(class_hash, sierra); - let cached_casm = RunnableCompiledClass::from(casm); + let cached_casm = VersionedRunnableCompiledClass::Cairo1(( + RunnableCompiledClass::from(casm), + sierra_version, + )); self.contract_caches.set_casm(class_hash, cached_casm); } + + #[cfg(any(feature = "testing", test))] + pub fn get_casm_cache_size(&self) -> usize { + self.contract_caches.casm_cache.lock().cache_size() + } } /// Handles compilation requests from the channel, holding the receiver end of the channel. /// If no request is available, non-busy-waits until a request is available. /// When the sender is dropped, the worker processes all pending requests and terminates. +#[cfg(feature = "cairo_native")] fn run_compilation_worker( - contract_caches: Arc, + contract_caches: ContractCaches, receiver: Receiver, - compiler: Arc, + compiler: impl SierraToNativeCompiler, ) { info!("Compilation worker started."); for (class_hash, sierra, casm) in receiver.iter() { diff --git a/crates/blockifier/src/state/global_cache.rs b/crates/blockifier/src/state/global_cache.rs index f60df02f01..abc105d839 100644 --- a/crates/blockifier/src/state/global_cache.rs +++ b/crates/blockifier/src/state/global_cache.rs @@ -5,8 +5,7 @@ use starknet_api::core::ClassHash; #[cfg(feature = "cairo_native")] use starknet_api::state::SierraContractClass; -#[cfg(feature = "cairo_native")] -use crate::execution::contract_class::RunnableCompiledClass; +use crate::execution::contract_class::VersionedRunnableCompiledClass; #[cfg(feature = "cairo_native")] use crate::execution::native::contract_class::NativeCompiledClassV1; @@ -51,35 +50,40 @@ impl GlobalContractCache { } } -#[cfg(feature = "cairo_native")] +#[derive(Clone)] pub struct ContractCaches { - pub casm_cache: GlobalContractCache, + pub casm_cache: GlobalContractCache, + #[cfg(feature = "cairo_native")] pub native_cache: GlobalContractCache, + #[cfg(feature = "cairo_native")] pub sierra_cache: GlobalContractCache>, } -#[cfg(feature = "cairo_native")] impl ContractCaches { - pub fn get_casm(&self, class_hash: &ClassHash) -> Option { + pub fn get_casm(&self, class_hash: &ClassHash) -> Option { self.casm_cache.get(class_hash) } - pub fn set_casm(&self, class_hash: ClassHash, compiled_class: RunnableCompiledClass) { + pub fn set_casm(&self, class_hash: ClassHash, compiled_class: VersionedRunnableCompiledClass) { self.casm_cache.set(class_hash, compiled_class); } + #[cfg(feature = "cairo_native")] pub fn get_native(&self, class_hash: &ClassHash) -> Option { self.native_cache.get(class_hash) } + #[cfg(feature = "cairo_native")] pub fn set_native(&self, class_hash: ClassHash, contract_executor: CachedCairoNative) { self.native_cache.set(class_hash, contract_executor); } + #[cfg(feature = "cairo_native")] pub fn get_sierra(&self, class_hash: &ClassHash) -> Option> { self.sierra_cache.get(class_hash) } + #[cfg(feature = "cairo_native")] pub fn set_sierra(&self, class_hash: ClassHash, contract_class: Arc) { self.sierra_cache.set(class_hash, contract_class); } @@ -87,14 +91,18 @@ impl ContractCaches { pub fn new(cache_size: usize) -> Self { Self { casm_cache: GlobalContractCache::new(cache_size), + #[cfg(feature = "cairo_native")] native_cache: GlobalContractCache::new(cache_size), + #[cfg(feature = "cairo_native")] sierra_cache: GlobalContractCache::new(cache_size), } } pub fn clear(&mut self) { self.casm_cache.clear(); + #[cfg(feature = "cairo_native")] self.native_cache.clear(); + #[cfg(feature = "cairo_native")] self.sierra_cache.clear(); } } diff --git a/crates/native_blockifier/src/py_block_executor.rs b/crates/native_blockifier/src/py_block_executor.rs index 57a92a16d1..05ae77d6b8 100644 --- a/crates/native_blockifier/src/py_block_executor.rs +++ b/crates/native_blockifier/src/py_block_executor.rs @@ -8,9 +8,8 @@ use blockifier::blockifier::transaction_executor::{TransactionExecutor, Transact use blockifier::bouncer::BouncerConfig; use blockifier::context::{BlockContext, ChainInfo, FeeTokenAddresses}; use blockifier::execution::call_info::CallInfo; -use blockifier::execution::contract_class::VersionedRunnableCompiledClass; use blockifier::fee::receipt::TransactionReceipt; -use blockifier::state::global_cache::GlobalContractCache; +use blockifier::state::contract_class_manager::ContractClassManager; use blockifier::transaction::objects::{ExecutionResourcesTraits, TransactionExecutionInfo}; use blockifier::transaction::transaction_execution::Transaction; use blockifier::utils::usize_from_u64; @@ -137,8 +136,7 @@ pub struct PyBlockExecutor { pub tx_executor: Option>, /// `Send` trait is required for `pyclass` compatibility as Python objects must be threadsafe. pub storage: Box, - pub contract_class_manager_config: ContractClassManagerConfig, - pub global_contract_cache: GlobalContractCache, + pub contract_class_manager: ContractClassManager, } #[pymethods] @@ -169,9 +167,8 @@ impl PyBlockExecutor { versioned_constants, tx_executor: None, storage: Box::new(storage), - contract_class_manager_config: contract_class_manager_config.into(), - global_contract_cache: GlobalContractCache::new( - contract_class_manager_config.contract_cache_size, + contract_class_manager: ContractClassManager::start( + contract_class_manager_config.into(), ), } } @@ -365,8 +362,8 @@ impl PyBlockExecutor { /// (this is true for every partial existence of information at tables). #[pyo3(signature = (block_number))] pub fn revert_block(&mut self, block_number: u64) -> NativeBlockifierResult<()> { - // Clear global class cache, to peroperly revert classes declared in the reverted block. - self.global_contract_cache.clear(); + // Clear global class cache, to properly revert classes declared in the reverted block. + self.contract_class_manager.clear(); self.storage.revert_block(block_number) } @@ -407,9 +404,8 @@ impl PyBlockExecutor { chain_info: os_config.into_chain_info(), versioned_constants, tx_executor: None, - contract_class_manager_config: contract_class_manager_config.into(), - global_contract_cache: GlobalContractCache::new( - contract_class_manager_config.contract_cache_size, + contract_class_manager: ContractClassManager::start( + contract_class_manager_config.into(), ), } } @@ -426,12 +422,17 @@ impl PyBlockExecutor { PapyrusReader::new( self.storage.reader().clone(), next_block_number, - self.global_contract_cache.clone(), + self.contract_class_manager.clone(), ) } pub fn create_for_testing_with_storage(storage: impl Storage + Send + 'static) -> Self { use blockifier::state::global_cache::GLOBAL_CONTRACT_CACHE_SIZE_FOR_TEST; + let contract_class_manager_config = ContractClassManagerConfig { + run_cairo_native: false, + wait_on_native_compilation: false, + contract_cache_size: GLOBAL_CONTRACT_CACHE_SIZE_FOR_TEST, + }; Self { bouncer_config: BouncerConfig::max(), tx_executor_config: TransactionExecutorConfig::create_for_testing(true), @@ -439,12 +440,7 @@ impl PyBlockExecutor { chain_info: ChainInfo::default(), versioned_constants: VersionedConstants::latest_constants().clone(), tx_executor: None, - contract_class_manager_config: ContractClassManagerConfig { - run_cairo_native: false, - wait_on_native_compilation: false, - contract_cache_size: GLOBAL_CONTRACT_CACHE_SIZE_FOR_TEST, - }, - global_contract_cache: GlobalContractCache::new(GLOBAL_CONTRACT_CACHE_SIZE_FOR_TEST), + contract_class_manager: ContractClassManager::start(contract_class_manager_config), } } diff --git a/crates/native_blockifier/src/py_block_executor_test.rs b/crates/native_blockifier/src/py_block_executor_test.rs index d223df4657..c8fcdc6964 100644 --- a/crates/native_blockifier/src/py_block_executor_test.rs +++ b/crates/native_blockifier/src/py_block_executor_test.rs @@ -3,7 +3,6 @@ use std::collections::HashMap; use blockifier::blockifier::transaction_executor::BLOCK_STATE_ACCESS_ERR; use blockifier::execution::contract_class::{CompiledClassV1, RunnableCompiledClass}; use blockifier::state::state_api::StateReader; -use cached::Cached; use cairo_lang_starknet_classes::casm_contract_class::CasmContractClass; use pretty_assertions::assert_eq; use starknet_api::class_hash; @@ -69,7 +68,7 @@ fn global_contract_cache_update() { ) .unwrap(); - assert_eq!(block_executor.global_contract_cache.lock().cache_size(), 0); + assert_eq!(block_executor.contract_class_manager.get_casm_cache_size(), 0); let queried_contract_class = block_executor .tx_executor() @@ -80,7 +79,7 @@ fn global_contract_cache_update() { .unwrap(); assert_eq!(queried_contract_class, contract_class); - assert_eq!(block_executor.global_contract_cache.lock().cache_size(), 1); + assert_eq!(block_executor.contract_class_manager.get_casm_cache_size(), 1); } #[test] diff --git a/crates/papyrus_state_reader/src/papyrus_state.rs b/crates/papyrus_state_reader/src/papyrus_state.rs index bfa5e01c41..fcf399163f 100644 --- a/crates/papyrus_state_reader/src/papyrus_state.rs +++ b/crates/papyrus_state_reader/src/papyrus_state.rs @@ -4,8 +4,8 @@ use blockifier::execution::contract_class::{ RunnableCompiledClass, VersionedRunnableCompiledClass, }; +use blockifier::state::contract_class_manager::ContractClassManager; use blockifier::state::errors::{couple_casm_and_sierra, StateError}; -use blockifier::state::global_cache::GlobalContractCache; use blockifier::state::state_api::{StateReader, StateResult}; use papyrus_storage::compiled_class::CasmStorageReader; use papyrus_storage::db::RO; @@ -25,16 +25,16 @@ type RawPapyrusReader<'env> = papyrus_storage::StorageTxn<'env, RO>; pub struct PapyrusReader { storage_reader: StorageReader, latest_block: BlockNumber, - global_class_hash_to_class: GlobalContractCache, + contract_class_manager: ContractClassManager, } impl PapyrusReader { pub fn new( storage_reader: StorageReader, latest_block: BlockNumber, - global_class_hash_to_class: GlobalContractCache, + contract_class_manager: ContractClassManager, ) -> Self { - Self { storage_reader, latest_block, global_class_hash_to_class } + Self { storage_reader, latest_block, contract_class_manager } } fn reader(&self) -> StateResult> { @@ -132,15 +132,15 @@ impl StateReader for PapyrusReader { fn get_compiled_class(&self, class_hash: ClassHash) -> StateResult { // Assumption: the global cache is cleared upon reverted blocks. - let versioned_contract_class = self.global_class_hash_to_class.get(&class_hash); + let versioned_contract_class = self.contract_class_manager.get_casm(&class_hash); match versioned_contract_class { Some(contract_class) => Ok(RunnableCompiledClass::from(contract_class)), None => { let versioned_contract_class_from_db = self.get_compiled_class_inner(class_hash)?; // The class was declared in a previous (finalized) state; update the global cache. - self.global_class_hash_to_class - .set(class_hash, versioned_contract_class_from_db.clone()); + self.contract_class_manager + .set_casm(class_hash, versioned_contract_class_from_db.clone()); Ok(RunnableCompiledClass::from(versioned_contract_class_from_db)) } } diff --git a/crates/papyrus_state_reader/src/papyrus_state_test.rs b/crates/papyrus_state_reader/src/papyrus_state_test.rs index 0f398f00af..d3c76cd598 100644 --- a/crates/papyrus_state_reader/src/papyrus_state_test.rs +++ b/crates/papyrus_state_reader/src/papyrus_state_test.rs @@ -1,9 +1,11 @@ use assert_matches::assert_matches; +use blockifier::blockifier::config::ContractClassManagerConfig; use blockifier::execution::call_info::CallExecution; use blockifier::execution::entry_point::CallEntryPoint; use blockifier::retdata; use blockifier::state::cached_state::CachedState; -use blockifier::state::global_cache::{GlobalContractCache, GLOBAL_CONTRACT_CACHE_SIZE_FOR_TEST}; +use blockifier::state::contract_class_manager::ContractClassManager; +use blockifier::state::global_cache::GLOBAL_CONTRACT_CACHE_SIZE_FOR_TEST; use blockifier::state::state_api::StateReader; use blockifier::test_utils::contracts::FeatureContract; use blockifier::test_utils::{trivial_external_entry_point_new, CairoVersion}; @@ -49,7 +51,10 @@ fn test_entry_point_with_papyrus_state() -> papyrus_storage::StorageResult<()> { let papyrus_reader = PapyrusReader::new( storage_reader, block_number, - GlobalContractCache::new(GLOBAL_CONTRACT_CACHE_SIZE_FOR_TEST), + ContractClassManager::start(ContractClassManagerConfig { + contract_cache_size: GLOBAL_CONTRACT_CACHE_SIZE_FOR_TEST, + ..Default::default() + }), ); let mut state = CachedState::from(papyrus_reader); diff --git a/crates/starknet_batcher/src/batcher.rs b/crates/starknet_batcher/src/batcher.rs index e7ed6b4ca6..01638b3449 100644 --- a/crates/starknet_batcher/src/batcher.rs +++ b/crates/starknet_batcher/src/batcher.rs @@ -1,7 +1,7 @@ use std::collections::{HashMap, HashSet}; use std::sync::Arc; -use blockifier::state::global_cache::GlobalContractCache; +use blockifier::state::contract_class_manager::ContractClassManager; #[cfg(test)] use mockall::automock; use papyrus_storage::state::{StateStorageReader, StateStorageWriter}; @@ -443,7 +443,9 @@ pub fn create_batcher( let block_builder_factory = Box::new(BlockBuilderFactory { block_builder_config: config.block_builder_config.clone(), storage_reader: storage_reader.clone(), - global_class_hash_to_class: GlobalContractCache::new(config.global_contract_cache_size), + contract_class_manager: ContractClassManager::start( + config.contract_class_manager_config.clone(), + ), }); let storage_reader = Arc::new(storage_reader); let storage_writer = Box::new(storage_writer); diff --git a/crates/starknet_batcher/src/block_builder.rs b/crates/starknet_batcher/src/block_builder.rs index c2e83e96b1..9a14abd74a 100644 --- a/crates/starknet_batcher/src/block_builder.rs +++ b/crates/starknet_batcher/src/block_builder.rs @@ -10,10 +10,9 @@ use blockifier::blockifier::transaction_executor::{ }; use blockifier::bouncer::{BouncerConfig, BouncerWeights}; use blockifier::context::{BlockContext, ChainInfo}; -use blockifier::execution::contract_class::VersionedRunnableCompiledClass; use blockifier::state::cached_state::CommitmentStateDiff; +use blockifier::state::contract_class_manager::ContractClassManager; use blockifier::state::errors::StateError; -use blockifier::state::global_cache::GlobalContractCache; use blockifier::transaction::objects::TransactionExecutionInfo; use blockifier::transaction::transaction_execution::Transaction as BlockifierTransaction; use blockifier::versioned_constants::{VersionedConstants, VersionedConstantsOverrides}; @@ -277,7 +276,7 @@ impl SerializeConfig for BlockBuilderConfig { pub struct BlockBuilderFactory { pub block_builder_config: BlockBuilderConfig, pub storage_reader: StorageReader, - pub global_class_hash_to_class: GlobalContractCache, + pub contract_class_manager: ContractClassManager, } impl BlockBuilderFactory { @@ -300,7 +299,7 @@ impl BlockBuilderFactory { let state_reader = PapyrusReader::new( self.storage_reader.clone(), height, - self.global_class_hash_to_class.clone(), + self.contract_class_manager.clone(), ); let executor = TransactionExecutor::pre_process_and_create( diff --git a/crates/starknet_batcher/src/config.rs b/crates/starknet_batcher/src/config.rs index b25c2d7ea1..176d6d5c83 100644 --- a/crates/starknet_batcher/src/config.rs +++ b/crates/starknet_batcher/src/config.rs @@ -1,5 +1,6 @@ use std::collections::BTreeMap; +use blockifier::blockifier::config::ContractClassManagerConfig; use papyrus_config::dumping::{append_sub_config_name, ser_param, SerializeConfig}; use papyrus_config::{ParamPath, ParamPrivacyInput, SerializedParam}; use serde::{Deserialize, Serialize}; @@ -15,7 +16,7 @@ pub struct BatcherConfig { pub outstream_content_buffer_size: usize, pub input_stream_content_buffer_size: usize, pub block_builder_config: BlockBuilderConfig, - pub global_contract_cache_size: usize, + pub contract_class_manager_config: ContractClassManagerConfig, pub max_l1_handler_txs_per_block_proposal: usize, } @@ -36,13 +37,6 @@ impl SerializeConfig for BatcherConfig { beyond this limit will block until space is available.", ParamPrivacyInput::Public, ), - ser_param( - "global_contract_cache_size", - &self.global_contract_cache_size, - "Cache size for the global_class_hash_to_class. Initialized with this size on \ - creation.", - ParamPrivacyInput::Public, - ), ser_param( "max_l1_handler_txs_per_block_proposal", &self.max_l1_handler_txs_per_block_proposal, @@ -55,6 +49,10 @@ impl SerializeConfig for BatcherConfig { self.block_builder_config.dump(), "block_builder_config", )); + dump.append(&mut append_sub_config_name( + self.contract_class_manager_config.dump(), + "contract_class_manager_config", + )); dump } } @@ -76,7 +74,11 @@ impl Default for BatcherConfig { outstream_content_buffer_size: 100, input_stream_content_buffer_size: 400, block_builder_config: BlockBuilderConfig::default(), - global_contract_cache_size: 400, + contract_class_manager_config: ContractClassManagerConfig { + run_cairo_native: false, + wait_on_native_compilation: false, + contract_cache_size: 400, + }, max_l1_handler_txs_per_block_proposal: 3, } }