From fcd9685c879d2a54dbb4258934bf26f1b354d7cd Mon Sep 17 00:00:00 2001 From: Daniel Liu <139250065@qq.com> Date: Mon, 19 Jan 2026 16:34:58 +0800 Subject: [PATCH] core/vm: return early in selfdestruct gas calculation #33450 (#1959) --- core/vm/operations_acl.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/vm/operations_acl.go b/core/vm/operations_acl.go index 777c9ee9da..96fcada0d4 100644 --- a/core/vm/operations_acl.go +++ b/core/vm/operations_acl.go @@ -237,6 +237,10 @@ func makeSelfdestructGasFn(refundsEnabled bool) gasFunc { // If the caller cannot afford the cost, this change will be rolled back evm.StateDB.AddAddressToAccessList(address) gas = params.ColdAccountAccessCostEIP2929 + + if contract.Gas < gas { + return gas, nil + } } // if empty and transfers value if evm.StateDB.Empty(address) && evm.StateDB.GetBalance(contract.Address()).Sign() != 0 {