fixes related to EIP-4399/EIP-3675
- fix `RANDOM` opcode export - fix `difficulty` return value in VMState
This commit is contained in:
parent
6869eafce6
commit
d3fbe1d94d
|
@ -12,7 +12,7 @@
|
|||
import
|
||||
./interpreter/opcode_values as vmo
|
||||
export
|
||||
vmo.Op
|
||||
vmo.Op, vmo.Random
|
||||
|
||||
|
||||
# see vm_message
|
||||
|
|
|
@ -308,6 +308,10 @@ method blockNumber*(vmState: BaseVMState): BlockNumber {.base, gcsafe.} =
|
|||
vmState.parent.blockNumber + 1
|
||||
|
||||
method difficulty*(vmState: BaseVMState): UInt256 {.base, gcsafe.} =
|
||||
if vmState.fork >= FkPostMerge:
|
||||
# EIP-4399/EIP-3675
|
||||
0.u256
|
||||
else:
|
||||
vmState.chainDB.config.calcDifficulty(vmState.timestamp, vmState.parent)
|
||||
|
||||
method baseFee*(vmState: BaseVMState): UInt256 {.base, gcsafe.} =
|
||||
|
|
|
@ -295,6 +295,10 @@ method blockNumber*(vmState: BaseVMState): BlockNumber {.base, gcsafe.} =
|
|||
vmState.parent.blockNumber + 1
|
||||
|
||||
method difficulty*(vmState: BaseVMState): UInt256 {.base, gcsafe.} =
|
||||
if vmState.fork >= FkPostMerge:
|
||||
# EIP-4399/EIP-3675
|
||||
0.u256
|
||||
else:
|
||||
vmState.chainDB.config.calcDifficulty(vmState.timestamp, vmState.parent)
|
||||
|
||||
method baseFee*(vmState: BaseVMState): UInt256 {.base, gcsafe.} =
|
||||
|
|
|
@ -133,6 +133,7 @@ else:
|
|||
eGmt.refundGas,
|
||||
eGmt.returnGas,
|
||||
fVmo.Op,
|
||||
fVmo.Random,
|
||||
gVmg.isCreate,
|
||||
hStk.Stack,
|
||||
hStk.`$`,
|
||||
|
|
Loading…
Reference in New Issue