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

ln: handle DecodedOnionFailure for local trampoline failures

Public commit record

What the developer wrote

Authored by Carla Kirk-Cohen

95/100 · Strong
ln: handle DecodedOnionFailure for local trampoline failures

While proper error handling will be added in a followup, we add the
bare minimum required here for testing.

Note that we intentionally keep the behavior of not setting
`payment_failed_permanently` for local failures because we can possibly
retry it because we're the sender as a trampoline forwarder.

For example, a local ChannelClosed error is considered to be permanent,
but we can still retry along another channel.
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Explains rationale or failure mode✓ Mentions testing or verification
The short version

What changed, and why it matters

This commit fixes a code path in the Lightning Dev Kit where a specific kind of local payment failure (called a 'TrampolineForward' failure) was not being handled. Previously, the code only expected failures from regular outbound routes and would panic with 'unreachable!' if a trampoline forward failure occurred. The change adds handling for that case, returning a decoded failure with no specific short channel ID. It is described by the author as a minimal fix for testing, with fuller error handling planned later.

Recommended action

Treat as a routine bug-fix commit rather than an urgent security patch. Reviewers should verify that the new TrampolineForward arm correctly propagates failure information without introducing incorrect permanent-failure classification, and monitor the promised follow-up for complete error handling.

Security signals we found

01

Removal of unreachable!() panic path for TrampolineForward HTLC source

02

Addition of local trampoline failure decoding in onion error handling

03

Intentional non-setting of payment_failed_permanently for local failures to allow retry

04

debug_assert used for runtime invariant (outbound_payment is None)

05

Commit message describes this as minimal/bare-bones fix pending follow-up proper error handling

Risk score

Why this scored 26/100

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