Expand description
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
MultiProofTaskprepares a storage or account job and hands it toProofWorkerHandle. 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. MultiProofTaskreceives the message, usessequence_numberto keep proofs in order, and proceeds with its state-root logic.
Each job gets its own direct channel so results go straight back to MultiProofTask. That keeps
ordering decisions in one place and lets workers run independently.
MultiProofTask -> MultiproofManager -> ProofWorkerHandle -> Storage/Account Worker
^ |
| v
ProofResultMessage <-------- ProofResultSender ---Structs§
- 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 storage proof instances.
- Proof
Task Tx - This contains all information shared between all storage proof instances.
- Proof
Worker Handle - A handle that provides type-safe access to proof worker pools.
- Storage
Proof Input - Input parameters for storage proof computation.
Enums§
- Proof
Result - Result of a proof calculation, which can be either an account multiproof or a storage proof.
- 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.