@@ -13,7 +13,7 @@ use std::{
1313 time:: Duration ,
1414} ;
1515use tokio:: sync:: { mpsc, oneshot} ;
16- use tracing:: { error, info, instrument, warn } ;
16+ use tracing:: { Instrument , debug , error, info, instrument} ;
1717
1818const BLOB_CACHE_SIZE : u32 = ( MAX_BLOBS_PER_BLOCK_ELECTRA * EPOCH_SLOTS ) as u32 ;
1919const CACHE_REQUEST_CHANNEL_SIZE : usize = ( MAX_BLOBS_PER_BLOCK_ELECTRA * 2 ) as usize ;
@@ -26,7 +26,13 @@ const BETWEEN_RETRIES: Duration = Duration::from_millis(250);
2626/// retrieving blobs.
2727#[ derive( Debug ) ]
2828enum CacheInst {
29- Retrieve { slot : usize , tx_hash : B256 , version_hashes : Vec < B256 > , resp : oneshot:: Sender < Blobs > } ,
29+ Retrieve {
30+ slot : usize ,
31+ tx_hash : B256 ,
32+ version_hashes : Vec < B256 > ,
33+ resp : oneshot:: Sender < Blobs > ,
34+ span : tracing:: Span ,
35+ } ,
3036}
3137
3238/// Handle for the cache.
@@ -51,7 +57,14 @@ impl CacheHandle {
5157 ) -> FetchResult < Blobs > {
5258 let ( resp, receiver) = oneshot:: channel ( ) ;
5359
54- self . send ( CacheInst :: Retrieve { slot, tx_hash, version_hashes, resp } ) . await ;
60+ self . send ( CacheInst :: Retrieve {
61+ slot,
62+ tx_hash,
63+ version_hashes,
64+ resp,
65+ span : tracing:: Span :: current ( ) ,
66+ } )
67+ . await ;
5568
5669 receiver. await . map_err ( |_| BlobFetcherError :: missing_sidecar ( tx_hash) )
5770 }
@@ -164,7 +177,7 @@ impl<Pool: TransactionPool + 'static> BlobCacher<Pool> {
164177 return Ok ( blobs) ;
165178 }
166179 Err ( BlobFetcherError :: Ignorable ( e) ) => {
167- warn ! ( target: "signet_blobber::BlobCacher" , attempt, %e, "Blob fetch attempt failed." ) ;
180+ debug ! ( target: "signet_blobber::BlobCacher" , attempt, %e, "Blob fetch attempt failed." ) ;
168181 tokio:: time:: sleep ( BETWEEN_RETRIES ) . await ;
169182 continue ;
170183 }
@@ -178,8 +191,10 @@ impl<Pool: TransactionPool + 'static> BlobCacher<Pool> {
178191 /// Processes the cache instructions.
179192 async fn handle_inst ( self : Arc < Self > , inst : CacheInst ) {
180193 match inst {
181- CacheInst :: Retrieve { slot, tx_hash, version_hashes, resp } => {
182- if let Ok ( blobs) = self . fetch_blobs ( slot, tx_hash, version_hashes) . await {
194+ CacheInst :: Retrieve { slot, tx_hash, version_hashes, resp, span } => {
195+ if let Ok ( blobs) =
196+ self . fetch_blobs ( slot, tx_hash, version_hashes) . instrument ( span) . await
197+ {
183198 // if listener has gone away, that's okay, we just won't send the response
184199 let _ = resp. send ( blobs) ;
185200 }
0 commit comments