From da4700411e9802929cf51855ae5038e9c2ee2b5d Mon Sep 17 00:00:00 2001 From: Marius van der Wijden Date: Mon, 9 Mar 2026 12:08:07 +0100 Subject: [PATCH] core/vm: more fixes from ai --- build/checksums.txt | 6 +++--- core/vm/instructions.go | 12 ++++++++++++ 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/build/checksums.txt b/build/checksums.txt index 26e9eb2678..5efe9dd96f 100644 --- a/build/checksums.txt +++ b/build/checksums.txt @@ -5,10 +5,10 @@ # https://github.com/ethereum/execution-spec-tests/releases/download/v5.1.0 a3192784375acec7eaec492799d5c5d0c47a2909a3cc40178898e4ecd20cc416 fixtures_develop.tar.gz -# version:spec-tests-bal v5.2.0 +# version:spec-tests-bal v5.3.0 # https://github.com/ethereum/execution-spec-tests/releases -# https://github.com/ethereum/execution-spec-tests/releases/download/bal%40v5.2.0 -a0dc6f4070da4dab4831f4e8fddfc087c10a5120a6a683257e963d9c6713378a fixtures_bal.tar.gz +# https://github.com/ethereum/execution-spec-tests/releases/download/bal%40v5.3.0 +a1840f2e74d7d53f9f36f969bfd280407829b21e85bea206ba907453fdc47ac4 fixtures_bal.tar.gz # version:golang 1.25.7 # https://go.dev/dl/ diff --git a/core/vm/instructions.go b/core/vm/instructions.go index 0bc126377e..da9d6ff518 100644 --- a/core/vm/instructions.go +++ b/core/vm/instructions.go @@ -703,6 +703,12 @@ func opCreate(pc *uint64, evm *EVM, scope *ScopeContext) ([]byte, error) { returnGas.RevertedStateGasSpill = 0 returnGas.StateGas = stateGas } + // On address collision, child's regular gas is consumed (not returned). + // Track as RevertedStateGasSpill so block 2D accounting is unaffected. + if evm.chainRules.IsAmsterdam && errors.Is(suberr, ErrContractAddressCollision) { + returnGas.RevertedStateGasSpill += returnGas.RegularGas + returnGas.RegularGas = 0 + } scope.Contract.RefundGas(returnGas, evm.Config.Tracer, tracing.GasChangeCallLeftOverRefunded) if suberr == ErrExecutionReverted { @@ -763,6 +769,12 @@ func opCreate2(pc *uint64, evm *EVM, scope *ScopeContext) ([]byte, error) { returnGas.RevertedStateGasSpill = 0 returnGas.StateGas = stateGas } + // On address collision, child's regular gas is consumed (not returned). + // Track as RevertedStateGasSpill so block 2D accounting is unaffected. + if evm.chainRules.IsAmsterdam && errors.Is(suberr, ErrContractAddressCollision) { + returnGas.RevertedStateGasSpill += returnGas.RegularGas + returnGas.RegularGas = 0 + } scope.Contract.RefundGas(returnGas, evm.Config.Tracer, tracing.GasChangeCallLeftOverRefunded) if suberr == ErrExecutionReverted {