diff --git a/crates/blockifier/resources/versioned_constants_0_13_0.json b/crates/blockifier/resources/versioned_constants_0_13_0.json index b5a7203236..c7560dd2fe 100644 --- a/crates/blockifier/resources/versioned_constants_0_13_0.json +++ b/crates/blockifier/resources/versioned_constants_0_13_0.json @@ -73,15 +73,17 @@ "default_entry_point_selector": 0, "stored_block_hash_buffer": 10, "step_gas_cost": 100, - "range_check_gas_cost": 70, - "keccak_builtin_gas_cost": 0, - "pedersen_gas_cost": 0, - "bitwise_builtin_gas_cost": 0, - "ecop_gas_cost": 0, - "poseidon_gas_cost": 0, - "add_mod_gas_cost": 0, - "mul_mod_gas_cost": 0, - "ecdsa_gas_cost": 0, + "builtin_gas_costs": { + "range_check_gas_cost": 70, + "keccak_builtin_gas_cost": 0, + "pedersen_gas_cost": 0, + "bitwise_builtin_gas_cost": 0, + "ecop_gas_cost": 0, + "poseidon_gas_cost": 0, + "add_mod_gas_cost": 0, + "mul_mod_gas_cost": 0, + "ecdsa_gas_cost": 0 + }, "memory_hole_gas_cost": 10, "os_contract_addresses": { "block_hash_contract_address": 1, @@ -101,11 +103,6 @@ "entry_point_initial_budget": 1, "step_gas_cost": 600 }, - "transaction_gas_cost": { - "entry_point_initial_budget": 2, - "fee_transfer_gas_cost": 1, - "step_gas_cost": 1100 - }, "error_block_number_out_of_range": "Block number out of range", "error_out_of_gas": "Out of gas", "error_entry_point_failed": "ENTRYPOINT_FAILED", @@ -620,4 +617,4 @@ 1000 ] } -} +} \ No newline at end of file diff --git a/crates/blockifier/resources/versioned_constants_0_13_1.json b/crates/blockifier/resources/versioned_constants_0_13_1.json index cb05b58cb7..ef6b2160a2 100644 --- a/crates/blockifier/resources/versioned_constants_0_13_1.json +++ b/crates/blockifier/resources/versioned_constants_0_13_1.json @@ -73,15 +73,17 @@ "default_entry_point_selector": 0, "stored_block_hash_buffer": 10, "step_gas_cost": 100, - "range_check_gas_cost": 70, - "keccak_builtin_gas_cost": 0, - "pedersen_gas_cost": 0, - "bitwise_builtin_gas_cost": 0, - "ecop_gas_cost": 0, - "poseidon_gas_cost": 0, - "add_mod_gas_cost": 0, - "mul_mod_gas_cost": 0, - "ecdsa_gas_cost": 0, + "builtin_gas_costs": { + "range_check_gas_cost": 70, + "keccak_builtin_gas_cost": 0, + "pedersen_gas_cost": 0, + "bitwise_builtin_gas_cost": 0, + "ecop_gas_cost": 0, + "poseidon_gas_cost": 0, + "add_mod_gas_cost": 0, + "mul_mod_gas_cost": 0, + "ecdsa_gas_cost": 0 + }, "os_contract_addresses": { "block_hash_contract_address": 1, "alias_contract_address": 2, @@ -101,11 +103,6 @@ "entry_point_initial_budget": 1, "step_gas_cost": 600 }, - "transaction_gas_cost": { - "entry_point_initial_budget": 2, - "fee_transfer_gas_cost": 1, - "step_gas_cost": 1100 - }, "error_block_number_out_of_range": "Block number out of range", "error_out_of_gas": "Out of gas", "error_entry_point_failed": "ENTRYPOINT_FAILED", @@ -656,4 +653,4 @@ 10000 ] } -} +} \ No newline at end of file diff --git a/crates/blockifier/resources/versioned_constants_0_13_1_1.json b/crates/blockifier/resources/versioned_constants_0_13_1_1.json index 4f9f5885cf..71fdda73d2 100644 --- a/crates/blockifier/resources/versioned_constants_0_13_1_1.json +++ b/crates/blockifier/resources/versioned_constants_0_13_1_1.json @@ -73,15 +73,17 @@ "default_entry_point_selector": 0, "stored_block_hash_buffer": 10, "step_gas_cost": 100, - "range_check_gas_cost": 70, - "keccak_builtin_gas_cost": 0, - "pedersen_gas_cost": 0, - "bitwise_builtin_gas_cost": 0, - "ecop_gas_cost": 0, - "poseidon_gas_cost": 0, - "add_mod_gas_cost": 0, - "mul_mod_gas_cost": 0, - "ecdsa_gas_cost": 0, + "builtin_gas_costs": { + "range_check_gas_cost": 70, + "keccak_builtin_gas_cost": 0, + "pedersen_gas_cost": 0, + "bitwise_builtin_gas_cost": 0, + "ecop_gas_cost": 0, + "poseidon_gas_cost": 0, + "add_mod_gas_cost": 0, + "mul_mod_gas_cost": 0, + "ecdsa_gas_cost": 0 + }, "memory_hole_gas_cost": 10, "os_contract_addresses": { "block_hash_contract_address": 1, @@ -101,11 +103,6 @@ "entry_point_initial_budget": 1, "step_gas_cost": 600 }, - "transaction_gas_cost": { - "entry_point_initial_budget": 2, - "fee_transfer_gas_cost": 1, - "step_gas_cost": 1100 - }, "error_block_number_out_of_range": "Block number out of range", "error_out_of_gas": "Out of gas", "error_entry_point_failed": "ENTRYPOINT_FAILED", @@ -656,4 +653,4 @@ 10000 ] } -} +} \ No newline at end of file diff --git a/crates/blockifier/resources/versioned_constants_0_13_2.json b/crates/blockifier/resources/versioned_constants_0_13_2.json index 571cce2ee0..21db4a15b3 100644 --- a/crates/blockifier/resources/versioned_constants_0_13_2.json +++ b/crates/blockifier/resources/versioned_constants_0_13_2.json @@ -93,26 +93,23 @@ "alias_contract_address": 2, "reserved_contract_address": 3 }, - "range_check_gas_cost": 70, - "keccak_builtin_gas_cost": 0, - "pedersen_gas_cost": 0, - "bitwise_builtin_gas_cost": 594, - "ecop_gas_cost": 0, - "poseidon_gas_cost": 0, - "add_mod_gas_cost": 0, - "mul_mod_gas_cost": 0, - "ecdsa_gas_cost": 0, + "builtin_gas_costs": { + "range_check_gas_cost": 70, + "keccak_builtin_gas_cost": 0, + "pedersen_gas_cost": 0, + "bitwise_builtin_gas_cost": 594, + "ecop_gas_cost": 0, + "poseidon_gas_cost": 0, + "add_mod_gas_cost": 0, + "mul_mod_gas_cost": 0, + "ecdsa_gas_cost": 0 + }, "sierra_array_len_bound": 4294967296, "step_gas_cost": 100, "stored_block_hash_buffer": 10, "syscall_base_gas_cost": { "step_gas_cost": 100 }, - "transaction_gas_cost": { - "entry_point_initial_budget": 2, - "fee_transfer_gas_cost": 1, - "step_gas_cost": 1100 - }, "transfer_entry_point_selector": "0x83afd3f4caedc6eebf44246fe54e38c95e3179a5ec9ea81740eca5b482d12e", "validate_declare_entry_point_selector": "0x289da278a8dc833409cabfdad1581e8e7d40e42dcaed693fa4008dcdb4963b3", "validate_deploy_entry_point_selector": "0x36fcbf06cd96843058359e1a75928beacfac10727dab22a3972f0af8aa92895", @@ -663,4 +660,4 @@ 10000 ] } -} +} \ No newline at end of file diff --git a/crates/blockifier/resources/versioned_constants_0_13_2_1.json b/crates/blockifier/resources/versioned_constants_0_13_2_1.json index ea79b39e53..613bb20fe8 100644 --- a/crates/blockifier/resources/versioned_constants_0_13_2_1.json +++ b/crates/blockifier/resources/versioned_constants_0_13_2_1.json @@ -93,26 +93,23 @@ "alias_contract_address": 2, "reserved_contract_address": 3 }, - "range_check_gas_cost": 70, - "keccak_builtin_gas_cost": 0, - "pedersen_gas_cost": 0, - "bitwise_builtin_gas_cost": 594, - "ecop_gas_cost": 0, - "poseidon_gas_cost": 0, - "add_mod_gas_cost": 0, - "mul_mod_gas_cost": 0, - "ecdsa_gas_cost": 0, + "builtin_gas_costs": { + "range_check_gas_cost": 70, + "keccak_builtin_gas_cost": 0, + "pedersen_gas_cost": 0, + "bitwise_builtin_gas_cost": 594, + "ecop_gas_cost": 0, + "poseidon_gas_cost": 0, + "add_mod_gas_cost": 0, + "mul_mod_gas_cost": 0, + "ecdsa_gas_cost": 0 + }, "sierra_array_len_bound": 4294967296, "step_gas_cost": 100, "stored_block_hash_buffer": 10, "syscall_base_gas_cost": { "step_gas_cost": 100 }, - "transaction_gas_cost": { - "entry_point_initial_budget": 2, - "fee_transfer_gas_cost": 1, - "step_gas_cost": 1100 - }, "transfer_entry_point_selector": "0x83afd3f4caedc6eebf44246fe54e38c95e3179a5ec9ea81740eca5b482d12e", "validate_declare_entry_point_selector": "0x289da278a8dc833409cabfdad1581e8e7d40e42dcaed693fa4008dcdb4963b3", "validate_deploy_entry_point_selector": "0x36fcbf06cd96843058359e1a75928beacfac10727dab22a3972f0af8aa92895", @@ -663,4 +660,4 @@ 10000 ] } -} +} \ No newline at end of file diff --git a/crates/blockifier/resources/versioned_constants_0_13_3.json b/crates/blockifier/resources/versioned_constants_0_13_3.json index ea79b39e53..613bb20fe8 100644 --- a/crates/blockifier/resources/versioned_constants_0_13_3.json +++ b/crates/blockifier/resources/versioned_constants_0_13_3.json @@ -93,26 +93,23 @@ "alias_contract_address": 2, "reserved_contract_address": 3 }, - "range_check_gas_cost": 70, - "keccak_builtin_gas_cost": 0, - "pedersen_gas_cost": 0, - "bitwise_builtin_gas_cost": 594, - "ecop_gas_cost": 0, - "poseidon_gas_cost": 0, - "add_mod_gas_cost": 0, - "mul_mod_gas_cost": 0, - "ecdsa_gas_cost": 0, + "builtin_gas_costs": { + "range_check_gas_cost": 70, + "keccak_builtin_gas_cost": 0, + "pedersen_gas_cost": 0, + "bitwise_builtin_gas_cost": 594, + "ecop_gas_cost": 0, + "poseidon_gas_cost": 0, + "add_mod_gas_cost": 0, + "mul_mod_gas_cost": 0, + "ecdsa_gas_cost": 0 + }, "sierra_array_len_bound": 4294967296, "step_gas_cost": 100, "stored_block_hash_buffer": 10, "syscall_base_gas_cost": { "step_gas_cost": 100 }, - "transaction_gas_cost": { - "entry_point_initial_budget": 2, - "fee_transfer_gas_cost": 1, - "step_gas_cost": 1100 - }, "transfer_entry_point_selector": "0x83afd3f4caedc6eebf44246fe54e38c95e3179a5ec9ea81740eca5b482d12e", "validate_declare_entry_point_selector": "0x289da278a8dc833409cabfdad1581e8e7d40e42dcaed693fa4008dcdb4963b3", "validate_deploy_entry_point_selector": "0x36fcbf06cd96843058359e1a75928beacfac10727dab22a3972f0af8aa92895", @@ -663,4 +660,4 @@ 10000 ] } -} +} \ No newline at end of file diff --git a/crates/blockifier/resources/versioned_constants_0_13_4.json b/crates/blockifier/resources/versioned_constants_0_13_4.json index dbb15ca39d..7fbfdfba8c 100644 --- a/crates/blockifier/resources/versioned_constants_0_13_4.json +++ b/crates/blockifier/resources/versioned_constants_0_13_4.json @@ -91,27 +91,23 @@ "alias_contract_address": 2, "reserved_contract_address": 3 }, - "range_check_gas_cost": 70, - "keccak_builtin_gas_cost": 136189, - "pedersen_gas_cost": 4050, - "bitwise_builtin_gas_cost": 583, - "ecop_gas_cost": 4085, - "poseidon_gas_cost": 491, - "add_mod_gas_cost": 230, - "mul_mod_gas_cost": 604, - "ecdsa_gas_cost": 10561, + "builtin_gas_costs": { + "range_check_gas_cost": 70, + "keccak_builtin_gas_cost": 136189, + "pedersen_gas_cost": 4050, + "bitwise_builtin_gas_cost": 583, + "ecop_gas_cost": 4085, + "poseidon_gas_cost": 491, + "add_mod_gas_cost": 230, + "mul_mod_gas_cost": 604, + "ecdsa_gas_cost": 10561 + }, "sierra_array_len_bound": 4294967296, "step_gas_cost": 100, "stored_block_hash_buffer": 10, "syscall_base_gas_cost": { "step_gas_cost": 100 }, - "transaction_gas_cost": { - "step_gas_cost": 4098, - "pedersen_gas_cost": 4, - "range_check_gas_cost": 77, - "poseidon_gas_cost": 11 - }, "transfer_entry_point_selector": "0x83afd3f4caedc6eebf44246fe54e38c95e3179a5ec9ea81740eca5b482d12e", "validate_declare_entry_point_selector": "0x289da278a8dc833409cabfdad1581e8e7d40e42dcaed693fa4008dcdb4963b3", "validate_deploy_entry_point_selector": "0x36fcbf06cd96843058359e1a75928beacfac10727dab22a3972f0af8aa92895", @@ -666,4 +662,4 @@ 10000 ] } -} +} \ No newline at end of file diff --git a/crates/blockifier/src/execution/entry_point_execution.rs b/crates/blockifier/src/execution/entry_point_execution.rs index cdb9c8c7dc..2286c944aa 100644 --- a/crates/blockifier/src/execution/entry_point_execution.rs +++ b/crates/blockifier/src/execution/entry_point_execution.rs @@ -196,12 +196,12 @@ fn prepare_program_extra_data( // Create the builtin cost segment, the builtin order should be the same as the price builtin // array in the os in compiled_class.cairo in load_compiled_class_facts. let builtin_price_array = [ - gas_costs.base.pedersen_gas_cost, - gas_costs.base.bitwise_builtin_gas_cost, - gas_costs.base.ecop_gas_cost, - gas_costs.base.poseidon_gas_cost, - gas_costs.base.add_mod_gas_cost, - gas_costs.base.mul_mod_gas_cost, + gas_costs.builtins.pedersen_gas_cost, + gas_costs.builtins.bitwise_builtin_gas_cost, + gas_costs.builtins.ecop_gas_cost, + gas_costs.builtins.poseidon_gas_cost, + gas_costs.builtins.add_mod_gas_cost, + gas_costs.builtins.mul_mod_gas_cost, ]; let data = builtin_price_array diff --git a/crates/blockifier/src/execution/native/entry_point_execution.rs b/crates/blockifier/src/execution/native/entry_point_execution.rs index 37c7cf55db..3199dcb5ca 100644 --- a/crates/blockifier/src/execution/native/entry_point_execution.rs +++ b/crates/blockifier/src/execution/native/entry_point_execution.rs @@ -32,12 +32,12 @@ pub fn execute_entry_point_call( let builtin_costs = BuiltinCosts { // todo(rodrigo): Unsure of what value `const` means, but 1 is the right value. r#const: 1, - pedersen: gas_costs.base.pedersen_gas_cost, - bitwise: gas_costs.base.bitwise_builtin_gas_cost, - ecop: gas_costs.base.ecop_gas_cost, - poseidon: gas_costs.base.poseidon_gas_cost, - add_mod: gas_costs.base.add_mod_gas_cost, - mul_mod: gas_costs.base.mul_mod_gas_cost, + pedersen: gas_costs.builtins.pedersen_gas_cost, + bitwise: gas_costs.builtins.bitwise_builtin_gas_cost, + ecop: gas_costs.builtins.ecop_gas_cost, + poseidon: gas_costs.builtins.poseidon_gas_cost, + add_mod: gas_costs.builtins.add_mod_gas_cost, + mul_mod: gas_costs.builtins.mul_mod_gas_cost, }; // Grow the stack (if it's below the red zone) to handle deep Cairo recursions - diff --git a/crates/blockifier/src/versioned_constants.rs b/crates/blockifier/src/versioned_constants.rs index 1bf86ff6df..2af916dcb3 100644 --- a/crates/blockifier/src/versioned_constants.rs +++ b/crates/blockifier/src/versioned_constants.rs @@ -645,6 +645,16 @@ impl SyscallGasCosts { pub struct BaseGasCosts { pub step_gas_cost: u64, pub memory_hole_gas_cost: u64, + // An estimation of the initial gas for a transaction to run with. This solution is + // temporary and this value will be deduced from the transaction's fields. + pub default_initial_gas_cost: u64, + // Compiler gas costs. + pub entry_point_initial_budget: u64, + pub syscall_base_gas_cost: u64, +} + +#[derive(Debug, Default, Deserialize)] +pub struct BuiltinGasCosts { // Range check has a hard-coded cost higher than its proof percentage to avoid the overhead of // retrieving its price from the table. pub range_check_gas_cost: u64, @@ -657,36 +667,29 @@ pub struct BaseGasCosts { pub add_mod_gas_cost: u64, pub mul_mod_gas_cost: u64, pub ecdsa_gas_cost: u64, - // An estimation of the initial gas for a transaction to run with. This solution is - // temporary and this value will be deduced from the transaction's fields. - pub default_initial_gas_cost: u64, - // Compiler gas costs. - pub entry_point_initial_budget: u64, - pub syscall_base_gas_cost: u64, - // OS gas costs. - pub transaction_gas_cost: u64, } /// Gas cost constants. For more documentation see in core/os/constants.cairo. #[derive(Debug, Default, Deserialize)] pub struct GasCosts { pub base: BaseGasCosts, + pub builtins: BuiltinGasCosts, pub syscalls: SyscallGasCosts, } impl GasCosts { pub fn get_builtin_gas_cost(&self, builtin: &BuiltinName) -> Result { let gas_cost = match *builtin { - BuiltinName::range_check => self.base.range_check_gas_cost, - BuiltinName::pedersen => self.base.pedersen_gas_cost, - BuiltinName::bitwise => self.base.bitwise_builtin_gas_cost, - BuiltinName::ec_op => self.base.ecop_gas_cost, - BuiltinName::keccak => self.base.keccak_builtin_gas_cost, - BuiltinName::poseidon => self.base.poseidon_gas_cost, - BuiltinName::range_check96 => self.base.range_check_gas_cost, - BuiltinName::add_mod => self.base.add_mod_gas_cost, - BuiltinName::mul_mod => self.base.mul_mod_gas_cost, - BuiltinName::ecdsa => self.base.ecdsa_gas_cost, + BuiltinName::range_check => self.builtins.range_check_gas_cost, + BuiltinName::pedersen => self.builtins.pedersen_gas_cost, + BuiltinName::bitwise => self.builtins.bitwise_builtin_gas_cost, + BuiltinName::ec_op => self.builtins.ecop_gas_cost, + BuiltinName::keccak => self.builtins.keccak_builtin_gas_cost, + BuiltinName::poseidon => self.builtins.poseidon_gas_cost, + BuiltinName::range_check96 => self.builtins.range_check_gas_cost, + BuiltinName::add_mod => self.builtins.add_mod_gas_cost, + BuiltinName::mul_mod => self.builtins.mul_mod_gas_cost, + BuiltinName::ecdsa => self.builtins.ecdsa_gas_cost, BuiltinName::segment_arena => return Err(GasCostsError::VirtualBuiltin), BuiltinName::output => { return Err(GasCostsError::UnsupportedBuiltinInCairo1 { builtin: *builtin }); @@ -715,7 +718,7 @@ impl OsConstants { // not used by the blockifier but included for transparency. These constanst will be ignored // during the creation of the struct containing the gas costs. - const ADDITIONAL_FIELDS: [&'static str; 30] = [ + const ADDITIONAL_FIELDS: [&'static str; 31] = [ "block_hash_contract_address", "constructor_entry_point_selector", "default_entry_point_selector", @@ -746,6 +749,7 @@ impl OsConstants { "validate_rounding_consts", "validated", "syscall_gas_costs", + "builtin_gas_costs", ]; } @@ -755,9 +759,12 @@ impl TryFrom<&OsConstantsRawJson> for GasCosts { fn try_from(raw_json_data: &OsConstantsRawJson) -> Result { let base_value: Value = serde_json::to_value(&raw_json_data.parse_base()?)?; let base: BaseGasCosts = serde_json::from_value(base_value)?; - let syscalls_value: Value = serde_json::to_value(&raw_json_data.parse_syscalls(&base)?)?; + let builtins_value: Value = serde_json::to_value(&raw_json_data.parse_builtin()?)?; + let builtins: BuiltinGasCosts = serde_json::from_value(builtins_value)?; + let syscalls_value: Value = + serde_json::to_value(&raw_json_data.parse_syscalls(&base, &builtins)?)?; let syscalls: SyscallGasCosts = serde_json::from_value(syscalls_value)?; - Ok(GasCosts { base, syscalls }) + Ok(GasCosts { base, builtins, syscalls }) } } @@ -831,13 +838,34 @@ impl OsConstantsRawJson { fn parse_syscalls( &self, base: &BaseGasCosts, + builtins: &BuiltinGasCosts, ) -> Result, OsConstantsSerdeError> { let mut gas_costs = IndexMap::new(); let syscalls: IndexMap = serde_json::from_value( (self.raw_json_file_as_dict.get("syscall_gas_costs").unwrap()).clone(), )?; for (key, value) in syscalls { - self.add_to_syscalls(&key, &value, &mut gas_costs, base)?; + self.add_to_syscalls(&key, &value, &mut gas_costs, base, builtins)?; + } + Ok(gas_costs) + } + + fn parse_builtin(&self) -> Result, OsConstantsSerdeError> { + let mut gas_costs = IndexMap::new(); + let builtins: IndexMap = serde_json::from_value( + (self.raw_json_file_as_dict.get("builtin_gas_costs").unwrap()).clone(), + )?; + for (key, value) in builtins { + match value { + Value::Number(n) => { + let cost = n.as_u64().ok_or_else(|| OsConstantsSerdeError::OutOfRange { + key: key.to_string(), + value: n.clone(), + })?; + gas_costs.insert(key.to_string(), cost); + } + _ => return Err(OsConstantsSerdeError::UnhandledValueType(value.clone())), + } } Ok(gas_costs) } @@ -910,6 +938,7 @@ impl OsConstantsRawJson { value: &Value, syscalls: &mut IndexMap, base: &BaseGasCosts, + builtins: &BuiltinGasCosts, ) -> Result<(), OsConstantsSerdeError> { let mut cost = 0; match value { @@ -918,19 +947,18 @@ impl OsConstantsRawJson { let inner_value = match inner_key.as_str() { "step_gas_cost" => base.step_gas_cost, "memory_hole_gas_cost" => base.memory_hole_gas_cost, - "range_check_gas_cost" => base.range_check_gas_cost, - "keccak_builtin_gas_cost" => base.keccak_builtin_gas_cost, - "pedersen_gas_cost" => base.pedersen_gas_cost, - "bitwise_builtin_gas_cost" => base.bitwise_builtin_gas_cost, - "ecop_gas_cost" => base.ecop_gas_cost, - "poseidon_gas_cost" => base.poseidon_gas_cost, - "add_mod_gas_cost" => base.add_mod_gas_cost, - "mul_mod_gas_cost" => base.mul_mod_gas_cost, - "ecdsa_gas_cost" => base.ecdsa_gas_cost, "default_initial_gas_cost" => base.default_initial_gas_cost, "entry_point_initial_budget" => base.entry_point_initial_budget, "syscall_base_gas_cost" => base.syscall_base_gas_cost, - "transaction_gas_cost" => base.transaction_gas_cost, + "range_check_gas_cost" => builtins.range_check_gas_cost, + "keccak_builtin_gas_cost" => builtins.keccak_builtin_gas_cost, + "pedersen_gas_cost" => builtins.pedersen_gas_cost, + "bitwise_builtin_gas_cost" => builtins.bitwise_builtin_gas_cost, + "ecop_gas_cost" => builtins.ecop_gas_cost, + "poseidon_gas_cost" => builtins.poseidon_gas_cost, + "add_mod_gas_cost" => builtins.add_mod_gas_cost, + "mul_mod_gas_cost" => builtins.mul_mod_gas_cost, + "ecdsa_gas_cost" => builtins.ecdsa_gas_cost, _ => { return Err(OsConstantsSerdeError::KeyNotFound { key: key.to_string(), diff --git a/crates/blockifier/src/versioned_constants_test.rs b/crates/blockifier/src/versioned_constants_test.rs index 4f9b96c16f..2a56911127 100644 --- a/crates/blockifier/src/versioned_constants_test.rs +++ b/crates/blockifier/src/versioned_constants_test.rs @@ -19,7 +19,7 @@ fn test_successful_gas_costs_parsing() { "entry_point_initial_budget": { "step_gas_cost": 3 }, - "transaction_gas_cost": { + "syscall_base_gas_cost": { "entry_point_initial_budget": 4, "step_gas_cost": 5 }, @@ -33,7 +33,10 @@ fn test_successful_gas_costs_parsing() { assert_eq!(versioned_constants.os_constants.gas_costs.base.entry_point_initial_budget, 2 * 3); // step_gas_cost * 3. // entry_point_initial_budget * 4 + step_gas_cost * 5. - assert_eq!(versioned_constants.os_constants.gas_costs.base.transaction_gas_cost, 6 * 4 + 2 * 5); + assert_eq!( + versioned_constants.os_constants.gas_costs.base.syscall_base_gas_cost, + 6 * 4 + 2 * 5 + ); } /// Assert versioned constants overrides are used when provided.