Skip to content

Commit

Permalink
fix: modify the measurement code for write receipts
Browse files Browse the repository at this point in the history
  • Loading branch information
anonymousGiga committed Mar 14, 2024
1 parent 4897f88 commit c9293e1
Showing 1 changed file with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -399,15 +399,14 @@ impl BundleStateWithReceipts {
for (tx_idx, receipt) in receipts.into_iter().enumerate() {
if let Some(receipt) = receipt {
#[cfg(feature = "enable_write_to_db_measure")]
{
let size = std::mem::size_of::<Receipt>() +
let _record = perf_metrics::ReceiptsWrite::new(
std::mem::size_of::<Receipt>() +
receipt
.logs
.iter()
.map(|log| log.topics.len() * 32 + log.data.0.len())
.sum::<usize>();
let _record = perf_metrics::ReceiptsWrite::new(size);
}
.sum::<usize>(),
);
receipts_cursor.append(first_tx_index + tx_idx as u64, receipt)?;
}
}
Expand Down

0 comments on commit c9293e1

Please sign in to comment.