Skip to content

Commit ce56fc7

Browse files
committed
fix: integrate bitmap to hash announcement
1 parent e558fa1 commit ce56fc7

File tree

1 file changed

+27
-45
lines changed

1 file changed

+27
-45
lines changed

caps/eth.md

Lines changed: 27 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -123,32 +123,19 @@ of it (either because it was previously sent or because it was informed from thi
123123
originally). This is usually achieved by remembering a set of transaction hashes recently
124124
relayed by the peer.
125125

126-
### Blob Transaction
126+
### Blob Transaction and Cell Exchange
127127

128128
Blob transaction carries one or more large objects called blobs, in addition to the normal
129-
transaction payload. The transaction also includes metadata that allows peers to verify
130-
blob fragments (cells) they exchange over the network.
129+
transaction payload. Blobs are not sent directly with the transaction but are exchanged
130+
in the form of `Cell` separately between peers.
131+
Cells are computed by splitting the blob and applying the erasure-code defined in [EIP-7594].
132+
A cell has its `index`, according to its relative position in the erasure-coded blob.
131133

132-
- `cell`: Cell is computed by splitting the blob and applying the erasure-code defined in
133-
[EIP-7594]. A cell can be identified in the erasure-coded blob by its `index`.
134-
135-
- Commitment: Commitment is a cryptographic value bound to a blob. It is used in inclusion
136-
verification to ensure that any given cell is part of the original blob.
137-
138-
- Proof: Proof is a cell-specific data used during the inclusion verification of associated cell.
139-
140-
- Versioned hash (`vhash`): Versioned hash is the identifier for a blob, which is calculated
141-
taking the hash of the blob's commitment, prefixed with a version byte.
142-
143-
Note that blobs are not sent directly with the transaction but are exchanged in the form of
144-
cells separately between peers.
145-
146-
### Cell Exchange
147-
148-
When a new cell is added to a peer's pool, it should be announced to the network using
149-
the [CellAvailability] message. All peers that receive the message can request
150-
the cell whose index is specified in the message using the [GetCells] message.
151-
Clients can selectively store cells according to their local parameters.
134+
When a blob transaction is added to a peer's pool, availability of its cell should be announced
135+
to the network using `cells` field in the [NewPooledTransactionHashes] message.
136+
All peers that receive the message can request the cell whose index is specified in the
137+
`cells` using the [GetCells] message. Clients can selectively store cells according to
138+
their local parameters.
152139

153140
A node should never announce availability to a peer that it can infer to already
154141
have the associated cell. This can be achieved by remembering set of versioned hashes
@@ -449,11 +436,11 @@ block.
449436

450437
### NewPooledTransactionHashes (0x08)
451438

452-
`[txtypes: B, [txsize₁: P, txsize₂: P, ...], [txhash₁: B_32, txhash₂: B_32, ...]]`
439+
`[txtypes: B, [txsize₁: P, txsize₂: P, ...], [txhash₁: B_32, txhash₂: B_32, ...], cells: B_16]`
453440

454441
This message announces one or more transactions that have appeared in the network and
455442
which have not yet been included in a block. The message payload describes a list of of
456-
transactions, but note that it is encoded as three separate elements.
443+
transactions, but note that it is encoded as four separate elements.
457444

458445
The `txtypes` element is a byte array containing the announced [transaction types]. The
459446
other two payload elements refer to the sizes and hashes of the announced transactions.
@@ -463,6 +450,10 @@ All three payload elements must contain an equal number of items.
463450
the byte size of `tx-type || tx-data` for typed transactions, and the size of the
464451
RLP-encoded `legacy-tx` for non-typed legacy transactions.
465452

453+
The `cells` element is a bitmap marking the indices of cells stored by the sending peer.
454+
For each cell stored by the peer the corresponding bit is set. Note that blob transactions
455+
with same cells field is being batched together.
456+
466457
The recommended soft limit for this message is 4096 items (~150 KiB).
467458

468459
To be maximally helpful, nodes should inform peers of all transactions that they may not
@@ -540,36 +531,28 @@ received updates.
540531
At the same time, client implementations must take care to not disconnect all syncing
541532
peers purely on the basis of their BlockRangeUpdate.
542533

543-
### CellAvailability (0x12)
544-
545-
`[[vhash₁: B_32, vhash₂: B_32, ...], cells: B_16]`
546-
547-
This message announces the cell availability of transaction payloads.
548-
The list of `vhash` values represents the commitment hashes of payloads for which cells are available.
549-
The `cells` element is a bitmap marking the indices of cells in the transaction payload
550-
stored by the sending peer. For each cell stored by the peer the corresponding bit is set.
551-
552-
### GetCells (0x13)
534+
### GetCells (0x12)
553535

554-
`[request-id: P, [vhash₁: B_32, vhash₂: B_32, ...], cells : B_16]`
536+
`[request-id: P, [txhash₁: B_32, txhash₂: B_32, ...], cells : B_16]`
555537

556-
This message requests the peer to return cells of the given vhashes.
538+
This message requests the peer to return cells of the given txhashes.
557539
The `cells` element, a bitmap, specifies indices of the requested cells.
558540

559-
### Cells (0x14)
541+
### Cells (0x13)
560542

561-
`[request-id: P, [[vhash₁: B_32, [index₁: P, cell₁: B], [index₂: P, cell₂: B, ...]], [vhash₂: B_32, [index₁: P, cell₁: B], [index₂: P, cell₂: B, ...]], ...]]`
543+
`[request-id: P, [[txhash₁: B_32, [index₁: P, cell₁: B], [index₂: P, cell₂: B, ...]], [txhash₂: B_32, [index₁: P, cell₁: B], [index₂: P, cell₂: B, ...]], ...]]`
562544

563545
This is the response to [GetCells].
564-
Each element must match the vhash and cells specified in the request.
565-
The sender can skip any cells that are not available, so the requester can fetch them
546+
Each element must match the txhash and cells specified in the request. The `cellₙ` field
547+
is an rlp encoded array that contains the cells for all blobs included in the transaction.
548+
The sender can skip any indices that are not available, so the requester can fetch them
566549
from other peers.
567550

568551
## Change Log
569552

570553
### eth/70 ()
571554

572-
Version 70 added the [CellAvailability] message to exchange custody information
555+
Version 70 changed the [NewPooledTransactionHashes] message to include custody information
573556
which represents cell indicies sending peer has stored. New message types,
574557
[GetCells] and [Cells] were introduced to support cell-level messaging.
575558

@@ -686,9 +669,8 @@ Version numbers below 60 were used during the Ethereum PoC development phase.
686669
[GetReceipts]: #getreceipts-0x0f
687670
[Receipts]: #receipts-0x10
688671
[BlockRangeUpdate]: #blockrangeupdate-0x11
689-
[CellAvailability]: #cellavailability-0x12
690-
[GetCells]: #getcells-0x13
691-
[Cells]: #cells-0x14
672+
[GetCells]: #getcells-0x12
673+
[Cells]: #cells-0x13
692674
[RLPx]: ../rlpx.md
693675
[EIP-155]: https://eips.ethereum.org/EIPS/eip-155
694676
[EIP-1559]: https://eips.ethereum.org/EIPS/eip-1559

0 commit comments

Comments
 (0)