staticaddr/deposit: separate generic OnError from caller-held rollback events
メンテナーはふだん 2 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
まず updateDeposit、lockedEvents、TransitionDeposits を追跡し、次に deposit FSM のアクションである PublishDepositExpirySweepAction と WaitForExpirySweepAction を調査します。呼び出し元が保持するロールバックイベントを汎用の fsm.OnError から分離し、内部で生成されたエラーが deposit lock を取得する一方で、manager によって実行されるロールバックでは二重ロックを避けられるようにします。両方の経路が、誤った lock の前提に依存せず、意図した状態と store の更新を維持できれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Problem
The static-address deposit FSM currently treats fsm.OnError as if it always arrives while the caller already holds the deposit lock.
That assumption is not reliable. Some fsm.OnError transitions do come from TransitionDeposits, where the manager locks deposits before sending the event. But deposit FSM actions can also emit fsm.OnError internally. Examples include:
PublishDepositExpirySweepActionreturningfsm.OnErrorafter expiry sweep publish failures;WaitForExpirySweepActionreturningfsm.OnErrorafter notifier or context errors.
Those internal paths originate from the deposit FSM's own block handling, so no external deposit lock is held.
Because fsm.OnError is in lockedEvents, updateDeposit can skip acquiring the deposit lock, call no-lock state mutation helpers, and update the store under an assumption that is false for internally generated errors.
This was discussed during PR #1161: https://github.com/lightninglabs/loop/pull/1161#discussion_r3539803146
The issue appears to predate PR #1161, but that PR touched the surrounding deposit locking/lifecycle code and made the invariant visible.
Potential fix
Do not use the generic fsm.OnError event to also mean "caller-held rollback/unlock to Deposited".
One possible shape:
- introduce a deposit-specific rollback event, for example
OnReleaseDepositorOnDepositRollback; - use that event from manager-driven
TransitionDepositscallers that already hold deposit locks and need to move selected deposits back toDeposited; - include that specific rollback event in
lockedEvents; - remove generic
fsm.OnErrorfromlockedEvents, so internally generated errors acquire the deposit lock insideupdateDeposit; - keep
fsm.OnErroras the generic action-error transition in the deposit FSM, not as an implicit lock-state signal.
That separates event meaning from caller locking context: events sent by TransitionDeposits can still avoid double-locking, while internally generated fsm.OnError paths no longer run no-lock state/store updates without a held deposit lock.
- 主要言語
- Go
- スター
- 593
- フォーク
- 138
- 平均マージ
- 4日 18時間
- マージ済み PR(30日)
- 20
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートあり
- コントリビューションガイドなし
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
lightninglabs/loop のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
lightninglabs/loop#1246 ·
メンテナーはふだん 2 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 50/100
lightninglabs/loop#1208 · コメント 1 件 ·
メンテナーはふだん 2 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
lightninglabs/loop#1196 ·
メンテナーはふだん 2 日以内に返信
-
難易度 5/5 1週間以上 初心者へのやさしさ 42/100
lightninglabs/loop#1172 ·
メンテナーはふだん 2 日以内に返信
-
Track armed static address HTLCs after aborted swaps再び着手できるかも @hieblmi が 111 日前に担当しましたが、オープン中のプルリクエストはありません。 オープン
lightninglabs/loop#1171 · 担当者 1 名 ·
メンテナーはふだん 2 日以内に返信
lightninglabs/loop の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
yetone/magpie#4095 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
docs: Google Safe Browsing flags go-bonnie.dev as "deceptive" (pipe-to-shell install instructions)オープンdocumentation
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 2 日以内に返信
-
[Bug]: Telegram bot (v3.11.0): "Ban log" no longer sends the current 3xipl-banned.log対応中かも @HamedSanaei が今日担当しました。 オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
MHSanaei/3x-ui#6990 · コメント 1 件 ·
メンテナーはふだん 3 日以内に返信
-
bug(tool/internal/instrument): identical inject_code rules from two rule packages are applied twiceオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
open-telemetry/opentelemetry-go-compile-instrumentation#1611 ·
メンテナーはふだん 2 日以内に返信