-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Description
Summary
Add a BlockAccessListsClient trait (analogous to BodiesClient) for downloading block access lists from peers over the eth/71 protocol. The wire types GetBlockAccessLists and BlockAccessLists already exist, and the server-side handling is wired up, but there is no client-side trait or fetcher integration to request them.
Relates to #22591 (ReceiptsClient).
TODO
1. Define the BlockAccessListsClient trait
Create a new module under crates/net/p2p/src/ (e.g. block_access_lists/) with a trait modeled after BodiesClient:
#[auto_impl(&, Arc, Box)]
pub trait BlockAccessListsClient: DownloadClient {
type Output: Future<Output = PeerRequestResult<BlockAccessLists>> + Send + Sync + Unpin;
fn get_block_access_lists(&self, hashes: Vec<B256>) -> Self::Output;
fn get_block_access_lists_with_priority(&self, hashes: Vec<B256>, priority: Priority) -> Self::Output;
}2. Add a GetBlockAccessLists variant to DownloadRequest
Extend the DownloadRequest enum with a new variant:
GetBlockAccessLists {
request: Vec<B256>,
response: oneshot::Sender<PeerRequestResult<BlockAccessLists>>,
priority: Priority,
}3. Implement BlockAccessListsClient for FetchClient
Follow the pattern in FetchClient's BodiesClient impl — send a DownloadRequest::GetBlockAccessLists over the channel.
4. Handle the request in StateFetcher
Wire up the new download request in StateFetcher:
- Add
inflight_bal_requeststracking (similar toinflight_bodies_requests) - Add
PeerState::GetBlockAccessListsvariant - Handle dispatching in
prepare_block_request/poll_action
5. Check peer version before dispatching — eth/71 only
Important: GetBlockAccessLists / BlockAccessLists are only available in eth/71 (message IDs 0x12 / 0x13). The Peer struct already stores capabilities. Before dispatching a BAL request to a peer, the fetcher must verify the peer has negotiated eth/71. Peers on eth/70 or earlier must be skipped in next_best_peer.
6. Handle BAL responses in the session layer
The session layer already decodes BAL responses (active.rs), but these need to be routed back through the StateFetcher to resolve the inflight request's oneshot::Sender.
Reference
- Wire types:
block_access_lists.rs - Message variants:
EthMessage::GetBlockAccessLists/BlockAccessLists - Message IDs:
EthMessageID::GetBlockAccessLists(0x12) /BlockAccessLists(0x13) - Version gating:
EthMessageID::max() - Existing server-side handling:
eth_requests.rs - Session layer decode:
active.rs
Metadata
Metadata
Assignees
Labels
Type
Projects
Status