Add config options for custom feature bits (feature bits, gossip)

https://github.com/lightningnetwork/lnd/pull/7568

Host: ziggie1984  -  PR author: carlaKC

Notes

  • The following PR laid the ground work for the above commit so might be worth it to take a glimpse into it: https://github.com/lightningnetwork/lnd/pull/5587/commits
  • Different nodes might have different Features they support therefore it’s very important to signal these compatibilities. Also some nodes do not want to peer with nodes with a specific set of features. This flexibility makes a protocol also upgradable allowing features to be added over time. This week we are talking about this concept and discussing some examples.

Questions

  • At a high level, what is this PR trying to achieve?
  • Did you review the PR? If yes, what’s your overall verdict? (ACK, NACK, concept ACK, unknown)
  • Why should feature bits always be assigned in pairs. What’s special about feature bit 3?
  • What’s the reason why feature bits are separated into different sets. Does lnd support a set other implementation don’t ? (See https://github.com/lightning/bolts/pull/658). What’s special about the feature set: globalfeatures ?
  • Is it possible to set the even and uneven bit for a feature at the same time (ok to be odd rule)? Bonus: When using lmcli getinfo bit 30 and 31 is set what does this mean?
  • Since lnd 0.16 you can update features (how do you do it?), are these features persistent during restarts when they are changed?
  • Will nd not connect to a node when their node_announcement signalling a feature which is required but we do not understand, although the init message does not signal it in its feature word?
  • What’s the standard feature set, will it be allowed to set/unset those features after this PR ?
  • Are custom features needed in the space, what might be potential use case ? => See https://github.com/BitcoinAndLightningLayerSpecs, https://github.com/carlaKC/lndk
  • Why does the invoice feature bit have a different size limit than the other ones (hint see Bolt11)
  • What is a simple ddos measure to prevent to many node_announcement spamming the receiving node. (Hint Bolt 7 => NodeAnnouncement Msg)
  • Regarding Channel Type negotiation, was it necessary to build the anchor channel type dependant on the option_static_remote feature ? Does lnd still support the feature option_anchor_outputs 20/21 ?