Repository navigation
Conversation
`lightning-liquidity` requires `Event::ChannelClosed` to be forwarded to the LSPS2 service handler, which we never did. The service hence kept the state of every JIT channel that ever got paid for, and with it the persisted state of the respective client, forever. That state also counts towards the service's global peer limit. We now hand closed channels to the LSPS2 service, allowing it to prune the state of JIT channels that are gone. Co-Authored-By: HAL 9000
When we couldn't open a JIT channel as an LSPS2 service, or when the channel closed before becoming ready, we never told `lightning-liquidity` about it. The intercepted HTLCs were therefore held until they timed out, and as the JIT channel state stayed stuck waiting for the channel, no later payment to the same invoice could trigger another attempt. We now report failed channel opens to the LSPS2 service, which fails the held HTLCs back right away and lets the payer retry. Co-Authored-By: HAL 9000
|
👋 Thanks for assigning @jkczyz as a reviewer! |
tnull
force-pushed
the
2026-11-lsps2-forward-channel-closed
branch
from
November 12, 2026 08:49
049f1a4 to
3a3dafb
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
lightning-liquidityexpects LSPS2 services to forwardEvent::ChannelClosedand to report failed JIT channel opens. We did neither:
the state of every client that ever paid for a channel. That state also
counts towards the service's global peer limit.
timed out, and the JIT state stayed stuck waiting for the channel, so
retrying the same invoice could never trigger another open.
This PR fixes both, one commit each:
ChannelClosedtoLSPS2ServiceHandler::channel_closed.LSPS2ServiceHandler::channel_open_failedwhen we can't open thechannel (peer not connected, insufficient on-chain funds,
create_channelfailing) and when the channel closes before becoming ready. The held HTLCs
are failed back right away and the payer can retry.