perf(trie): dispatch storage proofs in lexicographical order (#21213)

Signed-off-by: Ahsen Kamal <itsahsenkamal@gmail.com>
This commit is contained in:
Ahsen Kamal
2026-01-20 22:39:20 +05:30
committed by GitHub
parent 7371bd3f29
commit 7934294988

View File

@@ -1555,8 +1555,11 @@ fn dispatch_storage_proofs(
let mut storage_proof_receivers =
B256Map::with_capacity_and_hasher(targets.len(), Default::default());
let mut sorted_targets: Vec<_> = targets.iter().collect();
sorted_targets.sort_unstable_by_key(|(addr, _)| *addr);
// Dispatch all storage proofs to worker pool
for (hashed_address, target_slots) in targets.iter() {
for (hashed_address, target_slots) in sorted_targets {
// Create channel for receiving ProofResultMessage
let (result_tx, result_rx) = crossbeam_channel::unbounded();