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
|
import
|
||||||
./interpreter/opcode_values as vmo
|
./interpreter/opcode_values as vmo
|
||||||
export
|
export
|
||||||
vmo.Op
|
vmo.Op, vmo.Random
|
||||||
|
|
||||||
|
|
||||||
# see vm_message
|
# see vm_message
|
||||||
|
|
|
@ -308,6 +308,10 @@ method blockNumber*(vmState: BaseVMState): BlockNumber {.base, gcsafe.} =
|
||||||
vmState.parent.blockNumber + 1
|
vmState.parent.blockNumber + 1
|
||||||
|
|
||||||
method difficulty*(vmState: BaseVMState): UInt256 {.base, gcsafe.} =
|
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)
|
vmState.chainDB.config.calcDifficulty(vmState.timestamp, vmState.parent)
|
||||||
|
|
||||||
method baseFee*(vmState: BaseVMState): UInt256 {.base, gcsafe.} =
|
method baseFee*(vmState: BaseVMState): UInt256 {.base, gcsafe.} =
|
||||||
|
|
|
@ -295,6 +295,10 @@ method blockNumber*(vmState: BaseVMState): BlockNumber {.base, gcsafe.} =
|
||||||
vmState.parent.blockNumber + 1
|
vmState.parent.blockNumber + 1
|
||||||
|
|
||||||
method difficulty*(vmState: BaseVMState): UInt256 {.base, gcsafe.} =
|
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)
|
vmState.chainDB.config.calcDifficulty(vmState.timestamp, vmState.parent)
|
||||||
|
|
||||||
method baseFee*(vmState: BaseVMState): UInt256 {.base, gcsafe.} =
|
method baseFee*(vmState: BaseVMState): UInt256 {.base, gcsafe.} =
|
||||||
|
|
|
@ -133,6 +133,7 @@ else:
|
||||||
eGmt.refundGas,
|
eGmt.refundGas,
|
||||||
eGmt.returnGas,
|
eGmt.returnGas,
|
||||||
fVmo.Op,
|
fVmo.Op,
|
||||||
|
fVmo.Random,
|
||||||
gVmg.isCreate,
|
gVmg.isCreate,
|
||||||
hStk.Stack,
|
hStk.Stack,
|
||||||
hStk.`$`,
|
hStk.`$`,
|
||||||
|
|
Loading…
Reference in New Issue