Skip to main content

reth_network_p2p/block_access_lists/
client.rs

1use crate::{download::DownloadClient, error::PeerRequestResult, priority::Priority};
2use alloy_primitives::B256;
3use auto_impl::auto_impl;
4use futures::Future;
5use reth_eth_wire_types::BlockAccessLists;
6
7/// A client capable of downloading block access lists.
8#[auto_impl(&, Arc, Box)]
9pub trait BlockAccessListsClient: DownloadClient {
10    /// The bal type this client fetches.
11    type Output: Future<Output = PeerRequestResult<BlockAccessLists>> + Send + Sync + Unpin;
12
13    ///  Fetches the block access lists for given hashes.
14    fn get_block_access_lists(&self, hashes: Vec<B256>) -> Self::Output {
15        self.get_block_access_lists_with_priority(hashes, Priority::Normal)
16    }
17
18    ///  Fetches the block access lists for given hashes with priority
19    fn get_block_access_lists_with_priority(
20        &self,
21        hashes: Vec<B256>,
22        priority: Priority,
23    ) -> Self::Output;
24}