-
Notifications
You must be signed in to change notification settings - Fork 284
[WIP] caps/eth.md: cell exchange #263
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from 9 commits
e0bfa16
5ba0075
556cc66
4f29887
75753f0
e558fa1
ce56fc7
1d36625
efe662b
9a8ff92
0896be2
6caf1bc
bb37e52
6021b98
a902ea9
c2a1f03
744324f
eab5207
9e049e7
bda330c
cafd6d3
24be46e
7d162ef
390d9bc
5e476bb
4161bd1
46fffe3
c064077
4cc7746
6d926b1
2b12215
bd2207a
edb32f5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
# Ethereum Wire Protocol (ETH) | ||
|
||
'eth' is a protocol on the [RLPx] transport that facilitates exchange of Ethereum | ||
blockchain information between peers. The current protocol version is **eth/69**. See end | ||
blockchain information between peers. The current protocol version is **eth/70**. See end | ||
of document for a list of changes in past protocol versions. | ||
|
||
### Basic Operation | ||
|
@@ -123,6 +123,24 @@ of it (either because it was previously sent or because it was informed from thi | |
originally). This is usually achieved by remembering a set of transaction hashes recently | ||
relayed by the peer. | ||
|
||
### Blob Transaction and Cell Exchange | ||
|
||
Blob transaction carries one or more large objects called blobs, in addition to the normal | ||
transaction payload. Blobs are not sent directly with the transaction but are exchanged | ||
in the form of `Cell` separately between peers. | ||
Cells are computed by splitting the blob and applying the erasure-code defined in [EIP-7594]. | ||
A cell has its `index`, according to its relative position in the erasure-coded blob. | ||
|
||
When a blob transaction is added to a peer's pool, availability of its cell should be announced | ||
to the network using `cells` field in the [NewPooledTransactionHashes] message. | ||
All peers that receive the message can request the cell whose index is specified in the | ||
`cells` using the [GetCells] message. Clients can selectively store cells according to | ||
their local parameters. | ||
|
||
A node should never announce availability to a peer that it can infer to already | ||
have the associated cell. This can be achieved by remembering set of versioned hashes | ||
and cell indices announced by each peer. | ||
|
||
### Transaction Encoding and Validity | ||
|
||
Transaction objects exchanged by peers have one of two encodings. In definitions across | ||
|
@@ -418,11 +436,11 @@ block. | |
|
||
### NewPooledTransactionHashes (0x08) | ||
|
||
`[txtypes: B, [txsize₁: P, txsize₂: P, ...], [txhash₁: B_32, txhash₂: B_32, ...]]` | ||
`[txtypes: B, [txsize₁: P, txsize₂: P, ...], [txhash₁: B_32, txhash₂: B_32, ...], cells: B_16]` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We should decide whether there is one
|
||
|
||
This message announces one or more transactions that have appeared in the network and | ||
which have not yet been included in a block. The message payload describes a list of of | ||
transactions, but note that it is encoded as three separate elements. | ||
transactions, but note that it is encoded as four separate elements. | ||
|
||
The `txtypes` element is a byte array containing the announced [transaction types]. The | ||
other two payload elements refer to the sizes and hashes of the announced transactions. | ||
|
@@ -432,6 +450,10 @@ All three payload elements must contain an equal number of items. | |
the byte size of `tx-type || tx-data` for typed transactions, and the size of the | ||
RLP-encoded `legacy-tx` for non-typed legacy transactions. | ||
|
||
The `cells` element is a bitmap marking the indices of cells stored by the sending peer. | ||
For each cell stored by the peer the corresponding bit is set. Note that blob transactions | ||
with same cells field is being batched together. | ||
|
||
|
||
The recommended soft limit for this message is 4096 items (~150 KiB). | ||
|
||
To be maximally helpful, nodes should inform peers of all transactions that they may not | ||
|
@@ -509,8 +531,30 @@ received updates. | |
At the same time, client implementations must take care to not disconnect all syncing | ||
peers purely on the basis of their BlockRangeUpdate. | ||
|
||
### GetCells (0x12) | ||
|
||
`[request-id: P, [txhash₁: B_32, txhash₂: B_32, ...], cells : B_16]` | ||
|
||
This message requests the peer to return cells of the given txhashes. | ||
The `cells` element, a bitmap, specifies indices of the requested cells. | ||
|
||
### Cells (0x13) | ||
|
||
`[request-id: P, [[txhash₁: B_32, [index₁: P, cell₁: B, cell₂: B, ...], [index₂: P, cell₁: B, cell₂: B, ...]], [txhash₂: B_32, [index₁: P, cell₁: B, cell₂: B, ...], [index₂: P, cell₁: B, cell₂: B, ...]], ...]]` | ||
|
||
This is the response to [GetCells]. | ||
Each element must match the txhash and cells specified in the request. | ||
The sender can skip any indices that are not available, so the requester can fetch them | ||
from other peers. | ||
|
||
## Change Log | ||
|
||
### eth/70 () | ||
|
||
Version 70 changed the [NewPooledTransactionHashes] message to include custody information | ||
which represents cell indicies sending peer has stored. New message types, | ||
[GetCells] and [Cells] were introduced to support cell-level messaging. | ||
|
||
### eth/69 ([EIP-7642], April 2025) | ||
|
||
Version 69 changed the [Status] message to include information about the available block | ||
|
@@ -624,6 +668,8 @@ Version numbers below 60 were used during the Ethereum PoC development phase. | |
[GetReceipts]: #getreceipts-0x0f | ||
[Receipts]: #receipts-0x10 | ||
[BlockRangeUpdate]: #blockrangeupdate-0x11 | ||
[GetCells]: #getcells-0x12 | ||
[Cells]: #cells-0x13 | ||
[RLPx]: ../rlpx.md | ||
[EIP-155]: https://eips.ethereum.org/EIPS/eip-155 | ||
[EIP-1559]: https://eips.ethereum.org/EIPS/eip-1559 | ||
|
@@ -639,6 +685,7 @@ Version numbers below 60 were used during the Ethereum PoC development phase. | |
[EIP-4844]: https://eips.ethereum.org/EIPS/eip-4844 | ||
[EIP-4938]: https://eips.ethereum.org/EIPS/eip-4938 | ||
[EIP-5793]: https://eips.ethereum.org/EIPS/eip-5793 | ||
[EIP-7594]: https://eips.ethereum.org/EIPS/eip-7594 | ||
[EIP-7642]: https://eips.ethereum.org/EIPS/eip-7642 | ||
[EIP-7685]: https://eips.ethereum.org/EIPS/eip-7685 | ||
[The Merge]: https://eips.ethereum.org/EIPS/eip-3675 | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are already eth/70 proposals in progress, so the number will be different
We can update at the end in the doc, but maybe remove from title to avoid confusion
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed all eth/70 numbering in this PR and on doc so that we can add it back at the end.