-
Notifications
You must be signed in to change notification settings - Fork 404
Fetch InitFeatures from both Channel and Routing Message Handlers #1701
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
Merged
TheBlueMatt
merged 4 commits into
lightningdevkit:main
from
TheBlueMatt:2022-09-feature-or
Sep 9, 2022
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
950ccc4
Fetch our `InitFeatures` from `ChannelMessageHandler`
TheBlueMatt 06cb48a
OR InitFeatures from both Channel and Routing message handlers
TheBlueMatt e34a2bc
Add a new InitFeatures constructor to capture the types of flags
TheBlueMatt 1b67b0b
Make clear_initial_routing_sync more consistent with other APIs
TheBlueMatt File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this also set
initial_routing_sync
since that is cleared inknown_channel_features
? Maybe it would be better to defineknown_channel_features
as the set difference ofInitFeatures::known
withP2PGossipSync::provided_init_features
(as a const somewhere). Then what is described in the comment onInitContext
's optional features wouldn't be necessary.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, the fact that we were previously setting initial_routing_sync was an oversight, basically. If our peer supports gossip sync they'll ignore it, and we shouldnt be setting it on every connection anyway as it'll waste bandwidth.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we call this out in the commit message and changelog since it is a behavioral change? Will / should we ever set
initial_routing_sync
now?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure added a note. We will no longer ever set it, no.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any way we could still do something with set difference, though? Would need to special case removing
initial_routing_sync
, but I guess that is an unordinary feature anyhow.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure what a set difference here gets us? If anything I'd be inclined to have the
ChannelManager
explicitly set all the features it wants, rather than having that logic infeatures.rs
itself, I only didn't bother because it'd be very verbose.I see the purpose of this change, ultimately as moving away from defining an LDK-global "known features" set, which was always a little awkward, and instead defining the "known features" set in each module that actually provides said features.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Discussed offline. My primary concern was to avoid relying on a comment to know when to update
known_channel_features
. Possible alternative could be to have a unit test asserting that the intersection ofChannelManager
andP2PGossipSync
's provided features is empty.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See #1707