@@ -2,6 +2,7 @@ use crate::error::ExecutionError;
2
2
use crate :: juno_state_reader:: JunoStateReader ;
3
3
use blockifier:: execution:: contract_class:: TrackedResource ;
4
4
use blockifier:: state:: state_api:: { StateReader , StateResult , UpdatableState } ;
5
+ use blockifier:: transaction:: account_transaction:: ExecutionFlags ;
5
6
use blockifier:: transaction:: objects:: HasRelatedFeeType ;
6
7
use blockifier:: transaction:: transaction_execution:: Transaction ;
7
8
use blockifier:: transaction:: transactions:: ExecutableTransaction ;
@@ -218,7 +219,7 @@ where
218
219
// If the computed gas limit exceeds the initial limit, revert the transaction.
219
220
// The L2 gas limit is set to zero to prevent the transaction execution from succeeding
220
221
// in the case where the user defined gas limit is less than the required gas limit
221
- if l2_gas_limit > initial_gas_limit {
222
+ if get_execution_flags ( transaction ) . charge_fee && l2_gas_limit > initial_gas_limit {
222
223
tx_state. abort ( ) ;
223
224
set_l2_gas_limit ( transaction, GasAmount :: ZERO ) ?;
224
225
return execute_transaction ( & transaction, state, block_context, error_on_revert) ;
@@ -232,6 +233,13 @@ where
232
233
Ok ( exec_info)
233
234
}
234
235
236
+ fn get_execution_flags ( tx : & Transaction ) -> ExecutionFlags {
237
+ match tx {
238
+ Transaction :: Account ( account_transaction) => account_transaction. execution_flags . clone ( ) ,
239
+ Transaction :: L1Handler ( _) => Default :: default ( ) ,
240
+ }
241
+ }
242
+
235
243
fn calculate_midpoint ( a : GasAmount , b : GasAmount ) -> GasAmount {
236
244
let GasAmount ( a) = a;
237
245
let GasAmount ( b) = b;
0 commit comments