Expand description
Implementation of parallel proof computation. Parallel proof computation using worker pools with dedicated database transactions.
§Architecture
- Worker Pools: Pre-spawned workers with dedicated database transactions
- Storage pool: Handles storage proofs and blinded storage node requests
- Account pool: Handles account multiproofs and blinded account node requests
- Direct Channel Access:
ProofWorkerHandleprovides type-safe queue methods with direct access to worker channels, eliminating routing overhead - Automatic Shutdown: Workers terminate gracefully when all handles are dropped
§Message Flow
- The multiproof task prepares a storage or account job and hands it to
ProofWorkerHandle. The job carries aProofResultContextso the worker knows how to send the result back. - A worker receives the job, runs the proof, and sends a
ProofResultMessagethrough the providedProofResultSender. - The multiproof task receives the message and proceeds with its state-root logic.
Each job gets its own direct channel so results go straight back to the multiproof task. That keeps ordering decisions in one place and lets workers run independently.
SparseTrieCacheTask -> ProofWorkerHandle -> Storage/Account Worker
^ |
| v
ProofResultMessage <-- ProofResultSenderStructs§
- Account
Multiproof Input - Input parameters for account multiproof computation.
- Proof
Result Context - Context for sending proof calculation results back to
MultiProofTask. - Proof
Result Message - Message containing a completed proof result with metadata for direct delivery to
MultiProofTask. - Proof
Task Ctx - Data used for initializing cursor factories that is shared across all proof worker instances.
- Proof
Task Tx - This contains all information shared between account proof worker instances.
- Proof
Worker Handle - A handle that provides type-safe access to proof worker pools.
- Storage
Proof Input - Input parameters for storage proof computation.
- Storage
Proof Result Message - Message containing a completed storage proof result with metadata.
Enums§
- Proof
Task Trie Node Provider - Trie node provider for retrieving trie nodes by path.
Type Aliases§
- Proof
Result Sender - Channel used by worker threads to deliver
ProofResultMessageitems back toMultiProofTask.