ops: the mint replay window is 60 s and memory-only — CDK_MINTD_CACHE_TTL is never set, and any mint restart wipes the window mid-TTL

Aperta
#867 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
35/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
docker, go, redis

Direzione di ricerca

Read /root/src/nut19-restore-research/nut19-restore-research.md §4 and inspect Dockerfile.mint to confirm the current cdk-mintd version and build features. Trace how lab and production mint deployments set environment variables, then check whether their configuration supports the requested TTL and Redis backend. Done means the TTL is configured and restart persistence is addressed where required, with the /v1/info nuts.19.ttl value matching the chosen setting.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Finding. Every lab/deployment mint so far runs cdk-mintd's NUT-19 response cache at
defaults: CDK_MINTD_CACHE_BACKEND=memory, TTL 60 s (cdk-axum DEFAULT_TTL_SECS).
Two consequences the crash lane lived with:

  1. The replay window is only as long as the TTL — scenario (e): wallet down 95 s ⇒
    400 {"code":11001,...}, value stuck-but-journaled pending the /restore follow-up.
  2. Any mint restart wipes the window instantly, mid-TTL — verified live 2026-10-11:
    a replay was refused 11001 seconds after a docker restart, well inside the 60 s
    window (in-memory cache dies with the process). The effective window is
    min(TTL, mint uptime), and no TTL value fixes the uptime half.

Knobs (source-verified, cdk v0.17.6 tag + cdk-0.18.1 tree; details in
/root/src/nut19-restore-research/nut19-restore-research.md §4):

  • 0.17.6 (current pin): env CDK_MINTD_CACHE_TTL=<secs> (or legacy
    CDK_MINTD_CACHE_SECONDS) — honored at every startup. Backend:
    CDK_MINTD_CACHE_BACKEND=memory|redis + CDK_MINTD_CACHE_REDIS_URL — redis needs
    the compile feature; our Dockerfile.mint builds --features fakewallet,sqlite
    only
    , so redis currently isn't even buildable in the lab image.
  • 0.18.x: env no longer applied at normal startup (DB-authoritative config) — set
    [info.http_cache] ttl via cdk-mintd config apply.
  • Observability: /v1/info advertises nuts.19.ttl (live-observed {"ttl":60,...}).
  • Reference point: nutshell ships NUT-19 off by default; when enabled it is
    redis-backed with a default TTL of 1 week — cdk's 60 s memory window is the
    conservative outlier, not the norm.

Ask (ranked; none of this needs wallet code):

  1. Set CDK_MINTD_CACHE_TTL=604800 on lab + production mints (0.17.6 env) — cheap,
    buys a week of replay window; only prior 200s are ever replayed (errors are never
    cached, signatures deterministic ⇒ no fund-safety cost). Memory backend caps ~10k
    entries — fine at our volumes.
  2. Add redis to Dockerfile.mint features and point deployments at a redis if the
    replay window must survive mint restarts/replicas — this is precisely the half TTL
    cannot cover.
  3. Monitoring: alert on not recoverable this pass (emitted exactly once per boot per
    stuck OpID — clean signal, lane-verified); reconcile the bbolt pending_swaps bucket
    against wallet balance; watch /v1/info nuts.19.ttl for config regressions.
  4. Note this hardens the window only — restart + TTL expiry are jointly covered solely
    by the NUT-09 /restore fallback tracked in the sibling issue.
Lingua principale
Go
Stelle
12
Fork
14
Merge medio
3g 20h
PR unite (30g)
261

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di OpenTollGate/tollgate-module-basic-go

Tutte le issue di OpenTollGate/tollgate-module-basic-go

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.