Skip to content

Commit 54bcb8f

Browse files
authored
caps/eth.md: add changes for EIP-4895 withdrawals (#236)
1 parent 9136f2d commit 54bcb8f

File tree

1 file changed

+19
-5
lines changed

1 file changed

+19
-5
lines changed

caps/eth.md

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,7 @@ Ethereum blocks are encoded as follows:
177177
block = [header, transactions, ommers]
178178
transactions = [tx₁, tx₂, ...]
179179
ommers = [header₁, header₂, ...]
180+
withdrawals = [withdrawal₁, withdrawal₂, ...]
180181
header = [
181182
parent-hash: B_32,
182183
ommers-hash: B_32,
@@ -194,12 +195,13 @@ Ethereum blocks are encoded as follows:
194195
mix-digest: B_32,
195196
block-nonce: B_8,
196197
basefee-per-gas: P,
198+
withdrawals-root: B_32,
197199
]
198200

199201
In certain protocol messages, the transaction and ommer lists are relayed together as a
200202
single item called the 'block body'.
201203

202-
block-body = [transactions, ommers]
204+
block-body = [transactions, ommers, withdrawals]
203205

204206
The validity of block headers depends on the context in which they are used. For a single
205207
block header, only the validity of the proof-of-work seal (`mix-digest`, `block-nonce`)
@@ -212,10 +214,10 @@ headers are processed in sequence during chain synchronization, the following ru
212214
values of `difficulty`, `gas-limit` and `time` are within the bounds of protocol rules
213215
given in the [Yellow Paper].
214216
- The `gas-used` header field must be less than or equal to the `gas-limit`.
215-
- The `basefee-per-gas` header field must be present for blocks after the [London hard
216-
fork]. Note that `basefee-per-gas` must be absent for earlier blocks. This rule was
217-
added implicity by [EIP-1559], which added the field into the definition of the Ethereum
218-
block hash.
217+
- `basefee-per-gas` must be present in headers after the [London hard fork]. It must be
218+
absent for earlier blocks. This rule was added by [EIP-1559].
219+
- `withdrawals-root` must be present in headers after the [Shanghai fork]. The field must
220+
be absent for blocks before the fork. This rule was added by [EIP-4895].
219221

220222
For complete blocks, we distinguish between the validity of the block's EVM state
221223
transition, and the (weaker) 'data validity' of the block. The definition of state
@@ -234,6 +236,10 @@ disconnect peers sending invalid blocks.
234236
block.
235237
- The `transactions` of the block must be verified against the `txs-root` by computing and
236238
comparing the merkle trie hash of the transactions list.
239+
- The `withdrawals` of block body must be verified against the `withdrawals-root` by
240+
computing and comparing the merkle trie hash of the withdrawals list. Note that no
241+
further validation of withdrawals is possible, since they are injected into the block by
242+
the consensus layer.
237243
- The `ommers` list may contain at most two headers.
238244
- `keccak256(ommers)` must match the `ommers-hash` of the block header.
239245
- The headers contained in the `ommers` list must be valid headers. Their block number
@@ -456,6 +462,12 @@ Version 68 changed the [NewPooledTransactionHashes] message to include types and
456462
the announced transactions. Prior to this update, the message payload was simply a list of
457463
hashes: `[txhash₁: B_32, txhash₂: B_32, ...]`.
458464

465+
### eth/67 with withdrawals ([EIP-4895], March 2022)
466+
467+
PoS validator withdrawals were added by [EIP-4895], which changed the definition of block
468+
headers to include a `withdrawals-root`, and block bodies to include the `withdrawals`
469+
list. No new wire protocol version was created for this change.
470+
459471
### eth/67 ([EIP-4938], March 2022)
460472

461473
Version 67 removed the GetNodeData and NodeData messages.
@@ -559,8 +571,10 @@ Version numbers below 60 were used during the Ethereum PoC development phase.
559571
[EIP-2718]: https://eips.ethereum.org/EIPS/eip-2718
560572
[transaction types]: https://eips.ethereum.org/EIPS/eip-2718
561573
[EIP-2976]: https://eips.ethereum.org/EIPS/eip-2976
574+
[EIP-4895]: https://eips.ethereum.org/EIPS/eip-4895
562575
[EIP-4938]: https://eips.ethereum.org/EIPS/eip-4938
563576
[EIP-5793]: https://eips.ethereum.org/EIPS/eip-5793
564577
[The Merge]: https://eips.ethereum.org/EIPS/eip-3675
565578
[London hard fork]: https://github.com/ethereum/execution-specs/blob/master/network-upgrades/mainnet-upgrades/london.md
579+
[Shanghai fork]: https://github.com/ethereum/execution-specs/blob/master/network-upgrades/mainnet-upgrades/shanghai.md
566580
[Yellow Paper]: https://ethereum.github.io/yellowpaper/paper.pdf

0 commit comments

Comments
 (0)