11use crate :: { BlobFetcherError , Blobs , FetchResult } ;
22use alloy:: consensus:: { SidecarCoder , SimpleCoder , Transaction as _} ;
3+ use alloy:: eips:: eip7691:: MAX_BLOBS_PER_BLOCK_ELECTRA ;
4+ use alloy:: eips:: merge:: EPOCH_SLOTS ;
35use alloy:: primitives:: { keccak256, Bytes , B256 } ;
46use reth:: transaction_pool:: TransactionPool ;
57use reth:: { network:: cache:: LruMap , primitives:: Receipt } ;
@@ -13,7 +15,8 @@ use std::{
1315use tokio:: sync:: { mpsc, oneshot} ;
1416use tracing:: { error, info, instrument, warn} ;
1517
16- const BLOB_CACHE_SIZE : u32 = 144 ;
18+ const BLOB_CACHE_SIZE : u32 = ( MAX_BLOBS_PER_BLOCK_ELECTRA * EPOCH_SLOTS ) as u32 ;
19+ const CACHE_REQUEST_CHANNEL_SIZE : usize = ( MAX_BLOBS_PER_BLOCK_ELECTRA * 2 ) as usize ;
1720const FETCH_RETRIES : usize = 3 ;
1821const BETWEEN_RETRIES : Duration = Duration :: from_millis ( 250 ) ;
1922
@@ -198,7 +201,7 @@ impl<Pool: TransactionPool + 'static> BlobCacher<Pool> {
198201 /// # Panics
199202 /// This function will panic if the cache task fails to spawn.
200203 pub fn spawn ( self ) -> CacheHandle {
201- let ( sender, inst) = mpsc:: channel ( 12 ) ;
204+ let ( sender, inst) = mpsc:: channel ( CACHE_REQUEST_CHANNEL_SIZE ) ;
202205 tokio:: spawn ( Arc :: new ( self ) . task_future ( inst) ) ;
203206 CacheHandle { sender }
204207 }
0 commit comments