Priority: P2 — multi-process wallet access assumptions: the daemon and the CLI can open the same bbolt wallet concurrently.
メンテナーはふだん 1 日以内に返信
@Amperstrand がすでに取り組んでいます。
2026年11月2日 から。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 25/100
調査の方向性
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.
索引モデルが issue の本文から書いたものです。
説明
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.
- 主要言語
- Go
- スター
- 12
- フォーク
- 14
- 平均マージ
- 3日 20時間
- マージ済み PR(30日)
- 261
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
OpenTollGate/tollgate-module-basic-go のほかの issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 85/100
OpenTollGate/tollgate-module-basic-go#1159 ·
メンテナーはふだん 1 日以内に返信
-
Degraded-mode hygiene follow-ups: dead walletNotInitializedError() + main.go's startup log still over-promises mint recovery対応中かも @Amperstrand が 2 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
OpenTollGate/tollgate-module-basic-go#1135 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
setup_uhttpd_portal hardcodes the GUEST portal docroot to the TollGate path — the brand token cannot select a re-brand guest portal対応中かも @Amperstrand が 3 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
OpenTollGate/tollgate-module-basic-go#1122 ·
メンテナーはふだん 1 日以内に返信
-
changelog: dependency-security sweep missing from [Unreleased] [Amperstrand fork #105 review debt]オープン
難易度 1/5 1時間未満 初心者へのやさしさ 72/100
OpenTollGate/tollgate-module-basic-go#1055 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
OpenTollGate/tollgate-module-basic-go#1027 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
OpenTollGate/tollgate-module-basic-go の issue をすべて見る
似ている issue
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
TUM-Dev/Campus-Backend#678 ·
メンテナーはふだん 1 日以内に返信
-
fix(app): fail closed if GetGeneralSetting fails during initialization対応中かも @kalavt が今日担当しました。 オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
tsukumogami/tsuku#2813 ·
メンテナーはふだん 1 日以内に返信
-
component:obi contribfest go test
難易度 2/5 1時間未満 初心者へのやさしさ 83/100
open-telemetry/opentelemetry-ebpf-instrumentation#4143 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信