mirror of
https://github.com/paradigmxyz/reth.git
synced 2026-04-30 03:01:58 -04:00
refactor(trie): improve storage proof handling in parallel processing
- Added logic to drain receivers for accounts not touched by the walker, allowing workers to deliver results without encountering closed channels. - Enhanced error handling for closed channels during storage proof reception, ensuring robustness in parallel processing.
This commit is contained in:
@@ -321,6 +321,17 @@ where
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Drain receivers for accounts the walker never touched (e.g. destroyed targets) so workers
|
||||
// can deliver their results without hitting a closed channel.
|
||||
for (hashed_address, rx) in storage_proof_receivers {
|
||||
let decoded_storage_multiproof = rx.recv().map_err(|e| {
|
||||
ParallelStateRootError::StorageRoot(StorageRootError::Database(
|
||||
DatabaseError::Other(format!("channel closed for {hashed_address}: {e}")),
|
||||
))
|
||||
})??;
|
||||
collected_decoded_storages.insert(hashed_address, decoded_storage_multiproof);
|
||||
}
|
||||
let _ = hash_builder.root();
|
||||
|
||||
let stats = tracker.finish();
|
||||
|
||||
Reference in New Issue
Block a user