-
Notifications
You must be signed in to change notification settings - Fork 492
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Drop the required channel_update
in failure onions
#1163
Closed
TheBlueMatt
wants to merge
1
commit into
lightning:master
from
TheBlueMatt:2024-05-no-update-in-onions
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1080,12 +1080,7 @@ The top byte of `failure_code` can be read as a set of flags: | |
* 0x8000 (BADONION): unparsable onion encrypted by sending peer | ||
* 0x4000 (PERM): permanent failure (otherwise transient) | ||
* 0x2000 (NODE): node failure (otherwise channel) | ||
* 0x1000 (UPDATE): new channel update enclosed | ||
|
||
Please note that the `channel_update` field is mandatory in messages whose | ||
`failure_code` includes the `UPDATE` flag. It is encoded *with* the message | ||
type prefix, i.e. it should always start with `0x0102`. Note that historical | ||
lightning implementations serialized this without the `0x0102` message type. | ||
* 0x1000 (UPDATE): channel forwarding parameter was violated | ||
|
||
The following `failure_code`s are defined: | ||
|
||
|
@@ -1378,12 +1373,21 @@ In the case of multiple short_channel_id aliases, the `channel_update` | |
expecting, to both avoid confusion and to avoid leaking information | ||
about other aliases (or the real location of the channel UTXO). | ||
|
||
The `channel_update` field used to be mandatory in messages whose `failure_code` | ||
includes the `UPDATE` flag. However, because nodes applying an update contained | ||
in the onion to their gossip data is a massive fingerprinting vulnerability, | ||
the `channel_update` field is no longer mandatory and nodes are expected to | ||
transition away from including it. Nodes which do not provide a | ||
`channel_update` are expected to set the `channel_update` `len` field to zero. | ||
|
||
|
||
## Receiving Failure Codes | ||
|
||
### Requirements | ||
|
||
The _origin node_: | ||
- MUST ignore any extra bytes in `failuremsg`. | ||
- MUST ignore the `channel_update` field. | ||
- if the _final node_ is returning the error: | ||
- if the PERM bit is set: | ||
- SHOULD fail the payment. | ||
|
@@ -1397,20 +1401,8 @@ The _origin node_: | |
- SHOULD remove all channels connected with the erring node from | ||
consideration. | ||
- if the PERM bit is NOT set: | ||
- SHOULD restore the channels as it receives new `channel_update`s. | ||
- otherwise: | ||
- if UPDATE is set, AND the `channel_update` is valid and more recent | ||
than the `channel_update` used to send the payment: | ||
- if `channel_update` should NOT have caused the failure: | ||
- MAY treat the `channel_update` as invalid. | ||
- otherwise: | ||
- SHOULD apply the `channel_update`. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This can also be a |
||
- MAY queue the `channel_update` for broadcast. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We can also remove just this line. |
||
- otherwise: | ||
- SHOULD eliminate the channel outgoing from the erring node from | ||
consideration. | ||
- if the PERM bit is NOT set: | ||
- SHOULD restore the channel as it receives new `channel_update`s. | ||
- SHOULD restore the channels as it receives new `channel_update`s from | ||
its peers. | ||
- SHOULD then retry routing and sending the payment. | ||
- MAY use the data specified in the various failure types for debugging | ||
purposes. | ||
|
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 for this section, it's already optional today, but the spec still states it as being mandatory.