Skip to main content
For the complete documentation index, see llms.txt

Proof server errors

The proof server is a standalone HTTP service that generates zero-knowledge proofs for transactions. It is part of the midnight-ledger repository and typically runs on port 6300.

It is the only crate in midnight-ledger that uses thiserror derives for error handling. The server maps errors to HTTP status codes and returns them as HTTP responses.

Worker pool errors (WorkerPoolError)

These errors arise from the proof server's internal job queue and worker pool management.

HTTP statusErrorDescriptionFix
400 Bad RequestJobNotPending(Uuid)Tried to cancel a non-pending job.Job is already processing, completed, or cancelled.
428 Precondition RequiredJobMissing(Uuid)Referenced job not found.The job ID is invalid or has expired.
429 Too Many RequestsJobQueueFullThe proof generation job queue is full.Wait and retry; the server is under heavy load.
500 Internal Server ErrorChannelClosedInternal work channel closed.Restart the proof server.

Work errors (WorkError)

These errors occur during the actual proof generation process.

HTTP StatusErrorDescriptionFix
400 Bad RequestBadInput(String)Proof request input data is invalid.Check the transaction data being sent for proving.
500 Internal Server ErrorCancelledUnexpectedlyThe system cancelled the job without an explicit requestInternal error; retry the proof request
500 Internal Server ErrorInternalError(String)Internal proof generation error.Check proof server logs; restart the proof server if the error persists.
500 Internal Server ErrorJoinErrorTask join error during proof generation.Internal threading error; retry or restart.

Job status enum

The proof server tracks each proof job through the following states.

StatusDescription
PendingJob queued, waiting for a worker.
ProcessingProof generation in progress.
CancelledThe system cancelled this job.
Error(WorkError)Job failed with an error.
Success(Vec<u8>)Proof generated successfully.

Health endpoint

Use the /ready endpoint to check whether the proof server is accepting new requests.

EndpointHTTP statusDescription
GET /ready200 OKServer is ready to accept proof requests.
GET /ready503 Service UnavailableServer is busy (all workers occupied).

Common issues

The following table covers the most frequent problems and their likely causes.

SymptomLikely causeFix
429 responsesToo many concurrent proof requests are being sent to the server.Reduce the number of parallel proof requests and implement an exponential backoff retry strategy so requests are spaced out under load.
503 from /readyAll proof workers are busy.Wait for current proofs to complete or increase the worker count in config.
500 with "BadInput"Malformed transaction dataVerify the transaction was built correctly with the SDK.
Connection refused on port 6300Proof server not runningStart the proof server container, check Docker status.
Slow proof generationLarge circuit or insufficient resourcesAllocate more CPU or memory to the proof server container.