From b1cce15b8bdd95615913f065e8e2d66381b65018 Mon Sep 17 00:00:00 2001 From: Aner Ben Efraim Date: Sun, 22 Dec 2024 18:53:08 +0200 Subject: [PATCH] fix(blockifier): initial sierra gas max_execute in l1handler tx --- crates/blockifier/src/transaction/transaction_execution.rs | 3 ++- crates/blockifier/src/transaction/transactions_test.rs | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/crates/blockifier/src/transaction/transaction_execution.rs b/crates/blockifier/src/transaction/transaction_execution.rs index e6bf862ba9..ec2a7aeac6 100644 --- a/crates/blockifier/src/transaction/transaction_execution.rs +++ b/crates/blockifier/src/transaction/transaction_execution.rs @@ -144,7 +144,8 @@ impl ExecutableTransaction for L1HandlerTransaction { let limit_steps_by_resources = false; let mut context = EntryPointExecutionContext::new_invoke(tx_context.clone(), limit_steps_by_resources); - let mut remaining_gas = tx_context.initial_sierra_gas().0; + // The Sierra gas limit for L1 handler transaction is set to max_execute_sierra_gas. + let mut remaining_gas = context.mode_sierra_gas_limit().0; let execute_call_info = self.run_execute(state, &mut context, &mut remaining_gas)?; let l1_handler_payload_size = self.payload_size(); let TransactionReceipt { diff --git a/crates/blockifier/src/transaction/transactions_test.rs b/crates/blockifier/src/transaction/transactions_test.rs index a46db4032a..534cc6c049 100644 --- a/crates/blockifier/src/transaction/transactions_test.rs +++ b/crates/blockifier/src/transaction/transactions_test.rs @@ -2354,7 +2354,7 @@ fn test_l1_handler(#[values(false, true)] use_kzg_da: bool) { storage_address: contract_address, caller_address: ContractAddress::default(), call_type: CallType::Call, - initial_gas: initial_gas_amount_from_block_context(Some(block_context)).0, + initial_gas: block_context.versioned_constants.execute_max_sierra_gas.0, }, execution: CallExecution { retdata: Retdata(vec![value]),