Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,16 @@ where
.withdrawal_transactions_per_block_limit,
"No queued withdrawal documents found to pool into transactions"
);
// Reading every withdrawal document the chain ever produced, only to
// count them for a log line. Withdrawal documents are never removed,
// so this grows without bound with chain history — measured at 4.8 ms
// a block by height 200,000 on mainnet, and it ran on every block
// that had nothing queued, which is nearly all of them. Do it only
// when the line it feeds will actually be emitted.
if !tracing::enabled!(tracing::Level::DEBUG) {
return Ok(());
}

let all_documents = self
.drive
.fetch_oldest_withdrawal_documents(transaction, platform_version)?;
Expand All @@ -57,7 +67,7 @@ where
height = block_info.height,
"No withdrawal documents found at all"
);
} else if tracing::enabled!(tracing::Level::DEBUG) {
} else {
// Count documents by status
let queued_count = all_documents
.get(&(withdrawals_contract::WithdrawalStatus::QUEUED as u8))
Expand Down
Loading