mirror of
https://github.com/paradigmxyz/reth.git
synced 2026-04-08 03:01:12 -04:00
perf(trie): defer consuming remaining storage proof receivers (#20915)
This commit is contained in:
@@ -1505,17 +1505,6 @@ where
|
||||
}
|
||||
}
|
||||
|
||||
// Consume remaining storage proof receivers for accounts not encountered during trie walk.
|
||||
for (hashed_address, receiver) in storage_proof_receivers {
|
||||
if let Ok(proof_msg) = receiver.recv() {
|
||||
// Extract storage proof from the result
|
||||
let proof_result = proof_msg.result?;
|
||||
let proof = Into::<Option<DecodedStorageMultiProof>>::into(proof_result)
|
||||
.expect("Partial proofs are not yet supported");
|
||||
collected_decoded_storages.insert(hashed_address, proof);
|
||||
}
|
||||
}
|
||||
|
||||
let _ = hash_builder.root();
|
||||
|
||||
let account_subtree_raw_nodes = hash_builder.take_proof_nodes();
|
||||
@@ -1537,6 +1526,17 @@ where
|
||||
tracker.cursor_metrics.account_trie_cursor.extend(&account_trie_cursor_metrics);
|
||||
tracker.cursor_metrics.account_hashed_cursor.extend(&account_hashed_cursor_metrics);
|
||||
|
||||
// Consume remaining storage proof receivers for accounts not encountered during trie walk.
|
||||
// Done last to allow storage workers more time to complete while we finalized the account trie.
|
||||
for (hashed_address, receiver) in storage_proof_receivers {
|
||||
if let Ok(proof_msg) = receiver.recv() {
|
||||
let proof_result = proof_msg.result?;
|
||||
let proof = Into::<Option<DecodedStorageMultiProof>>::into(proof_result)
|
||||
.expect("Partial proofs are not yet supported");
|
||||
collected_decoded_storages.insert(hashed_address, proof);
|
||||
}
|
||||
}
|
||||
|
||||
Ok(DecodedMultiProof {
|
||||
account_subtree: decoded_account_subtree,
|
||||
branch_node_masks,
|
||||
|
||||
Reference in New Issue
Block a user