EIP-7542 · Withdrawn · Networking · 2023-10-21
EIP-7542: eth/70 - available-blocks-extended protocol
A withdrawn proposal for an eth/70 p2p protocol where nodes advertise which block range they can serve, so peers stop asking for history a node has pruned; the idea shipped instead in eth/69.
What problem does it solve?
With history expiry (EIP-4444), some nodes will keep serving old blocks while others prune them. Without any signal, a node looking for historical data has to connect to peers and request specific blocks just to discover whether they have them, wasting bandwidth and time. The same issue hits syncing: a peer that is itself still syncing may not have the blocks you need, and you only find out after an empty response.
EIP-7542 proposed letting each node announce the range of blocks it can serve, so peers can choose whom to ask and whom to stay connected to.
How it works
The proposal defined a new eth protocol version, eth/70, running side by side with eth/69 until widely adopted:
- The
Status (0x00)handshake gains ablockRangefield right afterforkid, whereblockRangeis[startBlock, endBlock]. - Two new messages:
RequestBlockRange (0x0b): ask a peer for its current range.SendBlockRange (0x0c): reply with[startBlock, endBlock].
Since the range moves as a node syncs or prunes, peers can re-query it at any time.
Nodes were expected to keep connections regardless of a peer's range, except that a node with full peer slots and no peer holding the range it needs may disconnect one to look for a better peer. As a networking change, no hard fork was required.
Sample code
Message shapes as proposed (RLP-style notation):
# eth/69 Status (as referenced by the proposal)
[version, networkid, blockhash, genesis, forkid]
# eth/70 Status (proposed)
[version, networkid, blockhash, genesis, forkid, [startBlock, endBlock]]
# RequestBlockRange (0x0b)
[]
# SendBlockRange (0x0c)
[startBlock: uint64, endBlock: uint64]
Choosing a peer for a historical request (pseudocode):
def pick_peer(peers, wanted_block):
candidates = [p for p in peers if p.start_block <= wanted_block <= p.end_block]
return random.choice(candidates) if candidates else None
Things to know
- Status is Withdrawn. Per EIP-7642, it was withdrawn because no decision on history expiry had been reached at the time.
- The idea lives on in EIP-7642 (eth/69, Final), which adds
earliestBlock/latestBlocktoStatusand aBlockRangeUpdate (0x11)message pushed when the range changes, instead of request/response. - The
eth/70version number was later used by other proposals, such as EIP-7639 and EIP-7975, so do not assume "eth/70" means this design. - The spec stresses that advertising a block range is not a license to stop serving history before alternative storage for it exists.