diff --git a/crates/native_blockifier/src/py_block_executor.rs b/crates/native_blockifier/src/py_block_executor.rs index bf3c244ebae..06cefba1444 100644 --- a/crates/native_blockifier/src/py_block_executor.rs +++ b/crates/native_blockifier/src/py_block_executor.rs @@ -91,11 +91,11 @@ pub struct PyBlockExecutor { #[pymethods] impl PyBlockExecutor { #[new] - #[pyo3(signature = (bouncer_config, concurrency_config, general_config, global_contract_cache_size, target_storage_config, py_versioned_constants_overrides))] + #[pyo3(signature = (bouncer_config, concurrency_config, os_config, global_contract_cache_size, target_storage_config, py_versioned_constants_overrides))] pub fn create( bouncer_config: PyBouncerConfig, concurrency_config: PyConcurrencyConfig, - general_config: PyGeneralConfig, + os_config: PyOsConfig, global_contract_cache_size: usize, target_storage_config: StorageConfig, py_versioned_constants_overrides: PyVersionedConstantsOverrides, @@ -112,7 +112,7 @@ impl PyBlockExecutor { tx_executor_config: TransactionExecutorConfig { concurrency_config: concurrency_config.into(), }, - chain_info: general_config.starknet_os_config.into_chain_info(), + chain_info: os_config.into_chain_info(), versioned_constants, tx_executor: None, storage: Box::new(storage), @@ -333,11 +333,11 @@ impl PyBlockExecutor { } #[cfg(any(feature = "testing", test))] - #[pyo3(signature = (concurrency_config, general_config, path, max_state_diff_size))] + #[pyo3(signature = (concurrency_config, os_config, path, max_state_diff_size))] #[staticmethod] fn create_for_testing( concurrency_config: PyConcurrencyConfig, - general_config: PyGeneralConfig, + os_config: PyOsConfig, path: std::path::PathBuf, max_state_diff_size: usize, ) -> Self { @@ -357,11 +357,8 @@ impl PyBlockExecutor { tx_executor_config: TransactionExecutorConfig { concurrency_config: concurrency_config.into(), }, - storage: Box::new(PapyrusStorage::new_for_testing( - path, - &general_config.starknet_os_config.chain_id, - )), - chain_info: general_config.starknet_os_config.into_chain_info(), + storage: Box::new(PapyrusStorage::new_for_testing(path, &os_config.chain_id)), + chain_info: os_config.into_chain_info(), versioned_constants, tx_executor: None, global_contract_cache: GlobalContractCache::new(GLOBAL_CONTRACT_CACHE_SIZE_FOR_TEST), @@ -401,21 +398,14 @@ impl PyBlockExecutor { #[cfg(test)] pub(crate) fn native_create_for_testing( concurrency_config: PyConcurrencyConfig, - general_config: PyGeneralConfig, + os_config: PyOsConfig, path: std::path::PathBuf, max_state_diff_size: usize, ) -> Self { - Self::create_for_testing(concurrency_config, general_config, path, max_state_diff_size) + Self::create_for_testing(concurrency_config, os_config, path, max_state_diff_size) } } -#[derive(Default, FromPyObject)] -pub struct PyGeneralConfig { - pub starknet_os_config: PyOsConfig, - pub invoke_tx_max_n_steps: u32, - pub validate_max_n_steps: u32, -} - #[derive(Clone, FromPyObject)] pub struct PyOsConfig { #[pyo3(from_py_with = "int_to_chain_id")] diff --git a/crates/native_blockifier/src/py_block_executor_test.rs b/crates/native_blockifier/src/py_block_executor_test.rs index ffc5908ad8c..b3cbca87c04 100644 --- a/crates/native_blockifier/src/py_block_executor_test.rs +++ b/crates/native_blockifier/src/py_block_executor_test.rs @@ -10,7 +10,7 @@ use starknet_api::core::ClassHash; use starknet_api::{class_hash, felt}; use starknet_types_core::felt::Felt; -use crate::py_block_executor::{PyBlockExecutor, PyGeneralConfig}; +use crate::py_block_executor::{PyBlockExecutor, PyOsConfig}; use crate::py_objects::PyConcurrencyConfig; use crate::py_state_diff::{PyBlockInfo, PyStateDiff}; use crate::py_utils::PyFelt; @@ -26,7 +26,7 @@ fn global_contract_cache_update() { let temp_storage_path = tempfile::tempdir().unwrap().into_path(); let mut block_executor = PyBlockExecutor::create_for_testing( PyConcurrencyConfig::default(), - PyGeneralConfig::default(), + PyOsConfig::default(), temp_storage_path, 4000, ); diff --git a/crates/native_blockifier/src/py_validator.rs b/crates/native_blockifier/src/py_validator.rs index 8398e48c1a5..e035f0c4ef6 100644 --- a/crates/native_blockifier/src/py_validator.rs +++ b/crates/native_blockifier/src/py_validator.rs @@ -12,7 +12,7 @@ use starknet_api::transaction::TransactionHash; use starknet_types_core::felt::Felt; use crate::errors::NativeBlockifierResult; -use crate::py_block_executor::PyGeneralConfig; +use crate::py_block_executor::PyOsConfig; use crate::py_objects::PyVersionedConstantsOverrides; use crate::py_state_diff::PyBlockInfo; use crate::py_transaction::{py_account_tx, PyClassInfo, PY_TX_PARSING_ERR}; @@ -28,9 +28,9 @@ pub struct PyValidator { #[pymethods] impl PyValidator { #[new] - #[pyo3(signature = (general_config, state_reader_proxy, next_block_info, max_nonce_for_validation_skip, py_versioned_constants_overrides))] + #[pyo3(signature = (os_config, state_reader_proxy, next_block_info, max_nonce_for_validation_skip, py_versioned_constants_overrides))] pub fn create( - general_config: PyGeneralConfig, + os_config: PyOsConfig, state_reader_proxy: &PyAny, next_block_info: PyBlockInfo, max_nonce_for_validation_skip: PyFelt, @@ -45,7 +45,7 @@ impl PyValidator { VersionedConstants::get_versioned_constants(py_versioned_constants_overrides.into()); let block_context = BlockContext::new( next_block_info.try_into().expect("Failed to convert block info."), - general_config.starknet_os_config.into_chain_info(), + os_config.into_chain_info(), versioned_constants, BouncerConfig::max(), );