From f5017bd2a2159a94629b2eaeb5aba94d08cab9ce Mon Sep 17 00:00:00 2001 From: Etan Kissling Date: Wed, 16 Oct 2024 23:10:46 +0200 Subject: [PATCH] Add `systemLogsRoot` --- eth/common/headers.nim | 1 + eth/rlp/writer.nim | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/eth/common/headers.nim b/eth/common/headers.nim index 8c11256..cc265b4 100644 --- a/eth/common/headers.nim +++ b/eth/common/headers.nim @@ -39,6 +39,7 @@ type excessBlobGas*: Opt[uint64] # EIP-4844 parentBeaconBlockRoot*: Opt[Hash32] # EIP-4788 requestsRoot*: Opt[Hash32] # EIP-7685 + systemLogsRoot*: Opt[Hash32] # Fusaka-Light # starting from EIP-4399, `mixDigest` field is called `prevRandao` template prevRandao*(h: Header): Bytes32 = diff --git a/eth/rlp/writer.nim b/eth/rlp/writer.nim index e726ddc..b8178a6 100644 --- a/eth/rlp/writer.nim +++ b/eth/rlp/writer.nim @@ -224,9 +224,14 @@ macro genOptionalFieldsValidation(obj: untyped, T: type, num: static[int]): unty doAssert(obj.withdrawalsRoot.isNone, "withdrawalsRoot needs fee") doAssert(obj.blobGasUsed.isNone, "blobGasUsed needs fee") doAssert(obj.excessBlobGas.isNone, "excessBlobGas needs fee") + doAssert(obj.systemLogsRoot.isNone, "systemLogsRoot needs fee") if obj.withdrawalsRoot.isNone: doAssert(obj.blobGasUsed.isNone, "blobGasUsed 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, "blobGasUsed and excessBlobGas must both be present or absent"