diff --git a/crates/blockifier/resources/versioned_constants_0_13_3.json b/crates/blockifier/resources/versioned_constants_0_13_3.json index f031928371..9d90171501 100644 --- a/crates/blockifier/resources/versioned_constants_0_13_3.json +++ b/crates/blockifier/resources/versioned_constants_0_13_3.json @@ -38,27 +38,26 @@ ] }, "disable_cairo0_redeclaration": true, - "enable_reverts": true, "max_recursion_depth": 50, + "enable_reverts": false, "segment_arena_cells": false, "os_constants": { "block_hash_contract_address": 1, "call_contract_gas_cost": { "entry_point_gas_cost": 1, - "step_gas_cost": 860, - "range_check_gas_cost": 15 + "step_gas_cost": 10, + "syscall_base_gas_cost": 1 }, "constructor_entry_point_selector": "0x28ffe4ff0f226a9107253e17a904099aa4f63a02a5621de0576e5aa71bc5194", "default_entry_point_selector": 0, "deploy_gas_cost": { "entry_point_gas_cost": 1, - "step_gas_cost": 1128, - "range_check_gas_cost": 18, - "pedersen_gas_cost": 7 + "step_gas_cost": 200, + "syscall_base_gas_cost": 1 }, "emit_event_gas_cost": { - "step_gas_cost": 100, - "range_check_gas_cost": 1 + "step_gas_cost": 10, + "syscall_base_gas_cost": 1 }, "entry_point_gas_cost": { "entry_point_initial_budget": 1, @@ -77,13 +76,17 @@ "error_entry_point_failed": "ENTRYPOINT_FAILED", "error_entry_point_not_found": "ENTRYPOINT_NOT_FOUND", "execute_entry_point_selector": "0x15d40a3d6ca2ac30f4031e42be28da9b056fef9bb7357ac5e85627ee876e5ad", + "fee_transfer_gas_cost": { + "entry_point_gas_cost": 1, + "step_gas_cost": 100 + }, "get_block_hash_gas_cost": { - "step_gas_cost": 104, - "range_check_gas_cost": 2 + "step_gas_cost": 50, + "syscall_base_gas_cost": 1 }, "get_execution_info_gas_cost": { - "step_gas_cost": 100, - "range_check_gas_cost": 1 + "step_gas_cost": 10, + "syscall_base_gas_cost": 1 }, "default_initial_gas_cost": { "step_gas_cost": 100000000 @@ -96,16 +99,12 @@ "l1_gas_index": 0, "l1_handler_version": 0, "l2_gas": "L2_GAS", - "l1_data_gas": "L1_DATA", - "l1_data_gas_index": 2, "l2_gas_index": 1, "library_call_gas_cost": { - "entry_point_gas_cost": 1, - "step_gas_cost": 836, - "range_check_gas_cost": 15 + "call_contract_gas_cost": 1 }, "sha256_process_block_gas_cost": { - "step_gas_cost": 1855, + "step_gas_cost": 1852, "range_check_gas_cost": 65, "bitwise_builtin_gas_cost": 1115, "syscall_base_gas_cost": 1 @@ -113,87 +112,86 @@ "memory_hole_gas_cost": 10, "nop_entry_point_offset": -1, "range_check_gas_cost": 70, - "pedersen_gas_cost": 4050, - "bitwise_builtin_gas_cost": 583, - "ecop_gas_cost": 4085, - "poseidon_gas_cost": 491, - "add_mod_gas_cost": 230, - "mul_mod_gas_cost": 604, + "pedersen_gas_cost": 0, + "bitwise_builtin_gas_cost": 594, + "ecop_gas_cost": 0, + "poseidon_gas_cost": 0, + "add_mod_gas_cost": 0, + "mul_mod_gas_cost": 0, "replace_class_gas_cost": { - "step_gas_cost": 104, - "range_check_gas_cost": 1 + "step_gas_cost": 50, + "syscall_base_gas_cost": 1 }, "secp256k1_add_gas_cost": { "range_check_gas_cost": 29, - "step_gas_cost": 410 + "step_gas_cost": 406 }, "secp256k1_get_point_from_x_gas_cost": { "memory_hole_gas_cost": 20, "range_check_gas_cost": 30, - "step_gas_cost": 395 + "step_gas_cost": 391 }, "secp256k1_get_xy_gas_cost": { "memory_hole_gas_cost": 40, "range_check_gas_cost": 11, - "step_gas_cost": 207 + "step_gas_cost": 239 }, "secp256k1_mul_gas_cost": { "memory_hole_gas_cost": 2, "range_check_gas_cost": 7045, - "step_gas_cost": 76505 + "step_gas_cost": 76501 }, "secp256k1_new_gas_cost": { "memory_hole_gas_cost": 40, "range_check_gas_cost": 35, - "step_gas_cost": 461 + "step_gas_cost": 475 }, "secp256r1_add_gas_cost": { "range_check_gas_cost": 57, - "step_gas_cost": 593 + "step_gas_cost": 589 }, "secp256r1_get_point_from_x_gas_cost": { "memory_hole_gas_cost": 20, "range_check_gas_cost": 44, - "step_gas_cost": 514 + "step_gas_cost": 510 }, "secp256r1_get_xy_gas_cost": { "memory_hole_gas_cost": 40, "range_check_gas_cost": 11, - "step_gas_cost": 209 + "step_gas_cost": 241 }, "secp256r1_mul_gas_cost": { "memory_hole_gas_cost": 2, "range_check_gas_cost": 13961, - "step_gas_cost": 125344 + "step_gas_cost": 125340 }, "secp256r1_new_gas_cost": { "memory_hole_gas_cost": 40, "range_check_gas_cost": 49, - "step_gas_cost": 580 + "step_gas_cost": 594 }, "send_message_to_l1_gas_cost": { - "step_gas_cost": 141, - "range_check_gas_cost": 1 + "step_gas_cost": 50, + "syscall_base_gas_cost": 1 }, "sierra_array_len_bound": 4294967296, "step_gas_cost": 100, "storage_read_gas_cost": { - "step_gas_cost": 100, - "range_check_gas_cost": 1 + "step_gas_cost": 50, + "syscall_base_gas_cost": 1 }, "storage_write_gas_cost": { - "step_gas_cost": 100, - "range_check_gas_cost": 1 + "step_gas_cost": 50, + "syscall_base_gas_cost": 1 }, "stored_block_hash_buffer": 10, "syscall_base_gas_cost": { "step_gas_cost": 100 }, "transaction_gas_cost": { - "step_gas_cost": 4098, - "pedersen_gas_cost": 4, - "range_check_gas_cost": 77, - "poseidon_gas_cost": 11 + "entry_point_gas_cost": 2, + "fee_transfer_gas_cost": 1, + "step_gas_cost": 100 }, "transfer_entry_point_selector": "0x83afd3f4caedc6eebf44246fe54e38c95e3179a5ec9ea81740eca5b482d12e", "validate_declare_entry_point_selector": "0x289da278a8dc833409cabfdad1581e8e7d40e42dcaed693fa4008dcdb4963b3", @@ -208,7 +206,7 @@ "os_resources": { "execute_syscalls": { "CallContract": { - "n_steps": 866, + "n_steps": 827, "builtin_instance_counter": { "range_check_builtin": 15 }, @@ -229,7 +227,7 @@ "n_memory_holes": 0 }, "Deploy": { - "n_steps": 1132, + "n_steps": 1097, "builtin_instance_counter": { "pedersen_builtin": 7, "range_check_builtin": 18 @@ -308,7 +306,7 @@ "n_memory_holes": 0 }, "LibraryCall": { - "n_steps": 842, + "n_steps": 818, "builtin_instance_counter": { "range_check_builtin": 15 }, @@ -322,7 +320,7 @@ "n_memory_holes": 0 }, "ReplaceClass": { - "n_steps": 104, + "n_steps": 98, "builtin_instance_counter": { "range_check_builtin": 1 }, @@ -406,7 +404,7 @@ "n_memory_holes": 0 }, "Sha256ProcessBlock": { - "n_steps": 1865, + "n_steps": 1855, "builtin_instance_counter": { "range_check_builtin": 65, "bitwise_builtin": 1115 @@ -421,7 +419,7 @@ "n_memory_holes": 0 }, "StorageWrite": { - "n_steps": 93, + "n_steps": 89, "builtin_instance_counter": { "range_check_builtin": 1 }, @@ -432,11 +430,10 @@ "Declare": { "deprecated_resources": { "constant": { - "n_steps": 3203, + "n_steps": 2973, "builtin_instance_counter": { "pedersen_builtin": 16, - "range_check_builtin": 56, - "poseidon_builtin": 4 + "range_check_builtin": 53 }, "n_memory_holes": 0 }, @@ -448,11 +445,11 @@ }, "resources": { "constant": { - "n_steps": 3346, + "n_steps": 3079, "builtin_instance_counter": { "pedersen_builtin": 4, - "range_check_builtin": 64, - "poseidon_builtin": 14 + "range_check_builtin": 58, + "poseidon_builtin": 10 }, "n_memory_holes": 0 }, @@ -466,7 +463,7 @@ "DeployAccount": { "deprecated_resources": { "constant": { - "n_steps": 4161, + "n_steps": 4015, "builtin_instance_counter": { "pedersen_builtin": 23, "range_check_builtin": 72 @@ -483,10 +480,10 @@ }, "resources": { "constant": { - "n_steps": 4321, + "n_steps": 4137, "builtin_instance_counter": { "pedersen_builtin": 11, - "range_check_builtin": 80, + "range_check_builtin": 77, "poseidon_builtin": 10 }, "n_memory_holes": 0 @@ -503,7 +500,7 @@ "InvokeFunction": { "deprecated_resources": { "constant": { - "n_steps": 3918, + "n_steps": 3763, "builtin_instance_counter": { "pedersen_builtin": 14, "range_check_builtin": 69 @@ -520,10 +517,10 @@ }, "resources": { "constant": { - "n_steps": 4102, + "n_steps": 3904, "builtin_instance_counter": { "pedersen_builtin": 4, - "range_check_builtin": 77, + "range_check_builtin": 74, "poseidon_builtin": 11 }, "n_memory_holes": 0 @@ -540,7 +537,7 @@ "L1Handler": { "deprecated_resources": { "constant": { - "n_steps": 1279, + "n_steps": 1233, "builtin_instance_counter": { "pedersen_builtin": 11, "range_check_builtin": 16 diff --git a/crates/blockifier/resources/versioned_constants_0_13_4.json b/crates/blockifier/resources/versioned_constants_0_13_4.json new file mode 100644 index 0000000000..f031928371 --- /dev/null +++ b/crates/blockifier/resources/versioned_constants_0_13_4.json @@ -0,0 +1,636 @@ +{ + "tx_event_limits": { + "max_data_length": 300, + "max_keys_length": 50, + "max_n_emitted_events": 1000 + }, + "gateway": { + "max_calldata_length": 5000, + "max_contract_bytecode_size": 81920 + }, + "invoke_tx_max_n_steps": 10000000, + "deprecated_l2_resource_gas_costs": { + "gas_per_data_felt": [ + 128, + 1000 + ], + "event_key_factor": [ + 2, + 1 + ], + "gas_per_code_byte": [ + 32, + 1000 + ] + }, + "archival_data_gas_costs": { + "gas_per_data_felt": [ + 5120, + 1 + ], + "event_key_factor": [ + 2, + 1 + ], + "gas_per_code_byte": [ + 1280, + 1 + ] + }, + "disable_cairo0_redeclaration": true, + "enable_reverts": true, + "max_recursion_depth": 50, + "segment_arena_cells": false, + "os_constants": { + "block_hash_contract_address": 1, + "call_contract_gas_cost": { + "entry_point_gas_cost": 1, + "step_gas_cost": 860, + "range_check_gas_cost": 15 + }, + "constructor_entry_point_selector": "0x28ffe4ff0f226a9107253e17a904099aa4f63a02a5621de0576e5aa71bc5194", + "default_entry_point_selector": 0, + "deploy_gas_cost": { + "entry_point_gas_cost": 1, + "step_gas_cost": 1128, + "range_check_gas_cost": 18, + "pedersen_gas_cost": 7 + }, + "emit_event_gas_cost": { + "step_gas_cost": 100, + "range_check_gas_cost": 1 + }, + "entry_point_gas_cost": { + "entry_point_initial_budget": 1, + "step_gas_cost": 500 + }, + "entry_point_initial_budget": { + "step_gas_cost": 100 + }, + "entry_point_type_constructor": 2, + "entry_point_type_external": 0, + "entry_point_type_l1_handler": 1, + "error_block_number_out_of_range": "Block number out of range", + "error_invalid_input_len": "Invalid input length", + "error_invalid_argument": "Invalid argument", + "error_out_of_gas": "Out of gas", + "error_entry_point_failed": "ENTRYPOINT_FAILED", + "error_entry_point_not_found": "ENTRYPOINT_NOT_FOUND", + "execute_entry_point_selector": "0x15d40a3d6ca2ac30f4031e42be28da9b056fef9bb7357ac5e85627ee876e5ad", + "get_block_hash_gas_cost": { + "step_gas_cost": 104, + "range_check_gas_cost": 2 + }, + "get_execution_info_gas_cost": { + "step_gas_cost": 100, + "range_check_gas_cost": 1 + }, + "default_initial_gas_cost": { + "step_gas_cost": 100000000 + }, + "keccak_gas_cost": { + "syscall_base_gas_cost": 1 + }, + "keccak_round_cost_gas_cost": 180000, + "l1_gas": "L1_GAS", + "l1_gas_index": 0, + "l1_handler_version": 0, + "l2_gas": "L2_GAS", + "l1_data_gas": "L1_DATA", + "l1_data_gas_index": 2, + "l2_gas_index": 1, + "library_call_gas_cost": { + "entry_point_gas_cost": 1, + "step_gas_cost": 836, + "range_check_gas_cost": 15 + }, + "sha256_process_block_gas_cost": { + "step_gas_cost": 1855, + "range_check_gas_cost": 65, + "bitwise_builtin_gas_cost": 1115, + "syscall_base_gas_cost": 1 + }, + "memory_hole_gas_cost": 10, + "nop_entry_point_offset": -1, + "range_check_gas_cost": 70, + "pedersen_gas_cost": 4050, + "bitwise_builtin_gas_cost": 583, + "ecop_gas_cost": 4085, + "poseidon_gas_cost": 491, + "add_mod_gas_cost": 230, + "mul_mod_gas_cost": 604, + "replace_class_gas_cost": { + "step_gas_cost": 104, + "range_check_gas_cost": 1 + }, + "secp256k1_add_gas_cost": { + "range_check_gas_cost": 29, + "step_gas_cost": 410 + }, + "secp256k1_get_point_from_x_gas_cost": { + "memory_hole_gas_cost": 20, + "range_check_gas_cost": 30, + "step_gas_cost": 395 + }, + "secp256k1_get_xy_gas_cost": { + "memory_hole_gas_cost": 40, + "range_check_gas_cost": 11, + "step_gas_cost": 207 + }, + "secp256k1_mul_gas_cost": { + "memory_hole_gas_cost": 2, + "range_check_gas_cost": 7045, + "step_gas_cost": 76505 + }, + "secp256k1_new_gas_cost": { + "memory_hole_gas_cost": 40, + "range_check_gas_cost": 35, + "step_gas_cost": 461 + }, + "secp256r1_add_gas_cost": { + "range_check_gas_cost": 57, + "step_gas_cost": 593 + }, + "secp256r1_get_point_from_x_gas_cost": { + "memory_hole_gas_cost": 20, + "range_check_gas_cost": 44, + "step_gas_cost": 514 + }, + "secp256r1_get_xy_gas_cost": { + "memory_hole_gas_cost": 40, + "range_check_gas_cost": 11, + "step_gas_cost": 209 + }, + "secp256r1_mul_gas_cost": { + "memory_hole_gas_cost": 2, + "range_check_gas_cost": 13961, + "step_gas_cost": 125344 + }, + "secp256r1_new_gas_cost": { + "memory_hole_gas_cost": 40, + "range_check_gas_cost": 49, + "step_gas_cost": 580 + }, + "send_message_to_l1_gas_cost": { + "step_gas_cost": 141, + "range_check_gas_cost": 1 + }, + "sierra_array_len_bound": 4294967296, + "step_gas_cost": 100, + "storage_read_gas_cost": { + "step_gas_cost": 100, + "range_check_gas_cost": 1 + }, + "storage_write_gas_cost": { + "step_gas_cost": 100, + "range_check_gas_cost": 1 + }, + "stored_block_hash_buffer": 10, + "syscall_base_gas_cost": { + "step_gas_cost": 100 + }, + "transaction_gas_cost": { + "step_gas_cost": 4098, + "pedersen_gas_cost": 4, + "range_check_gas_cost": 77, + "poseidon_gas_cost": 11 + }, + "transfer_entry_point_selector": "0x83afd3f4caedc6eebf44246fe54e38c95e3179a5ec9ea81740eca5b482d12e", + "validate_declare_entry_point_selector": "0x289da278a8dc833409cabfdad1581e8e7d40e42dcaed693fa4008dcdb4963b3", + "validate_deploy_entry_point_selector": "0x36fcbf06cd96843058359e1a75928beacfac10727dab22a3972f0af8aa92895", + "validate_entry_point_selector": "0x162da33a4585851fe8d3af3c2a9c60b557814e221e0d4f30ff0b2189d9c7775", + "validate_rounding_consts": { + "validate_block_number_rounding": 100, + "validate_timestamp_rounding": 3600 + }, + "validated": "VALID" + }, + "os_resources": { + "execute_syscalls": { + "CallContract": { + "n_steps": 866, + "builtin_instance_counter": { + "range_check_builtin": 15 + }, + "n_memory_holes": 0 + }, + "DelegateCall": { + "n_steps": 713, + "builtin_instance_counter": { + "range_check_builtin": 19 + }, + "n_memory_holes": 0 + }, + "DelegateL1Handler": { + "n_steps": 692, + "builtin_instance_counter": { + "range_check_builtin": 15 + }, + "n_memory_holes": 0 + }, + "Deploy": { + "n_steps": 1132, + "builtin_instance_counter": { + "pedersen_builtin": 7, + "range_check_builtin": 18 + }, + "n_memory_holes": 0 + }, + "EmitEvent": { + "n_steps": 61, + "builtin_instance_counter": { + "range_check_builtin": 1 + }, + "n_memory_holes": 0 + }, + "GetBlockHash": { + "n_steps": 104, + "builtin_instance_counter": { + "range_check_builtin": 2 + }, + "n_memory_holes": 0 + }, + "GetBlockNumber": { + "n_steps": 40, + "builtin_instance_counter": {}, + "n_memory_holes": 0 + }, + "GetBlockTimestamp": { + "n_steps": 38, + "builtin_instance_counter": {}, + "n_memory_holes": 0 + }, + "GetCallerAddress": { + "n_steps": 64, + "builtin_instance_counter": { + "range_check_builtin": 1 + }, + "n_memory_holes": 0 + }, + "GetContractAddress": { + "n_steps": 64, + "builtin_instance_counter": { + "range_check_builtin": 1 + }, + "n_memory_holes": 0 + }, + "GetExecutionInfo": { + "n_steps": 64, + "builtin_instance_counter": { + "range_check_builtin": 1 + }, + "n_memory_holes": 0 + }, + "GetSequencerAddress": { + "n_steps": 34, + "builtin_instance_counter": {}, + "n_memory_holes": 0 + }, + "GetTxInfo": { + "n_steps": 64, + "builtin_instance_counter": { + "range_check_builtin": 1 + }, + "n_memory_holes": 0 + }, + "GetTxSignature": { + "n_steps": 44, + "builtin_instance_counter": {}, + "n_memory_holes": 0 + }, + "Keccak": { + "n_steps": 381, + "builtin_instance_counter": { + "bitwise_builtin": 6, + "keccak_builtin": 1, + "range_check_builtin": 56 + }, + "n_memory_holes": 0 + }, + "LibraryCall": { + "n_steps": 842, + "builtin_instance_counter": { + "range_check_builtin": 15 + }, + "n_memory_holes": 0 + }, + "LibraryCallL1Handler": { + "n_steps": 659, + "builtin_instance_counter": { + "range_check_builtin": 15 + }, + "n_memory_holes": 0 + }, + "ReplaceClass": { + "n_steps": 104, + "builtin_instance_counter": { + "range_check_builtin": 1 + }, + "n_memory_holes": 0 + }, + "Secp256k1Add": { + "n_steps": 410, + "builtin_instance_counter": { + "range_check_builtin": 29 + }, + "n_memory_holes": 0 + }, + "Secp256k1GetPointFromX": { + "n_steps": 395, + "builtin_instance_counter": { + "range_check_builtin": 30 + }, + "n_memory_holes": 0 + }, + "Secp256k1GetXy": { + "n_steps": 207, + "builtin_instance_counter": { + "range_check_builtin": 11 + }, + "n_memory_holes": 0 + }, + "Secp256k1Mul": { + "n_steps": 76505, + "builtin_instance_counter": { + "range_check_builtin": 7045 + }, + "n_memory_holes": 0 + }, + "Secp256k1New": { + "n_steps": 461, + "builtin_instance_counter": { + "range_check_builtin": 35 + }, + "n_memory_holes": 0 + }, + "Secp256r1Add": { + "n_steps": 593, + "builtin_instance_counter": { + "range_check_builtin": 57 + }, + "n_memory_holes": 0 + }, + "Secp256r1GetPointFromX": { + "n_steps": 514, + "builtin_instance_counter": { + "range_check_builtin": 44 + }, + "n_memory_holes": 0 + }, + "Secp256r1GetXy": { + "n_steps": 209, + "builtin_instance_counter": { + "range_check_builtin": 11 + }, + "n_memory_holes": 0 + }, + "Secp256r1Mul": { + "n_steps": 125344, + "builtin_instance_counter": { + "range_check_builtin": 13961 + }, + "n_memory_holes": 0 + }, + "Secp256r1New": { + "n_steps": 580, + "builtin_instance_counter": { + "range_check_builtin": 49 + }, + "n_memory_holes": 0 + }, + "SendMessageToL1": { + "n_steps": 141, + "builtin_instance_counter": { + "range_check_builtin": 1 + }, + "n_memory_holes": 0 + }, + "Sha256ProcessBlock": { + "n_steps": 1865, + "builtin_instance_counter": { + "range_check_builtin": 65, + "bitwise_builtin": 1115 + }, + "n_memory_holes": 0 + }, + "StorageRead": { + "n_steps": 87, + "builtin_instance_counter": { + "range_check_builtin": 1 + }, + "n_memory_holes": 0 + }, + "StorageWrite": { + "n_steps": 93, + "builtin_instance_counter": { + "range_check_builtin": 1 + }, + "n_memory_holes": 0 + } + }, + "execute_txs_inner": { + "Declare": { + "deprecated_resources": { + "constant": { + "n_steps": 3203, + "builtin_instance_counter": { + "pedersen_builtin": 16, + "range_check_builtin": 56, + "poseidon_builtin": 4 + }, + "n_memory_holes": 0 + }, + "calldata_factor": { + "n_steps": 0, + "builtin_instance_counter": {}, + "n_memory_holes": 0 + } + }, + "resources": { + "constant": { + "n_steps": 3346, + "builtin_instance_counter": { + "pedersen_builtin": 4, + "range_check_builtin": 64, + "poseidon_builtin": 14 + }, + "n_memory_holes": 0 + }, + "calldata_factor": { + "n_steps": 0, + "builtin_instance_counter": {}, + "n_memory_holes": 0 + } + } + }, + "DeployAccount": { + "deprecated_resources": { + "constant": { + "n_steps": 4161, + "builtin_instance_counter": { + "pedersen_builtin": 23, + "range_check_builtin": 72 + }, + "n_memory_holes": 0 + }, + "calldata_factor": { + "n_steps": 21, + "builtin_instance_counter": { + "pedersen_builtin": 2 + }, + "n_memory_holes": 0 + } + }, + "resources": { + "constant": { + "n_steps": 4321, + "builtin_instance_counter": { + "pedersen_builtin": 11, + "range_check_builtin": 80, + "poseidon_builtin": 10 + }, + "n_memory_holes": 0 + }, + "calldata_factor": { + "n_steps": 21, + "builtin_instance_counter": { + "pedersen_builtin": 2 + }, + "n_memory_holes": 0 + } + } + }, + "InvokeFunction": { + "deprecated_resources": { + "constant": { + "n_steps": 3918, + "builtin_instance_counter": { + "pedersen_builtin": 14, + "range_check_builtin": 69 + }, + "n_memory_holes": 0 + }, + "calldata_factor": { + "n_steps": 8, + "builtin_instance_counter": { + "pedersen_builtin": 1 + }, + "n_memory_holes": 0 + } + }, + "resources": { + "constant": { + "n_steps": 4102, + "builtin_instance_counter": { + "pedersen_builtin": 4, + "range_check_builtin": 77, + "poseidon_builtin": 11 + }, + "n_memory_holes": 0 + }, + "calldata_factor": { + "n_steps": 8, + "builtin_instance_counter": { + "pedersen_builtin": 1 + }, + "n_memory_holes": 0 + } + } + }, + "L1Handler": { + "deprecated_resources": { + "constant": { + "n_steps": 1279, + "builtin_instance_counter": { + "pedersen_builtin": 11, + "range_check_builtin": 16 + }, + "n_memory_holes": 0 + }, + "calldata_factor": { + "n_steps": 13, + "builtin_instance_counter": { + "pedersen_builtin": 1 + }, + "n_memory_holes": 0 + } + }, + "resources": { + "constant": { + "n_steps": 0, + "builtin_instance_counter": {}, + "n_memory_holes": 0 + }, + "calldata_factor": { + "n_steps": 13, + "builtin_instance_counter": { + "pedersen_builtin": 1 + }, + "n_memory_holes": 0 + } + } + } + }, + "compute_os_kzg_commitment_info": { + "n_steps": 113, + "builtin_instance_counter": { + "range_check_builtin": 17 + }, + "n_memory_holes": 0 + } + }, + "validate_max_n_steps": 1000000, + "min_compiler_version_for_sierra_gas": "2.8.0", + "vm_resource_fee_cost": { + "builtins": { + "add_mod_builtin": [ + 4, + 100 + ], + "bitwise_builtin": [ + 16, + 100 + ], + "ec_op_builtin": [ + 256, + 100 + ], + "ecdsa_builtin": [ + 512, + 100 + ], + "keccak_builtin": [ + 512, + 100 + ], + "mul_mod_builtin": [ + 4, + 100 + ], + "output_builtin": [ + 0, + 1 + ], + "pedersen_builtin": [ + 8, + 100 + ], + "poseidon_builtin": [ + 8, + 100 + ], + "range_check_builtin": [ + 4, + 100 + ], + "range_check96_builtin": [ + 4, + 100 + ] + }, + "n_steps": [ + 25, + 10000 + ] + } +} diff --git a/crates/blockifier/src/versioned_constants.rs b/crates/blockifier/src/versioned_constants.rs index d6433df961..79e95b8b2d 100644 --- a/crates/blockifier/src/versioned_constants.rs +++ b/crates/blockifier/src/versioned_constants.rs @@ -112,6 +112,7 @@ define_versioned_constants! { (V0_13_2, "../resources/versioned_constants_0_13_2.json"), (V0_13_2_1, "../resources/versioned_constants_0_13_2_1.json"), (V0_13_3, "../resources/versioned_constants_0_13_3.json"), + (V0_13_4, "../resources/versioned_constants_0_13_4.json"), } pub type ResourceCost = Ratio; diff --git a/crates/papyrus_storage/src/serialization/serializers.rs b/crates/papyrus_storage/src/serialization/serializers.rs index f092e69aa5..25f0befef3 100644 --- a/crates/papyrus_storage/src/serialization/serializers.rs +++ b/crates/papyrus_storage/src/serialization/serializers.rs @@ -397,6 +397,7 @@ auto_storage_serde! { V0_13_2 = 16, V0_13_2_1 = 17, V0_13_3 = 18, + V0_13_4 = 19, } pub struct StateDiffCommitment(pub PoseidonHash); pub struct Tip(pub u64); diff --git a/crates/papyrus_test_utils/src/lib.rs b/crates/papyrus_test_utils/src/lib.rs index 12daf989e0..3aedbe268c 100644 --- a/crates/papyrus_test_utils/src/lib.rs +++ b/crates/papyrus_test_utils/src/lib.rs @@ -494,6 +494,7 @@ auto_impl_get_test_instance! { V0_13_2 = 16, V0_13_2_1 = 17, V0_13_3 = 18, + V0_13_4 = 19, } pub struct Calldata(pub Arc>); pub struct ClassHash(pub StarkHash); diff --git a/crates/starknet_api/src/block.rs b/crates/starknet_api/src/block.rs index d59268e241..09bee68117 100644 --- a/crates/starknet_api/src/block.rs +++ b/crates/starknet_api/src/block.rs @@ -94,7 +94,8 @@ starknet_version_enum! { (V0_13_2, 0, 13, 2), (V0_13_2_1, 0, 13, 2, 1), (V0_13_3, 0, 13, 3), - V0_13_3 + (V0_13_4, 0, 13, 4), + V0_13_4 } impl Default for StarknetVersion { diff --git a/crates/starknet_api/src/block_hash/block_hash_calculator.rs b/crates/starknet_api/src/block_hash/block_hash_calculator.rs index 27864a7091..ad367ba847 100644 --- a/crates/starknet_api/src/block_hash/block_hash_calculator.rs +++ b/crates/starknet_api/src/block_hash/block_hash_calculator.rs @@ -47,15 +47,15 @@ static STARKNET_GAS_PRICES0: LazyLock = LazyLock::new(|| { #[allow(non_camel_case_types)] #[derive(Clone, Debug, PartialEq, Eq, PartialOrd)] pub enum BlockHashVersion { - VO_13_2, - VO_13_3, + V0_13_2, + V0_13_4, } impl From for StarknetVersion { fn from(value: BlockHashVersion) -> Self { match value { - BlockHashVersion::VO_13_2 => StarknetVersion::V0_13_2, - BlockHashVersion::VO_13_3 => StarknetVersion::V0_13_3, + BlockHashVersion::V0_13_2 => StarknetVersion::V0_13_2, + BlockHashVersion::V0_13_4 => StarknetVersion::V0_13_4, } } } @@ -64,12 +64,13 @@ impl TryFrom for BlockHashVersion { type Error = StarknetApiError; fn try_from(value: StarknetVersion) -> StarknetApiResult { - if value < Self::VO_13_2.into() { + if value < Self::V0_13_2.into() { Err(StarknetApiError::BlockHashVersion { version: value.to_string() }) - } else if value < Self::VO_13_3.into() { - Ok(Self::VO_13_2) + } else if value < Self::V0_13_4.into() { + // Starknet versions 0.13.2 and 0.13.3 both have the same block hash mechanism. + Ok(Self::V0_13_2) } else { - Ok(Self::VO_13_3) + Ok(Self::V0_13_4) } } } @@ -80,8 +81,8 @@ type BlockHashConstant = Felt; impl From for BlockHashConstant { fn from(block_hash_version: BlockHashVersion) -> Self { match block_hash_version { - BlockHashVersion::VO_13_2 => *STARKNET_BLOCK_HASH0, - BlockHashVersion::VO_13_3 => *STARKNET_BLOCK_HASH1, + BlockHashVersion::V0_13_2 => *STARKNET_BLOCK_HASH0, + BlockHashVersion::V0_13_4 => *STARKNET_BLOCK_HASH1, } } } @@ -164,7 +165,7 @@ pub fn calculate_block_commitments( .iter() .map(|tx_leaf| { let mut tx_leaf_element = TransactionLeafElement::from(tx_leaf); - if starknet_version < &BlockHashVersion::VO_13_3.into() + if starknet_version < &BlockHashVersion::V0_13_4.into() && tx_leaf.transaction_signature.0.is_empty() { tx_leaf_element.transaction_signature.0.push(Felt::ZERO); @@ -248,7 +249,7 @@ fn gas_prices_to_hash( l2_gas_price: &GasPricePerToken, block_hash_version: &BlockHashVersion, ) -> Vec { - if block_hash_version >= &BlockHashVersion::VO_13_3 { + if block_hash_version >= &BlockHashVersion::V0_13_4 { vec![ HashChain::new() .chain(&STARKNET_GAS_PRICES0) diff --git a/crates/starknet_api/src/block_hash/block_hash_calculator_test.rs b/crates/starknet_api/src/block_hash/block_hash_calculator_test.rs index fa2754211f..9981acf2c2 100644 --- a/crates/starknet_api/src/block_hash/block_hash_calculator_test.rs +++ b/crates/starknet_api/src/block_hash/block_hash_calculator_test.rs @@ -44,7 +44,7 @@ macro_rules! test_hash_changes { { let header = BlockHeaderWithoutHash { l1_da_mode: L1DataAvailabilityMode::Blob, - starknet_version: BlockHashVersion::VO_13_3.into(), + starknet_version: BlockHashVersion::V0_13_4.into(), $($header_field: $header_value),* }; let commitments = BlockHeaderCommitments { @@ -73,7 +73,7 @@ macro_rules! test_hash_changes { #[rstest] fn test_block_hash_regression( - #[values(BlockHashVersion::VO_13_2, BlockHashVersion::VO_13_3)] + #[values(BlockHashVersion::V0_13_2, BlockHashVersion::V0_13_4)] block_hash_version: BlockHashVersion, ) { let block_header = BlockHeaderWithoutHash { @@ -106,11 +106,11 @@ fn test_block_hash_regression( ); let expected_hash = match block_hash_version { - BlockHashVersion::VO_13_2 => { + BlockHashVersion::V0_13_2 => { felt!("0xe248d6ce583f8fa48d1d401d4beb9ceced3733e38d8eacb0d8d3669a7d901c") } - BlockHashVersion::VO_13_3 => { - felt!("0x566c0aaa2bb5fbd7957224108f089100d58f1d8767dd2b53698e27efbf2a28b") + BlockHashVersion::V0_13_4 => { + felt!("0x3d6174623c812f5dc03fa3faa07c42c06fd90ad425629ee5f39e149df65c3ca") } }; @@ -121,14 +121,14 @@ fn test_block_hash_regression( } #[test] -fn l2_gas_price_pre_v0_13_3() { +fn l2_gas_price_pre_v0_13_4() { let block_header = { |l2_gas_price: u8| BlockHeaderWithoutHash { l2_gas_price: GasPricePerToken { price_in_fri: l2_gas_price.into(), price_in_wei: l2_gas_price.into(), }, - starknet_version: BlockHashVersion::VO_13_2.into(), + starknet_version: BlockHashVersion::V0_13_2.into(), ..Default::default() } };