From 6c1c599804dee3089ff3ceaf3ceb3c8540c71a1d Mon Sep 17 00:00:00 2001 From: MariusVanDerWijden Date: Thu, 30 Apr 2026 13:35:24 +0200 Subject: [PATCH] core: fix collisions --- core/vm/evm.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/core/vm/evm.go b/core/vm/evm.go index e733e79793..9330d72aa5 100644 --- a/core/vm/evm.go +++ b/core/vm/evm.go @@ -544,10 +544,12 @@ func (evm *EVM) create(caller common.Address, code []byte, gas GasBudget, value if evm.Config.Tracer != nil && evm.Config.Tracer.OnGasChange != nil { evm.Config.Tracer.OnGasChange(gas.RegularGas, 0, tracing.GasChangeCallFailedExecution) } - // Record all burned gas - burned := gas.RegularGas + // Drain the entire budget on collision gas.Exhaust() - return nil, common.Address{}, gas, GasUsed{RegularGas: burned}, ErrContractAddressCollision + if evm.chainRules.IsAmsterdam { + gas.StateGas = 0 + } + return nil, common.Address{}, gas, GasUsed{}, ErrContractAddressCollision } // Create a new account on the state only if the object was not present. // It might be possible the contract code is deployed to a pre-existent