From 1ade15c645882e3a0bd70ef8f79b23fc66a517e0 Mon Sep 17 00:00:00 2001 From: nimrod-starkware <143319383+nimrod-starkware@users.noreply.github.com> Date: Mon, 9 Sep 2024 14:57:36 +0300 Subject: [PATCH] build(fee): add l2 costs to versioned constants (#671) --- .../resources/versioned_constants.json | 10 ++-- .../resources/versioned_constants_13_1.json | 8 +-- .../resources/versioned_constants_13_1_1.json | 8 +-- .../resources/versioned_constants_13_2.json | 8 +-- .../resources/versioned_constants_13_2_1.json | 10 ++-- crates/blockifier/src/blockifier/block.rs | 8 +-- crates/blockifier/src/fee/actual_cost_test.rs | 11 ++-- crates/blockifier/src/fee/fee_test.rs | 9 +-- crates/blockifier/src/fee/fee_utils.rs | 6 +- crates/blockifier/src/fee/gas_usage_test.rs | 9 ++- .../blockifier/src/test_utils/struct_impls.rs | 4 +- crates/blockifier/src/transaction/objects.rs | 38 +++++++------ crates/blockifier/src/versioned_constants.rs | 55 ++++++++++--------- .../src/versioned_constants_test.rs | 2 +- crates/native_blockifier/src/py_state_diff.rs | 4 +- 15 files changed, 100 insertions(+), 90 deletions(-) diff --git a/crates/blockifier/resources/versioned_constants.json b/crates/blockifier/resources/versioned_constants.json index ed8ed973de..662b22b353 100644 --- a/crates/blockifier/resources/versioned_constants.json +++ b/crates/blockifier/resources/versioned_constants.json @@ -9,18 +9,18 @@ "max_contract_bytecode_size": 81920 }, "invoke_tx_max_n_steps": 10000000, - "l2_resource_gas_costs": { + "archival_data_gas_costs": { "gas_per_data_felt": [ - 128, - 1000 + 5120, + 1 ], "event_key_factor": [ 2, 1 ], "gas_per_code_byte": [ - 32, - 1000 + 1280, + 1 ] }, "disable_cairo0_redeclaration": true, diff --git a/crates/blockifier/resources/versioned_constants_13_1.json b/crates/blockifier/resources/versioned_constants_13_1.json index b92d0bb0a9..5c46d30d55 100644 --- a/crates/blockifier/resources/versioned_constants_13_1.json +++ b/crates/blockifier/resources/versioned_constants_13_1.json @@ -11,16 +11,16 @@ "invoke_tx_max_n_steps": 4000000, "l2_resource_gas_costs": { "gas_per_data_felt": [ - 128, - 1000 + 5120, + 1 ], "event_key_factor": [ 2, 1 ], "gas_per_code_byte": [ - 875, - 1000 + 35000, + 1 ] }, "max_recursion_depth": 50, diff --git a/crates/blockifier/resources/versioned_constants_13_1_1.json b/crates/blockifier/resources/versioned_constants_13_1_1.json index 7264f5810b..b88333ffc1 100644 --- a/crates/blockifier/resources/versioned_constants_13_1_1.json +++ b/crates/blockifier/resources/versioned_constants_13_1_1.json @@ -11,16 +11,16 @@ "invoke_tx_max_n_steps": 4000000, "l2_resource_gas_costs": { "gas_per_data_felt": [ - 128, - 1000 + 5120, + 1 ], "event_key_factor": [ 2, 1 ], "gas_per_code_byte": [ - 32, - 1000 + 1280, + 1 ] }, "max_recursion_depth": 50, diff --git a/crates/blockifier/resources/versioned_constants_13_2.json b/crates/blockifier/resources/versioned_constants_13_2.json index 96bd9d3e45..4df4b0ea41 100644 --- a/crates/blockifier/resources/versioned_constants_13_2.json +++ b/crates/blockifier/resources/versioned_constants_13_2.json @@ -11,16 +11,16 @@ "invoke_tx_max_n_steps": 10000000, "l2_resource_gas_costs": { "gas_per_data_felt": [ - 128, - 1000 + 5120, + 1 ], "event_key_factor": [ 2, 1 ], "gas_per_code_byte": [ - 875, - 1000 + 35000, + 1 ] }, "disable_cairo0_redeclaration": true, diff --git a/crates/blockifier/resources/versioned_constants_13_2_1.json b/crates/blockifier/resources/versioned_constants_13_2_1.json index 670ac8b387..74558bcf5b 100644 --- a/crates/blockifier/resources/versioned_constants_13_2_1.json +++ b/crates/blockifier/resources/versioned_constants_13_2_1.json @@ -11,16 +11,16 @@ "invoke_tx_max_n_steps": 10000000, "l2_resource_gas_costs": { "gas_per_data_felt": [ - 128, - 1000 + 5120, + 1 ], "event_key_factor": [ 2, 1 ], "gas_per_code_byte": [ - 32, - 1000 + 1280, + 1 ] }, "disable_cairo0_redeclaration": true, @@ -610,4 +610,4 @@ 100 ] } -} \ No newline at end of file +} diff --git a/crates/blockifier/src/blockifier/block.rs b/crates/blockifier/src/blockifier/block.rs index 7fdf2fb30a..986bd10720 100644 --- a/crates/blockifier/src/blockifier/block.rs +++ b/crates/blockifier/src/blockifier/block.rs @@ -47,16 +47,16 @@ impl GasPrices { strk_l2_gas_price: NonZeroU128, ) -> Self { // TODO(Aner): fix backwards compatibility. - let expected_eth_l2_gas_price = VersionedConstants::latest_constants() - .l1_to_l2_gas_price_conversion(eth_l1_gas_price.into()); + let expected_eth_l2_gas_price = + VersionedConstants::latest_constants().convert_l1_to_l2_gas(eth_l1_gas_price.into()); if u128::from(eth_l2_gas_price) != expected_eth_l2_gas_price { warn!( "eth_l2_gas_price does not match expected! eth_l2_gas_price:{eth_l2_gas_price}, \ expected:{expected_eth_l2_gas_price}." ) } - let expected_strk_l2_gas_price = VersionedConstants::latest_constants() - .l1_to_l2_gas_price_conversion(strk_l1_gas_price.into()); + let expected_strk_l2_gas_price = + VersionedConstants::latest_constants().convert_l1_to_l2_gas(strk_l1_gas_price.into()); if u128::from(strk_l2_gas_price) != expected_strk_l2_gas_price { warn!( "strk_l2_gas_price does not match expected! \ diff --git a/crates/blockifier/src/fee/actual_cost_test.rs b/crates/blockifier/src/fee/actual_cost_test.rs index 0e3a89f4ec..50690d8584 100644 --- a/crates/blockifier/src/fee/actual_cost_test.rs +++ b/crates/blockifier/src/fee/actual_cost_test.rs @@ -52,7 +52,7 @@ fn versioned_constants() -> &'static VersionedConstants { #[rstest] fn test_calculate_tx_gas_usage_basic<'a>(#[values(false, true)] use_kzg_da: bool) { // An empty transaction (a theoretical case for sanity check). - let versioned_constants = VersionedConstants::default(); + let versioned_constants = VersionedConstants::create_for_account_testing(); let empty_tx_starknet_resources = StarknetResources::default(); let empty_tx_gas_usage_vector = empty_tx_starknet_resources.to_gas_vector( &versioned_constants, @@ -73,7 +73,8 @@ fn test_calculate_tx_gas_usage_basic<'a>(#[values(false, true)] use_kzg_da: bool None, std::iter::empty(), ); - let code_gas_cost = versioned_constants.l2_resource_gas_costs.gas_per_code_byte + let code_gas_cost = versioned_constants.archival_data_gas_costs.gas_per_code_byte + * versioned_constants.l1_to_l2_gas_price_ratio() * u128_from_usize( (class_info.bytecode_length() + class_info.sierra_program_length()) * eth_gas_constants::WORD_WIDTH @@ -110,7 +111,8 @@ fn test_calculate_tx_gas_usage_basic<'a>(#[values(false, true)] use_kzg_da: bool std::iter::empty(), ); let calldata_and_signature_gas_cost = - versioned_constants.l2_resource_gas_costs.gas_per_data_felt + versioned_constants.archival_data_gas_costs.gas_per_data_felt + * versioned_constants.l1_to_l2_gas_price_ratio() * u128_from_usize(calldata_length + signature_length); let manual_starknet_gas_usage = calldata_and_signature_gas_cost.to_integer(); let manual_gas_vector = GasVector { l1_gas: manual_starknet_gas_usage, ..Default::default() } @@ -143,7 +145,8 @@ fn test_calculate_tx_gas_usage_basic<'a>(#[values(false, true)] use_kzg_da: bool // Manual calculation. let message_segment_length = get_message_segment_length(&[], Some(l1_handler_payload_size)); let calldata_and_signature_gas_cost = - versioned_constants.l2_resource_gas_costs.gas_per_data_felt + versioned_constants.archival_data_gas_costs.gas_per_data_felt + * versioned_constants.l1_to_l2_gas_price_ratio() * u128_from_usize(l1_handler_payload_size + signature_length); let manual_starknet_gas_usage = message_segment_length * eth_gas_constants::GAS_PER_MEMORY_WORD + eth_gas_constants::GAS_PER_COUNTER_DECREASE diff --git a/crates/blockifier/src/fee/fee_test.rs b/crates/blockifier/src/fee/fee_test.rs index 42a3667965..822ac36427 100644 --- a/crates/blockifier/src/fee/fee_test.rs +++ b/crates/blockifier/src/fee/fee_test.rs @@ -84,7 +84,7 @@ fn test_simple_get_vm_resource_usage() { #[test] fn test_float_get_vm_resource_usage() { - let versioned_constants = VersionedConstants::create_float_for_testing(); + let versioned_constants = VersionedConstants::create_for_testing(); let mut vm_resource_usage = get_vm_resource_usage(); // Positive flow. @@ -154,13 +154,10 @@ fn test_discounted_gas_overdraft( DEFAULT_ETH_L1_DATA_GAS_PRICE.try_into().unwrap(), data_gas_price.try_into().unwrap(), VersionedConstants::latest_constants() - .l1_to_l2_gas_price_conversion(DEFAULT_ETH_L1_GAS_PRICE) - .try_into() - .unwrap(), - VersionedConstants::latest_constants() - .l1_to_l2_gas_price_conversion(gas_price) + .convert_l1_to_l2_gas(DEFAULT_ETH_L1_GAS_PRICE) .try_into() .unwrap(), + VersionedConstants::latest_constants().convert_l1_to_l2_gas(gas_price).try_into().unwrap(), ); let account = FeatureContract::AccountWithoutValidations(CairoVersion::Cairo0); diff --git a/crates/blockifier/src/fee/fee_utils.rs b/crates/blockifier/src/fee/fee_utils.rs index 0a08800f62..4e55a8ac18 100644 --- a/crates/blockifier/src/fee/fee_utils.rs +++ b/crates/blockifier/src/fee/fee_utils.rs @@ -70,9 +70,9 @@ pub fn get_vm_resources_cost( match computation_mode { GasVectorComputationMode::NoL2Gas => Ok(GasVector::from_l1_gas(vm_l1_gas_usage)), - GasVectorComputationMode::All => Ok(GasVector::from_l2_gas( - versioned_constants.l1_to_l2_gas_price_conversion(vm_l1_gas_usage), - )), + GasVectorComputationMode::All => { + Ok(GasVector::from_l2_gas(versioned_constants.convert_l1_to_l2_gas(vm_l1_gas_usage))) + } } } diff --git a/crates/blockifier/src/fee/gas_usage_test.rs b/crates/blockifier/src/fee/gas_usage_test.rs index 6df1bb9900..728e9daa7a 100644 --- a/crates/blockifier/src/fee/gas_usage_test.rs +++ b/crates/blockifier/src/fee/gas_usage_test.rs @@ -33,9 +33,9 @@ fn test_get_event_gas_cost( versioned_constants: &VersionedConstants, #[values(false, true)] use_kzg_da: bool, ) { - let l2_resource_gas_costs = &versioned_constants.l2_resource_gas_costs; + let archival_data_gas_costs = &versioned_constants.archival_data_gas_costs; let (event_key_factor, data_word_cost) = - (l2_resource_gas_costs.event_key_factor, l2_resource_gas_costs.gas_per_data_felt); + (archival_data_gas_costs.event_key_factor, archival_data_gas_costs.gas_per_data_felt); let call_infos = vec![CallInfo::default(), CallInfo::default(), CallInfo::default()]; let call_infos_iter = call_infos.iter(); let starknet_resources = @@ -82,7 +82,10 @@ fn test_get_event_gas_cost( let call_infos_iter = call_infos.iter(); let expected = GasVector::from_l1_gas( // 8 keys and 11 data words overall. - (data_word_cost * (event_key_factor * 8_u128 + 11_u128)).to_integer(), + (data_word_cost + * versioned_constants.l1_to_l2_gas_price_ratio() + * (event_key_factor * 8_u128 + 11_u128)) + .to_integer(), ); let starknet_resources = StarknetResources::new(0, 0, 0, StateChangesCount::default(), None, call_infos_iter); diff --git a/crates/blockifier/src/test_utils/struct_impls.rs b/crates/blockifier/src/test_utils/struct_impls.rs index 0c7c11abf6..65be6bba25 100644 --- a/crates/blockifier/src/test_utils/struct_impls.rs +++ b/crates/blockifier/src/test_utils/struct_impls.rs @@ -163,11 +163,11 @@ impl BlockInfo { DEFAULT_ETH_L1_DATA_GAS_PRICE.try_into().unwrap(), DEFAULT_STRK_L1_DATA_GAS_PRICE.try_into().unwrap(), VersionedConstants::latest_constants() - .l1_to_l2_gas_price_conversion(DEFAULT_ETH_L1_GAS_PRICE) + .convert_l1_to_l2_gas(DEFAULT_ETH_L1_GAS_PRICE) .try_into() .unwrap(), VersionedConstants::latest_constants() - .l1_to_l2_gas_price_conversion(DEFAULT_STRK_L1_GAS_PRICE) + .convert_l1_to_l2_gas(DEFAULT_STRK_L1_GAS_PRICE) .try_into() .unwrap(), ), diff --git a/crates/blockifier/src/transaction/objects.rs b/crates/blockifier/src/transaction/objects.rs index 8b37b2e077..6530a2ad85 100644 --- a/crates/blockifier/src/transaction/objects.rs +++ b/crates/blockifier/src/transaction/objects.rs @@ -350,28 +350,36 @@ impl StarknetResources { versioned_constants: &VersionedConstants, mode: &GasVectorComputationMode, ) -> GasVector { - let l2_resources_in_l1_gas = self.get_calldata_and_signature_cost(versioned_constants) - + self.get_code_cost(versioned_constants) - + self.get_events_cost(versioned_constants); + // Cost in L2 gas. + let l2_archival_data_costs = [ + self.get_calldata_and_signature_cost(versioned_constants), + self.get_code_cost(versioned_constants), + self.get_events_cost(versioned_constants), + ]; match mode { - GasVectorComputationMode::All => GasVector::from_l2_gas( - versioned_constants.l1_to_l2_gas_price_conversion(l2_resources_in_l1_gas), + GasVectorComputationMode::All => { + GasVector::from_l2_gas(l2_archival_data_costs.iter().sum()) + } + GasVectorComputationMode::NoL2Gas => GasVector::from_l1_gas( + l2_archival_data_costs + .map(|cost| versioned_constants.convert_l2_to_l1_gas(cost)) + .iter() + .sum(), ), - GasVectorComputationMode::NoL2Gas => GasVector::from_l1_gas(l2_resources_in_l1_gas), } } /// Returns the cost for transaction calldata and transaction signature. Each felt costs a /// fixed and configurable amount of gas. This cost represents the cost of storing the - /// calldata and the signature on L2. The result is given in L1 gas units. - // TODO(Nimrod, 1/10/2024): Calculate cost in L2 gas units. + /// calldata and the signature on L2. The result is given in L2 gas units. pub fn get_calldata_and_signature_cost( &self, versioned_constants: &VersionedConstants, ) -> u128 { // TODO(Avi, 20/2/2024): Calculate the number of bytes instead of the number of felts. let total_data_size = u128_from_usize(self.calldata_length + self.signature_length); - (versioned_constants.l2_resource_gas_costs.gas_per_data_felt * total_data_size).to_integer() + (versioned_constants.archival_data_gas_costs.gas_per_data_felt * total_data_size) + .to_integer() } /// Returns an estimation of the gas usage for processing L1<>L2 messages on L1. Accounts for @@ -419,10 +427,9 @@ impl StarknetResources { (message_segment_length, gas_weight) } - /// Returns the cost of declared class codes in L1 gas units. - // TODO(Nimrod, 1/10/2024): Calculate cost in L2 gas units. + /// Returns the cost of declared class codes in L2 gas units. pub fn get_code_cost(&self, versioned_constants: &VersionedConstants) -> u128 { - (versioned_constants.l2_resource_gas_costs.gas_per_code_byte + (versioned_constants.archival_data_gas_costs.gas_per_code_byte * u128_from_usize(self.code_size)) .to_integer() } @@ -433,12 +440,11 @@ impl StarknetResources { get_da_gas_cost(&self.state_changes_for_fee, use_kzg_da) } - /// Returns the cost of the transaction's emmited events in L1 gas units. - // TODO(Nimrod, 1/10/2024): Calculate cost in L2 gas units. + /// Returns the cost of the transaction's emmited events in L2 gas units. pub fn get_events_cost(&self, versioned_constants: &VersionedConstants) -> u128 { - let l2_resource_gas_costs = &versioned_constants.l2_resource_gas_costs; + let archival_data_gas_costs = &versioned_constants.archival_data_gas_costs; let (event_key_factor, data_word_cost) = - (l2_resource_gas_costs.event_key_factor, l2_resource_gas_costs.gas_per_data_felt); + (archival_data_gas_costs.event_key_factor, archival_data_gas_costs.gas_per_data_felt); (data_word_cost * (event_key_factor * self.total_event_keys + self.total_event_data_size)) .to_integer() } diff --git a/crates/blockifier/src/versioned_constants.rs b/crates/blockifier/src/versioned_constants.rs index 029a49ab5f..784d7cb690 100644 --- a/crates/blockifier/src/versioned_constants.rs +++ b/crates/blockifier/src/versioned_constants.rs @@ -7,6 +7,7 @@ use cairo_vm::types::builtin_name::BuiltinName; use cairo_vm::vm::runners::cairo_runner::ExecutionResources; use indexmap::{IndexMap, IndexSet}; use num_rational::Ratio; +use num_traits::Inv; use paste::paste; use serde::de::Error as DeserializationError; use serde::{Deserialize, Deserializer}; @@ -86,7 +87,7 @@ pub struct VersionedConstants { pub tx_event_limits: EventLimits, pub invoke_tx_max_n_steps: u32, #[serde(default)] - pub l2_resource_gas_costs: L2ResourceGasCosts, + pub archival_data_gas_costs: ArchivalDataGasCosts, pub max_recursion_depth: usize, pub validate_max_n_steps: u32, // BACKWARD COMPATIBILITY: If true, the segment_arena builtin instance counter will be @@ -125,12 +126,22 @@ impl VersionedConstants { Self::get(StarknetVersion::Latest) } - /// Converts from l1 gas cost to l2 gas cost with **upward rounding** - pub fn l1_to_l2_gas_price_conversion(&self, l1_gas_price: u128) -> u128 { - let l1_to_l2_gas_price_ratio: Ratio = - Ratio::new(1, u128::from(self.os_constants.gas_costs.step_gas_cost)) - * self.vm_resource_fee_cost()["n_steps"]; - *(l1_to_l2_gas_price_ratio * l1_gas_price).ceil().numer() + /// Converts from L1 gas to L2 gas with **upward rounding**. + pub fn convert_l1_to_l2_gas(&self, l1_gas: u128) -> u128 { + let l1_to_l2_gas_price_ratio = self.l1_to_l2_gas_price_ratio().inv(); + *(l1_to_l2_gas_price_ratio * l1_gas).ceil().numer() + } + + /// Converts from L2 gas to L1 gas **rounding towards zero**. + pub fn convert_l2_to_l1_gas(&self, l2_gas: u128) -> u128 { + let l2_to_l1_gas_price_ratio = self.l1_to_l2_gas_price_ratio(); + (l2_to_l1_gas_price_ratio * l2_gas).to_integer() + } + + /// Returns the following ratio: L2_gas_price/L1_gas_price. + pub fn l1_to_l2_gas_price_ratio(&self) -> ResourceCost { + Ratio::new(1, u128::from(self.os_constants.gas_costs.step_gas_cost)) + * self.vm_resource_fee_cost()["n_steps"] } /// Returns the initial gas of any transaction to run with. @@ -186,8 +197,9 @@ impl VersionedConstants { #[cfg(any(feature = "testing", test))] pub fn create_for_account_testing() -> Self { + let step_cost = ResourceCost::from_integer(1); let vm_resource_fee_cost = Arc::new(HashMap::from([ - (crate::abi::constants::N_STEPS_RESOURCE.to_string(), ResourceCost::from_integer(1)), + (crate::abi::constants::N_STEPS_RESOURCE.to_string(), step_cost), (BuiltinName::pedersen.to_str_with_suffix().to_string(), ResourceCost::from_integer(1)), ( BuiltinName::range_check.to_str_with_suffix().to_string(), @@ -206,24 +218,13 @@ impl VersionedConstants { (BuiltinName::mul_mod.to_str_with_suffix().to_string(), ResourceCost::from_integer(1)), ])); - Self { vm_resource_fee_cost, ..Self::create_for_testing() } - } - - // A more complicated instance to increase test coverage. - #[cfg(any(feature = "testing", test))] - pub fn create_float_for_testing() -> Self { - let vm_resource_fee_cost = Arc::new(HashMap::from([ - (crate::abi::constants::N_STEPS_RESOURCE.to_string(), ResourceCost::new(25, 10000)), - (BuiltinName::pedersen.to_str_with_suffix().to_string(), ResourceCost::new(8, 100)), - (BuiltinName::range_check.to_str_with_suffix().to_string(), ResourceCost::new(4, 100)), - (BuiltinName::ecdsa.to_str_with_suffix().to_string(), ResourceCost::new(512, 100)), - (BuiltinName::bitwise.to_str_with_suffix().to_string(), ResourceCost::new(16, 100)), - (BuiltinName::poseidon.to_str_with_suffix().to_string(), ResourceCost::new(8, 100)), - (BuiltinName::output.to_str_with_suffix().to_string(), ResourceCost::from_integer(0)), - (BuiltinName::ec_op.to_str_with_suffix().to_string(), ResourceCost::new(256, 100)), - ])); - - Self { vm_resource_fee_cost, ..Self::create_for_testing() } + // Maintain the ratio between L1 gas price and L2 gas price. + let latest = Self::create_for_testing(); + let latest_step_cost = latest.vm_resource_fee_cost["n_steps"]; + let mut archival_data_gas_costs = latest.archival_data_gas_costs; + archival_data_gas_costs.gas_per_code_byte *= latest_step_cost / step_cost; + archival_data_gas_costs.gas_per_data_felt *= latest_step_cost / step_cost; + Self { vm_resource_fee_cost, archival_data_gas_costs, ..latest } } pub fn latest_constants_with_overrides( @@ -260,7 +261,7 @@ impl TryFrom<&Path> for VersionedConstants { } #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq)] -pub struct L2ResourceGasCosts { +pub struct ArchivalDataGasCosts { // TODO(barak, 18/03/2024): Once we start charging per byte change to milligas_per_data_byte, // divide the value by 32 in the JSON file. pub gas_per_data_felt: ResourceCost, diff --git a/crates/blockifier/src/versioned_constants_test.rs b/crates/blockifier/src/versioned_constants_test.rs index 7a6f9f545d..290138a025 100644 --- a/crates/blockifier/src/versioned_constants_test.rs +++ b/crates/blockifier/src/versioned_constants_test.rs @@ -124,7 +124,7 @@ fn test_default_values() { assert_eq!(versioned_constants.get_validate_timestamp_rounding(), 1); assert_eq!(versioned_constants.tx_event_limits, EventLimits::max()); - assert_eq!(versioned_constants.l2_resource_gas_costs, L2ResourceGasCosts::default()); + assert_eq!(versioned_constants.archival_data_gas_costs, ArchivalDataGasCosts::default()); // Calldata factor was initialized as 0, and did not affect the expected result, even if // calldata length is nonzero. diff --git a/crates/native_blockifier/src/py_state_diff.rs b/crates/native_blockifier/src/py_state_diff.rs index fb71058e88..4aba1bc291 100644 --- a/crates/native_blockifier/src/py_state_diff.rs +++ b/crates/native_blockifier/src/py_state_diff.rs @@ -162,9 +162,9 @@ impl Default for PyBlockInfo { }, l2_gas_price: PyResourcePrice { price_in_wei: VersionedConstants::latest_constants() - .l1_to_l2_gas_price_conversion(DEFAULT_ETH_L1_GAS_PRICE), + .convert_l1_to_l2_gas(DEFAULT_ETH_L1_GAS_PRICE), price_in_fri: VersionedConstants::latest_constants() - .l1_to_l2_gas_price_conversion(DEFAULT_STRK_L1_GAS_PRICE), + .convert_l1_to_l2_gas(DEFAULT_STRK_L1_GAS_PRICE), }, sequencer_address: PyFelt::default(), use_kzg_da: bool::default(),