lightninglabs / lightninglabs/loop

Inconsistent status and recovery for loops with double payment

Open
#582 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
595
Forks
135
Avg merge
1d 8h
Merged PRs (30d)
12

Description

We did two swaps where we paid twice (one manually and one automatically done by loop itself). Both swaps actually went through successfully.

One of the swaps had trouble finishing to SUCCESS status, and eventually reached FAILED status (reason FAILURE_REASON_TEMPORARY). That swap has actually recovered the funds from the double pay through a timeout tx. Also, even though the swap is FAILED and already recovered the double pay, it's still trying to send more recovery transactions every time we restart loop.

The other swap has SUCCESS status but never tried recovering the funds. We eventually had to recover the funds with "chantools recoverloopin". That swap seems settled by loop since it's not trying to recover the double pay.

Let us know if you need more logs or other information from the servers.

PS: Also to avoid this issue, maybe when creating a loop it should say clearly when it's going to be paid by loop, and when it requires external funding, since we got confused by this :)

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by examining the loop recovery handling for the two reported cases: a FAILED swap that already recovered through a timeout transaction and a SUCCESS swap that did not recover the double payment. Compare behavior across loop restarts and with `chantools recoverloopin`; done means recovery is attempted exactly when needed and is not repeated after funds are recovered.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
backend, payments
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.