Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

Priority: P2 — multi-process wallet access assumptions: the daemon and the CLI can open the same bbolt wallet concurrently.

Abierto
#504 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

@Amperstrand ya está trabajando en esto.

Desde el 11/10/2026.

  • #742 de @Amperstrand — cerrado sin fusionar
  • #870 de @Amperstrand — abierto
  • #932 de @Amperstrand — abierto

Evaluación

Dificultad
5/5
Tiempo estimado
Más de una semana
Aptitud para principiantes
25/100
Tipo de issue
Nueva funcionalidad
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
docker, go

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 same tollwallet.New path (verify: which subcommands open the DB while the daemon runs? drain does).
  • gonuts wallet/storage/bolt.go — bolt.Open(path, 0600, nil) default (no NoSync, 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

  1. 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.
  2. CLI UX: pre-flight check for daemon-held lock → either route through the daemon socket (preferred for online ops) or refuse with guidance.
  3. Sidecar policy: config validation rejects simultaneous in-process wallet + sidecar for overlapping mints.
  4. 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

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de OpenTollGate/tollgate-module-basic-go

Todos los issues de OpenTollGate/tollgate-module-basic-go

Issues similares

Más issues de Go

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.