Skip to content

Commit

Permalink
chore(blockifier): add syscalls_gas_costs struct
Browse files Browse the repository at this point in the history
  • Loading branch information
Yonatan-Starkware committed Dec 5, 2024
1 parent 882df1b commit 82b0083
Show file tree
Hide file tree
Showing 21 changed files with 1,005 additions and 888 deletions.
208 changes: 106 additions & 102 deletions crates/blockifier/resources/versioned_constants_0_13_0.json
Original file line number Diff line number Diff line change
Expand Up @@ -105,106 +105,6 @@
"fee_transfer_gas_cost": 1,
"step_gas_cost": 1100
},
"call_contract_gas_cost": {
"syscall_base_gas_cost": 1,
"step_gas_cost": 510,
"entry_point_initial_budget": 1
},
"deploy_gas_cost": {
"syscall_base_gas_cost": 1,
"step_gas_cost": 700,
"entry_point_initial_budget": 1
},
"get_block_hash_gas_cost": {
"syscall_base_gas_cost": 1,
"step_gas_cost": 50
},
"get_execution_info_gas_cost": {
"syscall_base_gas_cost": 1,
"step_gas_cost": 10
},
"library_call_gas_cost": {
"call_contract_gas_cost": 1
},
"replace_class_gas_cost": {
"syscall_base_gas_cost": 1,
"step_gas_cost": 50
},
"storage_read_gas_cost": {
"syscall_base_gas_cost": 1,
"step_gas_cost": 50
},
"storage_write_gas_cost": {
"syscall_base_gas_cost": 1,
"step_gas_cost": 50
},
"get_class_hash_at_gas_cost": {
"step_gas_cost": 0,
"syscall_base_gas_cost": 0
},
"emit_event_gas_cost": {
"syscall_base_gas_cost": 1,
"step_gas_cost": 10
},
"send_message_to_l1_gas_cost": {
"syscall_base_gas_cost": 1,
"step_gas_cost": 50
},
"secp256k1_add_gas_cost": {
"step_gas_cost": 406,
"range_check_gas_cost": 29
},
"secp256k1_get_point_from_x_gas_cost": {
"step_gas_cost": 391,
"range_check_gas_cost": 30,
"memory_hole_gas_cost": 20
},
"secp256k1_get_xy_gas_cost": {
"step_gas_cost": 239,
"range_check_gas_cost": 11,
"memory_hole_gas_cost": 40
},
"secp256k1_mul_gas_cost": {
"step_gas_cost": 76401,
"range_check_gas_cost": 7045
},
"secp256k1_new_gas_cost": {
"step_gas_cost": 475,
"range_check_gas_cost": 35,
"memory_hole_gas_cost": 40
},
"secp256r1_add_gas_cost": {
"step_gas_cost": 589,
"range_check_gas_cost": 57
},
"secp256r1_get_point_from_x_gas_cost": {
"step_gas_cost": 510,
"range_check_gas_cost": 44,
"memory_hole_gas_cost": 20
},
"secp256r1_get_xy_gas_cost": {
"step_gas_cost": 241,
"range_check_gas_cost": 11,
"memory_hole_gas_cost": 40
},
"secp256r1_mul_gas_cost": {
"step_gas_cost": 125240,
"range_check_gas_cost": 13961
},
"secp256r1_new_gas_cost": {
"step_gas_cost": 594,
"range_check_gas_cost": 49,
"memory_hole_gas_cost": 40
},
"keccak_gas_cost": {
"syscall_base_gas_cost": 1
},
"keccak_round_cost_gas_cost": 180000,
"sha256_process_block_gas_cost": {
"step_gas_cost": 0,
"range_check_gas_cost": 0,
"syscall_base_gas_cost": 0
},
"error_block_number_out_of_range": "Block number out of range",
"error_out_of_gas": "Out of gas",
"error_entry_point_failed": "ENTRYPOINT_FAILED",
Expand All @@ -215,7 +115,111 @@
"l1_gas": "L1_GAS",
"l2_gas": "L2_GAS",
"l1_gas_index": 0,
"l2_gas_index": 1
"l2_gas_index": 1,
"syscall_gas_costs": {
"call_contract": {
"syscall_base_gas_cost": 1,
"step_gas_cost": 510,
"entry_point_initial_budget": 1
},
"deploy": {
"syscall_base_gas_cost": 1,
"step_gas_cost": 700,
"entry_point_initial_budget": 1
},
"get_block_hash": {
"syscall_base_gas_cost": 1,
"step_gas_cost": 50
},
"get_execution_info": {
"syscall_base_gas_cost": 1,
"step_gas_cost": 10
},
"library_call": {
"syscall_base_gas_cost": 1,
"step_gas_cost": 510,
"entry_point_initial_budget": 1
},
"replace_class": {
"syscall_base_gas_cost": 1,
"step_gas_cost": 50
},
"storage_read": {
"syscall_base_gas_cost": 1,
"step_gas_cost": 50
},
"storage_write": {
"syscall_base_gas_cost": 1,
"step_gas_cost": 50
},
"get_class_hash_at": {
"step_gas_cost": 0,
"syscall_base_gas_cost": 0
},
"emit_event": {
"syscall_base_gas_cost": 1,
"step_gas_cost": 10
},
"send_message_to_l1": {
"syscall_base_gas_cost": 1,
"step_gas_cost": 50
},
"secp256k1_add": {
"step_gas_cost": 406,
"range_check_gas_cost": 29
},
"secp256k1_get_point_from_x": {
"step_gas_cost": 391,
"range_check_gas_cost": 30,
"memory_hole_gas_cost": 20
},
"secp256k1_get_xy": {
"step_gas_cost": 239,
"range_check_gas_cost": 11,
"memory_hole_gas_cost": 40
},
"secp256k1_mul": {
"step_gas_cost": 76401,
"range_check_gas_cost": 7045
},
"secp256k1_new": {
"step_gas_cost": 475,
"range_check_gas_cost": 35,
"memory_hole_gas_cost": 40
},
"secp256r1_add": {
"step_gas_cost": 589,
"range_check_gas_cost": 57
},
"secp256r1_get_point_from_x": {
"step_gas_cost": 510,
"range_check_gas_cost": 44,
"memory_hole_gas_cost": 20
},
"secp256r1_get_xy": {
"step_gas_cost": 241,
"range_check_gas_cost": 11,
"memory_hole_gas_cost": 40
},
"secp256r1_mul": {
"step_gas_cost": 125240,
"range_check_gas_cost": 13961
},
"secp256r1_new": {
"step_gas_cost": 594,
"range_check_gas_cost": 49,
"memory_hole_gas_cost": 40
},
"keccak": {
"syscall_base_gas_cost": 1
},
"keccak_round_cost": 180000,
"sha256_process_block": {
"step_gas_cost": 0,
"range_check_gas_cost": 0,
"syscall_base_gas_cost": 0
}
}
},
"os_resources": {
"execute_syscalls": {
Expand Down Expand Up @@ -615,4 +619,4 @@
1000
]
}
}
}
Loading

0 comments on commit 82b0083

Please sign in to comment.