mirror of
https://github.com/status-im/nimbus-eth1.git
synced 2025-01-12 21:34:33 +00:00
implement EIP 1884 stub
This commit is contained in:
parent
0bb6c73bdb
commit
078375061b
@ -604,10 +604,17 @@ func spuriousGasFees(previous_fees: GasFeeSchedule): GasFeeSchedule =
|
||||
result = previous_fees
|
||||
result[GasExpByte] = 50
|
||||
|
||||
func istanbulGasFees(previous_fees: GasFeeSchedule): GasFeeSchedule =
|
||||
# https://eips.ethereum.org/EIPS/eip-1884
|
||||
result[GasSload] = 800
|
||||
result[GasExtCodeHash] = 700
|
||||
result[GasBalance] = 700
|
||||
|
||||
const
|
||||
HomesteadGasFees = BaseGasFees.homesteadGasFees
|
||||
TangerineGasFees = HomesteadGasFees.tangerineGasFees
|
||||
SpuriousGasFees = TangerineGasFees.spuriousGasFees
|
||||
IstanbulGasFees = SpuriousGasFees.istanbulGasFees
|
||||
|
||||
gasFees*: array[Fork, GasFeeSchedule] = [
|
||||
FkFrontier: BaseGasFees,
|
||||
@ -618,7 +625,7 @@ const
|
||||
FkSpurious: SpuriousGasFees,
|
||||
FkByzantium: SpuriousGasFees,
|
||||
FkConstantinople: SpuriousGasFees,
|
||||
FkIstanbul: SpuriousGasFees
|
||||
FkIstanbul: IstanbulGasFees
|
||||
]
|
||||
|
||||
|
||||
|
@ -80,6 +80,7 @@ fill_enum_holes:
|
||||
GasLimit = 0x45, # Get the block's gas limit.
|
||||
|
||||
ChainID = 0x46, # Get current chain’s EIP-155 unique identifier.
|
||||
SelfBalance = 0x47, # Get current contract's balance.
|
||||
|
||||
# 50s: Stack, Memory, Storage and Flow Operations
|
||||
Pop = 0x50, # Remove item from stack.
|
||||
|
@ -377,6 +377,11 @@ op chainID, inline = true:
|
||||
# TODO: this is a stub
|
||||
push: 0
|
||||
|
||||
op selfBalance, inline = true:
|
||||
## 0x47, Get current contract's balance.
|
||||
# TODO: this is a stub
|
||||
push: 0
|
||||
|
||||
# ##########################################
|
||||
# 50s: Stack, Memory, Storage and Flow Operations
|
||||
|
||||
|
@ -218,6 +218,7 @@ let ConstantinopleOpDispatch {.compileTime.}: array[Op, NimNode] = genConstantin
|
||||
proc genIstanbulJumpTable(ops: array[Op, NimNode]): array[Op, NimNode] {.compileTime.} =
|
||||
result = ops
|
||||
result[ChainID] = newIdentNode "chainID"
|
||||
result[SelfBalance] = newIdentNode "selfBalance"
|
||||
|
||||
let IstanbulOpDispatch {.compileTime.}: array[Op, NimNode] = genIstanbulJumpTable(ConstantinopleOpDispatch)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user