diff --git a/crates/blockifier/resources/versioned_constants_0_13_0.json b/crates/blockifier/resources/versioned_constants_0_13_0.json index 1871d66fbf..a2cf11c976 100644 --- a/crates/blockifier/resources/versioned_constants_0_13_0.json +++ b/crates/blockifier/resources/versioned_constants_0_13_0.json @@ -73,6 +73,7 @@ "stored_block_hash_buffer": 10, "step_gas_cost": 100, "range_check_gas_cost": 70, + "keccak_builtin_gas_cost": 136189, "pedersen_gas_cost": 0, "bitwise_builtin_gas_cost": 0, "ecop_gas_cost": 0, diff --git a/crates/blockifier/resources/versioned_constants_0_13_1.json b/crates/blockifier/resources/versioned_constants_0_13_1.json index 884c8fe266..60c7ba7957 100644 --- a/crates/blockifier/resources/versioned_constants_0_13_1.json +++ b/crates/blockifier/resources/versioned_constants_0_13_1.json @@ -73,6 +73,7 @@ "stored_block_hash_buffer": 10, "step_gas_cost": 100, "range_check_gas_cost": 70, + "keccak_builtin_gas_cost": 136189, "pedersen_gas_cost": 0, "bitwise_builtin_gas_cost": 0, "ecop_gas_cost": 0, 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 86e40687ed..7586bd6753 100644 --- a/crates/blockifier/resources/versioned_constants_0_13_1_1.json +++ b/crates/blockifier/resources/versioned_constants_0_13_1_1.json @@ -73,6 +73,7 @@ "stored_block_hash_buffer": 10, "step_gas_cost": 100, "range_check_gas_cost": 70, + "keccak_builtin_gas_cost": 136189, "pedersen_gas_cost": 0, "bitwise_builtin_gas_cost": 0, "ecop_gas_cost": 0, diff --git a/crates/blockifier/resources/versioned_constants_0_13_2.json b/crates/blockifier/resources/versioned_constants_0_13_2.json index 3ef484e8cf..507f27f3bd 100644 --- a/crates/blockifier/resources/versioned_constants_0_13_2.json +++ b/crates/blockifier/resources/versioned_constants_0_13_2.json @@ -122,6 +122,7 @@ "memory_hole_gas_cost": 10, "nop_entry_point_offset": -1, "range_check_gas_cost": 70, + "keccak_builtin_gas_cost": 136189, "pedersen_gas_cost": 0, "bitwise_builtin_gas_cost": 594, "ecop_gas_cost": 0, 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 c990dc87a3..5313f82244 100644 --- a/crates/blockifier/resources/versioned_constants_0_13_2_1.json +++ b/crates/blockifier/resources/versioned_constants_0_13_2_1.json @@ -122,6 +122,7 @@ "memory_hole_gas_cost": 10, "nop_entry_point_offset": -1, "range_check_gas_cost": 70, + "keccak_builtin_gas_cost": 136189, "pedersen_gas_cost": 0, "bitwise_builtin_gas_cost": 594, "ecop_gas_cost": 0, diff --git a/crates/blockifier/resources/versioned_constants_0_13_3.json b/crates/blockifier/resources/versioned_constants_0_13_3.json index c990dc87a3..5313f82244 100644 --- a/crates/blockifier/resources/versioned_constants_0_13_3.json +++ b/crates/blockifier/resources/versioned_constants_0_13_3.json @@ -122,6 +122,7 @@ "memory_hole_gas_cost": 10, "nop_entry_point_offset": -1, "range_check_gas_cost": 70, + "keccak_builtin_gas_cost": 136189, "pedersen_gas_cost": 0, "bitwise_builtin_gas_cost": 594, "ecop_gas_cost": 0, diff --git a/crates/blockifier/resources/versioned_constants_0_13_4.json b/crates/blockifier/resources/versioned_constants_0_13_4.json index 26e1f90c4e..6779d5724c 100644 --- a/crates/blockifier/resources/versioned_constants_0_13_4.json +++ b/crates/blockifier/resources/versioned_constants_0_13_4.json @@ -123,6 +123,7 @@ "memory_hole_gas_cost": 10, "nop_entry_point_offset": -1, "range_check_gas_cost": 70, + "keccak_builtin_gas_cost": 136189, "pedersen_gas_cost": 4050, "bitwise_builtin_gas_cost": 583, "ecop_gas_cost": 4085, diff --git a/crates/blockifier/src/versioned_constants.rs b/crates/blockifier/src/versioned_constants.rs index 0a4fb04cf6..9775f39f5f 100644 --- a/crates/blockifier/src/versioned_constants.rs +++ b/crates/blockifier/src/versioned_constants.rs @@ -571,6 +571,7 @@ pub struct GasCosts { // retrieving its price from the table. pub range_check_gas_cost: u64, // Priced builtins. + pub keccak_builtin_gas_cost : u64, pub pedersen_gas_cost: u64, pub bitwise_builtin_gas_cost: u64, pub ecop_gas_cost: u64, @@ -614,16 +615,12 @@ pub struct GasCosts { impl GasCosts { pub fn get_builtin_gas_cost(&self, builtin: &BuiltinName) -> Result { - const KECCAK_BUILTIN_GAS_COST: u64 = 136189; - let gas_cost = match *builtin { BuiltinName::range_check => self.range_check_gas_cost, BuiltinName::pedersen => self.pedersen_gas_cost, BuiltinName::bitwise => self.bitwise_builtin_gas_cost, BuiltinName::ec_op => self.ecop_gas_cost, - // TODO (Yonatan): once keccak_builtin_gas_cost is being inserted to the versioned - // constants, replace the constant with field's value - BuiltinName::keccak => KECCAK_BUILTIN_GAS_COST, + BuiltinName::keccak => self.keccak_builtin_gas_cost, BuiltinName::poseidon => self.poseidon_gas_cost, BuiltinName::range_check96 => self.range_check_gas_cost, BuiltinName::add_mod => self.add_mod_gas_cost,