Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(blockifier): add gas cost for ecdsa #2502

Merged
merged 1 commit into from
Dec 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -135,6 +135,7 @@
"poseidon_gas_cost": 0,
"add_mod_gas_cost": 0,
"mul_mod_gas_cost": 0,
"ecdsa_gas_cost": 0,
"replace_class_gas_cost": {
"step_gas_cost": 50,
"syscall_base_gas_cost": 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@
"poseidon_gas_cost": 0,
"add_mod_gas_cost": 0,
"mul_mod_gas_cost": 0,
"ecdsa_gas_cost": 0,
"replace_class_gas_cost": {
"step_gas_cost": 50,
"syscall_base_gas_cost": 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@
"poseidon_gas_cost": 0,
"add_mod_gas_cost": 0,
"mul_mod_gas_cost": 0,
"ecdsa_gas_cost": 0,
"replace_class_gas_cost": {
"step_gas_cost": 50,
"syscall_base_gas_cost": 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@
"poseidon_gas_cost": 491,
"add_mod_gas_cost": 230,
"mul_mod_gas_cost": 604,
"ecdsa_gas_cost": 10561,
"replace_class_gas_cost": {
"step_gas_cost": 104,
"range_check_gas_cost": 1
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 @@ -584,6 +584,7 @@ pub struct GasCosts {
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 @@ -631,8 +632,9 @@ impl GasCosts {
BuiltinName::range_check96 => self.range_check_gas_cost,
BuiltinName::add_mod => self.add_mod_gas_cost,
BuiltinName::mul_mod => self.mul_mod_gas_cost,
BuiltinName::ecdsa => self.ecdsa_gas_cost,
BuiltinName::segment_arena => return Err(GasCostsError::VirtualBuiltin),
BuiltinName::output | BuiltinName::ecdsa => {
BuiltinName::output => {
return Err(GasCostsError::UnsupportedBuiltinInCairo1 { builtin: *builtin });
}
};
Expand Down
Loading