-
Notifications
You must be signed in to change notification settings - Fork 407
Expose temporary channel ID and user channel ID pre-funding #1121
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
Expose temporary channel ID and user channel ID pre-funding #1121
Conversation
This makes it more practical for users to track channels prior to funding, especially if the channel fails because the peer rejects it for a parameter mismatch.
This makes it more practical for users to track channels using their own IDs, especially across funding.
Codecov Report
@@ Coverage Diff @@
## main #1121 +/- ##
==========================================
+ Coverage 90.67% 91.83% +1.16%
==========================================
Files 66 66
Lines 34732 39174 +4442
==========================================
+ Hits 31492 35977 +4485
+ Misses 3240 3197 -43
Continue to review full report at Codecov.
|
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.
If we're gonna keep a user id around, it might be helpful to have the abilitty to set a channel's user id (just once), so once an iincoming channel is persisted to some local database, it's easier to keep track of.
lightning/src/ln/channelmanager.rs
Outdated
/// [`Event::FundingGenerationReady`]: events::Event::FundingGenerationReady | ||
/// [`Event::FundingGenerationReady::temporary_channel_id`]: events::Event::FundingGenerationReady::temporary_channel_id | ||
/// [`Event::ChannelClosed::channel_id`]: events::Event::ChannelClosed::channel_id | ||
pub fn create_channel(&self, their_network_key: PublicKey, channel_value_satoshis: u64, push_msat: u64, user_id: u64, override_config: Option<UserConfig>) -> Result<[u8; 32], APIError> { |
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.
Would it make sense to create a type alias for the channel id here instead of just [u8; 32]
?
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.
Yea, maybe lets do that as a part of addressing #105? We'll want to separate the types out between temporary channel ids and permanent ones, I think.
Yea, there's a few things we should probably consider for the user id, since its not new or (materially) changed in this PR, lets leave it for a followup and figure out what we want to do with it in #1125. |
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.
Minor suggestions only
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.
Fine with holding off on decision on channel_user_id
as per #1125.
Oops, sorry, fixed missing renames for user_id. |
347c49e
to
656a4a1
Compare
656a4a1
to
bb7ef6c
Compare
Squashed the fixup commit down, diff since Jeff's ACK:
|
Diff since Val's ACK is also just one trivial variable rename, so gonna take this. Gotta wait on #1127 anyway:
|
Its pretty hard for users to track a channel pre-funding to ChannelClosed especially when our counterparty closed the channel due to a parameter mismatch. This resolves that with more data in the relevant events.