@@ -287,6 +287,7 @@ func (st *StateTransition) TransitionDb() (*ExecutionResult, error) {
287
287
sender := vm .AccountRef (msg .From ())
288
288
homestead := st .evm .ChainConfig ().IsHomestead (st .evm .Context .BlockNumber )
289
289
istanbul := st .evm .ChainConfig ().IsIstanbul (st .evm .Context .BlockNumber )
290
+ london := st .evm .ChainConfig ().IsLondon (st .evm .Context .BlockNumber )
290
291
contractCreation := msg .To () == nil
291
292
292
293
// Check clauses 4-5, subtract intrinsic gas if everything is correct
@@ -319,15 +320,16 @@ func (st *StateTransition) TransitionDb() (*ExecutionResult, error) {
319
320
st .state .SetNonce (msg .From (), st .state .GetNonce (sender .Address ())+ 1 )
320
321
ret , st .gas , vmerr = st .evm .Call (sender , st .to (), st .data , st .gas , st .value )
321
322
}
322
- if ! st .evm .ChainConfig ().IsLondon (st .evm .Context .BlockNumber ) {
323
+
324
+ if ! london {
323
325
// Before EIP-3529: refunds were capped to gasUsed / 2
324
326
st .refundGas (params .RefundQuotient )
325
327
} else {
326
328
// After EIP-3529: refunds are capped to gasUsed / 5
327
329
st .refundGas (params .RefundQuotientEIP3529 )
328
330
}
329
331
effectiveTip := st .gasPrice
330
- if st . evm . ChainConfig (). IsLondon ( st . evm . Context . BlockNumber ) {
332
+ if london {
331
333
effectiveTip = cmath .BigMin (st .gasTipCap , new (big.Int ).Sub (st .gasFeeCap , st .evm .Context .BaseFee ))
332
334
}
333
335
st .state .AddBalance (st .evm .Context .Coinbase , new (big.Int ).Mul (new (big.Int ).SetUint64 (st .gasUsed ()), effectiveTip ))
0 commit comments