Skip to content

feature: advertise required feature bit for TLV onions#6336

Closed
Roasbeef wants to merge 1 commit intolightningnetwork:masterfrom
Roasbeef:mandatory-tlv-onion
Closed

feature: advertise required feature bit for TLV onions#6336
Roasbeef wants to merge 1 commit intolightningnetwork:masterfrom
Roasbeef:mandatory-tlv-onion

Conversation

@Roasbeef
Copy link
Member

In this commit, we start to advertise the required feature bit for the
new modern TLV onion format. In a future change, we'll remove the logic
for being able to encode+encode the payload. For now, we still have
tests that exercise being able to use the new and old formats (as well
as both of them in a single route), so we'll continue to retain that
behavior for now.

Implements lightning/bolts#962.

In this commit, we start to advertise the required feature bit for the
new modern TLV onion format. In a future change, we'll remove the logic
for being able to encode+encode the payload. For now, we still have
tests that exercise being able to use the new and old formats (as well
as both of them in a single route), so we'll continue to retain that
behavior for now.

Implements lightning/bolts#962.
@Roasbeef Roasbeef force-pushed the mandatory-tlv-onion branch from aff2913 to f77fb99 Compare March 15, 2022 01:45
@Roasbeef Roasbeef requested a review from ellemouton March 23, 2022 23:04
Copy link
Collaborator

@ellemouton ellemouton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

Just for completeness sake, the one other place I think we can maybe change to using the required bit instead of the optional bit in this pr (instead of waiting for the follow-up pr where we remove all the legacy code for the optional bit) is for when we create the JIT keysend and AMP invoices. currently we just put in the optional feature bit there & persist those invoices.

@Roasbeef
Copy link
Member Author

So instead, we might want to leave the feature bit as is, and modify the SendToRoute call to default to using the TLV payload: lightning/bolts#962 (comment)

@Roasbeef
Copy link
Member Author

Made this PR to implement the change above: #6385

@Roasbeef
Copy link
Member Author

Moving this to 0.16 given that we're introducing behavior in 0.14.3 to stop allowing the legacy onions to be sent at all.

@Roasbeef Roasbeef modified the milestones: v0.15.0, v0.16.0 Apr 12, 2022
@Roasbeef Roasbeef modified the milestones: v0.16.0, v0.17.0 Aug 23, 2022
@saubyk saubyk added P3 might get fixed, nice to have P1 MUST be fixed or reviewed and removed P3 might get fixed, nice to have labels Aug 8, 2023
@saubyk saubyk removed this from the Low Priority milestone Aug 8, 2023
@Roasbeef Roasbeef added this to the v0.21.0 milestone Nov 5, 2025
@saubyk saubyk added this to v0.21 Nov 5, 2025
@saubyk saubyk moved this to In progress in v0.21 Nov 5, 2025
@saubyk saubyk moved this from In progress to In review in v0.21 Nov 5, 2025
Copy link
Collaborator

@ziggie1984 ziggie1984 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM (pending release-notes), I agree with Elle, we can also update the invoices we create for our DB when creating a keysend or and spontaneous amp invoice


## P2P Protocol

[lnd now advertises the TLV onion feature bit as required(https://github.com/lightningnetwork/lnd/pull/6336).
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

move to 21

@Roasbeef
Copy link
Member Author

Roasbeef commented Feb 5, 2026

This PR implementing this change was merged: #8275

@Roasbeef Roasbeef closed this Feb 5, 2026
@github-project-automation github-project-automation bot moved this from In review to Done in v0.21 Feb 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants