@@ -115,30 +115,32 @@ where
115
115
let mut additional_cost = U256 :: ZERO ;
116
116
117
117
// The L1-cost fee is only computed for Optimism non-deposit transactions.
118
- if !is_deposit && !ctx . cfg ( ) . is_fee_charge_disabled ( ) {
118
+ if !is_deposit {
119
119
// L1 block info is stored in the context for later use.
120
120
// and it will be reloaded from the database if it is not for the current block.
121
121
if ctx. chain ( ) . l2_block != block_number {
122
122
* ctx. chain_mut ( ) = L1BlockInfo :: try_fetch ( ctx. db_mut ( ) , block_number, spec) ?;
123
123
}
124
124
125
- // account for additional cost of l1 fee and operator fee
126
- let enveloped_tx = ctx
127
- . tx ( )
128
- . enveloped_tx ( )
129
- . expect ( "all not deposit tx have enveloped tx" )
130
- . clone ( ) ;
131
-
132
- // compute L1 cost
133
- additional_cost = ctx. chain_mut ( ) . calculate_tx_l1_cost ( & enveloped_tx, spec) ;
134
-
135
- // compute operator fee
136
- if spec. is_enabled_in ( OpSpecId :: ISTHMUS ) {
137
- let gas_limit = U256 :: from ( ctx. tx ( ) . gas_limit ( ) ) ;
138
- let operator_fee_charge =
139
- ctx. chain ( )
140
- . operator_fee_charge ( & enveloped_tx, gas_limit, spec) ;
141
- additional_cost = additional_cost. saturating_add ( operator_fee_charge) ;
125
+ if !ctx. cfg ( ) . is_fee_charge_disabled ( ) {
126
+ // account for additional cost of l1 fee and operator fee
127
+ let enveloped_tx = ctx
128
+ . tx ( )
129
+ . enveloped_tx ( )
130
+ . expect ( "all not deposit tx have enveloped tx" )
131
+ . clone ( ) ;
132
+
133
+ // compute L1 cost
134
+ additional_cost = ctx. chain_mut ( ) . calculate_tx_l1_cost ( & enveloped_tx, spec) ;
135
+
136
+ // compute operator fee
137
+ if spec. is_enabled_in ( OpSpecId :: ISTHMUS ) {
138
+ let gas_limit = U256 :: from ( ctx. tx ( ) . gas_limit ( ) ) ;
139
+ let operator_fee_charge =
140
+ ctx. chain ( )
141
+ . operator_fee_charge ( & enveloped_tx, gas_limit, spec) ;
142
+ additional_cost = additional_cost. saturating_add ( operator_fee_charge) ;
143
+ }
142
144
}
143
145
}
144
146
@@ -289,7 +291,9 @@ where
289
291
) -> Result < ( ) , Self :: Error > {
290
292
let mut additional_refund = U256 :: ZERO ;
291
293
292
- if evm. ctx ( ) . tx ( ) . tx_type ( ) != DEPOSIT_TRANSACTION_TYPE {
294
+ if evm. ctx ( ) . tx ( ) . tx_type ( ) != DEPOSIT_TRANSACTION_TYPE
295
+ && !evm. ctx ( ) . cfg ( ) . is_fee_charge_disabled ( )
296
+ {
293
297
let spec = evm. ctx ( ) . cfg ( ) . spec ( ) ;
294
298
additional_refund = evm
295
299
. ctx ( )
0 commit comments