Skip to content
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

Feature bit unification and assignment #571

wants to merge 6 commits into
base: master


None yet
1 participant
Copy link

rustyrussell commented Feb 12, 2019

This is modified from the ml proposal: I hadn't appreciated that both channel_announcement and node_announcement have features fields.

Since you have to see a channel_announcement[*] to use a channel, it makes sense for "stuff you need to know to route through here" to go there. Since you need the node_announcement to connect to a node, it makes sense for that to advertize every feature you might want to select on.

The rough assignment is mainly to show the results, to get feedback and allow early experimentation. I won't renumber them if we remove/add any though!

rustyrussell added some commits Feb 12, 2019

BOLT 1, 7, 9: rename feature bits, combine in gossip.
Rename `globalfeatures` to `channelfeatures` and `localfeatures`
to `peerfeatures`.
BOLT 9: Note that features share the same number space.
Signed-off-by: Rusty Russell <>
BOLT 1: don't need to disconnect on unknown `channelfeatures`.
You can still gossip.

Signed-off-by: Rusty Russell <>
BOLT 7: Explicitly mirror channelfeatures in channel_announcement.
If we really want a new gossip message which old nodes will ignore,
we'll use a new type, so having it discard unknown features is

Each feature can itself specify how it's advertized here: an
key-exchange-instead-of-hash-preimage feature would need to advertize
as even (you need to understand it to use it), for example, but a
wumbo feature would advertize as odd.

Signed-off-by: Rusty Russell <>
BOLT 7: advertize both feature sets in node_announcement.
This lets you find out what nodes support what peer features, rather
than connecting and probing.

Like channel_announcement, we won't use feature bits for incompatible
changes; we'll use a separate type.  So don't discard messages with
unknown ones.

Similarly, you can try to connect to a node with unknown bits; you
might fail, but that's OK.  Either it was an unknown peer feature, and
you'll find out from their init msg, or it's a channel feature and you
won't be able to open a channel.

Signed-off-by: Rusty Russell <>

@rustyrussell rustyrussell added this to the v1.1 milestone Feb 12, 2019

BOLT 9: Guess at assignment of feature bis.
There are only two channel (prev "global") features, which you have to
know to route payments through a channel: wumborama and status.  Both
should be advertized as odd bits in channel_announcement, since it's
fine if a node doesn't understand them.

The other options are now advertized (thanks to node_announcment
combinedfeatures) but don't effect routing, so they're peerfeatures.

We might be able to get rid of `option_will_fund_for_food`; it's only
used to flag the existence of the two extra fields in
node_announcement, for which `option_dual_fund` could be used instead
(with some flag value meaning "will not fund for food).

Signed-off-by: Rusty Russell <>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.