Priority: P2 — multi-process wallet access assumptions: the daemon and the CLI can open the same bbolt wallet concurrently.
Los mantenedores suelen responder en 1 día
@Amperstrand ya está trabajando en esto.
Desde el 11/10/2026.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 25/100
Línea de trabajo
Start by auditing wallet-opening paths in src/cmd/tollgate-cli/, src/tollwallet/{select.go,sidecar.go}, daemon startup, and migration tools; verify the gonuts storage/bolt.go lock options. Then document the single-writer invariant and establish the intended behavior for daemon-plus-CLI and sidecar configurations. Done means the inventory is merged and the required concurrency, filesystem, and recovery tests show no dual writer.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Priority: P2 — multi-process wallet access assumptions: the daemon and the CLI can open the same bbolt wallet concurrently.
Problem
tollgate-cli (drain, fund, wallet ops) opens the same wallet.db (bbolt) as the running daemon. bbolt takes an OS file lock, so the file is single-writer — but the failure mode when the lock is held is an error at CLI time, and if any code path ever runs with the DB on a filesystem where flock is unreliable (some overlayfs/NAND configurations on OpenWrt), two writers corrupting the counter lineage is exactly the #480/#266 class again. Additionally the sidecar backend (src/tollwallet/sidecar.go) introduces a second daemon with its own wallet access by design.
Why it matters
Wallet-state writers must be provably single-writer per DB, or counter discipline (monotonic, reserved-before-expose) is unenforceable across processes. This is an audit + documentation + guard-rail issue, not an expected daily failure.
Current behavior (source refs)
src/cmd/tollgate-cli/— opens wallet via sametollwallet.Newpath (verify: which subcommands open the DB while the daemon runs? drain does).- gonuts
wallet/storage/bolt.go—bolt.Open(path, 0600, nil)default (noNoSync, blocking lock) — lock behavior on conflict = error after timeout? verify options. - Sidecar: separate daemon owns the wallet; the in-process daemon must then NOT also open it (policy enforcement?).
Desired invariant
Exactly one process has write access to a wallet DB at any time; conflicting access fails fast with a clear operator message; the sidecar architecture enforces this structurally (daemon never opens the DB when a sidecar owns it).
Proposed scope
- Audit: enumerate every wallet-opening entry point (daemon boot, CLI subcommands, sidecar, migration tools); document lock semantics on target filesystems (ext4 rootfs, overlayfs on NAND, btrfs?) — lab-verify flock on the MT3000's storage.
- CLI UX: pre-flight check for daemon-held lock → either route through the daemon socket (preferred for online ops) or refuse with guidance.
- Sidecar policy: config validation rejects simultaneous in-process wallet + sidecar for overlapping mints.
- Document the single-writer rule in AGENTS.md's implementation section (cross-ref).
Areas / files
src/cmd/tollgate-cli/, src/tollwallet/{select.go,sidecar.go}, gonuts storage/bolt.go (options only), docs.
Acceptance criteria
- Inventory doc merged; concurrent-open attempt produces the defined behavior on lab hardware (evidence attached); no path can dual-open with the sidecar.
Required tests
- Integration: daemon running → CLI drain attempt → defined outcome (routed or refused, never a second writer).
- Filesystem: flock behavior test on overlayfs image (CI docker with overlay storage).
Failure-injection tests
- Kill daemon while CLI holds a brief lock → daemon recovery re-acquires cleanly.
- Simulated flock-less FS (fuse stub or documented waiver) → wallet opens read-only or refuses.
Compatibility
CLI behavioral change possible (route-through-daemon) — release-note it.
Dependencies
None.
Out of scope
- bbolt replacement.
- Lenguaje dominante
- Go
- Estrellas
- 12
- Forks
- 14
- Merge medio
- 1 d 8 h
- PR fusionados (30 d)
- 201
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de OpenTollGate/tollgate-module-basic-go
-
changelog: dependency-security sweep missing from [Unreleased] [Amperstrand fork #105 review debt]Abierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 72/100
OpenTollGate/tollgate-module-basic-go#1055 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
OpenTollGate/tollgate-module-basic-go#1027 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
OpenTollGate/tollgate-module-basic-go#1026 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
OpenTollGate/tollgate-module-basic-go#833 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
OpenTollGate/tollgate-module-basic-go#813 ·
Los mantenedores suelen responder en 1 día
Todos los issues de OpenTollGate/tollgate-module-basic-go
Issues similares
-
area: records fast-track-debt priority: normal
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
Los mantenedores suelen responder en 1 día
-
processor/genainormalizer
Dificultad 2/5 1-3 horas Aptitud para principiantes 64/100
open-telemetry/opentelemetry-collector-contrib#52328 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
[tooling] Example acceptance runner reports ALL PASS for an unsupported program (tested patch)Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
limitlessprojects/Go-Hybrid#1595 ·
Los mantenedores suelen responder en 1 día
-
provider: hyper
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
charmbracelet/crush#4134 ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
AvengeMedia/DankMaterialShell#3912 ·