wallet init bricks into degraded mode on Unknown Keyset after mint rotation — no self-heal despite reachable mint (rc1, real hardware)
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
- 22/100
Direzione di ricerca
Start from the wallet init log lines quoted in the issue ("error getting keyset from mint: Unknown Keyset" and the degraded-mode warning) and find where the keyset lookup happens during TollWallet.New. Reproduce by seeding a wallet DB with retired keyset IDs against a mock mint that answers /v1/keys with new IDs. Done means init refreshes keysets from the mint and registers without discarding the wallet DB, and retired-keyset proofs stay spendable; read AGENTS.md first for the counter rules, since the issue says they constrain the fix.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Summary
On real hardware (GL.iNet MT3000, OpenWrt 25.12.5) with an existing wallet DB (created under v0.6.0-alpha4), the rc1 daemon deterministically fails wallet initialization with error getting keyset from mint: Unknown Keyset whenever the mint has rotated its keysets since the wallet last synced — and it never self-heals, despite logging "wallet will initialize when a mint becomes reachable" while the mint IS reachable. The router stays in degraded mode (payments refused, no-reachable-mints on :2121) until an operator manually intervenes.
Evidence (2026-10-09, desk run)
- Upgraded alpha4→rc1 (binary swap; config + wallet.db preserved). Mint reachable, DNS fine.
- Startup, then service restart — identical failure both times (deterministic, not a race):
TollWallet.New: Loading wallet with config: {WalletPath:/etc/tollgate CurrentMintURL:https://testnut.cashu.space/}
WARNING: Wallet initialization failed (failed to create wallet: error getting keyset from mint: Unknown Keyset) — starting in degraded mode
Degraded mode: offline wallet load failed (first boot or no cached data): failed to create wallet: error getting keyset from mint: Unknown Keyset
WARN Merchant started in degraded mode — wallet will initialize when a mint becomes reachable
- No retry ever fires: 45+ minutes later the state was unchanged, and the promise's condition was already true (mint answered
/v1/keysfine the whole time). - Root cause shape: the wallet DB caches a dozen retired keyset IDs (
strings wallet.db:00003ac3…,00020989…, …); testnut.cashu.space rotates its ENTIRE keyset set frequently — the sat keyset observed changed from0184237e…to017bc604…within ~1 hour during this run. The init path asks the mint for a keyset by a cached/known ID, the mint answersUnknown Keyset, and init treats that as fatal instead of falling back to fetching the mint's current keysets. - Workaround verified on-device (recovery for anyone hitting this): move the stale wallet aside and restart — fresh init registers all mints and the merchant reaches ready:
/etc/init.d/tollgate-wrt stop
mv /etc/tollgate/wallet.db /etc/tollgate/wallet.db.stale-keysets
/etc/init.d/tollgate-wrt start
# → TollWallet: registered mint … ×8, === Merchant ready ===
(Safe here only because balance was 0 — see the fund-safety note.)
Impact
Any router whose mint rotates keysets between syncs (testnut does it aggressively; production mints rotate on schedule) bricks into degraded mode at the next restart. For an unattended payment gateway this is a stop-ship-class availability bug in the upgrade/restart path: no payments until manual recovery, and the recovery that works today discards the wallet (unacceptable at nonzero balance).
Fund-safety note
The workaround above discards proofs still held in the moved-aside DB. The proper fix must NOT require wallet disposal: on Unknown Keyset at init, refresh keysets from the mint (/v1/keys) and re-register before giving up — the AGENTS.md counter-discipline rules (monotonic counters, no fresh-record overwrites, #480-class alias/refresh handling) apply to whatever path performs that refresh. Retired-keyset PROOFS must remain spendable through whatever swap path the mint still honors; keyset rotation must not orphan them.
Reproducer
Any wallet.db cached against keysets a mint has since retired (testnut.cashu.space guarantees rotation within hours): restart the daemon, observe the degraded loop above, confirm /v1/keys answers fine from the same router.
- Lingua principale
- Go
- Stelle
- 12
- Fork
- 14
- Merge medio
- 3g 22h
- PR unite (30g)
- 262
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di OpenTollGate/tollgate-module-basic-go
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 85/100
OpenTollGate/tollgate-module-basic-go#1159 ·
I maintainer di solito rispondono entro 1 giorno
-
Degraded-mode hygiene follow-ups: dead walletNotInitializedError() + main.go's startup log still over-promises mint recoveryForse già presa @Amperstrand l’ha presa 4 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
OpenTollGate/tollgate-module-basic-go#1135 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
setup_uhttpd_portal hardcodes the GUEST portal docroot to the TollGate path — the brand token cannot select a re-brand guest portalForse già presa @Amperstrand l’ha presa 4 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
OpenTollGate/tollgate-module-basic-go#1122 ·
I maintainer di solito rispondono entro 1 giorno
-
changelog: dependency-security sweep missing from [Unreleased] [Amperstrand fork #105 review debt]Aperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 72/100
OpenTollGate/tollgate-module-basic-go#1055 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
OpenTollGate/tollgate-module-basic-go#1027 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di OpenTollGate/tollgate-module-basic-go
Issue simili
-
agent-butler-finding bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
jordansmall/spindrift#6414 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
Icinga/icinga-kubernetes#294 ·
I maintainer di solito rispondono entro 4 giorni
-
Cluster details: the Control Plane version field has a different border color than its icon boxApertakind/design sig/ui
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 92/100
kubermatic/dashboard#8449 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
filecoin-project/curio#1632 ·
I maintainer di solito rispondono entro 1 giorno