core: fix floor base costs

This commit is contained in:
MariusVanDerWijden 2026-07-02 10:02:51 +02:00
parent 5b92de2dc5
commit 22470f9617
No known key found for this signature in database

View file

@ -242,12 +242,10 @@ func FloorDataGas(rules params.Rules, from common.Address, to *common.Address, v
tokenCost = params.TxCostFloorPerToken
}
// The floor is anchored to the transaction base cost. Under EIP-2780 that
// base is the per-resource decomposition (the same one used by the intrinsic
// gas), so the floor never undercuts the transaction's own base.
// The floor is anchored to the transaction base cost.
floorBase := params.TxGas
if rules.IsAmsterdam {
floorBase = intrinsicBaseGasEIP2780(from, to, value)
floorBase = params.TxBaseCost2780
}
// Check for overflow
if (math.MaxUint64-floorBase)/tokenCost < tokens {