mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-18 02:40:45 +00:00
core: fix floor base costs
This commit is contained in:
parent
5b92de2dc5
commit
22470f9617
1 changed files with 2 additions and 4 deletions
|
|
@ -242,12 +242,10 @@ func FloorDataGas(rules params.Rules, from common.Address, to *common.Address, v
|
||||||
tokenCost = params.TxCostFloorPerToken
|
tokenCost = params.TxCostFloorPerToken
|
||||||
}
|
}
|
||||||
|
|
||||||
// The floor is anchored to the transaction base cost. Under EIP-2780 that
|
// The floor is anchored to the transaction base cost.
|
||||||
// base is the per-resource decomposition (the same one used by the intrinsic
|
|
||||||
// gas), so the floor never undercuts the transaction's own base.
|
|
||||||
floorBase := params.TxGas
|
floorBase := params.TxGas
|
||||||
if rules.IsAmsterdam {
|
if rules.IsAmsterdam {
|
||||||
floorBase = intrinsicBaseGasEIP2780(from, to, value)
|
floorBase = params.TxBaseCost2780
|
||||||
}
|
}
|
||||||
// Check for overflow
|
// Check for overflow
|
||||||
if (math.MaxUint64-floorBase)/tokenCost < tokens {
|
if (math.MaxUint64-floorBase)/tokenCost < tokens {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue