AI-generated analysisPublished automatically and not human-verified. Validated context appears in community notes below.
← Watch feed
Moderate 64 Bitcoin

Splicing fix: use outbound_alias in manager maps

Public commit record

What the developer wrote

Authored by Valentine Wallace

80/100 · Strong
Splicing fix: use outbound_alias in manager maps

Since we have added/are adding splicing support, the scid of a channel is
liable to change post-splice.

Some maps in the ChannelManager are keyed by the scid of a channel, which is an
issue now -- if we forward an HTLC from a channel and then splice that
channel before the HTLC is resolved, we'll end up with an HTLC source with an
scid that doesn't correspond to any open channel. This may result in loss of
the HTLC resolution.

The outbound scid alias of a channel is stable even post-splice, so for the
short term here we switch to using that instead. In the medium term we should
update these maps to use (PublicKey, ChannelId) like everything else.

We don't always use the alias for outbound forwarded HTLCs, since we tend to
use whatever outbound scid is in the onion. That's fine because we properly
handle the case where the outbound channel cannot be found; the main problem is
in inbound HTLCs and forgetting their resolution.
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Explains rationale or failure mode
The short version

What changed, and why it matters

This commit fixes a bug in LDK's Lightning channel splicing support. When a channel is 'spliced' (its on-chain funding is changed), its short channel ID can change. Several internal maps that track pending HTLCs (payments being forwarded) were keyed by that changeable ID. If a splice happened while an HTLC was still in flight, the software could lose track of the payment's source and fail to resolve it, potentially causing loss of funds. The fix switches those maps to use the 'outbound SCID alias,' a stable identifier that survives splicing.

Recommended action

Apply the patch. Nodes running splicing-capable LDK versions should upgrade before splicing channels with in-flight HTLCs. Monitor for any HTLCs stuck in forwarding state across upgrades, and ensure persisted state is upgraded cleanly due to the serialization format change.

Security signals we found

01

Loss of HTLC resolution due to stale channel identifier after splice

02

Internal hash-map keying changed from mutable SCID to stable outbound SCID alias

03

Serialization format change for persisted HTLC source data

04

Backward-compatibility handling added for pre-0.0.124 forwarded HTLCs

05

Potential panic/runtime failure when claiming payments after channel close

Risk score

Why this scored 64/100

Our methodology →
Potential impact 22/30
Exploitability 8/25
Stealth signal 10/15
Affected reach 12/15
Confidence 8/10
Evidence quality 4/5
Human-validated context

Community notes

Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.

No validated notes yet.

The AI analysis stands alone for now. Submit a note if you can add evidence or important context.