Skip to main content

Module proof_task

Module proof_task 

Source
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, one account’s storage trie per job
    • Account pool: Handles account proofs, calculating storage roots inline
  • Automatic Shutdown: Workers terminate gracefully when the handle is dropped

§Message Flow

  1. ProofWorkerHandle::dispatch splits proof targets into storage and account jobs and queues each job for the matching worker pool.
  2. A worker receives a job, runs the proof, and sends one ProofWorkerResult to the handle’s result channel.
  3. The owner of the handle receives the results through ProofWorkerHandle::results.
ProofWorkerHandle::dispatch -> Storage/Account Worker
                                         |
                                         v
ProofWorkerHandle::results <-- ProofWorkerResult

Modules§

metricsmetrics
Proof worker metrics.

Structs§

ProofTaskCtx
Data used for opening proof providers that is shared across all proof worker instances.
ProofWorkerCounts
How many workers ProofWorkerHandle::new spawns for a block.
ProofWorkerHandle
Owns the storage and account proof worker pools and the channel their results arrive on.
ProofWorkersUnavailable
Error returned by ProofWorkerHandle::dispatch when a worker pool has shut down.

Type Aliases§

ProofWorkerResult
A message received from ProofWorkerHandle::results: the outcome of one queued job, or a worker’s failure to start.