-
Notifications
You must be signed in to change notification settings - Fork 525
Feature bit unification and renaming #571
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
Changes from all commits
bb479a8
733428e
0f1f7c6
783790a
14ced3b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -140,7 +140,7 @@ announcement message: this is accomplished by having a signature from each | |
| * [`64`:`bitcoin_signature_1`] | ||
| * [`64`:`bitcoin_signature_2`] | ||
| * [`2`:`len`] | ||
| * [`len`:`features`] | ||
| * [`len`:`channelfeatures`] | ||
| * [`32`:`chain_hash`] | ||
| * [`8`:`short_channel_id`] | ||
| * [`33`:`node_id_1`] | ||
|
|
@@ -173,16 +173,16 @@ The origin node: | |
| - MUST set `bitcoin_signature_1` and `bitcoin_signature_2` to valid | ||
| signatures of the hash `h` (using `bitcoin_key_1` and `bitcoin_key_2`'s | ||
| respective secrets). | ||
| - SHOULD set `len` to the minimum length required to hold the `features` bits | ||
| - SHOULD set `len` to the minimum length required to hold the `channelfeatures` bits | ||
| it sets. | ||
| - MUST set a `channelfeatures` bit for each `channelfeature` negotiated for | ||
| the channel, according to [BOLT #9](09-features.md). | ||
|
|
||
| The receiving node: | ||
| - MUST verify the integrity AND authenticity of the message by verifying the | ||
| signatures. | ||
| - if there is an unknown even bit in the `features` field: | ||
| - MUST NOT parse the remainder of the message. | ||
| - if there is an unknown even bit in the `channelfeatures` field: | ||
| - MUST NOT add the channel to its local network view. | ||
| - SHOULD NOT forward the announcement. | ||
| - if the `short_channel_id`'s output does NOT correspond to a P2WSH (using | ||
| `bitcoin_key_1` and `bitcoin_key_2`, as specified in | ||
| [BOLT #3](03-transactions.md#funding-transaction-output)) OR the output is | ||
|
|
@@ -248,8 +248,8 @@ nodes not associated with an already known channel are ignored. | |
| 1. type: 257 (`node_announcement`) | ||
| 2. data: | ||
| * [`64`:`signature`] | ||
| * [`2`:`flen`] | ||
| * [`flen`:`features`] | ||
| * [`2`:`cflen`] | ||
| * [`cflen`:`combinedfeatures`] | ||
| * [`4`:`timestamp`] | ||
| * [`33`:`node_id`] | ||
| * [`3`:`rgb_color`] | ||
|
|
@@ -304,8 +304,9 @@ The origin node: | |
| to 0. | ||
| - SHOULD ensure `ipv4_addr` AND `ipv6_addr` are routable addresses. | ||
| - MUST NOT include more than one `address descriptor` of the same type. | ||
| - SHOULD set `flen` to the minimum length required to hold the `features` | ||
| - SHOULD set `cflen` to the minimum length required to hold the `combinedfeatures` | ||
| bits it sets. | ||
| - MUST set `combinedfeatures` to the logical OR of `nodefeatures` and `channelfeatures`. | ||
|
|
||
| The receiving node: | ||
| - if `node_id` is NOT a valid compressed public key: | ||
|
|
@@ -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_: | ||
|
Collaborator
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. 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?
Collaborator
Author
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. 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?
Collaborator
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. In due time we may discover, I see arguments for both sides 🤷♂️ |
||
| - 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_, | ||
|
Collaborator
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 seems like a good change, we probably shouldn't be forwarding messages that we were unable to parse |
||
| regardless of if it has parsed the announcement or not. | ||
| - 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 | ||
|
|
@@ -343,11 +338,6 @@ any future fields appended to the end): | |
|
|
||
| ### Rationale | ||
|
|
||
| New node features are possible in the future: backwards compatible (or | ||
| optional) ones will have _odd_ `feature` _bits_, incompatible ones will have | ||
| _even_ `feature` _bits_. These may be propagated by nodes even if they | ||
| cannot process the announcements themselves. | ||
|
|
||
| New address types may be added in the future; as address descriptors have | ||
| to be ordered in ascending order, unknown ones can be safely ignored. | ||
| Additional fields beyond `addresses` may also be added in the future—with | ||
|
|
@@ -727,7 +717,7 @@ In the case where the `channel_announcement` is nonetheless missed, | |
| ## Initial Sync | ||
|
|
||
| If a node requires an initial sync of gossip messages, it will be flagged | ||
| in the `init` message, via a feature flag ([BOLT #9](09-features.md#assigned-localfeatures-flags)). | ||
| in the `init` message, via a feature flag ([BOLT #9](09-features.md#assigned-nodefeatures-flags)). | ||
|
|
||
| Note that the `initial_routing_sync` feature is overridden (and should | ||
| be considered equal to 0) by the `gossip_queries` feature if the | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.