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

ln: make event optional in EmitEventAndFreeOtherChannel

Public commit record

What the developer wrote

Authored by Carla Kirk-Cohen

85/100 · Strong
ln: make event optional in EmitEventAndFreeOtherChannel

In the commits that follow, we want to be able to free the other
channel without emitting an event so that we can emit a single event
for trampoline payments with multiple incoming HTLCs. We still want
to go through the full claim flow for each incoming HTLC (and persist
the EmitEventAndFreeOtherChannel event to be picked up on restart), but
do not want multiple events for the same trampoline forward.

Changing from upgradable_required to upgradable_option is forwards
compatible - old versions of the software will always have written this
field, newer versions don't require it to be there but will be able to
read it as-is.

This change is not backwards compatible, because older versions of the
software will expect the field to be present but newer versions may not
write it. An alternative would be to add a new event type, but that
would need to have an even TLV (because the event must be understood
and processed on restart to claim the incoming HTLC), so that option
isn't backwards compatible either.
✓ Specific, 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 changes how Lightning Dev Kit stores an internal event record when a payment is forwarded, specifically for an upcoming feature called trampoline payments. It makes one field optional so that future code can avoid emitting duplicate events when multiple incoming payments are part of the same trampoline forward. The change is forward-compatible but not backward-compatible: older versions of LDK will expect the field to always be present, so downgrading while trampoline forwards are in progress is not supported. There is no direct security vulnerability in this patch; it is a data-format change to enable a future feature.

Recommended action

No immediate security action required. Reviewers should verify that the optional event is correctly handled on restart and that downgrade paths reject or safely fail when the optional field is absent. Monitor follow-up commits that actually introduce trampoline payments with multiple incoming HTLCs to ensure the new behavior does not skip required event emission or channel unblocking.

Security signals we found

01

Serialization format change from required to optional TLV field

02

Explicit backward-compatibility break acknowledged by vendor

03

No input validation, cryptographic, or memory-safety changes

04

No privilege escalation, remote-triggerable behavior, or secret exposure in diff

05

Change gated by TLV upgrade/downgrade semantics

Risk score

Why this scored 24/100

Our methodology →
Potential impact 4/30
Exploitability 0/25
Stealth signal 3/15
Affected reach 5/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.