Skip to content

Commit

Permalink
chore(blockifier): split builtin gas costs from base gas costs
Browse files Browse the repository at this point in the history
  • Loading branch information
Yonatan-Starkware committed Dec 19, 2024
1 parent 8e2d4a3 commit d26db48
Show file tree
Hide file tree
Showing 11 changed files with 266 additions and 256 deletions.
49 changes: 23 additions & 26 deletions crates/blockifier/resources/versioned_constants_0_13_0.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": 70,
"keccak": 0,
"pedersen": 0,
"bitwise": 0,
"ecop": 0,
"poseidon": 0,
"add_mod": 0,
"mul_mod": 0,
"ecdsa": 0
},
"memory_hole_gas_cost": 10,
"os_contract_addresses": {
"block_hash_contract_address": 1,
Expand All @@ -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",
Expand Down Expand Up @@ -167,48 +164,48 @@
},
"secp256k1_add": {
"step_gas_cost": 406,
"range_check_gas_cost": 29
"range_check": 29
},
"secp256k1_get_point_from_x": {
"step_gas_cost": 391,
"range_check_gas_cost": 30,
"range_check": 30,
"memory_hole_gas_cost": 20
},
"secp256k1_get_xy": {
"step_gas_cost": 239,
"range_check_gas_cost": 11,
"range_check": 11,
"memory_hole_gas_cost": 40
},
"secp256k1_mul": {
"step_gas_cost": 76401,
"range_check_gas_cost": 7045
"range_check": 7045
},
"secp256k1_new": {
"step_gas_cost": 475,
"range_check_gas_cost": 35,
"range_check": 35,
"memory_hole_gas_cost": 40
},
"secp256r1_add": {
"step_gas_cost": 589,
"range_check_gas_cost": 57
"range_check": 57
},
"secp256r1_get_point_from_x": {
"step_gas_cost": 510,
"range_check_gas_cost": 44,
"range_check": 44,
"memory_hole_gas_cost": 20
},
"secp256r1_get_xy": {
"step_gas_cost": 241,
"range_check_gas_cost": 11,
"range_check": 11,
"memory_hole_gas_cost": 40
},
"secp256r1_mul": {
"step_gas_cost": 125240,
"range_check_gas_cost": 13961
"range_check": 13961
},
"secp256r1_new": {
"step_gas_cost": 594,
"range_check_gas_cost": 49,
"range_check": 49,
"memory_hole_gas_cost": 40
},
"keccak": {
Expand All @@ -217,7 +214,7 @@
"keccak_round_cost": 180000,
"sha256_process_block": {
"step_gas_cost": 0,
"range_check_gas_cost": 0,
"range_check": 0,
"syscall_base_gas_cost": 0
}
}
Expand Down Expand Up @@ -620,4 +617,4 @@
1000
]
}
}
}
49 changes: 23 additions & 26 deletions crates/blockifier/resources/versioned_constants_0_13_1.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": 70,
"keccak": 0,
"pedersen": 0,
"bitwise": 0,
"ecop": 0,
"poseidon": 0,
"add_mod": 0,
"mul_mod": 0,
"ecdsa": 0
},
"os_contract_addresses": {
"block_hash_contract_address": 1,
"alias_contract_address": 2,
Expand All @@ -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",
Expand Down Expand Up @@ -171,50 +168,50 @@
},
"secp256k1_add": {
"step_gas_cost": 406,
"range_check_gas_cost": 29
"range_check": 29
},
"secp256k1_get_point_from_x": {
"step_gas_cost": 391,
"range_check_gas_cost": 30,
"range_check": 30,
"memory_hole_gas_cost": 20
},
"secp256k1_get_xy": {
"step_gas_cost": 239,
"range_check_gas_cost": 11,
"range_check": 11,
"memory_hole_gas_cost": 40
},
"secp256k1_mul": {
"step_gas_cost": 76501,
"range_check_gas_cost": 7045,
"range_check": 7045,
"memory_hole_gas_cost": 2
},
"secp256k1_new": {
"step_gas_cost": 475,
"range_check_gas_cost": 35,
"range_check": 35,
"memory_hole_gas_cost": 40
},
"secp256r1_add": {
"step_gas_cost": 589,
"range_check_gas_cost": 57
"range_check": 57
},
"secp256r1_get_point_from_x": {
"step_gas_cost": 510,
"range_check_gas_cost": 44,
"range_check": 44,
"memory_hole_gas_cost": 20
},
"secp256r1_get_xy": {
"step_gas_cost": 241,
"range_check_gas_cost": 11,
"range_check": 11,
"memory_hole_gas_cost": 40
},
"secp256r1_mul": {
"step_gas_cost": 125340,
"range_check_gas_cost": 13961,
"range_check": 13961,
"memory_hole_gas_cost": 2
},
"secp256r1_new": {
"step_gas_cost": 594,
"range_check_gas_cost": 49,
"range_check": 49,
"memory_hole_gas_cost": 40
},
"keccak": {
Expand All @@ -223,7 +220,7 @@
"keccak_round_cost": 180000,
"sha256_process_block": {
"step_gas_cost": 0,
"range_check_gas_cost": 0,
"range_check": 0,
"syscall_base_gas_cost": 0
}
}
Expand Down Expand Up @@ -656,4 +653,4 @@
10000
]
}
}
}
49 changes: 23 additions & 26 deletions crates/blockifier/resources/versioned_constants_0_13_1_1.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": 70,
"keccak": 0,
"pedersen": 0,
"bitwise": 0,
"ecop": 0,
"poseidon": 0,
"add_mod": 0,
"mul_mod": 0,
"ecdsa": 0
},
"memory_hole_gas_cost": 10,
"os_contract_addresses": {
"block_hash_contract_address": 1,
Expand All @@ -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",
Expand Down Expand Up @@ -171,50 +168,50 @@
},
"secp256k1_add": {
"step_gas_cost": 406,
"range_check_gas_cost": 29
"range_check": 29
},
"secp256k1_get_point_from_x": {
"step_gas_cost": 391,
"range_check_gas_cost": 30,
"range_check": 30,
"memory_hole_gas_cost": 20
},
"secp256k1_get_xy": {
"step_gas_cost": 239,
"range_check_gas_cost": 11,
"range_check": 11,
"memory_hole_gas_cost": 40
},
"secp256k1_mul": {
"step_gas_cost": 76501,
"range_check_gas_cost": 7045,
"range_check": 7045,
"memory_hole_gas_cost": 2
},
"secp256k1_new": {
"step_gas_cost": 475,
"range_check_gas_cost": 35,
"range_check": 35,
"memory_hole_gas_cost": 40
},
"secp256r1_add": {
"step_gas_cost": 589,
"range_check_gas_cost": 57
"range_check": 57
},
"secp256r1_get_point_from_x": {
"step_gas_cost": 510,
"range_check_gas_cost": 44,
"range_check": 44,
"memory_hole_gas_cost": 20
},
"secp256r1_get_xy": {
"step_gas_cost": 241,
"range_check_gas_cost": 11,
"range_check": 11,
"memory_hole_gas_cost": 40
},
"secp256r1_mul": {
"step_gas_cost": 125340,
"range_check_gas_cost": 13961,
"range_check": 13961,
"memory_hole_gas_cost": 2
},
"secp256r1_new": {
"step_gas_cost": 594,
"range_check_gas_cost": 49,
"range_check": 49,
"memory_hole_gas_cost": 40
},
"keccak": {
Expand All @@ -223,7 +220,7 @@
"keccak_round_cost": 180000,
"sha256_process_block": {
"step_gas_cost": 0,
"range_check_gas_cost": 0,
"range_check": 0,
"syscall_base_gas_cost": 0
}
}
Expand Down Expand Up @@ -656,4 +653,4 @@
10000
]
}
}
}
Loading

0 comments on commit d26db48

Please sign in to comment.