Skip to content

lsps2: allow full inbound HTLC capacity on announced service channels - #1206

Draft
lmtlssss wants to merge 2 commits into
lightningdevkit:mainfrom
lmtlssss:lsps2-announced-inbound-cap-20261024
Draft

lmtlssss wants to merge 2 commits into
lightningdevkit:mainfrom
lmtlssss:lsps2-announced-inbound-cap-20261024

Conversation

@lmtlssss

Copy link
Copy Markdown

Observed user consequence

Fixes #1129. An LSPS2 service received one 100,000-sat part of a 105,000-sat JIT payment on an announced 400,000-sat inbound channel. The default announced-channel max HTLC-value-in-flight limit is 25%, so the incoming part alone consumed the permitted 100,000 sats. The next part could not arrive. The intercepted HTLC was held for 13 hours 6 minutes before failing back, per the issue reporter's mainnet measurements.

Root cause and fix

LDK Node's open_channel_inner supplies a UserConfig for announced channels without overriding LDK's 25% announced inbound HTLC cap. It already relies on 100% for unannounced channels to support JIT receipt.

For nodes serving LSPS2, set announced_channel_max_inbound_htlc_value_in_flight_percentage = 100 when creating announced channels, matching the full-capacity requirement already documented for the LSP→client JIT channel. This allows a sufficiently liquid announced inbound channel to carry the full payment, rather than being capped at 25% of nominal channel size.

The override is conditional on LSPS2 service mode; other announced channels on nodes without the service preserve the 25% default. There is no wire format change and existing channels retain their negotiated limit.

Proof scope

Source-backed candidate against current upstream main; mainnet incident and 13h06m hold are documented in issue #1129. This draft has not passed Rust compilation, cargo fmt, upstream tests, or the actual two-part LSPS2 service payment with announced inbound channel. Before review-ready: run Rust format/build and a live regtest journey (400k announced, 105k JIT split into 100k/5k, verify both parts arrive and channel opens), then measure operator liquidity exposure. Raising announced inbound capacity permits peers to occupy more HTLC liquidity, so this is intentionally scoped to LSPS2 service operators.

This fixes an existing reported issue; it is not a new security discovery or proof of stolen funds.

@ldk-reviews-bot

Copy link
Copy Markdown

👋 Hi! I see this is a draft PR.
I'll wait to assign reviewers until you mark it as ready for review.
Just convert it out of draft status when you're ready for review!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

LSPS2 service: announced inbound channels cap HTLC-value-in-flight at 25%, so JIT payments above that can't be collected and the payer's HTLC is held

2 participants