mirror of
https://github.com/paradigmxyz/reth.git
synced 2026-04-30 03:01:58 -04:00
fix(reth-bench): gracefully stop when transaction source exhausted (#21700)
This commit is contained in:
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user