@@ -13,7 +13,7 @@ use std::{
13
13
time:: Duration ,
14
14
} ;
15
15
use tokio:: sync:: { mpsc, oneshot} ;
16
- use tracing:: { error, info, instrument, warn } ;
16
+ use tracing:: { Instrument , debug , error, info, instrument} ;
17
17
18
18
const BLOB_CACHE_SIZE : u32 = ( MAX_BLOBS_PER_BLOCK_ELECTRA * EPOCH_SLOTS ) as u32 ;
19
19
const 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);
26
26
/// retrieving blobs.
27
27
#[ derive( Debug ) ]
28
28
enum 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
+ } ,
30
36
}
31
37
32
38
/// Handle for the cache.
@@ -51,7 +57,14 @@ impl CacheHandle {
51
57
) -> FetchResult < Blobs > {
52
58
let ( resp, receiver) = oneshot:: channel ( ) ;
53
59
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 ;
55
68
56
69
receiver. await . map_err ( |_| BlobFetcherError :: missing_sidecar ( tx_hash) )
57
70
}
@@ -164,7 +177,7 @@ impl<Pool: TransactionPool + 'static> BlobCacher<Pool> {
164
177
return Ok ( blobs) ;
165
178
}
166
179
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." ) ;
168
181
tokio:: time:: sleep ( BETWEEN_RETRIES ) . await ;
169
182
continue ;
170
183
}
@@ -178,8 +191,10 @@ impl<Pool: TransactionPool + 'static> BlobCacher<Pool> {
178
191
/// Processes the cache instructions.
179
192
async fn handle_inst ( self : Arc < Self > , inst : CacheInst ) {
180
193
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
+ {
183
198
// if listener has gone away, that's okay, we just won't send the response
184
199
let _ = resp. send ( blobs) ;
185
200
}
0 commit comments