Add `systemLogsRoot`

This commit is contained in:
Etan Kissling 2024-10-16 23:10:46 +02:00
parent 00c91a1dca
commit f5017bd2a2
No known key found for this signature in database
GPG Key ID: B21DA824C5A3D03D
2 changed files with 6 additions and 0 deletions

View File

@ -39,6 +39,7 @@ type
excessBlobGas*: Opt[uint64] # EIP-4844 excessBlobGas*: Opt[uint64] # EIP-4844
parentBeaconBlockRoot*: Opt[Hash32] # EIP-4788 parentBeaconBlockRoot*: Opt[Hash32] # EIP-4788
requestsRoot*: Opt[Hash32] # EIP-7685 requestsRoot*: Opt[Hash32] # EIP-7685
systemLogsRoot*: Opt[Hash32] # Fusaka-Light
# starting from EIP-4399, `mixDigest` field is called `prevRandao` # starting from EIP-4399, `mixDigest` field is called `prevRandao`
template prevRandao*(h: Header): Bytes32 = template prevRandao*(h: Header): Bytes32 =

View File

@ -224,9 +224,14 @@ macro genOptionalFieldsValidation(obj: untyped, T: type, num: static[int]): unty
doAssert(obj.withdrawalsRoot.isNone, "withdrawalsRoot needs fee") doAssert(obj.withdrawalsRoot.isNone, "withdrawalsRoot needs fee")
doAssert(obj.blobGasUsed.isNone, "blobGasUsed needs fee") doAssert(obj.blobGasUsed.isNone, "blobGasUsed needs fee")
doAssert(obj.excessBlobGas.isNone, "excessBlobGas needs fee") doAssert(obj.excessBlobGas.isNone, "excessBlobGas needs fee")
doAssert(obj.systemLogsRoot.isNone, "systemLogsRoot needs fee")
if obj.withdrawalsRoot.isNone: if obj.withdrawalsRoot.isNone:
doAssert(obj.blobGasUsed.isNone, "blobGasUsed needs withdrawalsRoot") doAssert(obj.blobGasUsed.isNone, "blobGasUsed needs withdrawalsRoot")
doAssert(obj.excessBlobGas.isNone, "excessBlobGas needs withdrawalsRoot") doAssert(obj.excessBlobGas.isNone, "excessBlobGas needs withdrawalsRoot")
doAssert(
obj.systemLogsRoot.isNone, "systemLogsRoot needs withdrawalsRoot")
if obj.blobGasUsed.isNone:
doAssert(obj.systemLogsRoot.isNone, "systemLogsRoot needs blobGasUsed")
doAssert obj.blobGasUsed.isSome == obj.excessBlobGas.isSome, doAssert obj.blobGasUsed.isSome == obj.excessBlobGas.isSome,
"blobGasUsed and excessBlobGas must both be present or absent" "blobGasUsed and excessBlobGas must both be present or absent"