diff --git a/crates/blockifier/resources/versioned_constants_0_13_1.json b/crates/blockifier/resources/versioned_constants_0_13_1.json index e155bd2fc8..adee9cb6e1 100644 --- a/crates/blockifier/resources/versioned_constants_0_13_1.json +++ b/crates/blockifier/resources/versioned_constants_0_13_1.json @@ -10,7 +10,6 @@ }, "invoke_tx_max_n_steps": 4000000, "execute_max_sierra_gas": 10000000000, - "execute_max_sierra_gas": 10000000000, "deprecated_l2_resource_gas_costs": { "gas_per_data_felt": [ 128, @@ -44,7 +43,6 @@ "disable_cairo0_redeclaration": false, "enable_stateful_compression": false, "comprehensive_state_diff": false, - "comprehensive_state_diff": false, "allocation_cost": { "blob_cost": { "l1_gas": 0, @@ -77,7 +75,6 @@ "step_gas_cost": 100, "range_check_gas_cost": 70, "keccak_builtin_gas_cost": 0, - "keccak_builtin_gas_cost": 0, "pedersen_gas_cost": 0, "bitwise_builtin_gas_cost": 0, "ecop_gas_cost": 0, @@ -101,565 +98,564 @@ "step_gas_cost": 100 }, "fee_transfer_gas_cost": { - "fee_transfer_gas_cost": { - "entry_point_initial_budget": 1, - "step_gas_cost": 600 - "step_gas_cost": 600 - }, - "transaction_gas_cost": { - "entry_point_initial_budget": 2, - "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", - "error_entry_point_not_found": "ENTRYPOINT_NOT_FOUND", - "error_invalid_input_len": "Invalid input length", - "error_invalid_argument": "Invalid argument", - "validated": "VALID", - "l1_gas": "L1_GAS", - "l2_gas": "L2_GAS", - "l1_gas_index": 0, - "l2_gas_index": 1, - "validate_rounding_consts": { - "validate_block_number_rounding": 100, - "validate_timestamp_rounding": 3600 - }, - "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": 76501, - "range_check_gas_cost": 7045, - "memory_hole_gas_cost": 2 - }, - "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": 125340, - "range_check_gas_cost": 13961, - "memory_hole_gas_cost": 2 - }, - "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 + "fee_transfer_gas_cost": { + "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", + "error_entry_point_not_found": "ENTRYPOINT_NOT_FOUND", + "error_invalid_input_len": "Invalid input length", + "error_invalid_argument": "Invalid argument", + "validated": "VALID", + "l1_gas": "L1_GAS", + "l2_gas": "L2_GAS", + "l1_gas_index": 0, + "l2_gas_index": 1, + "validate_rounding_consts": { + "validate_block_number_rounding": 100, + "validate_timestamp_rounding": 3600 + }, + "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": 76501, + "range_check_gas_cost": 7045, + "memory_hole_gas_cost": 2 + }, + "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": 125340, + "range_check_gas_cost": 13961, + "memory_hole_gas_cost": 2 + }, + "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": { - "CallContract": { - "n_steps": 760, - "builtin_instance_counter": { - "range_check_builtin": 20 + }, + "os_resources": { + "execute_syscalls": { + "CallContract": { + "n_steps": 760, + "builtin_instance_counter": { + "range_check_builtin": 20 + }, + "n_memory_holes": 0 }, - "n_memory_holes": 0 - }, - "DelegateCall": { - "n_steps": 713, - "builtin_instance_counter": { - "range_check_builtin": 19 + "DelegateCall": { + "n_steps": 713, + "builtin_instance_counter": { + "range_check_builtin": 19 + }, + "n_memory_holes": 0 }, - "n_memory_holes": 0 - }, - "DelegateL1Handler": { - "n_steps": 692, - "builtin_instance_counter": { - "range_check_builtin": 15 + "DelegateL1Handler": { + "n_steps": 692, + "builtin_instance_counter": { + "range_check_builtin": 15 + }, + "n_memory_holes": 0 }, - "n_memory_holes": 0 - }, - "Deploy": { - "n_steps": 1012, - "builtin_instance_counter": { - "pedersen_builtin": 7, - "range_check_builtin": 19 + "Deploy": { + "n_steps": 1012, + "builtin_instance_counter": { + "pedersen_builtin": 7, + "range_check_builtin": 19 + }, + "n_memory_holes": 0 }, - "n_memory_holes": 0 - }, - "EmitEvent": { - "n_steps": 61, - "builtin_instance_counter": { - "range_check_builtin": 1 + "EmitEvent": { + "n_steps": 61, + "builtin_instance_counter": { + "range_check_builtin": 1 + }, + "n_memory_holes": 0 }, - "n_memory_holes": 0 - }, - "GetBlockHash": { - "n_steps": 104, - "builtin_instance_counter": { - "range_check_builtin": 2 + "GetBlockHash": { + "n_steps": 104, + "builtin_instance_counter": { + "range_check_builtin": 2 + }, + "n_memory_holes": 0 }, - "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 + "GetBlockNumber": { + "n_steps": 40, + "builtin_instance_counter": {}, + "n_memory_holes": 0 }, - "n_memory_holes": 0 - }, - "GetContractAddress": { - "n_steps": 64, - "builtin_instance_counter": { - "range_check_builtin": 1 + "GetBlockTimestamp": { + "n_steps": 38, + "builtin_instance_counter": {}, + "n_memory_holes": 0 }, - "n_memory_holes": 0 - }, - "GetExecutionInfo": { - "n_steps": 64, - "builtin_instance_counter": { - "range_check_builtin": 1 + "GetCallerAddress": { + "n_steps": 64, + "builtin_instance_counter": { + "range_check_builtin": 1 + }, + "n_memory_holes": 0 }, - "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 + "GetContractAddress": { + "n_steps": 64, + "builtin_instance_counter": { + "range_check_builtin": 1 + }, + "n_memory_holes": 0 }, - "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 + "GetExecutionInfo": { + "n_steps": 64, + "builtin_instance_counter": { + "range_check_builtin": 1 + }, + "n_memory_holes": 0 }, - "n_memory_holes": 0 - }, - "LibraryCall": { - "n_steps": 751, - "builtin_instance_counter": { - "range_check_builtin": 20 + "GetSequencerAddress": { + "n_steps": 34, + "builtin_instance_counter": {}, + "n_memory_holes": 0 }, - "n_memory_holes": 0 - }, - "LibraryCallL1Handler": { - "n_steps": 659, - "builtin_instance_counter": { - "range_check_builtin": 15 + "GetTxInfo": { + "n_steps": 64, + "builtin_instance_counter": { + "range_check_builtin": 1 + }, + "n_memory_holes": 0 }, - "n_memory_holes": 0 - }, - "ReplaceClass": { - "n_steps": 98, - "builtin_instance_counter": { - "range_check_builtin": 1 + "GetTxSignature": { + "n_steps": 44, + "builtin_instance_counter": {}, + "n_memory_holes": 0 }, - "n_memory_holes": 0 - }, - "Secp256k1Add": { - "n_steps": 408, - "builtin_instance_counter": { - "range_check_builtin": 29 + "Keccak": { + "n_steps": 381, + "builtin_instance_counter": { + "bitwise_builtin": 6, + "keccak_builtin": 1, + "range_check_builtin": 56 + }, + "n_memory_holes": 0 }, - "n_memory_holes": 0 - }, - "Secp256k1GetPointFromX": { - "n_steps": 393, - "builtin_instance_counter": { - "range_check_builtin": 30 + "LibraryCall": { + "n_steps": 751, + "builtin_instance_counter": { + "range_check_builtin": 20 + }, + "n_memory_holes": 0 }, - "n_memory_holes": 0 - }, - "Secp256k1GetXy": { - "n_steps": 205, - "builtin_instance_counter": { - "range_check_builtin": 11 + "LibraryCallL1Handler": { + "n_steps": 659, + "builtin_instance_counter": { + "range_check_builtin": 15 + }, + "n_memory_holes": 0 }, - "n_memory_holes": 0 - }, - "Secp256k1Mul": { - "n_steps": 76503, - "builtin_instance_counter": { - "range_check_builtin": 7045 + "ReplaceClass": { + "n_steps": 98, + "builtin_instance_counter": { + "range_check_builtin": 1 + }, + "n_memory_holes": 0 }, - "n_memory_holes": 0 - }, - "Secp256k1New": { - "n_steps": 459, - "builtin_instance_counter": { - "range_check_builtin": 35 + "Secp256k1Add": { + "n_steps": 408, + "builtin_instance_counter": { + "range_check_builtin": 29 + }, + "n_memory_holes": 0 }, - "n_memory_holes": 0 - }, - "Secp256r1Add": { - "n_steps": 591, - "builtin_instance_counter": { - "range_check_builtin": 57 + "Secp256k1GetPointFromX": { + "n_steps": 393, + "builtin_instance_counter": { + "range_check_builtin": 30 + }, + "n_memory_holes": 0 }, - "n_memory_holes": 0 - }, - "Secp256r1GetPointFromX": { - "n_steps": 512, - "builtin_instance_counter": { - "range_check_builtin": 44 + "Secp256k1GetXy": { + "n_steps": 205, + "builtin_instance_counter": { + "range_check_builtin": 11 + }, + "n_memory_holes": 0 }, - "n_memory_holes": 0 - }, - "Secp256r1GetXy": { - "n_steps": 207, - "builtin_instance_counter": { - "range_check_builtin": 11 + "Secp256k1Mul": { + "n_steps": 76503, + "builtin_instance_counter": { + "range_check_builtin": 7045 + }, + "n_memory_holes": 0 }, - "n_memory_holes": 0 - }, - "Secp256r1Mul": { - "n_steps": 125342, - "builtin_instance_counter": { - "range_check_builtin": 13961 + "Secp256k1New": { + "n_steps": 459, + "builtin_instance_counter": { + "range_check_builtin": 35 + }, + "n_memory_holes": 0 }, - "n_memory_holes": 0 - }, - "Secp256r1New": { - "n_steps": 578, - "builtin_instance_counter": { - "range_check_builtin": 49 + "Secp256r1Add": { + "n_steps": 591, + "builtin_instance_counter": { + "range_check_builtin": 57 + }, + "n_memory_holes": 0 }, - "n_memory_holes": 0 - }, - "SendMessageToL1": { - "n_steps": 139, - "builtin_instance_counter": { - "range_check_builtin": 1 + "Secp256r1GetPointFromX": { + "n_steps": 512, + "builtin_instance_counter": { + "range_check_builtin": 44 + }, + "n_memory_holes": 0 }, - "n_memory_holes": 0 - }, - "Sha256ProcessBlock": { - "builtin_instance_counter": {}, - "n_memory_holes": 0, - "n_steps": 0 - }, - "StorageRead": { - "n_steps": 87, - "builtin_instance_counter": { - "range_check_builtin": 1 + "Secp256r1GetXy": { + "n_steps": 207, + "builtin_instance_counter": { + "range_check_builtin": 11 + }, + "n_memory_holes": 0 }, - "n_memory_holes": 0 - }, - "StorageWrite": { - "n_steps": 89, - "builtin_instance_counter": { - "range_check_builtin": 1 + "Secp256r1Mul": { + "n_steps": 125342, + "builtin_instance_counter": { + "range_check_builtin": 13961 + }, + "n_memory_holes": 0 }, - "n_memory_holes": 0 - }, - "GetClassHashAt": { - "n_steps": 0, - "builtin_instance_counter": {}, - "n_memory_holes": 0 - } - }, - "execute_txs_inner": { - "Declare": { - "resources": { - "constant": { - "n_steps": 2839, - "builtin_instance_counter": { - "pedersen_builtin": 16, - "range_check_builtin": 63 - }, - "n_memory_holes": 0 + "Secp256r1New": { + "n_steps": 578, + "builtin_instance_counter": { + "range_check_builtin": 49 }, - "calldata_factor": { - "n_steps": 0, - "builtin_instance_counter": {}, - "n_memory_holes": 0 - } + "n_memory_holes": 0 }, - "deprecated_resources": { - "constant": { - "n_steps": 2839, - "builtin_instance_counter": { - "pedersen_builtin": 16, - "range_check_builtin": 63 - }, - "n_memory_holes": 0 + "SendMessageToL1": { + "n_steps": 139, + "builtin_instance_counter": { + "range_check_builtin": 1 }, - "calldata_factor": { - "n_steps": 0, - "builtin_instance_counter": {}, - "n_memory_holes": 0 - } - } - }, - "DeployAccount": { - "resources": { - "constant": { - "n_steps": 3792, - "builtin_instance_counter": { - "pedersen_builtin": 23, - "range_check_builtin": 83 - }, - "n_memory_holes": 0 + "n_memory_holes": 0 + }, + "Sha256ProcessBlock": { + "builtin_instance_counter": {}, + "n_memory_holes": 0, + "n_steps": 0 + }, + "StorageRead": { + "n_steps": 87, + "builtin_instance_counter": { + "range_check_builtin": 1 }, - "calldata_factor": { - "n_steps": 21, - "builtin_instance_counter": { - "pedersen_builtin": 2 - }, - "n_memory_holes": 0 - } + "n_memory_holes": 0 }, - "deprecated_resources": { - "constant": { - "n_steps": 3792, - "builtin_instance_counter": { - "pedersen_builtin": 23, - "range_check_builtin": 83 - }, - "n_memory_holes": 0 + "StorageWrite": { + "n_steps": 89, + "builtin_instance_counter": { + "range_check_builtin": 1 }, - "calldata_factor": { - "n_steps": 21, - "builtin_instance_counter": { - "pedersen_builtin": 2 - }, - "n_memory_holes": 0 - } + "n_memory_holes": 0 + }, + "GetClassHashAt": { + "n_steps": 0, + "builtin_instance_counter": {}, + "n_memory_holes": 0 } }, - "InvokeFunction": { - "resources": { - "constant": { - "n_steps": 3546, - "builtin_instance_counter": { - "pedersen_builtin": 14, - "range_check_builtin": 80 + "execute_txs_inner": { + "Declare": { + "resources": { + "constant": { + "n_steps": 2839, + "builtin_instance_counter": { + "pedersen_builtin": 16, + "range_check_builtin": 63 + }, + "n_memory_holes": 0 }, - "n_memory_holes": 0 + "calldata_factor": { + "n_steps": 0, + "builtin_instance_counter": {}, + "n_memory_holes": 0 + } }, - "calldata_factor": { - "n_steps": 8, - "builtin_instance_counter": { - "pedersen_builtin": 1 + "deprecated_resources": { + "constant": { + "n_steps": 2839, + "builtin_instance_counter": { + "pedersen_builtin": 16, + "range_check_builtin": 63 + }, + "n_memory_holes": 0 }, - "n_memory_holes": 0 + "calldata_factor": { + "n_steps": 0, + "builtin_instance_counter": {}, + "n_memory_holes": 0 + } } }, - "deprecated_resources": { - "constant": { - "n_steps": 3546, - "builtin_instance_counter": { - "pedersen_builtin": 14, - "range_check_builtin": 80 + "DeployAccount": { + "resources": { + "constant": { + "n_steps": 3792, + "builtin_instance_counter": { + "pedersen_builtin": 23, + "range_check_builtin": 83 + }, + "n_memory_holes": 0 }, - "n_memory_holes": 0 + "calldata_factor": { + "n_steps": 21, + "builtin_instance_counter": { + "pedersen_builtin": 2 + }, + "n_memory_holes": 0 + } }, - "calldata_factor": { - "n_steps": 8, - "builtin_instance_counter": { - "pedersen_builtin": 1 + "deprecated_resources": { + "constant": { + "n_steps": 3792, + "builtin_instance_counter": { + "pedersen_builtin": 23, + "range_check_builtin": 83 + }, + "n_memory_holes": 0 }, - "n_memory_holes": 0 + "calldata_factor": { + "n_steps": 21, + "builtin_instance_counter": { + "pedersen_builtin": 2 + }, + "n_memory_holes": 0 + } } - } - }, - "L1Handler": { - "resources": { - "constant": { - "n_steps": 1146, - "builtin_instance_counter": { - "pedersen_builtin": 11, - "range_check_builtin": 17 + }, + "InvokeFunction": { + "resources": { + "constant": { + "n_steps": 3546, + "builtin_instance_counter": { + "pedersen_builtin": 14, + "range_check_builtin": 80 + }, + "n_memory_holes": 0 }, - "n_memory_holes": 0 + "calldata_factor": { + "n_steps": 8, + "builtin_instance_counter": { + "pedersen_builtin": 1 + }, + "n_memory_holes": 0 + } }, - "calldata_factor": { - "n_steps": 13, - "builtin_instance_counter": { - "pedersen_builtin": 1 + "deprecated_resources": { + "constant": { + "n_steps": 3546, + "builtin_instance_counter": { + "pedersen_builtin": 14, + "range_check_builtin": 80 + }, + "n_memory_holes": 0 }, - "n_memory_holes": 0 + "calldata_factor": { + "n_steps": 8, + "builtin_instance_counter": { + "pedersen_builtin": 1 + }, + "n_memory_holes": 0 + } } }, - "deprecated_resources": { - "constant": { - "n_steps": 1146, - "builtin_instance_counter": { - "pedersen_builtin": 11, - "range_check_builtin": 17 + "L1Handler": { + "resources": { + "constant": { + "n_steps": 1146, + "builtin_instance_counter": { + "pedersen_builtin": 11, + "range_check_builtin": 17 + }, + "n_memory_holes": 0 }, - "n_memory_holes": 0 + "calldata_factor": { + "n_steps": 13, + "builtin_instance_counter": { + "pedersen_builtin": 1 + }, + "n_memory_holes": 0 + } }, - "calldata_factor": { - "n_steps": 13, - "builtin_instance_counter": { - "pedersen_builtin": 1 + "deprecated_resources": { + "constant": { + "n_steps": 1146, + "builtin_instance_counter": { + "pedersen_builtin": 11, + "range_check_builtin": 17 + }, + "n_memory_holes": 0 }, - "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": 0, + "builtin_instance_counter": {}, + "n_memory_holes": 0 } }, - "compute_os_kzg_commitment_info": { - "n_steps": 0, - "builtin_instance_counter": {}, - "n_memory_holes": 0 - } - }, - "validate_max_n_steps": 1000000, - "validate_max_sierra_gas": 10000000000, - "min_compiler_version_for_sierra_gas": "2.8.0", - "vm_resource_fee_cost": { - "builtins": { - "add_mod_builtin": [ - 0, - 1 - ], - "bitwise_builtin": [ - 16, - 100 - ], - "ec_op_builtin": [ - 256, - 100 - ], - "ecdsa_builtin": [ - 512, - 100 - ], - "keccak_builtin": [ - 512, - 100 - ], - "mul_mod_builtin": [ - 0, - 1 - ], - "output_builtin": [ - 0, - 1 - ], - "pedersen_builtin": [ - 8, - 100 - ], - "poseidon_builtin": [ - 8, - 100 - ], - "range_check_builtin": [ - 4, - 100 - ], - "range_check96_builtin": [ - 0, - 1 + "validate_max_n_steps": 1000000, + "validate_max_sierra_gas": 10000000000, + "min_compiler_version_for_sierra_gas": "2.8.0", + "vm_resource_fee_cost": { + "builtins": { + "add_mod_builtin": [ + 0, + 1 + ], + "bitwise_builtin": [ + 16, + 100 + ], + "ec_op_builtin": [ + 256, + 100 + ], + "ecdsa_builtin": [ + 512, + 100 + ], + "keccak_builtin": [ + 512, + 100 + ], + "mul_mod_builtin": [ + 0, + 1 + ], + "output_builtin": [ + 0, + 1 + ], + "pedersen_builtin": [ + 8, + 100 + ], + "poseidon_builtin": [ + 8, + 100 + ], + "range_check_builtin": [ + 4, + 100 + ], + "range_check96_builtin": [ + 0, + 1 + ] + }, + "n_steps": [ + 25, + 10000 ] - }, - "n_steps": [ - 25, - 10000 - ] + } } } diff --git a/crates/blockifier/resources/versioned_constants_0_13_1_1.json b/crates/blockifier/resources/versioned_constants_0_13_1_1.json index 5c31c8a1ac..0765368804 100644 --- a/crates/blockifier/resources/versioned_constants_0_13_1_1.json +++ b/crates/blockifier/resources/versioned_constants_0_13_1_1.json @@ -10,7 +10,6 @@ }, "invoke_tx_max_n_steps": 4000000, "execute_max_sierra_gas": 10000000000, - "execute_max_sierra_gas": 10000000000, "deprecated_l2_resource_gas_costs": { "gas_per_data_felt": [ 128, @@ -44,7 +43,6 @@ "disable_cairo0_redeclaration": false, "enable_stateful_compression": false, "comprehensive_state_diff": false, - "comprehensive_state_diff": false, "allocation_cost": { "blob_cost": { "l1_gas": 0, @@ -77,7 +75,6 @@ "step_gas_cost": 100, "range_check_gas_cost": 70, "keccak_builtin_gas_cost": 0, - "keccak_builtin_gas_cost": 0, "pedersen_gas_cost": 0, "bitwise_builtin_gas_cost": 0, "ecop_gas_cost": 0, @@ -101,565 +98,564 @@ "step_gas_cost": 100 }, "fee_transfer_gas_cost": { - "fee_transfer_gas_cost": { - "entry_point_initial_budget": 1, - "step_gas_cost": 600 - "step_gas_cost": 600 - }, - "transaction_gas_cost": { - "entry_point_initial_budget": 2, - "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", - "error_entry_point_not_found": "ENTRYPOINT_NOT_FOUND", - "error_invalid_input_len": "Invalid input length", - "error_invalid_argument": "Invalid argument", - "validated": "VALID", - "l1_gas": "L1_GAS", - "l2_gas": "L2_GAS", - "l1_gas_index": 0, - "l2_gas_index": 1, - "validate_rounding_consts": { - "validate_block_number_rounding": 100, - "validate_timestamp_rounding": 3600 - }, - "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": 76501, - "range_check_gas_cost": 7045, - "memory_hole_gas_cost": 2 - }, - "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": 125340, - "range_check_gas_cost": 13961, - "memory_hole_gas_cost": 2 - }, - "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 + "fee_transfer_gas_cost": { + "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", + "error_entry_point_not_found": "ENTRYPOINT_NOT_FOUND", + "error_invalid_input_len": "Invalid input length", + "error_invalid_argument": "Invalid argument", + "validated": "VALID", + "l1_gas": "L1_GAS", + "l2_gas": "L2_GAS", + "l1_gas_index": 0, + "l2_gas_index": 1, + "validate_rounding_consts": { + "validate_block_number_rounding": 100, + "validate_timestamp_rounding": 3600 + }, + "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": 76501, + "range_check_gas_cost": 7045, + "memory_hole_gas_cost": 2 + }, + "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": 125340, + "range_check_gas_cost": 13961, + "memory_hole_gas_cost": 2 + }, + "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": { - "CallContract": { - "n_steps": 760, - "builtin_instance_counter": { - "range_check_builtin": 20 + }, + "os_resources": { + "execute_syscalls": { + "CallContract": { + "n_steps": 760, + "builtin_instance_counter": { + "range_check_builtin": 20 + }, + "n_memory_holes": 0 }, - "n_memory_holes": 0 - }, - "DelegateCall": { - "n_steps": 713, - "builtin_instance_counter": { - "range_check_builtin": 19 + "DelegateCall": { + "n_steps": 713, + "builtin_instance_counter": { + "range_check_builtin": 19 + }, + "n_memory_holes": 0 }, - "n_memory_holes": 0 - }, - "DelegateL1Handler": { - "n_steps": 692, - "builtin_instance_counter": { - "range_check_builtin": 15 + "DelegateL1Handler": { + "n_steps": 692, + "builtin_instance_counter": { + "range_check_builtin": 15 + }, + "n_memory_holes": 0 }, - "n_memory_holes": 0 - }, - "Deploy": { - "n_steps": 1012, - "builtin_instance_counter": { - "pedersen_builtin": 7, - "range_check_builtin": 19 + "Deploy": { + "n_steps": 1012, + "builtin_instance_counter": { + "pedersen_builtin": 7, + "range_check_builtin": 19 + }, + "n_memory_holes": 0 }, - "n_memory_holes": 0 - }, - "EmitEvent": { - "n_steps": 61, - "builtin_instance_counter": { - "range_check_builtin": 1 + "EmitEvent": { + "n_steps": 61, + "builtin_instance_counter": { + "range_check_builtin": 1 + }, + "n_memory_holes": 0 }, - "n_memory_holes": 0 - }, - "GetBlockHash": { - "n_steps": 104, - "builtin_instance_counter": { - "range_check_builtin": 2 + "GetBlockHash": { + "n_steps": 104, + "builtin_instance_counter": { + "range_check_builtin": 2 + }, + "n_memory_holes": 0 }, - "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 + "GetBlockNumber": { + "n_steps": 40, + "builtin_instance_counter": {}, + "n_memory_holes": 0 }, - "n_memory_holes": 0 - }, - "GetContractAddress": { - "n_steps": 64, - "builtin_instance_counter": { - "range_check_builtin": 1 + "GetBlockTimestamp": { + "n_steps": 38, + "builtin_instance_counter": {}, + "n_memory_holes": 0 }, - "n_memory_holes": 0 - }, - "GetExecutionInfo": { - "n_steps": 64, - "builtin_instance_counter": { - "range_check_builtin": 1 + "GetCallerAddress": { + "n_steps": 64, + "builtin_instance_counter": { + "range_check_builtin": 1 + }, + "n_memory_holes": 0 }, - "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 + "GetContractAddress": { + "n_steps": 64, + "builtin_instance_counter": { + "range_check_builtin": 1 + }, + "n_memory_holes": 0 }, - "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 + "GetExecutionInfo": { + "n_steps": 64, + "builtin_instance_counter": { + "range_check_builtin": 1 + }, + "n_memory_holes": 0 }, - "n_memory_holes": 0 - }, - "LibraryCall": { - "n_steps": 751, - "builtin_instance_counter": { - "range_check_builtin": 20 + "GetSequencerAddress": { + "n_steps": 34, + "builtin_instance_counter": {}, + "n_memory_holes": 0 }, - "n_memory_holes": 0 - }, - "LibraryCallL1Handler": { - "n_steps": 659, - "builtin_instance_counter": { - "range_check_builtin": 15 + "GetTxInfo": { + "n_steps": 64, + "builtin_instance_counter": { + "range_check_builtin": 1 + }, + "n_memory_holes": 0 }, - "n_memory_holes": 0 - }, - "ReplaceClass": { - "n_steps": 98, - "builtin_instance_counter": { - "range_check_builtin": 1 + "GetTxSignature": { + "n_steps": 44, + "builtin_instance_counter": {}, + "n_memory_holes": 0 }, - "n_memory_holes": 0 - }, - "Secp256k1Add": { - "n_steps": 408, - "builtin_instance_counter": { - "range_check_builtin": 29 + "Keccak": { + "n_steps": 381, + "builtin_instance_counter": { + "bitwise_builtin": 6, + "keccak_builtin": 1, + "range_check_builtin": 56 + }, + "n_memory_holes": 0 }, - "n_memory_holes": 0 - }, - "Secp256k1GetPointFromX": { - "n_steps": 393, - "builtin_instance_counter": { - "range_check_builtin": 30 + "LibraryCall": { + "n_steps": 751, + "builtin_instance_counter": { + "range_check_builtin": 20 + }, + "n_memory_holes": 0 }, - "n_memory_holes": 0 - }, - "Secp256k1GetXy": { - "n_steps": 205, - "builtin_instance_counter": { - "range_check_builtin": 11 + "LibraryCallL1Handler": { + "n_steps": 659, + "builtin_instance_counter": { + "range_check_builtin": 15 + }, + "n_memory_holes": 0 }, - "n_memory_holes": 0 - }, - "Secp256k1Mul": { - "n_steps": 76503, - "builtin_instance_counter": { - "range_check_builtin": 7045 + "ReplaceClass": { + "n_steps": 98, + "builtin_instance_counter": { + "range_check_builtin": 1 + }, + "n_memory_holes": 0 }, - "n_memory_holes": 0 - }, - "Secp256k1New": { - "n_steps": 459, - "builtin_instance_counter": { - "range_check_builtin": 35 + "Secp256k1Add": { + "n_steps": 408, + "builtin_instance_counter": { + "range_check_builtin": 29 + }, + "n_memory_holes": 0 }, - "n_memory_holes": 0 - }, - "Secp256r1Add": { - "n_steps": 591, - "builtin_instance_counter": { - "range_check_builtin": 57 + "Secp256k1GetPointFromX": { + "n_steps": 393, + "builtin_instance_counter": { + "range_check_builtin": 30 + }, + "n_memory_holes": 0 }, - "n_memory_holes": 0 - }, - "Secp256r1GetPointFromX": { - "n_steps": 512, - "builtin_instance_counter": { - "range_check_builtin": 44 + "Secp256k1GetXy": { + "n_steps": 205, + "builtin_instance_counter": { + "range_check_builtin": 11 + }, + "n_memory_holes": 0 }, - "n_memory_holes": 0 - }, - "Secp256r1GetXy": { - "n_steps": 207, - "builtin_instance_counter": { - "range_check_builtin": 11 + "Secp256k1Mul": { + "n_steps": 76503, + "builtin_instance_counter": { + "range_check_builtin": 7045 + }, + "n_memory_holes": 0 }, - "n_memory_holes": 0 - }, - "Secp256r1Mul": { - "n_steps": 125342, - "builtin_instance_counter": { - "range_check_builtin": 13961 + "Secp256k1New": { + "n_steps": 459, + "builtin_instance_counter": { + "range_check_builtin": 35 + }, + "n_memory_holes": 0 }, - "n_memory_holes": 0 - }, - "Secp256r1New": { - "n_steps": 578, - "builtin_instance_counter": { - "range_check_builtin": 49 + "Secp256r1Add": { + "n_steps": 591, + "builtin_instance_counter": { + "range_check_builtin": 57 + }, + "n_memory_holes": 0 }, - "n_memory_holes": 0 - }, - "SendMessageToL1": { - "n_steps": 139, - "builtin_instance_counter": { - "range_check_builtin": 1 + "Secp256r1GetPointFromX": { + "n_steps": 512, + "builtin_instance_counter": { + "range_check_builtin": 44 + }, + "n_memory_holes": 0 }, - "n_memory_holes": 0 - }, - "Sha256ProcessBlock": { - "builtin_instance_counter": {}, - "n_memory_holes": 0, - "n_steps": 0 - }, - "StorageRead": { - "n_steps": 87, - "builtin_instance_counter": { - "range_check_builtin": 1 + "Secp256r1GetXy": { + "n_steps": 207, + "builtin_instance_counter": { + "range_check_builtin": 11 + }, + "n_memory_holes": 0 }, - "n_memory_holes": 0 - }, - "StorageWrite": { - "n_steps": 89, - "builtin_instance_counter": { - "range_check_builtin": 1 + "Secp256r1Mul": { + "n_steps": 125342, + "builtin_instance_counter": { + "range_check_builtin": 13961 + }, + "n_memory_holes": 0 }, - "n_memory_holes": 0 - }, - "GetClassHashAt": { - "n_steps": 0, - "builtin_instance_counter": {}, - "n_memory_holes": 0 - } - }, - "execute_txs_inner": { - "Declare": { - "resources": { - "constant": { - "n_steps": 2839, - "builtin_instance_counter": { - "pedersen_builtin": 16, - "range_check_builtin": 63 - }, - "n_memory_holes": 0 + "Secp256r1New": { + "n_steps": 578, + "builtin_instance_counter": { + "range_check_builtin": 49 }, - "calldata_factor": { - "n_steps": 0, - "builtin_instance_counter": {}, - "n_memory_holes": 0 - } + "n_memory_holes": 0 }, - "deprecated_resources": { - "constant": { - "n_steps": 2839, - "builtin_instance_counter": { - "pedersen_builtin": 16, - "range_check_builtin": 63 - }, - "n_memory_holes": 0 + "SendMessageToL1": { + "n_steps": 139, + "builtin_instance_counter": { + "range_check_builtin": 1 }, - "calldata_factor": { - "n_steps": 0, - "builtin_instance_counter": {}, - "n_memory_holes": 0 - } - } - }, - "DeployAccount": { - "resources": { - "constant": { - "n_steps": 3792, - "builtin_instance_counter": { - "pedersen_builtin": 23, - "range_check_builtin": 83 - }, - "n_memory_holes": 0 + "n_memory_holes": 0 + }, + "Sha256ProcessBlock": { + "builtin_instance_counter": {}, + "n_memory_holes": 0, + "n_steps": 0 + }, + "StorageRead": { + "n_steps": 87, + "builtin_instance_counter": { + "range_check_builtin": 1 }, - "calldata_factor": { - "n_steps": 21, - "builtin_instance_counter": { - "pedersen_builtin": 2 - }, - "n_memory_holes": 0 - } + "n_memory_holes": 0 }, - "deprecated_resources": { - "constant": { - "n_steps": 3792, - "builtin_instance_counter": { - "pedersen_builtin": 23, - "range_check_builtin": 83 - }, - "n_memory_holes": 0 + "StorageWrite": { + "n_steps": 89, + "builtin_instance_counter": { + "range_check_builtin": 1 }, - "calldata_factor": { - "n_steps": 21, - "builtin_instance_counter": { - "pedersen_builtin": 2 - }, - "n_memory_holes": 0 - } + "n_memory_holes": 0 + }, + "GetClassHashAt": { + "n_steps": 0, + "builtin_instance_counter": {}, + "n_memory_holes": 0 } }, - "InvokeFunction": { - "resources": { - "constant": { - "n_steps": 3546, - "builtin_instance_counter": { - "pedersen_builtin": 14, - "range_check_builtin": 80 + "execute_txs_inner": { + "Declare": { + "resources": { + "constant": { + "n_steps": 2839, + "builtin_instance_counter": { + "pedersen_builtin": 16, + "range_check_builtin": 63 + }, + "n_memory_holes": 0 }, - "n_memory_holes": 0 + "calldata_factor": { + "n_steps": 0, + "builtin_instance_counter": {}, + "n_memory_holes": 0 + } }, - "calldata_factor": { - "n_steps": 8, - "builtin_instance_counter": { - "pedersen_builtin": 1 + "deprecated_resources": { + "constant": { + "n_steps": 2839, + "builtin_instance_counter": { + "pedersen_builtin": 16, + "range_check_builtin": 63 + }, + "n_memory_holes": 0 }, - "n_memory_holes": 0 + "calldata_factor": { + "n_steps": 0, + "builtin_instance_counter": {}, + "n_memory_holes": 0 + } } }, - "deprecated_resources": { - "constant": { - "n_steps": 3546, - "builtin_instance_counter": { - "pedersen_builtin": 14, - "range_check_builtin": 80 + "DeployAccount": { + "resources": { + "constant": { + "n_steps": 3792, + "builtin_instance_counter": { + "pedersen_builtin": 23, + "range_check_builtin": 83 + }, + "n_memory_holes": 0 }, - "n_memory_holes": 0 + "calldata_factor": { + "n_steps": 21, + "builtin_instance_counter": { + "pedersen_builtin": 2 + }, + "n_memory_holes": 0 + } }, - "calldata_factor": { - "n_steps": 8, - "builtin_instance_counter": { - "pedersen_builtin": 1 + "deprecated_resources": { + "constant": { + "n_steps": 3792, + "builtin_instance_counter": { + "pedersen_builtin": 23, + "range_check_builtin": 83 + }, + "n_memory_holes": 0 }, - "n_memory_holes": 0 + "calldata_factor": { + "n_steps": 21, + "builtin_instance_counter": { + "pedersen_builtin": 2 + }, + "n_memory_holes": 0 + } } - } - }, - "L1Handler": { - "resources": { - "constant": { - "n_steps": 1146, - "builtin_instance_counter": { - "pedersen_builtin": 11, - "range_check_builtin": 17 + }, + "InvokeFunction": { + "resources": { + "constant": { + "n_steps": 3546, + "builtin_instance_counter": { + "pedersen_builtin": 14, + "range_check_builtin": 80 + }, + "n_memory_holes": 0 }, - "n_memory_holes": 0 + "calldata_factor": { + "n_steps": 8, + "builtin_instance_counter": { + "pedersen_builtin": 1 + }, + "n_memory_holes": 0 + } }, - "calldata_factor": { - "n_steps": 13, - "builtin_instance_counter": { - "pedersen_builtin": 1 + "deprecated_resources": { + "constant": { + "n_steps": 3546, + "builtin_instance_counter": { + "pedersen_builtin": 14, + "range_check_builtin": 80 + }, + "n_memory_holes": 0 }, - "n_memory_holes": 0 + "calldata_factor": { + "n_steps": 8, + "builtin_instance_counter": { + "pedersen_builtin": 1 + }, + "n_memory_holes": 0 + } } }, - "deprecated_resources": { - "constant": { - "n_steps": 1146, - "builtin_instance_counter": { - "pedersen_builtin": 11, - "range_check_builtin": 17 + "L1Handler": { + "resources": { + "constant": { + "n_steps": 1146, + "builtin_instance_counter": { + "pedersen_builtin": 11, + "range_check_builtin": 17 + }, + "n_memory_holes": 0 }, - "n_memory_holes": 0 + "calldata_factor": { + "n_steps": 13, + "builtin_instance_counter": { + "pedersen_builtin": 1 + }, + "n_memory_holes": 0 + } }, - "calldata_factor": { - "n_steps": 13, - "builtin_instance_counter": { - "pedersen_builtin": 1 + "deprecated_resources": { + "constant": { + "n_steps": 1146, + "builtin_instance_counter": { + "pedersen_builtin": 11, + "range_check_builtin": 17 + }, + "n_memory_holes": 0 }, - "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": 0, + "builtin_instance_counter": {}, + "n_memory_holes": 0 } }, - "compute_os_kzg_commitment_info": { - "n_steps": 0, - "builtin_instance_counter": {}, - "n_memory_holes": 0 - } - }, - "validate_max_n_steps": 1000000, - "validate_max_sierra_gas": 10000000000, - "min_compiler_version_for_sierra_gas": "2.8.0", - "vm_resource_fee_cost": { - "builtins": { - "add_mod_builtin": [ - 0, - 1 - ], - "bitwise_builtin": [ - 16, - 100 - ], - "ec_op_builtin": [ - 256, - 100 - ], - "ecdsa_builtin": [ - 512, - 100 - ], - "keccak_builtin": [ - 512, - 100 - ], - "mul_mod_builtin": [ - 0, - 1 - ], - "output_builtin": [ - 0, - 1 - ], - "pedersen_builtin": [ - 8, - 100 - ], - "poseidon_builtin": [ - 8, - 100 - ], - "range_check_builtin": [ - 4, - 100 - ], - "range_check96_builtin": [ - 0, - 1 + "validate_max_n_steps": 1000000, + "validate_max_sierra_gas": 10000000000, + "min_compiler_version_for_sierra_gas": "2.8.0", + "vm_resource_fee_cost": { + "builtins": { + "add_mod_builtin": [ + 0, + 1 + ], + "bitwise_builtin": [ + 16, + 100 + ], + "ec_op_builtin": [ + 256, + 100 + ], + "ecdsa_builtin": [ + 512, + 100 + ], + "keccak_builtin": [ + 512, + 100 + ], + "mul_mod_builtin": [ + 0, + 1 + ], + "output_builtin": [ + 0, + 1 + ], + "pedersen_builtin": [ + 8, + 100 + ], + "poseidon_builtin": [ + 8, + 100 + ], + "range_check_builtin": [ + 4, + 100 + ], + "range_check96_builtin": [ + 0, + 1 + ] + }, + "n_steps": [ + 25, + 10000 ] - }, - "n_steps": [ - 25, - 10000 - ] + } } } diff --git a/crates/blockifier/resources/versioned_constants_0_13_2.json b/crates/blockifier/resources/versioned_constants_0_13_2.json index c035cd245d..571cce2ee0 100644 --- a/crates/blockifier/resources/versioned_constants_0_13_2.json +++ b/crates/blockifier/resources/versioned_constants_0_13_2.json @@ -10,7 +10,6 @@ }, "invoke_tx_max_n_steps": 10000000, "execute_max_sierra_gas": 10000000000, - "execute_max_sierra_gas": 10000000000, "deprecated_l2_resource_gas_costs": { "gas_per_data_felt": [ 128, @@ -42,7 +41,6 @@ "disable_cairo0_redeclaration": true, "enable_stateful_compression": false, "comprehensive_state_diff": false, - "comprehensive_state_diff": false, "allocation_cost": { "blob_cost": { "l1_gas": 0, @@ -97,7 +95,6 @@ }, "range_check_gas_cost": 70, "keccak_builtin_gas_cost": 0, - "keccak_builtin_gas_cost": 0, "pedersen_gas_cost": 0, "bitwise_builtin_gas_cost": 594, "ecop_gas_cost": 0, @@ -112,11 +109,9 @@ "step_gas_cost": 100 }, "transaction_gas_cost": { - "entry_point_initial_budget": 2, "entry_point_initial_budget": 2, "fee_transfer_gas_cost": 1, "step_gas_cost": 1100 - "step_gas_cost": 1100 }, "transfer_entry_point_selector": "0x83afd3f4caedc6eebf44246fe54e38c95e3179a5ec9ea81740eca5b482d12e", "validate_declare_entry_point_selector": "0x289da278a8dc833409cabfdad1581e8e7d40e42dcaed693fa4008dcdb4963b3", @@ -615,7 +610,6 @@ }, "validate_max_n_steps": 1000000, "validate_max_sierra_gas": 10000000000, - "validate_max_sierra_gas": 10000000000, "min_compiler_version_for_sierra_gas": "2.8.0", "vm_resource_fee_cost": { "builtins": { diff --git a/crates/blockifier/resources/versioned_constants_0_13_2_1.json b/crates/blockifier/resources/versioned_constants_0_13_2_1.json index 5d09c21a29..ea79b39e53 100644 --- a/crates/blockifier/resources/versioned_constants_0_13_2_1.json +++ b/crates/blockifier/resources/versioned_constants_0_13_2_1.json @@ -10,7 +10,6 @@ }, "invoke_tx_max_n_steps": 10000000, "execute_max_sierra_gas": 10000000000, - "execute_max_sierra_gas": 10000000000, "deprecated_l2_resource_gas_costs": { "gas_per_data_felt": [ 128, @@ -42,7 +41,6 @@ "disable_cairo0_redeclaration": true, "enable_stateful_compression": false, "comprehensive_state_diff": false, - "comprehensive_state_diff": false, "allocation_cost": { "blob_cost": { "l1_gas": 0, @@ -97,7 +95,6 @@ }, "range_check_gas_cost": 70, "keccak_builtin_gas_cost": 0, - "keccak_builtin_gas_cost": 0, "pedersen_gas_cost": 0, "bitwise_builtin_gas_cost": 594, "ecop_gas_cost": 0, @@ -112,11 +109,9 @@ "step_gas_cost": 100 }, "transaction_gas_cost": { - "entry_point_initial_budget": 2, "entry_point_initial_budget": 2, "fee_transfer_gas_cost": 1, "step_gas_cost": 1100 - "step_gas_cost": 1100 }, "transfer_entry_point_selector": "0x83afd3f4caedc6eebf44246fe54e38c95e3179a5ec9ea81740eca5b482d12e", "validate_declare_entry_point_selector": "0x289da278a8dc833409cabfdad1581e8e7d40e42dcaed693fa4008dcdb4963b3", @@ -615,7 +610,6 @@ }, "validate_max_n_steps": 1000000, "validate_max_sierra_gas": 10000000000, - "validate_max_sierra_gas": 10000000000, "min_compiler_version_for_sierra_gas": "2.8.0", "vm_resource_fee_cost": { "builtins": { diff --git a/crates/blockifier/resources/versioned_constants_0_13_3.json b/crates/blockifier/resources/versioned_constants_0_13_3.json index 5d09c21a29..ea79b39e53 100644 --- a/crates/blockifier/resources/versioned_constants_0_13_3.json +++ b/crates/blockifier/resources/versioned_constants_0_13_3.json @@ -10,7 +10,6 @@ }, "invoke_tx_max_n_steps": 10000000, "execute_max_sierra_gas": 10000000000, - "execute_max_sierra_gas": 10000000000, "deprecated_l2_resource_gas_costs": { "gas_per_data_felt": [ 128, @@ -42,7 +41,6 @@ "disable_cairo0_redeclaration": true, "enable_stateful_compression": false, "comprehensive_state_diff": false, - "comprehensive_state_diff": false, "allocation_cost": { "blob_cost": { "l1_gas": 0, @@ -97,7 +95,6 @@ }, "range_check_gas_cost": 70, "keccak_builtin_gas_cost": 0, - "keccak_builtin_gas_cost": 0, "pedersen_gas_cost": 0, "bitwise_builtin_gas_cost": 594, "ecop_gas_cost": 0, @@ -112,11 +109,9 @@ "step_gas_cost": 100 }, "transaction_gas_cost": { - "entry_point_initial_budget": 2, "entry_point_initial_budget": 2, "fee_transfer_gas_cost": 1, "step_gas_cost": 1100 - "step_gas_cost": 1100 }, "transfer_entry_point_selector": "0x83afd3f4caedc6eebf44246fe54e38c95e3179a5ec9ea81740eca5b482d12e", "validate_declare_entry_point_selector": "0x289da278a8dc833409cabfdad1581e8e7d40e42dcaed693fa4008dcdb4963b3", @@ -615,7 +610,6 @@ }, "validate_max_n_steps": 1000000, "validate_max_sierra_gas": 10000000000, - "validate_max_sierra_gas": 10000000000, "min_compiler_version_for_sierra_gas": "2.8.0", "vm_resource_fee_cost": { "builtins": { diff --git a/crates/blockifier/src/concurrency/versioned_state_test.rs b/crates/blockifier/src/concurrency/versioned_state_test.rs index cf222eb6d3..0c26cb760b 100644 --- a/crates/blockifier/src/concurrency/versioned_state_test.rs +++ b/crates/blockifier/src/concurrency/versioned_state_test.rs @@ -7,7 +7,6 @@ use rstest::{fixture, rstest}; use starknet_api::abi::abi_utils::{get_fee_token_var_address, get_storage_var_address}; use starknet_api::core::{calculate_contract_address, ClassHash, ContractAddress}; use starknet_api::test_utils::deploy_account::executable_deploy_account_tx; -use starknet_api::test_utils::deploy_account::executable_deploy_account_tx; use starknet_api::test_utils::NonceManager; use starknet_api::transaction::fields::{ContractAddressSalt, ValidResourceBounds}; use starknet_api::{ @@ -228,7 +227,6 @@ fn test_run_parallel_txs(default_all_resource_bounds: ValidResourceBounds) { let mut state_2 = TransactionalState::create_transactional(&mut versioned_state_proxy_2); // Prepare transactions - let tx = executable_deploy_account_tx( let tx = executable_deploy_account_tx( deploy_account_tx_args! { class_hash: account_without_validation.get_class_hash(), @@ -252,8 +250,6 @@ fn test_run_parallel_txs(default_all_resource_bounds: ValidResourceBounds) { constructor_calldata: constructor_calldata.clone(), }; let nonce_manager = &mut NonceManager::default(); - let tx = executable_deploy_account_tx(deploy_tx_args, nonce_manager); - let delpoy_account_tx_2 = AccountTransaction::new_for_sequencing(tx); let tx = executable_deploy_account_tx(deploy_tx_args, nonce_manager); let delpoy_account_tx_2 = AccountTransaction::new_for_sequencing(tx); diff --git a/crates/blockifier/src/state/cached_state_test.rs b/crates/blockifier/src/state/cached_state_test.rs index 7d83b28bf6..922883686d 100644 --- a/crates/blockifier/src/state/cached_state_test.rs +++ b/crates/blockifier/src/state/cached_state_test.rs @@ -298,12 +298,10 @@ fn cached_state_state_diff_conversion() { assert_eq!(expected_state_diff, state.to_state_diff().unwrap().state_maps.into()); } -fn create_state_cache_for_test( fn create_state_cache_for_test( state: &mut CachedState, sender_address: Option, fee_token_address: ContractAddress, -) -> StateCache { ) -> StateCache { let contract_address = contract_address!(CONTRACT_ADDRESS); let contract_address2 = contract_address!("0x101"); @@ -335,7 +333,6 @@ fn create_state_cache_for_test( state.set_storage_at(fee_token_address, sender_balance_key, felt!("0x1999")).unwrap(); } state.borrow_updated_state_cache().unwrap().clone() - state.borrow_updated_state_cache().unwrap().clone() } #[rstest] @@ -346,7 +343,7 @@ fn test_from_state_changes_for_fee_charge( let fee_token_address = contract_address!("0x17"); let state_changes = create_state_cache_for_test(&mut state, sender_address, fee_token_address).to_state_diff(); - create_state_cache_for_test(&mut state, sender_address, fee_token_address).to_state_diff(); + create_state_cache_for_test(&mut state, sender_address, fee_token_address).to_state_diff(); let state_changes_count = state_changes.count_for_fee_charge(sender_address, fee_token_address); let n_expected_storage_updates = 1 + usize::from(sender_address.is_some()); let expected_state_changes_count = StateChangesCountForFee { @@ -363,7 +360,6 @@ fn test_from_state_changes_for_fee_charge( } #[rstest] -fn test_state_cache_merge( fn test_state_cache_merge( #[values(Some(contract_address!("0x102")), None)] sender_address: Option, ) { @@ -374,8 +370,6 @@ fn test_state_cache_merge( let mut transactional_state = TransactionalState::create_transactional(&mut state); let block_context = BlockContext::create_for_testing(); let fee_token_address = block_context.chain_info.fee_token_addresses.eth_fee_token_address; - let state_cache1 = - create_state_cache_for_test(&mut transactional_state, sender_address, fee_token_address); let state_cache1 = create_state_cache_for_test(&mut transactional_state, sender_address, fee_token_address); transactional_state.commit(); @@ -398,8 +392,6 @@ fn test_state_cache_merge( assert_eq!(StateCache::squash_state_caches(vec![&state_cache1, &state_cache2]), state_cache1); assert_eq!(StateCache::squash_state_caches(vec![&state_cache2, &state_cache1]), state_cache1); - // Get the storage updates addresses and keys from the state_cache1, to overwrite. - let state_changes1 = state_cache1.to_state_diff(); // Get the storage updates addresses and keys from the state_cache1, to overwrite. let state_changes1 = state_cache1.to_state_diff(); let mut storage_updates_keys = state_changes1.state_maps.storage.keys(); @@ -417,8 +409,6 @@ fn test_state_cache_merge( transactional_state.increment_nonce(contract_address).unwrap(); // Get the new state cache and then commit the transactional state. let state_cache3 = transactional_state.borrow_updated_state_cache().unwrap().clone(); - // Get the new state cache and then commit the transactional state. - let state_cache3 = transactional_state.borrow_updated_state_cache().unwrap().clone(); transactional_state.commit(); // Get the total state changes of the CachedState underlying all the temporary transactional @@ -426,15 +416,11 @@ fn test_state_cache_merge( // states, but only when done in the right order. let state_changes_final = state.get_actual_state_changes().unwrap(); assert_eq!( - StateCache::squash_state_caches(vec![&state_cache1, &state_cache2, &state_cache3]) - .to_state_diff(), StateCache::squash_state_caches(vec![&state_cache1, &state_cache2, &state_cache3]) .to_state_diff(), state_changes_final ); assert_ne!( - StateCache::squash_state_caches(vec![&state_cache3, &state_cache1, &state_cache2]) - .to_state_diff(), StateCache::squash_state_caches(vec![&state_cache3, &state_cache1, &state_cache2]) .to_state_diff(), state_changes_final @@ -452,30 +438,24 @@ fn test_state_cache_merge( #[case(false, vec![felt!("0x7"), felt!("0x1")], false)] #[case(false, vec![felt!("0x0"), felt!("0x8")], false)] #[case(false, vec![felt!("0x0"), felt!("0x8"), felt!("0x0")], false)] -fn test_state_cache_commit_and_merge( fn test_state_cache_commit_and_merge( #[case] is_base_empty: bool, #[case] storage_updates: Vec, #[case] charged: bool, #[values(true, false)] comprehensive_state_diff: bool, - #[values(true, false)] comprehensive_state_diff: bool, ) { let contract_address = contract_address!(CONTRACT_ADDRESS); let storage_key = StorageKey::from(0x10_u16); // Set initial state let mut state: CachedState = CachedState::default(); - let non_empty_base_value = felt!("0x1"); - let non_empty_base_value = felt!("0x1"); if !is_base_empty { state.set_storage_at(contract_address, storage_key, non_empty_base_value).unwrap(); state.set_storage_at(contract_address, storage_key, non_empty_base_value).unwrap(); } let mut state_caches = vec![]; - let mut state_caches = vec![]; - for value in storage_updates.iter() { for value in storage_updates.iter() { // In the end of the previous loop, state has moved into the transactional state. let mut transactional_state = TransactionalState::create_transactional(&mut state); @@ -488,8 +468,8 @@ fn test_state_cache_commit_and_merge( let merged_changes = StateCache::squash_state_diff(state_caches.iter().collect(), comprehensive_state_diff); if comprehensive_state_diff { - // The comprehensive_state_diff is needed for backward compatibility of versions before the - // allocated keys feature was inserted. + // The comprehensive_state_diff is needed for backward compatibility of versions before + // the allocated keys feature was inserted. assert_ne!(merged_changes.allocated_keys.is_empty(), charged); } @@ -508,8 +488,8 @@ fn test_state_cache_commit_and_merge( let merged_changes = StateCache::squash_state_diff(state_caches.iter().collect(), comprehensive_state_diff); if comprehensive_state_diff { - // The comprehensive_state_diff is needed for backward compatibility of versions before the - // allocated keys feature was inserted. + // The comprehensive_state_diff is needed for backward compatibility of versions before + // the allocated keys feature was inserted. assert_ne!(merged_changes.allocated_keys.is_empty(), charged); } diff --git a/crates/blockifier/src/test_utils/cairo_compile.rs b/crates/blockifier/src/test_utils/cairo_compile.rs index 80eadf545d..5563f8bb1e 100644 --- a/crates/blockifier/src/test_utils/cairo_compile.rs +++ b/crates/blockifier/src/test_utils/cairo_compile.rs @@ -233,11 +233,6 @@ fn get_tag_and_repo_file_path(git_tag_override: Option) -> (String, Path pub fn prepare_group_tag_compiler_deps(tag_and_toolchain: &TagAndToolchain) { let (optional_tag, optional_toolchain) = tag_and_toolchain; - (tag, cairo_repo_path) -} - -pub fn prepare_group_tag_compiler_deps(git_tag_override: Option) { - let (tag, cairo_repo_path) = get_tag_and_repo_file_path(git_tag_override); // Checkout the required version in the compiler repo. let (tag, cairo_repo_path) = get_tag_and_repo_file_path(optional_tag.clone()); run_and_verify_output(Command::new("git").args([ diff --git a/crates/blockifier/src/test_utils/contracts.rs b/crates/blockifier/src/test_utils/contracts.rs index dbf14aa9cf..25970f9f7f 100644 --- a/crates/blockifier/src/test_utils/contracts.rs +++ b/crates/blockifier/src/test_utils/contracts.rs @@ -1,7 +1,5 @@ use std::collections::HashMap; -use std::collections::HashMap; - use cairo_lang_starknet_classes::casm_contract_class::CasmContractClass; use cairo_lang_starknet_classes::contract_class::ContractClass as CairoLangContractClass; use itertools::Itertools; @@ -95,9 +93,6 @@ const CAIRO_STEPS_TEST_CONTRACT_RUST_TOOLCHAIN: &str = "2024-04-29"; pub type TagAndToolchain = (Option, Option); pub type TagToContractsMapping = HashMap>; -pub type TagAndToolchain = (Option, Option); -pub type TagToContractsMapping = HashMap>; - /// Enum representing all feature contracts. /// The contracts that are implemented in both Cairo versions include a version field. #[derive(Clone, Copy, Debug, EnumIter, Hash, PartialEq, Eq)] @@ -223,7 +218,6 @@ impl FeatureContract { /// Some contracts are designed to test behavior of code compiled with a /// specific (old) compiler tag. To run the (old) compiler, older rust /// version is required. - pub fn fixed_tag_and_rust_toolchain(&self) -> TagAndToolchain { pub fn fixed_tag_and_rust_toolchain(&self) -> TagAndToolchain { match self { Self::LegacyTestContract => ( @@ -339,7 +333,6 @@ impl FeatureContract { /// Compiles the feature contract and returns the compiled contract as a byte vector. /// Panics if the contract is ERC20, as ERC20 contract recompilation is not supported. - pub fn compile(&self) -> CompilationArtifacts { pub fn compile(&self) -> CompilationArtifacts { if matches!(self, Self::ERC20(_)) { panic!("ERC20 contract recompilation not supported."); @@ -368,9 +361,9 @@ impl FeatureContract { } } - /// Fetch PC locations from the compiled contract to compute the expected PC locations in the - /// traceback. Computation is not robust, but as long as the cairo function itself is not - /// edited, this computation should be stable. + /// Fetch PC locations from the compiled contract to compute the expected PC locations in + /// the traceback. Computation is not robust, but as long as the cairo function + /// itself is not edited, this computation should be stable. fn get_offset( &self, entry_point_selector: EntryPointSelector, @@ -487,11 +480,4 @@ impl FeatureContract { .map(|contract| (contract.fixed_tag_and_rust_toolchain(), contract)) .into_group_map() } - - pub fn cairo1_feature_contracts_by_tag() -> TagToContractsMapping { - Self::all_feature_contracts() - .filter(|contract| contract.cairo_version() != CairoVersion::Cairo0) - .map(|contract| (contract.fixed_tag_and_rust_toolchain(), contract)) - .into_group_map() - } } diff --git a/crates/blockifier/src/transaction/account_transaction.rs b/crates/blockifier/src/transaction/account_transaction.rs index 73715f7841..f5e02fed6c 100644 --- a/crates/blockifier/src/transaction/account_transaction.rs +++ b/crates/blockifier/src/transaction/account_transaction.rs @@ -7,7 +7,6 @@ use starknet_api::contract_class::EntryPointType; use starknet_api::core::{ClassHash, ContractAddress, EntryPointSelector, Nonce}; use starknet_api::data_availability::DataAvailabilityMode; use starknet_api::executable_transaction::AccountTransaction as Transaction; -use starknet_api::executable_transaction::AccountTransaction as Transaction; use starknet_api::transaction::fields::Resource::{L1DataGas, L1Gas, L2Gas}; use starknet_api::transaction::fields::{ AccountDeploymentData, @@ -41,7 +40,6 @@ use crate::fee::gas_usage::estimate_minimal_gas_vector; use crate::fee::receipt::TransactionReceipt; use crate::retdata; use crate::state::cached_state::{StateCache, TransactionalState}; -use crate::state::cached_state::{StateCache, TransactionalState}; use crate::state::state_api::{State, StateReader, UpdatableState}; use crate::transaction::errors::{ TransactionExecutionError, @@ -61,7 +59,6 @@ use crate::transaction::objects::{ }; use crate::transaction::transaction_types::TransactionType; use crate::transaction::transactions::{ - enforce_fee, enforce_fee, Executable, ExecutableTransaction, @@ -93,25 +90,11 @@ impl Default for ExecutionFlags { } } -#[derive(Clone, Debug, derive_more::From)] -pub struct ExecutionFlags { - pub only_query: bool, - pub charge_fee: bool, - pub validate: bool, -} - -impl Default for ExecutionFlags { - fn default() -> Self { - Self { only_query: false, charge_fee: true, validate: true } - } -} - /// Represents a paid Starknet transaction. #[derive(Clone, Debug, derive_more::From)] pub struct AccountTransaction { pub tx: Transaction, pub execution_flags: ExecutionFlags, - pub execution_flags: ExecutionFlags, } // TODO(AvivG): create additional macro that returns a reference. macro_rules! implement_tx_getter_calls { @@ -149,17 +132,6 @@ impl AccountTransaction { Self { tx, execution_flags: ExecutionFlags::default() } } - pub fn new_for_sequencing(tx: Transaction) -> Self { - let execution_flags = ExecutionFlags { - only_query: false, - charge_fee: enforce_fee(&tx, false), - validate: true, - }; - AccountTransaction { tx, execution_flags } - pub fn new_with_default_flags(tx: Transaction) -> Self { - Self { tx, execution_flags: ExecutionFlags::default() } - } - pub fn new_for_sequencing(tx: Transaction) -> Self { let execution_flags = ExecutionFlags { only_query: false, @@ -619,7 +591,6 @@ impl AccountTransaction { // Save the state changes resulting from running `validate_tx`, to be used later for // resource and fee calculation. let validate_state_cache = state.borrow_updated_state_cache()?.clone(); - let validate_state_cache = state.borrow_updated_state_cache()?.clone(); // Create copies of state and validate_resources for the execution. // Both will be rolled back if the execution is reverted or committed upon success. @@ -645,19 +616,6 @@ impl AccountTransaction { execution_steps_consumed, ) }; - // Get the receipt only in case of revert. - let get_revert_receipt = || { - TransactionReceipt::from_account_tx( - self, - &tx_context, - &validate_state_cache.to_state_diff(), - CallInfo::summarize_many( - validate_call_info.iter(), - &tx_context.block_context.versioned_constants, - ), - execution_steps_consumed, - ) - }; match execution_result { Ok(execute_call_info) => { @@ -673,13 +631,6 @@ impl AccountTransaction { ], tx_context.block_context.versioned_constants.comprehensive_state_diff, ), - &StateCache::squash_state_diff( - vec![ - &validate_state_cache, - &execution_state.borrow_updated_state_cache()?.clone(), - ], - tx_context.block_context.versioned_constants.comprehensive_state_diff, - ), CallInfo::summarize_many( validate_call_info.iter().chain(execute_call_info.iter()), &tx_context.block_context.versioned_constants, @@ -704,15 +655,10 @@ impl AccountTransaction { fee: post_execution_report.recommended_fee(), ..get_revert_receipt() }; - let tx_receipt = TransactionReceipt { - fee: post_execution_report.recommended_fee(), - ..get_revert_receipt() - }; Ok(ValidateExecuteCallInfo::new_reverted( validate_call_info, post_execution_error.into(), tx_receipt, - tx_receipt, )) } None => { @@ -727,7 +673,6 @@ impl AccountTransaction { } } Err(execution_error) => { - let revert_receipt = get_revert_receipt(); let revert_receipt = get_revert_receipt(); // Error during execution. Revert, even if the error is sequencer-related. execution_state.abort(); @@ -789,7 +734,6 @@ impl ExecutableTransaction for AccountTransaction { state: &mut TransactionalState<'_, U>, block_context: &BlockContext, concurrency_mode: bool, - concurrency_mode: bool, ) -> TransactionExecutionResult { let tx_context = Arc::new(block_context.to_tx_context(self)); self.verify_tx_version(tx_context.tx_info.version())?; @@ -818,8 +762,6 @@ impl ExecutableTransaction for AccountTransaction { final_fee, self.execution_flags.charge_fee, concurrency_mode, - self.execution_flags.charge_fee, - concurrency_mode, )?; let tx_execution_info = TransactionExecutionInfo { @@ -841,7 +783,6 @@ impl ExecutableTransaction for AccountTransaction { impl TransactionInfoCreator for AccountTransaction { fn create_tx_info(&self) -> TransactionInfo { self.tx.create_tx_info(self.execution_flags.only_query) - self.tx.create_tx_info(self.execution_flags.only_query) } } diff --git a/crates/blockifier/src/transaction/account_transactions_test.rs b/crates/blockifier/src/transaction/account_transactions_test.rs index 6e598f21bc..d6c2b378b0 100644 --- a/crates/blockifier/src/transaction/account_transactions_test.rs +++ b/crates/blockifier/src/transaction/account_transactions_test.rs @@ -23,9 +23,6 @@ use starknet_api::state::StorageKey; use starknet_api::test_utils::declare::executable_declare_tx; use starknet_api::test_utils::deploy_account::executable_deploy_account_tx; use starknet_api::test_utils::invoke::{executable_invoke_tx, InvokeTxArgs}; -use starknet_api::test_utils::declare::executable_declare_tx; -use starknet_api::test_utils::deploy_account::executable_deploy_account_tx; -use starknet_api::test_utils::invoke::{executable_invoke_tx, InvokeTxArgs}; use starknet_api::test_utils::NonceManager; use starknet_api::transaction::constants::TRANSFER_ENTRY_POINT_NAME; use starknet_api::transaction::fields::{ @@ -91,10 +88,6 @@ use crate::transaction::account_transaction::{ AccountTransaction, ExecutionFlags as AccountExecutionFlags, }; -use crate::transaction::account_transaction::{ - AccountTransaction, - ExecutionFlags as AccountExecutionFlags, -}; use crate::transaction::objects::{HasRelatedFeeType, TransactionInfoCreator}; use crate::transaction::test_utils::{ all_resource_bounds, @@ -116,7 +109,6 @@ use crate::transaction::test_utils::{ }; use crate::transaction::transaction_types::TransactionType; use crate::transaction::transactions::ExecutableTransaction; -use crate::transaction::transactions::ExecutableTransaction; use crate::utils::u64_from_usize; #[rstest] @@ -204,7 +196,6 @@ fn test_fee_enforcement( ) { let account = FeatureContract::AccountWithoutValidations(CairoVersion::Cairo0); let state = &mut test_state(&block_context.chain_info, BALANCE, &[(account, 1)]); - let tx = executable_deploy_account_tx( let tx = executable_deploy_account_tx( deploy_account_tx_args! { class_hash: account.get_class_hash(), @@ -228,12 +219,10 @@ fn test_fee_enforcement( &mut NonceManager::default(), ); let deploy_account_tx = AccountTransaction::new_for_sequencing(tx); - let deploy_account_tx = AccountTransaction::new_for_sequencing(tx); let enforce_fee = deploy_account_tx.enforce_fee(); assert_ne!(zero_bounds, enforce_fee); let result = deploy_account_tx.execute(state, &block_context); - let result = deploy_account_tx.execute(state, &block_context); // Execution should fail if the fee is enforced because the account doesn't have sufficient // balance. assert_eq!(result.is_err(), enforce_fee); @@ -470,7 +459,6 @@ fn test_max_fee_limit_validate( let class_info = calculate_class_info_for_testing(grindy_validate_account.get_class()); // Declare the grindy-validation account. - let tx = executable_declare_tx( let tx = executable_declare_tx( declare_tx_args! { class_hash: grindy_class_hash, @@ -482,8 +470,6 @@ fn test_max_fee_limit_validate( ); let account_tx = AccountTransaction::new_with_default_flags(tx); account_tx.execute(&mut state, &block_context).unwrap(); - let account_tx = AccountTransaction::new_with_default_flags(tx); - account_tx.execute(&mut state, &block_context).unwrap(); // Deploy grindy account with a lot of grind in the constructor. // Expect this to fail without bumping nonce, so pass a temporary nonce manager. @@ -802,7 +788,6 @@ fn test_fail_declare(block_context: BlockContext, max_fee: Fee) { state.set_contract_class(class_hash, contract_class.clone().try_into().unwrap()).unwrap(); state.set_compiled_class_hash(class_hash, declare_tx_v2.compiled_class_hash).unwrap(); let class_info = calculate_class_info_for_testing(contract_class); - let executable_declare = ApiExecutableDeclareTransaction { let executable_declare = ApiExecutableDeclareTransaction { tx: DeclareTransaction::V2(DeclareTransactionV2 { nonce: next_nonce, ..declare_tx_v2 }), tx_hash: TransactionHash::default(), @@ -811,10 +796,6 @@ fn test_fail_declare(block_context: BlockContext, max_fee: Fee) { let declare_account_tx = AccountTransaction::new_with_default_flags( ApiExecutableTransaction::Declare(executable_declare), ); - }; - let declare_account_tx = AccountTransaction::new_with_default_flags( - ApiExecutableTransaction::Declare(executable_declare), - ); // Fail execution, assert nonce and balance are unchanged. let tx_info = declare_account_tx.create_tx_info(); @@ -1672,7 +1653,6 @@ fn test_concurrent_fee_transfer_when_sender_is_sequencer( let mut transactional_state = TransactionalState::create_transactional(state); let concurrency_mode = true; - let concurrency_mode = true; let result = account_tx.execute_raw(&mut transactional_state, &block_context, concurrency_mode).unwrap(); account_tx.execute_raw(&mut transactional_state, &block_context, concurrency_mode).unwrap(); @@ -1721,7 +1701,6 @@ fn test_initial_gas( version: TransactionVersion::THREE }); - let transaction_ex_info = account_tx.execute(state, &block_context).unwrap(); let transaction_ex_info = account_tx.execute(state, &block_context).unwrap(); let validate_call_info = &transaction_ex_info.validate_call_info.unwrap(); @@ -1809,7 +1788,6 @@ fn test_revert_in_execute( // Skip validate phase, as we want to test the revert in the execute phase. let validate = false; - let tx = executable_invoke_tx(invoke_tx_args! { let tx = executable_invoke_tx(invoke_tx_args! { resource_bounds: default_all_resource_bounds, ..tx_args @@ -1817,10 +1795,6 @@ fn test_revert_in_execute( let execution_flags = AccountExecutionFlags { validate, ..AccountExecutionFlags::default() }; let account_tx = AccountTransaction { tx, execution_flags }; let tx_execution_info = account_tx.execute(state, &block_context).unwrap(); - }); - let execution_flags = AccountExecutionFlags { validate, ..AccountExecutionFlags::default() }; - let account_tx = AccountTransaction { tx, execution_flags }; - let tx_execution_info = account_tx.execute(state, &block_context).unwrap(); assert!(tx_execution_info.is_reverted()); assert!( diff --git a/crates/blockifier/src/transaction/test_utils.rs b/crates/blockifier/src/transaction/test_utils.rs index 8472c6bd3a..2c111413be 100644 --- a/crates/blockifier/src/transaction/test_utils.rs +++ b/crates/blockifier/src/transaction/test_utils.rs @@ -2,15 +2,11 @@ use rstest::fixture; use starknet_api::abi::abi_utils::get_fee_token_var_address; use starknet_api::block::{FeeType, GasPrice}; use starknet_api::contract_class::{ClassInfo, ContractClass, SierraVersion}; -use starknet_api::contract_class::{ClassInfo, ContractClass, SierraVersion}; use starknet_api::core::{ClassHash, ContractAddress, Nonce}; use starknet_api::execution_resources::GasAmount; use starknet_api::test_utils::declare::executable_declare_tx; use starknet_api::test_utils::deploy_account::{executable_deploy_account_tx, DeployAccountTxArgs}; use starknet_api::test_utils::invoke::{executable_invoke_tx, InvokeTxArgs}; -use starknet_api::test_utils::declare::executable_declare_tx; -use starknet_api::test_utils::deploy_account::{executable_deploy_account_tx, DeployAccountTxArgs}; -use starknet_api::test_utils::invoke::{executable_invoke_tx, InvokeTxArgs}; use starknet_api::test_utils::NonceManager; use starknet_api::transaction::fields::{ AllResourceBounds, @@ -45,7 +41,6 @@ use crate::test_utils::{ MAX_FEE, }; use crate::transaction::account_transaction::{AccountTransaction, ExecutionFlags}; -use crate::transaction::account_transaction::{AccountTransaction, ExecutionFlags}; use crate::transaction::objects::{TransactionExecutionInfo, TransactionExecutionResult}; use crate::transaction::transaction_types::TransactionType; use crate::transaction::transactions::ExecutableTransaction; @@ -120,9 +115,6 @@ pub fn deploy_and_fund_account( let deploy_account_tx = AccountTransaction::new_with_default_flags( executable_deploy_account_tx(deploy_tx_args, nonce_manager), ); - let deploy_account_tx = AccountTransaction::new_with_default_flags( - executable_deploy_account_tx(deploy_tx_args, nonce_manager), - ); let account_address = deploy_account_tx.sender_address(); // Update the balance of the about-to-be deployed account contract in the erc20 contract, so it @@ -174,9 +166,6 @@ pub struct FaultyAccountTxCreatorArgs { pub validate: bool, pub only_query: bool, pub charge_fee: bool, - pub validate: bool, - pub only_query: bool, - pub charge_fee: bool, } impl Default for FaultyAccountTxCreatorArgs { @@ -196,9 +185,6 @@ impl Default for FaultyAccountTxCreatorArgs { validate: true, only_query: false, charge_fee: true, - validate: true, - only_query: false, - charge_fee: true, } } } @@ -238,9 +224,6 @@ pub fn create_account_tx_for_validate_test( validate, only_query, charge_fee, - validate, - only_query, - charge_fee, } = faulty_account_tx_creator_args; // The first felt of the signature is used to set the scenario. If the scenario is @@ -251,7 +234,6 @@ pub fn create_account_tx_for_validate_test( } let signature = TransactionSignature(signature_vector); let execution_flags = ExecutionFlags { validate, charge_fee, only_query }; - let execution_flags = ExecutionFlags { validate, charge_fee, only_query }; match tx_type { TransactionType::Declare => { let declared_contract = match declared_contract { @@ -263,7 +245,6 @@ pub fn create_account_tx_for_validate_test( }; let class_hash = declared_contract.get_class_hash(); let class_info = calculate_class_info_for_testing(declared_contract.get_class()); - let tx = executable_declare_tx( let tx = executable_declare_tx( declare_tx_args! { max_fee, @@ -278,8 +259,6 @@ pub fn create_account_tx_for_validate_test( class_info, ); AccountTransaction { tx, execution_flags } - ); - AccountTransaction { tx, execution_flags } } TransactionType::DeployAccount => { // We do not use the sender address here because the transaction generates the actual @@ -288,7 +267,6 @@ pub fn create_account_tx_for_validate_test( true => constants::FELT_TRUE, false => constants::FELT_FALSE, })]; - let tx = executable_deploy_account_tx( let tx = executable_deploy_account_tx( deploy_account_tx_args! { max_fee, @@ -302,12 +280,9 @@ pub fn create_account_tx_for_validate_test( nonce_manager, ); AccountTransaction { tx, execution_flags } - ); - AccountTransaction { tx, execution_flags } } TransactionType::InvokeFunction => { let execute_calldata = create_calldata(sender_address, "foo", &[]); - let tx = executable_invoke_tx(invoke_tx_args! { let tx = executable_invoke_tx(invoke_tx_args! { max_fee, resource_bounds, @@ -319,9 +294,6 @@ pub fn create_account_tx_for_validate_test( }); AccountTransaction { tx, execution_flags } - - }); - AccountTransaction { tx, execution_flags } } _ => panic!("{tx_type:?} is not an account transaction."), } @@ -339,11 +311,8 @@ pub fn run_invoke_tx( ) -> TransactionExecutionResult { let tx = executable_invoke_tx(invoke_args); let account_tx = AccountTransaction::new_for_sequencing(tx); - let tx = executable_invoke_tx(invoke_args); - let account_tx = AccountTransaction::new_for_sequencing(tx); account_tx.execute(state, block_context) - account_tx.execute(state, block_context) } /// Creates a `ResourceBoundsMapping` with the given `max_amount` and `max_price` for L1 gas limits. @@ -394,14 +363,11 @@ pub fn create_all_resource_bounds( } pub fn calculate_class_info_for_testing(contract_class: ContractClass) -> ClassInfo { - let (sierra_program_length, sierra_version) = match contract_class { - ContractClass::V0(_) => (0, SierraVersion::DEPRECATED), - ContractClass::V1(_) => (100, SierraVersion::LATEST), let (sierra_program_length, sierra_version) = match contract_class { ContractClass::V0(_) => (0, SierraVersion::DEPRECATED), ContractClass::V1(_) => (100, SierraVersion::LATEST), }; - ClassInfo::new(&contract_class, sierra_program_length, 100, sierra_version).unwrap() + ClassInfo::new(&contract_class, sierra_program_length, 100, sierra_version).unwrap() } @@ -417,15 +383,11 @@ pub fn emit_n_events_tx( felt!(0_u32), // data length. ]; let calldata = create_calldata(contract_address, "test_emit_events", &entry_point_args); - let tx = executable_invoke_tx(invoke_tx_args! { let tx = executable_invoke_tx(invoke_tx_args! { sender_address: account_contract, calldata, nonce }); - AccountTransaction::new_for_sequencing(tx) - }); - AccountTransaction::new_for_sequencing(tx) } diff --git a/crates/blockifier/src/transaction/transaction_execution.rs b/crates/blockifier/src/transaction/transaction_execution.rs index ec48ecedf5..19f2675867 100644 --- a/crates/blockifier/src/transaction/transaction_execution.rs +++ b/crates/blockifier/src/transaction/transaction_execution.rs @@ -23,10 +23,6 @@ use crate::transaction::account_transaction::{ AccountTransaction, ExecutionFlags as AccountExecutionFlags, }; -use crate::transaction::account_transaction::{ - AccountTransaction, - ExecutionFlags as AccountExecutionFlags, -}; use crate::transaction::errors::TransactionFeeError; use crate::transaction::objects::{ TransactionExecutionInfo, @@ -83,7 +79,6 @@ impl Transaction { paid_fee_on_l1: Option, deployed_contract_address: Option, execution_flags: AccountExecutionFlags, - execution_flags: AccountExecutionFlags, ) -> TransactionExecutionResult { let executable_tx = match tx { StarknetApiTransaction::L1Handler(l1_handler) => { @@ -126,7 +121,6 @@ impl Transaction { _ => unimplemented!(), }; Ok(AccountTransaction { tx: executable_tx, execution_flags }.into()) - Ok(AccountTransaction { tx: executable_tx, execution_flags }.into()) } } @@ -145,7 +139,6 @@ impl ExecutableTransaction for L1HandlerTransaction { state: &mut TransactionalState<'_, U>, block_context: &BlockContext, _concurrency_mode: bool, - _concurrency_mode: bool, ) -> TransactionExecutionResult { let tx_context = Arc::new(block_context.to_tx_context(self)); let limit_steps_by_resources = false; @@ -194,7 +187,6 @@ impl ExecutableTransaction for Transaction { state: &mut TransactionalState<'_, U>, block_context: &BlockContext, concurrency_mode: bool, - concurrency_mode: bool, ) -> TransactionExecutionResult { // TODO(Yoni, 1/8/2024): consider unimplementing the ExecutableTransaction trait for inner // types, since now running Transaction::execute_raw is not identical to @@ -202,10 +194,8 @@ impl ExecutableTransaction for Transaction { let tx_execution_info = match self { Self::Account(account_tx) => { account_tx.execute_raw(state, block_context, concurrency_mode)? - account_tx.execute_raw(state, block_context, concurrency_mode)? } Self::L1Handler(tx) => tx.execute_raw(state, block_context, concurrency_mode)?, - Self::L1Handler(tx) => tx.execute_raw(state, block_context, concurrency_mode)?, }; // Check if the transaction is too large to fit any block. diff --git a/crates/blockifier/src/transaction/transactions_test.rs b/crates/blockifier/src/transaction/transactions_test.rs index 79e8ce44d9..479ba7104a 100644 --- a/crates/blockifier/src/transaction/transactions_test.rs +++ b/crates/blockifier/src/transaction/transactions_test.rs @@ -22,9 +22,6 @@ use starknet_api::state::StorageKey; use starknet_api::test_utils::declare::executable_declare_tx; use starknet_api::test_utils::deploy_account::executable_deploy_account_tx; use starknet_api::test_utils::invoke::{executable_invoke_tx, InvokeTxArgs}; -use starknet_api::test_utils::declare::executable_declare_tx; -use starknet_api::test_utils::deploy_account::executable_deploy_account_tx; -use starknet_api::test_utils::invoke::{executable_invoke_tx, InvokeTxArgs}; use starknet_api::test_utils::NonceManager; use starknet_api::transaction::fields::Resource::{L1DataGas, L1Gas, L2Gas}; use starknet_api::transaction::fields::{ diff --git a/crates/blockifier/src/versioned_constants.rs b/crates/blockifier/src/versioned_constants.rs index e1a9c65b5e..6a333c6815 100644 --- a/crates/blockifier/src/versioned_constants.rs +++ b/crates/blockifier/src/versioned_constants.rs @@ -179,13 +179,11 @@ pub struct VersionedConstants { pub tx_event_limits: EventLimits, pub invoke_tx_max_n_steps: u32, pub execute_max_sierra_gas: GasAmount, - pub execute_max_sierra_gas: GasAmount, pub deprecated_l2_resource_gas_costs: ArchivalDataGasCosts, pub archival_data_gas_costs: ArchivalDataGasCosts, pub max_recursion_depth: usize, pub validate_max_n_steps: u32, pub validate_max_sierra_gas: GasAmount, - pub validate_max_sierra_gas: GasAmount, pub min_compiler_version_for_sierra_gas: CompilerVersion, // BACKWARD COMPATIBILITY: If true, the segment_arena builtin instance counter will be // multiplied by 3. This offsets a bug in the old vm where the counter counted the number of @@ -196,7 +194,6 @@ pub struct VersionedConstants { pub disable_cairo0_redeclaration: bool, pub enable_stateful_compression: bool, pub comprehensive_state_diff: bool, - pub comprehensive_state_diff: bool, pub ignore_inner_event_resources: bool, // Compiler settings. @@ -230,20 +227,16 @@ impl VersionedConstants { /// Converts from L1 gas price to L2 gas price with **upward rounding**, based on the /// conversion of a Cairo step from Sierra gas to L1 gas. pub fn convert_l1_to_l2_gas_price_round_up(&self, l1_gas_price: GasPrice) -> GasPrice { - (*(resource_cost_to_u128_ratio(self.sierra_gas_in_l1_gas_amount()) * l1_gas_price.0) (*(resource_cost_to_u128_ratio(self.sierra_gas_in_l1_gas_amount()) * l1_gas_price.0) .ceil() .numer()) .into() } - /// Converts L1 gas amount to Sierra (L2) gas amount with **upward rounding**. - pub fn l1_gas_to_sierra_gas_amount_round_up(&self, l1_gas_amount: GasAmount) -> GasAmount { /// Converts L1 gas amount to Sierra (L2) gas amount with **upward rounding**. pub fn l1_gas_to_sierra_gas_amount_round_up(&self, l1_gas_amount: GasAmount) -> GasAmount { // The amount ratio is the inverse of the price ratio. (*(self.sierra_gas_in_l1_gas_amount().inv() * l1_gas_amount.0).ceil().numer()).into() - (*(self.sierra_gas_in_l1_gas_amount().inv() * l1_gas_amount.0).ceil().numer()).into() } /// Converts Sierra (L2) gas amount to L1 gas amount with **upward rounding**. @@ -336,8 +329,8 @@ impl VersionedConstants { Self { vm_resource_fee_cost, archival_data_gas_costs, ..latest } } - // TODO(Arni): Consider replacing each call to this function with `latest_with_overrides`, and - // squashing the functions together. + // TODO(Arni): Consider replacing each call to this function with `latest_with_overrides`, + // and squashing the functions together. /// Returns the latest versioned constants, applying the given overrides. pub fn get_versioned_constants( versioned_constants_overrides: VersionedConstantsOverrides, @@ -385,7 +378,8 @@ impl VersionedConstants { builtin_cost * u64_from_usize(*amount) }) .sum(); - // The minimum total cost is `syscall_base_gas_cost`, which is pre-charged by the compiler. + // The minimum total cost is `syscall_base_gas_cost`, which is pre-charged by the + // compiler. std::cmp::max( n_steps * gas_costs.base.step_gas_cost + n_memory_holes * gas_costs.base.memory_hole_gas_cost @@ -659,7 +653,6 @@ pub struct BaseGasCosts { pub range_check_gas_cost: u64, // Priced builtins. pub keccak_builtin_gas_cost: u64, - pub keccak_builtin_gas_cost: u64, pub pedersen_gas_cost: u64, pub bitwise_builtin_gas_cost: u64, pub ecop_gas_cost: u64, diff --git a/crates/blockifier/tests/feature_contracts_compatibility_test.rs b/crates/blockifier/tests/feature_contracts_compatibility_test.rs index cbc43b868c..c8ec6f41eb 100644 --- a/crates/blockifier/tests/feature_contracts_compatibility_test.rs +++ b/crates/blockifier/tests/feature_contracts_compatibility_test.rs @@ -53,40 +53,6 @@ pub struct Cairo1FeatureContractMetadata { pub sierra_path: String, } -pub enum FeatureContractMetadata { - Cairo0(Cairo0FeatureContractMetadata), - Cairo1(Cairo1FeatureContractMetadata), -} - -impl FeatureContractMetadata { - pub fn compiled_path(&self) -> String { - match self { - FeatureContractMetadata::Cairo0(data) => data.compiled_path.clone(), - FeatureContractMetadata::Cairo1(data) => data.compiled_path.clone(), - } - } - - pub fn sierra_path(&self) -> String { - match self { - FeatureContractMetadata::Cairo0(_) => panic!("No sierra path for Cairo0 contracts."), - FeatureContractMetadata::Cairo1(data) => data.sierra_path.clone(), - } - } -} - -pub struct Cairo0FeatureContractMetadata { - pub source_path: String, - pub base_filename: String, - pub compiled_path: String, -} - -pub struct Cairo1FeatureContractMetadata { - pub source_path: String, - pub base_filename: String, - pub compiled_path: String, - pub sierra_path: String, -} - // To fix Cairo0 feature contracts, first enter a python venv and install the requirements: // ``` // python -m venv tmp_venv diff --git a/crates/papyrus_p2p_sync/src/client/header_test.rs b/crates/papyrus_p2p_sync/src/client/header_test.rs index b9d44e7231..ff2f660127 100644 --- a/crates/papyrus_p2p_sync/src/client/header_test.rs +++ b/crates/papyrus_p2p_sync/src/client/header_test.rs @@ -11,14 +11,12 @@ use papyrus_protobuf::sync::{ }; use papyrus_storage::header::HeaderStorageReader; use papyrus_test_utils::get_rng; -use papyrus_test_utils::get_rng; use starknet_api::block::{BlockHeader, BlockHeaderWithoutHash, BlockNumber}; use tokio::time::timeout; use super::test_utils::{ create_block_hashes_and_signatures, random_header, - random_header, run_test, setup, wait_for_marker, diff --git a/crates/papyrus_p2p_sync/src/client/test_utils.rs b/crates/papyrus_p2p_sync/src/client/test_utils.rs index a137311ed7..006ce510f9 100644 --- a/crates/papyrus_p2p_sync/src/client/test_utils.rs +++ b/crates/papyrus_p2p_sync/src/client/test_utils.rs @@ -37,16 +37,6 @@ use starknet_api::block::{ BlockNumber, BlockSignature, }; -use papyrus_test_utils::GetTestInstance; -use rand::{Rng, RngCore}; -use rand_chacha::ChaCha8Rng; -use starknet_api::block::{ - BlockHash, - BlockHeader, - BlockHeaderWithoutHash, - BlockNumber, - BlockSignature, -}; use starknet_api::core::ClassHash; use starknet_api::crypto::utils::Signature; use starknet_api::hash::StarkHash; diff --git a/crates/sequencing/papyrus_consensus/src/config.rs b/crates/sequencing/papyrus_consensus/src/config.rs index ca1796b1a2..e6016cea60 100644 --- a/crates/sequencing/papyrus_consensus/src/config.rs +++ b/crates/sequencing/papyrus_consensus/src/config.rs @@ -15,7 +15,6 @@ use papyrus_network::NetworkConfig; use serde::{Deserialize, Serialize}; use starknet_api::block::BlockNumber; use starknet_api::core::ChainId; -use starknet_api::core::ChainId; use super::types::ValidatorId; use crate::types::DEFAULT_VALIDATOR_ID; diff --git a/crates/sequencing/papyrus_consensus/src/manager.rs b/crates/sequencing/papyrus_consensus/src/manager.rs index add7d36d41..880d71f877 100644 --- a/crates/sequencing/papyrus_consensus/src/manager.rs +++ b/crates/sequencing/papyrus_consensus/src/manager.rs @@ -166,18 +166,6 @@ impl MultiHeightManager { let proposal_init: ProposalInit = first_part.try_into()?; self.handle_proposal(context, height, &mut shc, proposal_init, content_receiver).await? }, - Some(mut content_receiver) = proposal_receiver.next() => { - // Get the first message to verify the init was sent. - // TODO(guyn): add a timeout and panic, since StreamHandler should only send once - // the first message (message_id=0) has arrived. - let Some(first_part) = content_receiver.next().await else { - return Err(ConsensusError::InternalNetworkError( - "Proposal receiver closed".to_string(), - )); - }; - let proposal_init: ProposalInit = first_part.try_into()?; - self.handle_proposal(context, height, &mut shc, proposal_init, content_receiver).await? - }, Some(shc_event) = shc_events.next() => { shc.handle_event(context, shc_event).await? }, @@ -307,26 +295,6 @@ impl MultiHeightManager { } } - // Checks if a cached proposal already exists - // - returns the proposal if it exists and removes it from the cache. - // - returns None if no proposal exists. - // - cleans up any proposals from earlier heights. - fn get_current_proposal( - &mut self, - height: BlockNumber, - ) -> Option<(ProposalInit, mpsc::Receiver)> { - loop { - let entry = self.cached_proposals.first_entry()?; - match entry.key().cmp(&height.0) { - std::cmp::Ordering::Greater => return None, - std::cmp::Ordering::Equal => return Some(entry.remove()), - std::cmp::Ordering::Less => { - entry.remove(); - } - } - } - } - // Filters the cached messages: // - returns all of the current height messages. // - drops messages from earlier heights. diff --git a/crates/sequencing/papyrus_consensus/src/manager_test.rs b/crates/sequencing/papyrus_consensus/src/manager_test.rs index d9046f89c2..7d16c370db 100644 --- a/crates/sequencing/papyrus_consensus/src/manager_test.rs +++ b/crates/sequencing/papyrus_consensus/src/manager_test.rs @@ -20,13 +20,6 @@ use papyrus_protobuf::consensus::{ ProposalPart, Vote, }; -use papyrus_protobuf::consensus::{ - ConsensusMessage, - ProposalFin, - ProposalInit, - ProposalPart, - Vote, -}; use papyrus_test_utils::{get_rng, GetTestInstance}; use starknet_api::block::{BlockHash, BlockNumber}; use starknet_types_core::felt::Felt; diff --git a/crates/sequencing/papyrus_consensus_orchestrator/src/sequencer_consensus_context_test.rs b/crates/sequencing/papyrus_consensus_orchestrator/src/sequencer_consensus_context_test.rs index 141271a44e..085cfed39d 100644 --- a/crates/sequencing/papyrus_consensus_orchestrator/src/sequencer_consensus_context_test.rs +++ b/crates/sequencing/papyrus_consensus_orchestrator/src/sequencer_consensus_context_test.rs @@ -21,14 +21,6 @@ use papyrus_protobuf::consensus::{ StreamMessage, TransactionBatch, }; -use papyrus_protobuf::consensus::{ - ConsensusMessage, - ProposalFin, - ProposalInit, - ProposalPart, - StreamMessage, - TransactionBatch, -}; use starknet_api::block::{BlockHash, BlockNumber}; use starknet_api::core::StateDiffCommitment; use starknet_api::executable_transaction::Transaction as ExecutableTransaction;