Repository navigation
lightningd: omit channel_update from temporary_channel_failure - #9569
Open
daywalker90 wants to merge 1 commit into
Open
daywalker90 wants to merge 1 commit into
daywalker90 wants to merge 1 commit into
Conversation
daywalker90
marked this pull request as draft
September 24, 2026 19:33
daywalker90
force-pushed
the
fix-lightningd-omit-onion-channel-update
branch
4 times, most recently
from
September 28, 2026 16:30
105bfe5 to
98999f5
Compare
daywalker90
force-pushed
the
fix-lightningd-omit-onion-channel-update
branch
from
November 10, 2026 14:29
98999f5 to
cbb2bae
Compare
Collaborator
Author
|
Initially i wanted to drop all channel_update on error since half the implementations don't read them anyways and they are optional in the spec while us sending len=0 followed by some data seems weird. But because of lnd i instead only removed the channel_update from temporary_channel_failure and fixed the others. |
daywalker90
force-pushed
the
fix-lightningd-omit-onion-channel-update
branch
from
November 10, 2026 14:38
cbb2bae to
142dd06
Compare
BOLT #4 allows a node that does not provide a channel_update in an UPDATE-flagged failure to set its len to zero, so we stop sending one for temporary_channel_failure. We only do this for temporary_channel_failure. lnd's decoder (checked on lnd master) accepts len=0 for that code only. For fee_insufficient, amount_below_minimum, incorrect_cltv_expiry and expiry_too_soon it fails to decode, so lnd penalizes the whole reporting node instead of the channel. Those codes keep their channel_update. channeld's amount_below_minimum and incorrect_cltv_expiry used to get their update appended after a len=0 field, which lnd cannot decode. We now rebuild them with the update inside the message. For incorrect_cltv_expiry we report the outgoing HTLC's cltv_expiry, as BOLT #4 specifies and eclair does. lnd and LDK report the incoming value instead, so implementations differ here. Disabling a channel when its peer disconnects used to happen as a side effect of building the update for a failure. It is now done directly: we disable our own direction in channel_gossip_channel_disconnect() and re-enable it in channel_gossip_channel_reestablished(). test_xpay_get_error_with_update now injects the channel_update through an inline plugin, as its offline-peer failure no longer carries one. test_gossip_disable_on_disconnect_own_direction checks the disable bit. Changelog-Changed: Protocol: temporary_channel_failure onion errors no longer include channel_update (BOLT #4). Changelog-Fixed: Protocol: amount_below_minimum and incorrect_cltv_expiry onion errors from channeld carry the channel_update inside the message, so lnd can decode them.
daywalker90
force-pushed
the
fix-lightningd-omit-onion-channel-update
branch
from
November 10, 2026 15:18
142dd06 to
697c57e
Compare
daywalker90
marked this pull request as ready for review
November 11, 2026 11:08
This branch has not been deployed
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.
BOLT
#4made channel_update optional in UPDATE-flagged failuremessages; nodes are expected to transition away from including it
because applying onion-embedded updates to the gossip graph is a
fingerprinting vulnerability.
We already sent len=0 for private channels since 2022-02. For
channeld-originated failures, rcvd_htlc_reply has been appending the
channel_update after a message that already ended with the zero
length field (since 222da7f, Oct 2023): receivers parsed len=0 and
silently dropped the trailing update, so those failures were already
effectively len=0 on the wire.
Receive-side compatibility with len=0 UPDATE failures (oldest safe
versions):
(#79: Add Sphinx error propogation lightningnetwork/lnd#216, 98956bc2); other UPDATE codes
still fail wire decode and would punish us more than needed in their router
67ad6c4) for temporary_channel_failure; v0.0.124 (Sep 2024,
Ignore channel updates in onion errors lightningdevkit/rust-lightning#3083, 24c2468) for all
UPDATE codes
channel_updateACINQ/eclair#2854, 414f728)taken pointer intal_dup_talarr. #3781, c100de6)application-logic safety