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 renaming #571

Conversation

rustyrussell
Copy link
Collaborator

@rustyrussell rustyrussell commented Feb 12, 2019

This is 5 commits, each standalone:

  1. Rename "local" to "node" features, "global" to "channel" features. The original idea was that
    "local" features only affect direct peers. That still stands, but the new names are clearer.
    Note: There are still no "channel" features defined.
  2. Note that features share the same number space, needed for minor: updated open channel diagram #5.
  3. Remove init message requirement to disconnect on unknown channelfeatures. This just
    means you can't open a channel. Unknown node features means you can't even talk.
  4. Explicitly mirror channelfeatures in channel_announcement. These are things you might need to
    know to use that specific channel, or might be required, depending on the feature itself. Removes
    the "don't relay these if they have an unknown feature" rule.
  5. Explicitly mirror what channelfeatures we support in node_announcement (usually as optional
    features, of course). This lets you find nodes with specific features.

Concrete Examples

Consider a node which supports a d-log-HTLC channel, and doesn't support legacy HTLCs on that channel:

  1. This is clearly a channelfeature.
  2. It may have negotiated this with the peer as an optional or required feature.
  3. It must advertize this in channel_announcement as a required feature, since you need to understand it to use the channel at all.
  4. It gets advertized in node_announcement, as required or optional, depending on 2 above.

Now, consider a node which can create wumbo (> 2^24 satoshi) channels:

  1. This is a nodefeature.
  2. It's (presumably) optional.
  3. It doesn't appear in channel_announcement.
  4. It gets advertized in node_announcement, as (presumably) optional.

Finally, consider a node which can handle wumbo HTLCs:

  1. This is a channelfeature.
  2. It's (presumably) optional.
  3. It gets advertized in channel_announcement as optional, since you don't need to understand it.
  4. It gets advertized in node_announcmenet, as (presumably) optional.

Rename `globalfeatures` to `channelfeatures` and `localfeatures`
to `nodefeatures`.
You can still gossip.

Signed-off-by: Rusty Russell <[email protected]>
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
overzealous.

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 <[email protected]>
This lets you find out what nodes support what node 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 node 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 <[email protected]>
@rustyrussell rustyrussell changed the title Feature bit unification and assignment Feature bit unification and renaming May 6, 2019
@rustyrussell rustyrussell force-pushed the guilt/feature-bit-unification branch from b2de709 to 14ced3b Compare May 6, 2019 07:05
@t-bast
Copy link
Collaborator

t-bast commented May 28, 2019

I think this is a good clarification.
ACK from me for next meeting.

@t-bast
Copy link
Collaborator

t-bast commented Jun 28, 2019

As discussed in the IRC meeting, people still find the names confusing so here are my suggestions, I'll let the consensus judge if they're better or worse ;)

  • Suggestions for renaming local features
    • connection or conn features (since it only impacts people I'm connected to)
    • peer features (it only impacts my direct peers)
    • neighbour or neighbor features (meh)
    • keep local (I honestly think local is a good name, it's more the global part that I found a bit misleading)
  • Suggestions for renaming global features
    • network features (they are interesting to the whole network)
    • routing features (if we assume that routing is the only thing we're using remote nodes for - not sure if that will always be true)
    • remote features (meh)

I'll edit this comment if I have other ideas.

@rustyrussell
Copy link
Collaborator Author

I like local and routing features, TBH.

@Roasbeef Roasbeef assigned Roasbeef and unassigned Roasbeef Jul 12, 2019
@Roasbeef
Copy link
Collaborator

Thanks for those examples! I understand the underlying motivation now after reading through them. As for names, my vote goes for node features (former global) and link features.

@Roasbeef
Copy link
Collaborator

It seems the only "pure" link feature we have is initial-routing-sync, the rest can lie in either domain.

@t-bast
Copy link
Collaborator

t-bast commented Jul 12, 2019

As for names, my vote goes for node features (former global) and link features.

I think node is confusing. Rusty proposed it to replace the current local and you're now proposing it to replace the current global. That clearly indicates that it's misleading, doesn't it? :)

I also think that link is confusing, I can see arguments for using it to replace either local or global...
Because it could mean that it defines properties of your local links (channels?) so it's a local feature, or it's a global feature because it defines properties that remote non-neighbor nodes should know about your links (channel?).

@cfromknecht
Copy link
Collaborator

As discussed on IRC, the naming that makes the most sense to me personally is:

  • global -> node: functionally equivalent to service bits in bitcoin, apart from the fact that they are gossiped. Emphasize that the features are applicable to the node as a whole (depending on the feature, that it applies to all of a node's channels), e.g. can this node: support variable frame onions, extended gossip queries, DLP, link-level payment sharding, etc.
  • local -> connection: emphasizes that these feature bits are only applied for the duration of the connection, and may change upon a subsequent reconnect, e.g. will this connection: allow funding wumbo channels, extended gossip queries, DLP, etc.

To me routing is too specific, as there are already several features that could be advertised that have nothing to do with routing (and we are likely to add more in the future). local is okay, but it's a little ambiguous what that means and could be clearer.

Copy link
Collaborator

@cfromknecht cfromknecht left a comment

Choose a reason for hiding this comment

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

unification changes look pretty good, maybe still some bikeshedding to be done on naming tho :) i have a few other questions i've left inline

07-routing-gossip.md Show resolved Hide resolved
- MUST NOT parse the remainder of the message.
- MAY discard the message altogether.
- SHOULD NOT connect to the node.
- MAY forward `node_announcement`s that contain an _unknown_ `features` _bit_,
Copy link
Collaborator

Choose a reason for hiding this comment

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

this seems like a good change, we probably shouldn't be forwarding messages that we were unable to parse

@@ -316,12 +317,6 @@ The receiving node:
any future fields appended to the end):
- SHOULD fail the connection.
- MUST NOT process the message further.
- if `features` field contains _unknown even bits_:
Copy link
Collaborator

Choose a reason for hiding this comment

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

if i understand correctly, this will removes the ability to partition the gossip network as a result of nodes not understanding an even feature bit? do we still want to retain the ability to do so via unknown TLV types?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Hmm, that's an excellent question! I... don't know. Allowing "invalid" TLVs to propagate seems like a burden on implementations, but maybe it's a feature somehow?

Copy link
Collaborator

Choose a reason for hiding this comment

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

In due time we may discover, I see arguments for both sides 🤷‍♂️

@niftynei niftynei removed the Meeting Discussion Raise at next meeting label Jul 22, 2019
@t-bast t-bast added the Meeting Discussion Raise at next meeting label Aug 5, 2019
@t-bast
Copy link
Collaborator

t-bast commented Aug 5, 2019

I quite like renaming local to connection (seems like we all have a rough agreement on that one).
I'm not completely convinced by node to replace global but my best proposal (network) isn't perfect either, so I could live with it.

@Roasbeef
Copy link
Collaborator

Roasbeef commented Aug 8, 2019

node+connection SGTM!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Meeting Discussion Raise at next meeting
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants