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
ProofWorkerHandle::dispatchsplits proof targets into storage and account jobs and queues each job for the matching worker pool.- A worker receives a job, runs the proof, and sends one
ProofWorkerResultto the handle’s result channel. - The owner of the handle receives the results through
ProofWorkerHandle::results.
ProofWorkerHandle::dispatch -> Storage/Account Worker
|
v
ProofWorkerHandle::results <-- ProofWorkerResultModules§
- metrics
metrics - Proof worker metrics.
Structs§
- Proof
Task Ctx - Data used for opening proof providers that is shared across all proof worker instances.
- Proof
Worker Counts - How many workers
ProofWorkerHandle::newspawns for a block. - Proof
Worker Handle - Owns the storage and account proof worker pools and the channel their results arrive on.
- Proof
Workers Unavailable - Error returned by
ProofWorkerHandle::dispatchwhen a worker pool has shut down.
Type Aliases§
- Proof
Worker Result - A message received from
ProofWorkerHandle::results: the outcome of one queued job, or a worker’s failure to start.