diff --git a/crates/blockifier/resources/versioned_constants_0_13_0.json b/crates/blockifier/resources/versioned_constants_0_13_0.json index fd98c3ef07..ca4b3ff356 100644 --- a/crates/blockifier/resources/versioned_constants_0_13_0.json +++ b/crates/blockifier/resources/versioned_constants_0_13_0.json @@ -95,28 +95,24 @@ "syscall_base_gas_cost": { "step_gas_cost": 100 }, - "entry_point_gas_cost": { - "entry_point_initial_budget": 1, - "step_gas_cost": 500 - }, "fee_transfer_gas_cost": { - "entry_point_gas_cost": 1, - "step_gas_cost": 100 + "entry_point_initial_budget": 1, + "step_gas_cost": 600 }, "transaction_gas_cost": { - "entry_point_gas_cost": 2, + "entry_point_initial_budget": 2, "fee_transfer_gas_cost": 1, - "step_gas_cost": 100 + "step_gas_cost": 1100 }, "call_contract_gas_cost": { "syscall_base_gas_cost": 1, - "step_gas_cost": 10, - "entry_point_gas_cost": 1 + "step_gas_cost": 510, + "entry_point_initial_budget": 1 }, "deploy_gas_cost": { "syscall_base_gas_cost": 1, - "step_gas_cost": 200, - "entry_point_gas_cost": 1 + "step_gas_cost": 700, + "entry_point_initial_budget": 1 }, "get_block_hash_gas_cost": { "syscall_base_gas_cost": 1, @@ -618,4 +614,4 @@ 1000 ] } -} +} \ No newline at end of file diff --git a/crates/blockifier/resources/versioned_constants_0_13_1.json b/crates/blockifier/resources/versioned_constants_0_13_1.json index 2b634be904..e858521cd1 100644 --- a/crates/blockifier/resources/versioned_constants_0_13_1.json +++ b/crates/blockifier/resources/versioned_constants_0_13_1.json @@ -95,28 +95,24 @@ "syscall_base_gas_cost": { "step_gas_cost": 100 }, - "entry_point_gas_cost": { - "entry_point_initial_budget": 1, - "step_gas_cost": 500 - }, "fee_transfer_gas_cost": { - "entry_point_gas_cost": 1, - "step_gas_cost": 100 + "entry_point_initial_budget": 1, + "step_gas_cost": 600 }, "transaction_gas_cost": { - "entry_point_gas_cost": 2, + "entry_point_initial_budget": 2, "fee_transfer_gas_cost": 1, - "step_gas_cost": 100 + "step_gas_cost": 1100 }, "call_contract_gas_cost": { "syscall_base_gas_cost": 1, - "step_gas_cost": 10, - "entry_point_gas_cost": 1 + "step_gas_cost": 510, + "entry_point_initial_budget": 1 }, "deploy_gas_cost": { "syscall_base_gas_cost": 1, - "step_gas_cost": 200, - "entry_point_gas_cost": 1 + "step_gas_cost": 700, + "entry_point_initial_budget": 1 }, "get_block_hash_gas_cost": { "syscall_base_gas_cost": 1, 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 17d83179e5..0d139c39df 100644 --- a/crates/blockifier/resources/versioned_constants_0_13_1_1.json +++ b/crates/blockifier/resources/versioned_constants_0_13_1_1.json @@ -95,28 +95,24 @@ "syscall_base_gas_cost": { "step_gas_cost": 100 }, - "entry_point_gas_cost": { - "entry_point_initial_budget": 1, - "step_gas_cost": 500 - }, "fee_transfer_gas_cost": { - "entry_point_gas_cost": 1, - "step_gas_cost": 100 + "entry_point_initial_budget": 1, + "step_gas_cost": 600 }, "transaction_gas_cost": { - "entry_point_gas_cost": 2, + "entry_point_initial_budget": 2, "fee_transfer_gas_cost": 1, - "step_gas_cost": 100 + "step_gas_cost": 1100 }, "call_contract_gas_cost": { "syscall_base_gas_cost": 1, - "step_gas_cost": 10, - "entry_point_gas_cost": 1 + "step_gas_cost": 510, + "entry_point_initial_budget": 1 }, "deploy_gas_cost": { "syscall_base_gas_cost": 1, - "step_gas_cost": 200, - "entry_point_gas_cost": 1 + "step_gas_cost": 700, + "entry_point_initial_budget": 1 }, "get_block_hash_gas_cost": { "syscall_base_gas_cost": 1, diff --git a/crates/blockifier/resources/versioned_constants_0_13_2.json b/crates/blockifier/resources/versioned_constants_0_13_2.json index edec011294..9e34c5d31d 100644 --- a/crates/blockifier/resources/versioned_constants_0_13_2.json +++ b/crates/blockifier/resources/versioned_constants_0_13_2.json @@ -59,25 +59,21 @@ "segment_arena_cells": false, "os_constants": { "call_contract_gas_cost": { - "entry_point_gas_cost": 1, - "step_gas_cost": 10, + "entry_point_initial_budget": 1, + "step_gas_cost": 510, "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": 200, + "entry_point_initial_budget": 1, + "step_gas_cost": 700, "syscall_base_gas_cost": 1 }, "emit_event_gas_cost": { "step_gas_cost": 10, "syscall_base_gas_cost": 1 }, - "entry_point_gas_cost": { - "entry_point_initial_budget": 1, - "step_gas_cost": 500 - }, "entry_point_initial_budget": { "step_gas_cost": 100 }, @@ -92,8 +88,8 @@ "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 + "entry_point_initial_budget": 1, + "step_gas_cost": 600 }, "get_block_hash_gas_cost": { "step_gas_cost": 50, @@ -213,9 +209,9 @@ "step_gas_cost": 100 }, "transaction_gas_cost": { - "entry_point_gas_cost": 2, + "entry_point_initial_budget": 2, "fee_transfer_gas_cost": 1, - "step_gas_cost": 100 + "step_gas_cost": 1100 }, "transfer_entry_point_selector": "0x83afd3f4caedc6eebf44246fe54e38c95e3179a5ec9ea81740eca5b482d12e", "validate_declare_entry_point_selector": "0x289da278a8dc833409cabfdad1581e8e7d40e42dcaed693fa4008dcdb4963b3", 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 aa76c68c45..4e6dac1015 100644 --- a/crates/blockifier/resources/versioned_constants_0_13_2_1.json +++ b/crates/blockifier/resources/versioned_constants_0_13_2_1.json @@ -59,25 +59,21 @@ "segment_arena_cells": false, "os_constants": { "call_contract_gas_cost": { - "entry_point_gas_cost": 1, - "step_gas_cost": 10, + "entry_point_initial_budget": 1, + "step_gas_cost": 510, "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": 200, + "entry_point_initial_budget": 1, + "step_gas_cost": 700, "syscall_base_gas_cost": 1 }, "emit_event_gas_cost": { "step_gas_cost": 10, "syscall_base_gas_cost": 1 }, - "entry_point_gas_cost": { - "entry_point_initial_budget": 1, - "step_gas_cost": 500 - }, "entry_point_initial_budget": { "step_gas_cost": 100 }, @@ -92,8 +88,8 @@ "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 + "entry_point_initial_budget": 1, + "step_gas_cost": 600 }, "get_block_hash_gas_cost": { "step_gas_cost": 50, @@ -213,9 +209,9 @@ "step_gas_cost": 100 }, "transaction_gas_cost": { - "entry_point_gas_cost": 2, + "entry_point_initial_budget": 2, "fee_transfer_gas_cost": 1, - "step_gas_cost": 100 + "step_gas_cost": 1100 }, "transfer_entry_point_selector": "0x83afd3f4caedc6eebf44246fe54e38c95e3179a5ec9ea81740eca5b482d12e", "validate_declare_entry_point_selector": "0x289da278a8dc833409cabfdad1581e8e7d40e42dcaed693fa4008dcdb4963b3", diff --git a/crates/blockifier/resources/versioned_constants_0_13_3.json b/crates/blockifier/resources/versioned_constants_0_13_3.json index aa76c68c45..4e6dac1015 100644 --- a/crates/blockifier/resources/versioned_constants_0_13_3.json +++ b/crates/blockifier/resources/versioned_constants_0_13_3.json @@ -59,25 +59,21 @@ "segment_arena_cells": false, "os_constants": { "call_contract_gas_cost": { - "entry_point_gas_cost": 1, - "step_gas_cost": 10, + "entry_point_initial_budget": 1, + "step_gas_cost": 510, "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": 200, + "entry_point_initial_budget": 1, + "step_gas_cost": 700, "syscall_base_gas_cost": 1 }, "emit_event_gas_cost": { "step_gas_cost": 10, "syscall_base_gas_cost": 1 }, - "entry_point_gas_cost": { - "entry_point_initial_budget": 1, - "step_gas_cost": 500 - }, "entry_point_initial_budget": { "step_gas_cost": 100 }, @@ -92,8 +88,8 @@ "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 + "entry_point_initial_budget": 1, + "step_gas_cost": 600 }, "get_block_hash_gas_cost": { "step_gas_cost": 50, @@ -213,9 +209,9 @@ "step_gas_cost": 100 }, "transaction_gas_cost": { - "entry_point_gas_cost": 2, + "entry_point_initial_budget": 2, "fee_transfer_gas_cost": 1, - "step_gas_cost": 100 + "step_gas_cost": 1100 }, "transfer_entry_point_selector": "0x83afd3f4caedc6eebf44246fe54e38c95e3179a5ec9ea81740eca5b482d12e", "validate_declare_entry_point_selector": "0x289da278a8dc833409cabfdad1581e8e7d40e42dcaed693fa4008dcdb4963b3", diff --git a/crates/blockifier/resources/versioned_constants_0_13_4.json b/crates/blockifier/resources/versioned_constants_0_13_4.json index 3993b8567d..608541b977 100644 --- a/crates/blockifier/resources/versioned_constants_0_13_4.json +++ b/crates/blockifier/resources/versioned_constants_0_13_4.json @@ -59,14 +59,14 @@ "segment_arena_cells": false, "os_constants": { "call_contract_gas_cost": { - "entry_point_gas_cost": 1, + "entry_point_initial_budget": 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, + "entry_point_initial_budget": 1, "step_gas_cost": 1128, "range_check_gas_cost": 18, "pedersen_gas_cost": 7 @@ -75,10 +75,6 @@ "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 }, @@ -115,7 +111,7 @@ "l1_data_gas_index": 2, "l2_gas_index": 1, "library_call_gas_cost": { - "entry_point_gas_cost": 1, + "entry_point_initial_budget": 1, "step_gas_cost": 836, "range_check_gas_cost": 15 }, diff --git a/crates/blockifier/src/execution/syscalls/syscall_tests/constants.rs b/crates/blockifier/src/execution/syscalls/syscall_tests/constants.rs index daf276fd65..ff3ebd021d 100644 --- a/crates/blockifier/src/execution/syscalls/syscall_tests/constants.rs +++ b/crates/blockifier/src/execution/syscalls/syscall_tests/constants.rs @@ -1,4 +1,4 @@ -pub const REQUIRED_GAS_CALL_CONTRACT_TEST: u64 = 170370; +pub const REQUIRED_GAS_CALL_CONTRACT_TEST: u64 = 120370; pub const REQUIRED_GAS_STORAGE_READ_WRITE_TEST: u64 = 16990; pub const REQUIRED_GAS_GET_CLASS_HASH_AT_TEST: u64 = 7830; -pub const REQUIRED_GAS_LIBRARY_CALL_TEST: u64 = 167970; +pub const REQUIRED_GAS_LIBRARY_CALL_TEST: u64 = 117970; diff --git a/crates/blockifier/src/execution/syscalls/syscall_tests/deploy.rs b/crates/blockifier/src/execution/syscalls/syscall_tests/deploy.rs index 8bf2807852..c358f92910 100644 --- a/crates/blockifier/src/execution/syscalls/syscall_tests/deploy.rs +++ b/crates/blockifier/src/execution/syscalls/syscall_tests/deploy.rs @@ -38,7 +38,7 @@ fn no_constructor(cairo_version: CairoVersion) { let deploy_call = &entry_point_call.execute_directly(&mut state).unwrap(); assert_eq!( deploy_call.execution, - CallExecution { retdata: retdata![], gas_consumed: 205200, ..CallExecution::default() } + CallExecution { retdata: retdata![], gas_consumed: 155200, ..CallExecution::default() } ); let deployed_contract_address = calculate_contract_address( @@ -119,7 +119,7 @@ fn with_constructor(cairo_version: CairoVersion) { let deploy_call = &entry_point_call.execute_directly(&mut state).unwrap(); assert_eq!( deploy_call.execution, - CallExecution { retdata: retdata![], gas_consumed: 214550, ..CallExecution::default() } + CallExecution { retdata: retdata![], gas_consumed: 164550, ..CallExecution::default() } ); let constructor_call = &deploy_call.inner_calls[0]; diff --git a/crates/blockifier/src/execution/syscalls/syscall_tests/library_call.rs b/crates/blockifier/src/execution/syscalls/syscall_tests/library_call.rs index 77be372a37..d70dc3d78f 100644 --- a/crates/blockifier/src/execution/syscalls/syscall_tests/library_call.rs +++ b/crates/blockifier/src/execution/syscalls/syscall_tests/library_call.rs @@ -92,7 +92,7 @@ fn test_library_call_assert_fails(cairo_version: CairoVersion) { // 'ENTRYPOINT_FAILED'. felt!("0x454e545259504f494e545f4641494c4544") ]), - gas_consumed: 150980, + gas_consumed: 100980, failed: true, ..Default::default() } @@ -132,7 +132,7 @@ fn test_nested_library_call(cairo_version: CairoVersion) { class_hash: Some(test_class_hash), code_address: None, call_type: CallType::Delegate, - initial_gas: 9998985960, + initial_gas: 9999085960, ..trivial_external_entry_point_new(test_contract) }; let library_entry_point = CallEntryPoint { @@ -147,12 +147,12 @@ fn test_nested_library_call(cairo_version: CairoVersion) { class_hash: Some(test_class_hash), code_address: None, call_type: CallType::Delegate, - initial_gas: 9999136940, + initial_gas: 9999186940, ..trivial_external_entry_point_new(test_contract) }; let storage_entry_point = CallEntryPoint { calldata: calldata![felt!(key), felt!(value)], - initial_gas: 9998834320, + initial_gas: 9998984320, ..nested_storage_entry_point }; @@ -242,7 +242,7 @@ fn test_nested_library_call(cairo_version: CairoVersion) { call: main_entry_point.clone(), execution: CallExecution { retdata: retdata![felt!(value)], - gas_consumed: 475110, + gas_consumed: 325110, ..CallExecution::default() }, charged_resources: main_call_resources, diff --git a/crates/blockifier/src/transaction/transactions_test.rs b/crates/blockifier/src/transaction/transactions_test.rs index 73c64c5d83..3178a80c93 100644 --- a/crates/blockifier/src/transaction/transactions_test.rs +++ b/crates/blockifier/src/transaction/transactions_test.rs @@ -433,7 +433,7 @@ fn add_kzg_da_resources_to_resources_mapping( }, validate_gas_consumed: 4740, // The gas consumption results from parsing the input // arguments. - execute_gas_consumed: 162080, + execute_gas_consumed: 112080, inner_call_initial_gas: versioned_constants_for_account_testing().default_initial_gas_cost(), }, CairoVersion::Cairo1)] diff --git a/crates/blockifier/src/versioned_constants.rs b/crates/blockifier/src/versioned_constants.rs index 5c41d18b4d..75ea2e9673 100644 --- a/crates/blockifier/src/versioned_constants.rs +++ b/crates/blockifier/src/versioned_constants.rs @@ -590,7 +590,6 @@ pub struct GasCosts { pub entry_point_initial_budget: u64, pub syscall_base_gas_cost: u64, // OS gas costs. - pub entry_point_gas_cost: u64, pub transaction_gas_cost: u64, // Syscall gas costs. pub call_contract_gas_cost: u64, diff --git a/crates/blockifier/src/versioned_constants_test.rs b/crates/blockifier/src/versioned_constants_test.rs index 320f38aa90..26953061ce 100644 --- a/crates/blockifier/src/versioned_constants_test.rs +++ b/crates/blockifier/src/versioned_constants_test.rs @@ -19,7 +19,7 @@ fn test_successful_gas_costs_parsing() { "entry_point_initial_budget": { "step_gas_cost": 3 }, - "entry_point_gas_cost": { + "transaction_gas_cost": { "entry_point_initial_budget": 4, "step_gas_cost": 5 }, @@ -33,7 +33,7 @@ fn test_successful_gas_costs_parsing() { assert_eq!(versioned_constants.os_constants.gas_costs.entry_point_initial_budget, 2 * 3); // step_gas_cost * 3. // entry_point_initial_budget * 4 + step_gas_cost * 5. - assert_eq!(versioned_constants.os_constants.gas_costs.entry_point_gas_cost, 6 * 4 + 2 * 5); + assert_eq!(versioned_constants.os_constants.gas_costs.transaction_gas_cost, 6 * 4 + 2 * 5); } /// Assert versioned constants overrides are used when provided.