EIP-7542 eth/70 available block range protocol (eth/70 - available-blocks-extended protocol)
No call decision · Networking & nodes · EIP status Withdrawn · created 2023-10-21
A proposal to add the block range a node holds to the eth wire protocol handshake, along with two new messages to request and respond with that range.
Why it is needed
There is an ongoing discussion around EIP-4444, which would let Ethereum nodes prune old blocks instead of retaining every past block forever. In this environment, some nodes delete old block data while others continue to store and serve historical data. But under the current eth protocol, a node has no way to know in advance which blocks a peer holds, so a node looking for a specific block must send requests to multiple peers one by one and receive empty responses by trial and error when a peer doesn't have it. This wastes bandwidth and time, and also causes a syncing node to needlessly request blocks from peers that haven't yet received them. This EIP aims to reduce this inefficiency by having peers advertise the start and end of the block range they hold directly in the handshake.
What changes
Today
- A node sends requests without knowing which blocks a peer holds, and gets back only empty responses if the peer doesn't have them.
- A node looking for a past block has to query multiple peers one by one by trial and error.
- Requesting blocks from a syncing peer that hasn't received them yet also results in wasted effort.
After EIP-7542
- The Status message in the eth/70 handshake now includes the start and end range of blocks the peer holds (blockRange).
- RequestBlockRange (0x0b) can be used to re-query a peer's latest block range.
- SendBlockRange (0x0c) lets a peer report its current range, reducing unnecessary requests.
Who is affected
- Archive and full node operators: When requesting historical block data, peers that hold it can be identified in advance, improving efficiency.
- Client development teams: A new version (eth/70) and two new message types must be implemented in the eth wire protocol.
- Syncing nodes: Wasted requests to peers that have not yet received the needed blocks can be reduced.
In depth
Adding blockRange to the Status message
The eth/69 Status (0x00) packet consists of [version, networkid, blockhash, genesis, forkid]. In eth/70, a blockRange field is added right after forkid, giving [version, networkid, blockhash, genesis, forkid, blockRange]. blockRange is [startBlock: uint64, endBlock: uint64], representing the start and end of the blocks that node can serve. Since this field is exchanged right at the handshake stage, a peer's held range is known immediately after connecting.
RequestBlockRange and SendBlockRange
RequestBlockRange (0x0b) is a message that asks a peer for its current block range again. Because the block range can change as a node continues syncing or pruning, a means is needed to check the latest value even after the initial Status exchange. SendBlockRange (0x0c) carries [startBlock: uint64, endBlock: uint64] in response to RequestBlockRange, informing the requesting node of the peer's currently available range.
Coexistence with existing versions
eth/70 is advertised as a new protocol version, and since devp2p supports multiple versions of the same wire protocol simultaneously, eth/69 remains available alongside it until eth/70 is sufficiently adopted. Nodes that have not upgraded can continue using eth/69, eth/68, eth/67, and so on, so the whole network does not need to change at once. The author describes this as a way to mitigate backward-compatibility issues from the handshake change.
Connection retention and exception rules
A node should by default keep a connection alive even if a peer's available block range differs from the range it wants. However, if a node's peer slots are full and it is not connected to a peer holding the needed block range, it is permitted to drop an existing connection in order to find such a peer. This rule is meant to balance overall network connection stability against the syncing efficiency of quickly securing a particular block range.
Relationship to EIP-4444 pruning
This proposal is set against the backdrop of the EIP-4444 discussion, where some nodes are beginning to prune old block data. When nodes that still retain historical data and nodes that have pruned it are mixed together on the network, not knowing a peer's held range forces a node looking for data to inefficiently try multiple peers. This EIP explains that it eliminates that trial and error, and as a side effect also reduces the waste of requesting not-yet-received blocks from still-syncing peers.
Proposal status: Withdrawn
This change is a networking-layer proposal that does not affect the consensus engine and does not require a hard fork. However, the source text explicitly notes that this does not standardize the notion that nodes are no longer required to store and serve past blocks. The source status is recorded as Withdrawn, meaning this proposal was withdrawn and was never actually implemented or adopted as eth/70.