Skip to content

Commit

Permalink
Do not allow routing to a node with unkown feature bits set.
Browse files Browse the repository at this point in the history
This appears to have been an oversight in the flat features spec,
and is somewhat implicitly relied on for several new feature bits -
if var_onion_optin is set on a node_announcement (its not allowed
on a channel_announcement), then trying to route through that node
using the pre-tlv formt is somewhat nonsensical, and should be
forbidden.
  • Loading branch information
TheBlueMatt committed Jan 6, 2020
1 parent 44c5fa1 commit 5abee4d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
3 changes: 3 additions & 0 deletions 07-routing-gossip.md
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,9 @@ any future fields appended to the end):
- MUST NOT process the message further.
- if `features` field contains _unknown even bits_:
- SHOULD NOT connect to the node.
- Unless paying a [BOLT #11](11-payment-encoding.md) invoice which does not
have the same bit(s) set, MUST NOT attempt to send payments _to_ the node.
- MUST NOT route a payment _through_ the node.
- SHOULD ignore the first `address descriptor` that does NOT match the types
defined above.
- if `addrlen` is insufficient to hold the address descriptors of the
Expand Down
6 changes: 6 additions & 0 deletions 09-features.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,12 @@ There is no _even_ bit for `initial_routing_sync`, as there would be little
point: a local node can't determine if a remote node complies, and it must
interpret the flag, as defined in the initial spec.

Note that for feature flags which are available in both the `node_announcement`
and [BOLT 11](11-payment-encoding.md) invoice contexts, the features as set in
the [BOLT 11](11-payment-encoding.md) invoice should override those set in the
`node_announcement`. This keeps things consistent with the unknown features
behavior as specified in [BOLT 7](07-routing-gossip.md#the-node_announcement-message).

![Creative Commons License](https://i.creativecommons.org/l/by/4.0/88x31.png "License CC-BY")
<br>
This work is licensed under a [Creative Commons Attribution 4.0 International License](http://creativecommons.org/licenses/by/4.0/).
Expand Down

0 comments on commit 5abee4d

Please sign in to comment.