staticaddr/loopin: make canceled-invoice timeout unlock recoverable
Maintainer thường phản hồi trong vòng 2 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 48/100
Hướng nghiên cứu
Bắt đầu với MonitorInvoiceAndHtlcTxAction và transition MonitorInvoiceAndHtlcTx trên OnSwapTimedOut, sau đó kiểm tra UnlockState, OnRecover và unlockDeposits. Xem lại phần thảo luận về recovery và lifecycle trong PR #1161. Hoàn tất nghĩa là timeout không có xác nhận vẫn có thể recovery và chỉ đạt đến Failed sau khi các khoản tiền gửi được unlock hoặc đã biết là không cần thiết.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Problem
A static-address loop-in can reach the canceled-invoice recovery path without a durable guarantee that its deposits were unlocked.
Current monitor flow:
-
the payment deadline path cancels the invoice and then unlocks deposits:
cancelInvoice() err = f.unlockDeposits(ctx) -
those are separate side effects. If
loopdshuts down, crashes, or the deposit transition fails after invoice cancellation succeeds but before deposits are moved back toDeposited, recovery seesLookupInvoicereturnContractCanceled; -
in that recovered state no new
deadlineChanis created, so the deadline unlock path is not retried; -
if the HTLC never confirmed and the CLTV height arrives,
MonitorInvoiceAndHtlcTxActionreturnsOnSwapTimedOutand the loop-in moves toFailed, while deposits may remain stuck inLoopingIn.
This was discussed during PR #1161: https://github.com/lightninglabs/loop/pull/1161#discussion_r3539797010
The issue appears to predate PR #1161, but that PR touched the surrounding recovery/lifecycle code and made the invariant visible.
Potential fix
Route the no-HTLC-confirmation timeout path through a recoverable state-machine unlock state instead of transitioning directly to Failed.
One possible shape:
- add a success event such as
OnDepositsUnlocked; - route
MonitorInvoiceAndHtlcTx -> OnSwapTimedOut -> UnlockState(or a more specificUnlockDepositsBeforeFailstate); - make
UnlockStateretry onOnRecover; - only transition
UnlockState -> OnDepositsUnlocked -> FailedafterunlockDepositssucceeds; - if
unlockDepositsfails, keep the loop-in in the unlock state so restart/recovery retries cleanup rather than marking the swap failed with deposits possibly still locked.
The important invariant is: a no-confirmation timeout should not become final Failed until deposit unlock has succeeded or is known to be unnecessary.
- Ngôn ngữ chính
- Go
- Star
- 594
- Fork
- 137
- Merge trung bình
- 2 ngày 8 giờ
- Pull request đã merge (30 ngày)
- 15
Chuẩn bị môi trường
- Có Dockerfile hoặc tệp Docker Compose
- Có mẫu pull request
- Không có hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của lightninglabs/loop
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
lightninglabs/loop#1246 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
GPG key, GPG key fingerprintĐang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 49/100
lightninglabs/loop#1276 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 15/100
lightninglabs/loop#1274 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 50/100
lightninglabs/loop#1208 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
lightninglabs/loop#1196 ·
Maintainer thường phản hồi trong vòng 2 ngày
Tất cả issue của lightninglabs/loop
Issue tương tự
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 80/100
-
/shutdown/ready can fail to return an HTTP response when readiness takes longer than the server write timeoutCó thể đã có người làm @floriankoch đã nhận hôm nay. Đang mởtriage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
envoyproxy/gateway#10562 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Adding an LDAP group reports every search failure as "LDAP Group DN is not found"Có thể đã có người làm @Daksha1611 đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100