fixes gas_costs for istanbul
This commit is contained in:
parent
f66f49168a
commit
d61bb49a40
|
@ -642,27 +642,28 @@ const
|
||||||
]
|
]
|
||||||
|
|
||||||
# Create the schedule for each forks
|
# Create the schedule for each forks
|
||||||
func homesteadGasFees(previous_fees: GasFeeSchedule): GasFeeSchedule =
|
func homesteadGasFees(previousFees: GasFeeSchedule): GasFeeSchedule =
|
||||||
# https://github.com/ethereum/EIPs/blob/master/EIPS/eip-2.md
|
# https://github.com/ethereum/EIPs/blob/master/EIPS/eip-2.md
|
||||||
result = previous_fees
|
result = previousFees
|
||||||
result[GasTXCreate] = 32000
|
result[GasTXCreate] = 32000
|
||||||
|
|
||||||
func tangerineGasFees(previous_fees: GasFeeSchedule): GasFeeSchedule =
|
func tangerineGasFees(previousFees: GasFeeSchedule): GasFeeSchedule =
|
||||||
# https://github.com/ethereum/EIPs/blob/master/EIPS/eip-150.md
|
# https://github.com/ethereum/EIPs/blob/master/EIPS/eip-150.md
|
||||||
result = previous_fees
|
result = previousFees
|
||||||
result[GasExtCode] = 700
|
result[GasExtCode] = 700
|
||||||
result[GasSload] = 200
|
result[GasSload] = 200
|
||||||
result[GasSelfDestruct] = 5000
|
result[GasSelfDestruct] = 5000
|
||||||
result[GasBalance] = 400
|
result[GasBalance] = 400
|
||||||
result[GasCall] = 700
|
result[GasCall] = 700
|
||||||
|
|
||||||
func spuriousGasFees(previous_fees: GasFeeSchedule): GasFeeSchedule =
|
func spuriousGasFees(previousFees: GasFeeSchedule): GasFeeSchedule =
|
||||||
# https://github.com/ethereum/EIPs/blob/master/EIPS/eip-160.md
|
# https://github.com/ethereum/EIPs/blob/master/EIPS/eip-160.md
|
||||||
result = previous_fees
|
result = previousFees
|
||||||
result[GasExpByte] = 50
|
result[GasExpByte] = 50
|
||||||
|
|
||||||
func istanbulGasFees(previous_fees: GasFeeSchedule): GasFeeSchedule =
|
func istanbulGasFees(previousFees: GasFeeSchedule): GasFeeSchedule =
|
||||||
# https://eips.ethereum.org/EIPS/eip-1884
|
# https://eips.ethereum.org/EIPS/eip-1884
|
||||||
|
result = previousFees
|
||||||
result[GasSload] = 800
|
result[GasSload] = 800
|
||||||
result[GasExtCodeHash] = 700
|
result[GasExtCodeHash] = 700
|
||||||
result[GasBalance] = 700
|
result[GasBalance] = 700
|
||||||
|
@ -691,6 +692,7 @@ gasCosts(FkFrontier, base, BaseGasCosts)
|
||||||
gasCosts(FkHomestead, homestead, HomesteadGasCosts)
|
gasCosts(FkHomestead, homestead, HomesteadGasCosts)
|
||||||
gasCosts(FkTangerine, tangerine, TangerineGasCosts)
|
gasCosts(FkTangerine, tangerine, TangerineGasCosts)
|
||||||
gasCosts(FkSpurious, spurious, SpuriousGasCosts)
|
gasCosts(FkSpurious, spurious, SpuriousGasCosts)
|
||||||
|
gasCosts(FkIstanbul, istanbul, IstanbulGasCosts)
|
||||||
|
|
||||||
proc forkToSchedule*(fork: Fork): GasCosts =
|
proc forkToSchedule*(fork: Fork): GasCosts =
|
||||||
if fork < FkHomestead:
|
if fork < FkHomestead:
|
||||||
|
@ -699,8 +701,10 @@ proc forkToSchedule*(fork: Fork): GasCosts =
|
||||||
HomesteadGasCosts
|
HomesteadGasCosts
|
||||||
elif fork < FkSpurious:
|
elif fork < FkSpurious:
|
||||||
TangerineGasCosts
|
TangerineGasCosts
|
||||||
else:
|
elif fork < FkIstanbul:
|
||||||
SpuriousGasCosts
|
SpuriousGasCosts
|
||||||
|
else:
|
||||||
|
IstanbulGasCosts
|
||||||
|
|
||||||
const
|
const
|
||||||
## Precompile costs
|
## Precompile costs
|
||||||
|
|
Loading…
Reference in New Issue