Skip to content

Commit

Permalink
chore(blockifier): add ecdsa_gas_cost
Browse files Browse the repository at this point in the history
  • Loading branch information
Yonatan-Starkware committed Dec 5, 2024
1 parent 82b0083 commit 83b4e60
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@
"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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@
"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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@
"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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@
"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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@
"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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@
"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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@
"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,
Expand Down
4 changes: 3 additions & 1 deletion crates/blockifier/src/versioned_constants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -655,6 +655,7 @@ pub struct BaseGasCosts {
pub poseidon_gas_cost: u64,
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,
Expand Down Expand Up @@ -684,8 +685,9 @@ impl GasCosts {
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::segment_arena => return Err(GasCostsError::VirtualBuiltin),
BuiltinName::output | BuiltinName::ecdsa => {
BuiltinName::output => {
return Err(GasCostsError::UnsupportedBuiltinInCairo1 { builtin: *builtin });
}
};
Expand Down

0 comments on commit 83b4e60

Please sign in to comment.