Przejdź do treści
Biblioteka skilli
DevOps i chmura · Nauka i wyjaśnianie

proof-server:proof-server-configuration

/proof-server:proof-server-configuration

Opisuje flagi, zmienne środowiskowe i strojenie serwera dowodowego Midnight, czyli liczbę workerów, limity i pamięć.

Licencja
Apache-2.0
Ostatnia zmiana repozytorium
23.10.2026

Ocena i bezpieczeństwo

85/ 100Klasa: dobry
Format15 / 25
Frontmatter z nazwą i opisem, poprawna nazwa, opis do 1024 znaków, nazwa zgodna z folderem.
Odkrywalność25 / 25
Opis mówi, kiedy użyć skilla, ma sensowną długość i jest w 3. osobie.
Treść30 / 35
Co najmniej 150 słów i do 500 linii, nagłówki, listy kroków, przykłady albo kod.
Higiena15 / 15
Bez zaślepek typu TODO, bez ścieżek Windows, z licencją.
Ryzykobrak sygnałów w skanie
Pliki w paczce
1
Skrypty
0
Komentarze HTML
0
Adresy URL w SKILL.md
0
Przestarzałość

Brak sygnałów. Repozytorium zmienione 23.10.2026, bez odwołań do wycofanych modeli i API.

Licencja

Apache-2.0, otwarta: można używać i zmieniać, z zachowaniem licencji i informacji o zmianach.

Co robi i kiedy

Opisuje flagi, zmienne środowiskowe i strojenie serwera dowodowego Midnight, czyli liczbę workerów, limity i pamięć.

Oryginalny opis (EN)

This skill covers proof server CLI flags, environment variables, and tuning guidance. Use it when the user asks about proof server configuration, num-workers, job-capacity, job-timeout, no-fetch-params, how many workers should I use, proof server slow, proof server out of memory, proof server environment variables, proof server Docker configuration, port configuration, verbose mode, memory requirements, startup time, resource planning, or production settings.

Jak działa

  1. CLI Flags & Environment Variables
  2. Flag Details
  3. Environment Profiles
  4. Tuning Rationale
  5. Tuning Guidance
Sekcje z nagłówków SKILL.md, w oryginale · 215 linii, 1 246 słów
Podgląd SKILL.md
---
name: proof-server:proof-server-configuration
description: This skill covers proof server CLI flags, environment variables, and tuning guidance. Use it when the user asks about proof server configuration, num-workers, job-capacity, job-timeout, no-fetch-params, how many workers should I use, proof server slow, proof server out of memory, proof server environment variables, proof server Docker configuration, port configuration, verbose mode, memory requirements, startup time, resource planning, or production settings.
version: 0.1.0
---

# Proof Server Configuration

Complete reference for all CLI flags and environment variables that control the Midnight proof server. For basic Docker setup and running, see `midnight-tooling:proof-server`. For internal architecture, see `proof-server:proof-server-architecture`.

> Replace `<version>` in image tags below with the version matching your target Midnight network. Check `midnight-tooling:release-notes` for current versions.

## CLI Flags & Environment Variables

Every CLI flag has a corresponding environment variable. When both are set, the CLI flag takes precedence.

| Flag | Env Var | Default | Description |
|------|---------|---------|-------------|
| `-p`, `--port` | `MIDNIGHT_PROOF_SERVER_PORT` | `6300` | HTTP listen port |
| `-v`, `--verbose` | `MIDNIGHT_PROOF_SERVER_VERBOSE` | `false` | Enable DEBUG-level logging |
| `--job-capacity` | `MIDNIGHT_PROOF_SERVER_JOB_CAPACITY` | `0` (unlimited) | Maximum number of pending jobs in the queue |
| `--num-workers` | `MIDNIGHT_PROOF_SERVER_NUM_WORKERS` | `2` | Number of parallel proving threads |
| `--job-timeout` | `MIDNIGHT_PROOF_SERVER_JOB_TIMEOUT` | `600.0` (10 min) | Job time-to-live in seconds before garbage collection |
| `--no-fetch-params` | `MIDNIGHT_PROOF_SERVER_NO_FETCH_PARAMS` | `false` | Skip pre-fetching ZK parameters and proving keys on startup |

## Flag Details

### `-p`, `--port`

The HTTP port the proof server listens on. Change this when running multiple proof server instances or when port 6300 conflicts with another service.

```bash
# CLI
midnight-proof-server --port 6301

# Environment variable
MIDNIGHT_PROOF_SERVER_PORT=6301 midnight-proof-server

# Docker
docker run -d --name midnight-proof-server -p 6301:6301 \
  midnightntwrk/proof-server:<version> -- midnight-proof-server --port 6301
```

When changing the port with Docker, update both the container port (`--port` flag inside the container) and the Docker port mapping (`-p` flag).

### `-v`, `--verbose`

Enables DEBUG-level logging output. Without this flag, only INFO and above are logged. Verbose mode is useful for diagnosing proving failures, timing issues, and key material fetching.

```bash
# CLI
midnight-proof-server -v

# Docker (recommended for development)
docker run -d --name midnight-proof-server -p 6300:6300 \
  midnightntwrk/proof-server:<version> -- midnight-proof-server -v
```

### `--num-workers`

Controls how many proof generation tasks can run in parallel. Workers run on the shared tokio runtime and offload each job via `spawn_blocking`; a fresh current-thread tokio runtime is created per job inside the blocking closure.

```bash
# CLI — 4 workers for a quad-core machine
midnight-proof-server --num-workers 4

# Environment variable
MIDNIGHT_PROOF_SERVER_NUM_WORKERS=4 midnight-proof-server

# Docker
docker run -d --name midnight-proof-server -p 6300:6300 \
  midnightntwrk/proof-server:<version> -- midnight-proof-server --num-workers 4
```

Worker count does not need to match CPU core count exactly. Proving is CPU-intensive, so more workers than cores leads to contention. Fewer workers than cores leaves headroom for the HTTP server and garbage collection.

### `--job-capacity`

Sets the maximum number of pending jobs in the worker pool queue. When the queue is full, new `/prove` requests receive HTTP 429 (Too Many Requests). A value of 0 (default) means unlimited queue depth.

```bash
# CLI — limit to 20 pending jobs
midnight-proof-server --job-capacity 20

# Environment variable
MIDNIGHT_PROOF_SERVER_JOB_CAPACITY=20 midnight-proof-server
```

Setting a capacity limit is recommended for production to prevent unbounded memory growth when the server receives more requests than it can process.

### `--job-timeout`

Sets the time-to-live (TTL) in seconds for each job. A background garbage collector runs every 10 seconds and removes jobs that have exceeded this timeout. Applies to jobs in any state (pending, processing).

```bash
# CLI — 5 minute timeout
midnight-proof-server --job-timeout 300

# Environment variable
MIDNIGHT_PROOF_SERVER_JOB_TIMEOUT=300 midnight-proof-server
```

The default of 600 seconds (10 minutes) is generous for most circuits. Complex circuits with high k-values may need longer timeouts. Simple circuits typically complete in under 30 seconds.

### `--no-fetch-params`

Skips the pre-fetching of ZK public parameters (k=10 through k=15) and built-in proving keys (midnight/zswap/spend, midnight/zswap/output, midnight/zswap/sign, midnight/dust/spend) on startup. This makes the server available faster but defers the fetch cost to the first proof request for each circuit.

```bash
# CLI
midnight-proof-server --no-fetch-params

# Environment variable
MIDNIGHT_PROOF_SERVER_NO_FETCH_PARAMS=true midnight-proof-server

# Docker — fast startup for development
docker run -d --name midnight-proof-server -p 6300:6300 \
  midnightntwrk/proof-server:<version> -- midnight-proof-server --no-fetch-params -v
```

## Environment Profiles

### Development

Default settings work well for development. The server starts with 2 workers and pre-fetches parameters.

```bash
docker run -d --name midnight-proof-server -p 6300:6300 \
  midnightntwrk/proof-server:<version> -- midnight-proof-server -v
```

For faster startup during iterative development, skip parameter pre-fetching:

```bash
docker run -d --name midnight-proof-server -p 6300:6300 \
  midnightntwrk/proof-server:<version> -- midnight-proof-server --no-fetch-params -v
```

### Production

Scale workers based on available CPU cores and set capacity limits to prevent resource exhaustion:

```bash
docker run -d --name midnight-proof-server -p 6300:6300 \
  --memory=8g \
  midnightntwrk/proof-server:<version> -- midnight-proof-server \
  --num-workers 8 \
  --job-capacity 50 \
  --job-timeout 300
```

### CI / Testing

Minimal configuration for automated testing where fast startup matters more than throughput:

```bash
docker run -d --name midnight-proof-server -p 6300:6300 \
  midnightntwrk/proof-server:<version> -- midnight-proof-server \
  --no-fetch-params \
  --num-workers 1 \
  --job-capacity 5
```

## Tuning Rationale

The configuration knobs map directly onto two phases of the proving pipeline. Workers control parallelism at the CPU level: each proof runs inside a `spawn_blocking` closure, pinning one physical core for its entire duration, so `--num-workers` should not exceed the cores available for proving work. The `--no-fetch-params` flag trades startup time for first-proof latency: omitting it causes the server to download ZK public parameters and built-in proving keys before the HTTP listener binds, which means the server is unavailable for several minutes but serves the first proof immediately; passing it inverts this trade-off and defers the fetch cost to the first request for each circuit. For a full description of how parameters and proving keys are stored and loaded at runtime, see `proof-server:proof-server-architecture`.

## Tuning Guidance

### Worker Count

| Scenario | Recommended `--num-workers` |
|----------|----------------------------|
| Development (local machine) | 2 (default) |
| CI / testing | 1 |
| Production (4-core) | 3-4 |
| Production (8-core) | 6-8 |
| Production (16+ core) | 12-14 (leave cores for OS/HTTP) |

Proving is CPU-bound. Each worker occupies one core during proof generation. Leave 1-2 cores free for the HTTP server, garbage collection, and OS tasks.

### Job Capacity

| Scenario | Recommended `--job-capacity` |
|----------|------------------------------|
| Development | 0 (unlimited, default) |
| Production (small) | 10-20 |
| Production (large) | 50-100 |

Unlimited capacity is fine for development where request volume is low. In production, set capacity to prevent OOM when bursts of requests arrive faster than workers can process them.

### Memory Requirements

| Configuration | Minimum RAM |
|---------------|-------------|
| Development (2 workers) | 4 GB |
| Production (4 workers) | 8 GB |
| Production (8 workers) | 16 GB |

Each worker holds proving keys and intermediate state in memory during proof generation. Complex circuits (high k-values) require more memory per worker. When running in Docker, set the container memory limit using `--memory` to match.

### Startup Time

| Mode | Typical Startup Time |
|------|---------------------|
| With pre-fetch (default) | 2-5 minutes (network and cache dependent) |
| With `--no-fetch-params` | Under 5 seconds |

Pre-fetching downloads public parameters and proving keys from the network. Subsequent starts are faster if the cache is warm. The `--no-fetch-params` flag defers this cost to the first proof request, making the server available immediately but causing a delay on the first proof for each circuit.

### Job Timeout

| Circuit Complexity | Recommended `--job-timeout` |
|-------------------|----------------------------|
| Simple (k <= 12) | 120-300 seconds |
| Medium (k = 13-15) | 300-600 seconds |
| Complex (k > 15) | 600-1200 seconds |

The default 600-second timeout accommodates most circuits. Increase it only if you observe timeout-related job cancellations in the logs for legitimate proving requests.

Wersje

W bazie nie ma innych skilli o nazwie proof-server:proof-server-configuration.

Migawka bazy z 13.11.2026 · wersja paczki a607200aa479 (skrót SHA-256 całej paczki)

Pobrania w ostatnich 30 dniach: 1 · ranking

Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.

Podobne skille

  • 90midnight-tooling:proof-server
    Uruchamia, zatrzymuje i diagnozuje serwer dowodów Midnight lokalnie, w testnecie lub na mainnecie, wraz z logami, portem i obrazem Docker.
  • 90proof-server:proof-server-operations
    Pomaga monitorować i diagnozować serwer dowodów: kontrole zdrowia, kody 503 i 429, logi, limity czasu, pamięć, zgodność wersji i skalowanie.
  • 100configuration-management
    Zarządza konfiguracją aplikacji w różnych środowiskach: warstwowe ładowanie, zmienne środowiskowe, zarządzanie sekretami i walidacja, ze wzorcami 12-factor app i formatami plików konfiguracyjnych.
  • 100medusa-deploy
    Wdraża Medusa v2 na produkcję: proces budowania, tryb serwera i workera, zmienne środowiskowe, opcje hostingu, cache Redis, konfiguracja bazy i lista kontrolna produkcyjna.
  • 100vercel-deployment
    Wdraża aplikacje Next.js na Vercel z poprawną konfiguracją: zmienne środowiskowe, edge functions i diagnostyka buildów.
  • 90vercel-overview
    Wprowadza w platformę Vercel: projekty, CLI, integrację z Gitem, zmienne środowiskowe, REST API i webhooki.

Uwagi i zgłoszenia

Wiadomość trafi do Bartosza Sokolińskiego. Adres e-mail jest potrzebny tylko do odpowiedzi. Szczegóły w polityce prywatności.