diff --git a/crates/blockifier/src/versioned_constants.rs b/crates/blockifier/src/versioned_constants.rs index 0e1d9c1420..5fb29cd573 100644 --- a/crates/blockifier/src/versioned_constants.rs +++ b/crates/blockifier/src/versioned_constants.rs @@ -301,14 +301,6 @@ impl VersionedConstants { Self { vm_resource_fee_cost, archival_data_gas_costs, ..latest } } - // TODO(Arni): Share code with latest_with_overrides. - pub fn latest_constants_with_overrides( - validate_max_n_steps: u32, - max_recursion_depth: usize, - ) -> Self { - Self { validate_max_n_steps, max_recursion_depth, ..Self::latest_constants().clone() } - } - // TODO(Arni): Consider replacing each call to this function with `latest_with_overrides`, and // squashing the functions together. /// Returns the latest versioned constants, applying the given overrides. diff --git a/crates/gateway/src/stateful_transaction_validator.rs b/crates/gateway/src/stateful_transaction_validator.rs index 6384ab039d..f882b92b80 100644 --- a/crates/gateway/src/stateful_transaction_validator.rs +++ b/crates/gateway/src/stateful_transaction_validator.rs @@ -7,7 +7,7 @@ use blockifier::bouncer::BouncerConfig; use blockifier::context::{BlockContext, ChainInfo}; use blockifier::state::cached_state::CachedState; use blockifier::transaction::account_transaction::AccountTransaction; -use blockifier::versioned_constants::VersionedConstants; +use blockifier::versioned_constants::{VersionedConstants, VersionedConstantsOverrides}; #[cfg(test)] use mockall::automock; use starknet_api::core::{ContractAddress, Nonce}; @@ -95,10 +95,14 @@ impl StatefulTransactionValidator { let latest_block_info = get_latest_block_info(state_reader_factory)?; let state_reader = state_reader_factory.get_state_reader(latest_block_info.block_number); let state = CachedState::new(state_reader); - let versioned_constants = VersionedConstants::latest_constants_with_overrides( - self.config.validate_max_n_steps, - self.config.max_recursion_depth, - ); + // TODO(Arni): Set versioned constants overrieds as part of the validate config. + let versioned_constants_overrides = VersionedConstantsOverrides { + validate_max_n_steps: self.config.validate_max_n_steps, + max_recursion_depth: self.config.max_recursion_depth, + ..Default::default() + }; + let versioned_constants = + VersionedConstants::get_versioned_constants(versioned_constants_overrides); let mut block_info = latest_block_info; block_info.block_number = block_info.block_number.unchecked_next(); // TODO(yael 21/4/24): create the block context using pre_process_block once we will be