Skip to content

@armada/sdk / index / createWorkerProver

Function: createWorkerProver() ​

createWorkerProver(spawn): ProverAdapter

Defined in: src/prover/worker-prover.ts:100

Main-thread ProverAdapter over a worker — proving runs off the main thread. spawn starts a worker and returns its channel; it is called lazily on the first request, and again after a worker is lost:

  • a worker failure (onError) rejects that worker's in-flight requests with ProverWorkerError;
  • aborting an in-flight request terminates the worker (snarkjs can't be interrupted mid-proof, and a retry must not prove alongside the abandoned proof): the aborted request rejects with AbortedError, any others on that worker with ProverWorkerError.

Either way the next request starts a fresh worker. close() rejects in-flight requests, posts a close request (so the worker terminates its curve threads), terminates the worker, and never spawns another.

Parameters ​

spawn ​

() => WorkerChannel

Returns ​

ProverAdapter