Skip to content

Commit 8cbd42a

Browse files
authored
feat(blobber): add trace logging for extraction results (ENG-256) (#77)
Add .inspect() calls with trace! logging to help debug extraction results: 1. In fetch_and_decode: logs slot and tx_hash when blobs are successfully fetched and decoded 2. In signet_block: logs host_block_number and tx_count when a ZenithBlock is constructed from header and data Closes ENG-256
1 parent d40a1c2 commit 8cbd42a

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

crates/blobber/src/blobs/cache.rs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,9 @@ impl<Coder> CacheHandle<Coder> {
100100
.find(|data| keccak256(data) == extract.block_data_hash())
101101
.map(Into::into)
102102
.ok_or_else(|| BlobberError::block_data_not_found(extract.block_data_hash()))
103+
.inspect(|_| {
104+
trace!(slot, %tx_hash, "Successfully fetched and decoded blobs");
105+
})
103106
}
104107

105108
/// Fetch the blobs, decode them using the provided coder, and construct a
@@ -131,7 +134,13 @@ impl<Coder> CacheHandle<Coder> {
131134
}
132135
Err(BlobberError::Fetch(err)) => return Err(err),
133136
};
134-
Ok(ZenithBlock::from_header_and_data(header, block_data))
137+
Ok(ZenithBlock::from_header_and_data(header, block_data)).inspect(|block| {
138+
trace!(
139+
host_block_number = %block.header().hostBlockNumber,
140+
tx_count = block.transactions().len(),
141+
"Constructed ZenithBlock from header and data"
142+
);
143+
})
135144
}
136145
}
137146

0 commit comments

Comments
 (0)