mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-22 20:56:42 +00:00
core: fix remaining spec issues
This commit is contained in:
parent
dd8dd1520f
commit
027be7fdc7
2 changed files with 7 additions and 11 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 {
|
||||||
|
|
@ -755,6 +753,10 @@ func (st *stateTransition) execute() (*ExecutionResult, error) {
|
||||||
// performing the resolution and warming.
|
// performing the resolution and warming.
|
||||||
if addr, ok := types.ParseDelegation(st.state.GetCode(*msg.To)); ok {
|
if addr, ok := types.ParseDelegation(st.state.GetCode(*msg.To)); ok {
|
||||||
st.state.AddAddressToAccessList(addr)
|
st.state.AddAddressToAccessList(addr)
|
||||||
|
// Record in BAL
|
||||||
|
if rules.IsAmsterdam {
|
||||||
|
st.state.GetCode(addr)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// EIP-2780: charge the transaction's top-level recipient costs. If the
|
// EIP-2780: charge the transaction's top-level recipient costs. If the
|
||||||
// budget cannot cover the charge, the top frame halts out of gas.
|
// budget cannot cover the charge, the top frame halts out of gas.
|
||||||
|
|
|
||||||
|
|
@ -101,13 +101,7 @@ const (
|
||||||
TxAccessListStorageKeyGas uint64 = 1900 // Per storage key specified in EIP 2930 access list
|
TxAccessListStorageKeyGas uint64 = 1900 // Per storage key specified in EIP 2930 access list
|
||||||
TxAuthTupleGas uint64 = 12500 // Per auth tuple code specified in EIP-7702
|
TxAuthTupleGas uint64 = 12500 // Per auth tuple code specified in EIP-7702
|
||||||
|
|
||||||
// RegularPerAuthBaseCost is defined in EIP-8037 as the sum of:
|
RegularPerAuthBaseCost uint64 = 7816 // As defined by EIP-8037 and EIP-8038
|
||||||
//
|
|
||||||
// - Calldata cost: 1,616 (101 bytes × 16)
|
|
||||||
// - Recovering authority address (ecRecover)
|
|
||||||
// - Reading nonce and code of authority (cold access)
|
|
||||||
// - Storing values in already warm account: 2 x WARM_ACCESS
|
|
||||||
RegularPerAuthBaseCost uint64 = 7500
|
|
||||||
|
|
||||||
// EIP-2780: resource-based intrinsic transaction gas.
|
// EIP-2780: resource-based intrinsic transaction gas.
|
||||||
TxBaseCost2780 uint64 = 12000
|
TxBaseCost2780 uint64 = 12000
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue