staticaddr/deposit: separate generic OnError from caller-held rollback events
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
调研方向
首先跟踪 updateDeposit、lockedEvents 和 TransitionDeposits,然后检查 deposit FSM 的操作 PublishDepositExpirySweepAction 和 WaitForExpirySweepAction。将由调用方持有的回滚事件与通用的 fsm.OnError 分开,使内部生成的错误获取 deposit lock,同时由 manager 驱动的回滚避免重复加锁。当两条路径都能在不依赖错误的锁假设的情况下保留预期状态和 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
- 派生
- 137
- 平均合并
- 2 天 6 小时
- 30 天内合并 PR
- 13
环境准备
- 提供 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 没有贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
lightninglabs/loop 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 78/100
lightninglabs/loop#1246 ·
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 50/100
lightninglabs/loop#1208 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 48/100
lightninglabs/loop#1196 ·
维护者通常 1 天内回复
-
难度 5/5 一周以上 新手友好度 42/100
lightninglabs/loop#1172 ·
维护者通常 1 天内回复
-
Track armed static address HTLCs after aborted swaps可能重新可做 @hieblmi 于 114 天前认领,目前没有进行中的 PR。 未关闭
lightninglabs/loop#1171 · 已指派 1 人 ·
维护者通常 1 天内回复
查看 lightninglabs/loop 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 72/100
-
难度 2/5 1-3 小时 新手友好度 72/100
hashicorp/golang-lru#245 ·
-
难度 2/5 1-3 小时 新手友好度 72/100
spotify/flink-on-k8s-operator#1075 ·
-
难度 2/5 半天 新手友好度 62/100
prometheus-community/pyrra#1995 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 75/100
microsoft/TypeScript#65083 ·
维护者通常 1 天内回复