fix(reth-bench): gracefully stop when transaction source exhausted (#21700)

This commit is contained in:
Alexey Shekhirin
2026-02-02 11:10:58 +00:00
committed by GitHub
parent 49128ed28f
commit 05ab98107c

View File

@@ -572,13 +572,22 @@ impl Command {
for i in 0..self.count { for i in 0..self.count {
// Get initial batch of transactions for this payload // Get initial batch of transactions for this payload
let mut result = tx_buffer let Some(mut result) = tx_buffer.take_batch().await else {
.take_batch() info!(
.await payloads_built = i,
.ok_or_else(|| eyre::eyre!("Transaction fetcher stopped unexpectedly"))?; payloads_requested = self.count,
"Transaction source exhausted, stopping"
);
break;
};
if result.transactions.is_empty() { if result.transactions.is_empty() {
return Err(eyre::eyre!("No transactions collected for payload {}", i + 1)); info!(
payloads_built = i,
payloads_requested = self.count,
"No more transactions available, stopping"
);
break;
} }
// Build with retry - may need to request more transactions // Build with retry - may need to request more transactions