add: added basic structure of forward failure reasons - #9419
Draft
Andezion wants to merge 1 commit into
Draft
Conversation
Changelog-None
Andezion
force-pushed
the
forward-failure-reason
branch
from
August 14, 2026 09:10
8e3085c to
fb03867
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.
Changelog-None
Important
26.09 FREEZE August 5th: Non-bugfix PRs not ready by this date will wait for 26.12.
RC1 is scheduled on August 17th
The final release is scheduled for September 7th.
Summary
Classify locally-failed forwards with a precise root cause (failure_reason)
forward_event/listforwards currently only expose the raw BOLT4 onion failcode for local_failed forwards, WIRE_TEMPORARY_CHANNEL_FAILURE - which is the same code for at least three unrelated causes (insufficient outgoing liquidity, too many HTLCs, dust limit, peer offline...). Operators can't tell "we're out of outgoing liquidity" from other failure classes
This adds a new optional failure_reason string field (insufficient_outgoing_liquidity, outgoing_peer_offline, cltv_expiry_too_far, ...) derived as close to the real root cause as possible - including carrying the precise cause out of channeld's channel_add_htlc result instead of discarding it, and fixing a gap where a forward that failed because the outgoing subdaemon died mid-send never appeared in listforwards at all
Purely additive - existing failcode/failreason fields and old DB rows are untouched. Includes a new pytest reproducing the insufficient-liquidity case end-to-end and doc/schema updates.
Checklist
Before submitting the PR, ensure the following tasks are completed. If an item is not applicable to your PR, please mark it as checked:
tools/lightning-downgrade