-
Notifications
You must be signed in to change notification settings - Fork 412
Implement the SCIDAlias Channel Type and provide SCID Privacy #1351
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 9 commits into
lightningdevkit:main
from
TheBlueMatt:2022-03-scid-privacy
Mar 28, 2022
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
41fb56b
Bump `check_commits` CI job rustc to 1.57
TheBlueMatt b42ebd8
Expose chan type in `Event::OpenChannelRequest` & `ChannelDetails`
TheBlueMatt 5d652bf
Add support for the SCIDAlias feature bit in incoming channels
TheBlueMatt 2eb6e1f
Negotiate `scid_alias` for private channels based on a new config
TheBlueMatt dc4e62d
Add simple tests for our SCIDAlias implementation and negotiation
TheBlueMatt 99b7219
Make all callsites to `get_channel_update_for_unicast` fallible
TheBlueMatt d225630
Use the correct SCID when failing HTLCs to aliased channels
TheBlueMatt c47acd7
Drop the `Writeable::encode_with_len` method in non-test buidls
TheBlueMatt 952cee4
Add notes about SCID alias rotation to `ChannelDetails` docs
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
Oops, something went wrong.
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.
Hmmm... this check may be more suitable at the call site. That way it is clear the error message is in response to an
open_channel
message. Though, I suppose you wouldn't want this called when in a different state. Maybe it would simpler to inline the method inhandle_error
?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.
Hmmmm, I really prefer to keep as much channel state machine logic in
channel.rs
as possible. In general we've failed at this increasingly, but if I ever find time I'm gonna try to push a chunk back down. channelmanager should just be for inter-channel stuff, never have any real knowledge of channel's state machine transitions, though it has to sometimes ask about the current state.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.
Ah, I see - good point! I guess it seems that
ChannelManager::handle_event
has state machine logic, though, because it assumes theerror
message is a response toopen_channel
. Would it make sense to add ahandle_error
method toChannel
, whichChannelManager
could delegate to? That would in turn have this logic to determine whetheradvance_channel_type_pref
should be called or something else in the future depending on the channel state. I suppose it would need to return an event forChannelManager
to enqueue instead of assuming it isSendOpenChannel
.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.
Heh, that's why i put the state check in
channel.rs
that waychannelmanager
doesn't really know what the error is in response to, it just tries and lets channel figure it out. I'm gonna renameadvance_channel_type_pref
tomaybe_handle_error_without_close
to make it "feel" more generic.Unless you feel strongly I'm not gonna bother changing its return type, though, currently all of the
channel
/channelmanager
bounday has chanellmanger "know" what type of message is being sent, cause its enforced by the type-checker. I agree in the future we should move some of those to events, but that's also a larger refactor.