mirror of
https://github.com/paradigmxyz/reth.git
synced 2026-02-19 03:04:27 -05:00
perf(trie): dispatch V2 storage proofs in lexicographical order (#21684)
This commit is contained in:
@@ -1828,8 +1828,14 @@ fn dispatch_v2_storage_proofs(
|
||||
}
|
||||
}
|
||||
|
||||
// Sort storage targets by address for optimal dispatch order.
|
||||
// Since trie walk processes accounts in lexicographical order, dispatching in the same order
|
||||
// reduces head-of-line blocking when consuming results.
|
||||
let mut sorted_storage_targets: Vec<_> = storage_targets.into_iter().collect();
|
||||
sorted_storage_targets.sort_unstable_by_key(|(addr, _)| *addr);
|
||||
|
||||
// Dispatch all proofs for targeted storage slots
|
||||
for (hashed_address, targets) in storage_targets {
|
||||
for (hashed_address, targets) in sorted_storage_targets {
|
||||
// Create channel for receiving StorageProofResultMessage
|
||||
let (result_tx, result_rx) = crossbeam_channel::unbounded();
|
||||
let input = StorageProofInput::new(hashed_address, targets);
|
||||
|
||||
Reference in New Issue
Block a user