-
Notifications
You must be signed in to change notification settings - Fork 2k
Closed
Labels
A-engineRelated to the engine implementationRelated to the engine implementationC-enhancementNew feature or requestNew feature or requestC-perfA change motivated by improving speed, memory usage or disk footprintA change motivated by improving speed, memory usage or disk footprint
Milestone
Description
Eliminate the spawn_blocking hop in the multiproof pipeline.
- Pass the multiproof task's Sender (or a dedicated result sender) directly into the proof workers.
- Instead of recving here: , we could forward a sender to the proofworker then we don’t need to spawn just to recv and send back the result
reth/crates/trie/parallel/src/proof.rs
Lines 126 to 130 in 792b82d
let proof_result = receiver.recv().map_err(|_| { ParallelStateRootError::StorageRoot(StorageRootError::Database(DatabaseError::Other( format!("channel closed for {hashed_address}"), ))) })?; - Wire the worker-side result path () directly into the multiproof task's inbox (
reth/crates/trie/parallel/src/proof_task.rs
Lines 77 to 78 in 792b82d
/// Channel to send result back to original caller result_sender: Sender<StorageProofResult>, ).match self.rx.recv() { - We would need a separate channel with a crossbeam select! because we cant use
https://github.com/paradigmxyz/reth/blob/792b82d8956d91255c022abf7ea39a81781d0796/crates/engine/tree/src/tree/payload_processor/multiproof.rs#L[…]66
due to different crates
Current:
MultiproofManager --(spawn_blocking)--> worker_rx.recv()
└── result -> MultiProofTask channel
Proposed:
MultiproofManager -input-> worker
worker -direct send-> MultiProofTask channel
Impact: Remove the spawn → recv → send roundtrip for both account and storage proof workers.
Additional context
https://docs.rs/crossbeam/latest/crossbeam/macro.select.html
Metadata
Metadata
Assignees
Labels
A-engineRelated to the engine implementationRelated to the engine implementationC-enhancementNew feature or requestNew feature or requestC-perfA change motivated by improving speed, memory usage or disk footprintA change motivated by improving speed, memory usage or disk footprint
Type
Projects
Status
Done