Skip to content

lightningd: omit channel_update from temporary_channel_failure - #9569

Open
daywalker90 wants to merge 1 commit into
ElementsProject:masterfrom
daywalker90:fix-lightningd-omit-onion-channel-update
Open

daywalker90 wants to merge 1 commit into
ElementsProject:masterfrom
daywalker90:fix-lightningd-omit-onion-channel-update

Conversation

@daywalker90

@daywalker90 daywalker90 commented Sep 24, 2026 •

Copy link
Copy Markdown
Collaborator

BOLT #4 made channel_update optional in UPDATE-flagged failure
messages; 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):

@daywalker90
daywalker90 requested a review from nGoline September 24, 2026 18:15
@daywalker90 daywalker90 added this to the v26.12 milestone Sep 24, 2026
@daywalker90
daywalker90 marked this pull request as draft September 24, 2026 19:33
@daywalker90
daywalker90 force-pushed the fix-lightningd-omit-onion-channel-update branch 4 times, most recently from 105bfe5 to 98999f5 Compare September 28, 2026 16:30
@madelinevibes madelinevibes removed this from the v26.12 milestone Nov 9, 2026
@daywalker90
daywalker90 force-pushed the fix-lightningd-omit-onion-channel-update branch from 98999f5 to cbb2bae Compare November 10, 2026 14:29
@daywalker90 daywalker90 changed the title lightningd: stop including channel_update in onion failures lightningd: omit channel_update from temporary_channel_failure Nov 10, 2026
@daywalker90

Copy link
Copy Markdown
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
daywalker90 force-pushed the fix-lightningd-omit-onion-channel-update branch from cbb2bae to 142dd06 Compare November 10, 2026 14:38
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
daywalker90 force-pushed the fix-lightningd-omit-onion-channel-update branch from 142dd06 to 697c57e Compare November 10, 2026 15:18
@daywalker90
daywalker90 marked this pull request as ready for review November 11, 2026 11:08

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants