From bc729671d9c2bef71b45dbe95628770ecfbdd196 Mon Sep 17 00:00:00 2001 From: YK Date: Wed, 4 Feb 2026 02:28:04 +0800 Subject: [PATCH] perf(rocksdb): batch tx reads in TransactionLookupStage unwind (#21723) Co-authored-by: Georgios Konstantopoulos Co-authored-by: Amp --- crates/stages/stages/src/stages/tx_lookup.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/crates/stages/stages/src/stages/tx_lookup.rs b/crates/stages/stages/src/stages/tx_lookup.rs index 1148eb443a..f35d153470 100644 --- a/crates/stages/stages/src/stages/tx_lookup.rs +++ b/crates/stages/stages/src/stages/tx_lookup.rs @@ -236,10 +236,10 @@ where } // Delete all transactions that belong to this block - for tx_id in body.tx_num_range() { - if let Some(transaction) = static_file_provider.transaction_by_id(tx_id)? { - writer.delete_transaction_hash_number(transaction.trie_hash())?; - } + for transaction in + static_file_provider.transactions_by_tx_range(body.tx_num_range())? + { + writer.delete_transaction_hash_number(transaction.trie_hash())?; } }