Module proof_task

Module proof_task 

Source
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: ProofWorkerHandle provides 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

  1. MultiProofTask prepares a storage or account job and hands it to ProofWorkerHandle. The job carries a ProofResultContext so the worker knows how to send the result back.
  2. A worker receives the job, runs the proof, and sends a ProofResultMessage through the provided ProofResultSender.
  3. MultiProofTask receives the message, uses sequence_number to 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§

AccountMultiproofInput
Input parameters for account multiproof computation.
ProofResultContext
Context for sending proof calculation results back to MultiProofTask.
ProofResultMessage
Message containing a completed proof result with metadata for direct delivery to MultiProofTask.
ProofTaskCtx
Data used for initializing cursor factories that is shared across all storage proof instances.
ProofTaskTx
This contains all information shared between all storage proof instances.
ProofWorkerHandle
A handle that provides type-safe access to proof worker pools.
StorageProofInput
Input parameters for storage proof computation.

Enums§

ProofResult
Result of a proof calculation, which can be either an account multiproof or a storage proof.
ProofTaskTrieNodeProvider
Trie node provider for retrieving trie nodes by path.

Type Aliases§

ProofResultSender
Channel used by worker threads to deliver ProofResultMessage items back to MultiProofTask.