-
Notifications
You must be signed in to change notification settings - Fork 414
Introduce FundingTransactionReadyForSignatures
event
#3889
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
base: main
Are you sure you want to change the base?
Conversation
👋 Thanks for assigning @jkczyz as a reviewer! |
lightning/src/events/mod.rs
Outdated
/// channel is ready to be signed by the client. This event will only be triggered | ||
/// if at least one input was contributed by the holder and needs to be signed. | ||
/// | ||
/// The transaction contains all inputs provided by both parties along with the channel's funding |
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.
nit: extra space after "parties"
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.
Not fixed.
/// After signing, call [`ChannelManager::funding_transaction_signed`] with the (partially) signed | ||
/// funding transaction. | ||
/// | ||
/// Generated in [`ChannelManager`] message handling. |
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.
Could you add a "Failure Behavior and Persistence" section as is done for other events?
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.
Yeah and it makes sense to replay this after failure to handle, but not to persist across restarts as the new channel/splice won't be persisted before signing, anyway.
lightning/src/events/mod.rs
Outdated
// TODO(dual_funding): Enable links when methods are implemented | ||
/// The `user_channel_id` value passed in to `ChannelManager::create_dual_funded_channel` for outbound | ||
/// channels, or to [`ChannelManager::accept_inbound_channel`] or `ChannelManager::accept_inbound_channel_with_contribution` | ||
/// for inbound channels if [`UserConfig::manually_accept_inbound_channels`] config flag is set to true. |
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.
Let's remove mentions of the dual-funded methods for 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.
Likewise not yet resolved.
lightning/src/ln/channelmanager.rs
Outdated
/// counterparty's signature(s) the funding transaction will automatically be broadcast via the | ||
/// [`BroadcasterInterface`] provided when this `ChannelManager` was constructed. | ||
/// | ||
/// SIGHASH_ALL MUST be used for all signatures when providing signatures. |
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.
nit: SIGHASH_ALL
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.
Not resolved. Could you do the same in other docs?
let witnesses: Vec<_> = transaction | ||
.input | ||
.into_iter() | ||
.filter_map(|input| if input.witness.is_empty() { None } else { Some(input.witness) }) | ||
.collect(); |
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.
Don't have a strong opinion here, but seems we can avoid this by passing the Transaction
through and only collecting witnesses when we are ready to construct TxSignatures
.
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.
Cool, yeah will look at changing this after fixups.
165d59d
to
8ca6d79
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3889 +/- ##
==========================================
- Coverage 88.88% 88.82% -0.07%
==========================================
Files 165 165
Lines 118886 118971 +85
Branches 118886 118971 +85
==========================================
Hits 105676 105676
- Misses 10892 10976 +84
- Partials 2318 2319 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
1 similar comment
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.
Looks good!
890633d
to
a1de384
Compare
🔔 2nd Reminder Hey @wpaulino! This PR has been waiting for your review. |
The `FundingTransactionReadyForSignatures` event requests witnesses from the client for their contributed inputs to an interactively constructed transaction. The client calls `ChannelManager::funding_transaction_signed` to provide the witnesses to LDK.
a1de384
to
7df5779
Compare
7df5779
to
c8f981c
Compare
🔔 3rd Reminder Hey @wpaulino! This PR has been waiting for your review. |
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.
Not sure if there was a problem rebasing, but some comments that had been marked resolved weren't fixed.
lightning/src/events/mod.rs
Outdated
/// channel is ready to be signed by the client. This event will only be triggered | ||
/// if at least one input was contributed by the holder and needs to be signed. | ||
/// | ||
/// The transaction contains all inputs provided by both parties along with the channel's funding |
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.
Not fixed.
lightning/src/events/mod.rs
Outdated
/// Indicates that a funding transaction constructed via interactive transaction construction for a | ||
/// channel is ready to be signed by the client. This event will only be triggered | ||
/// if at least one input was contributed by the holder and needs to be signed. |
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.
/// Indicates that a funding transaction constructed via interactive transaction construction for a | |
/// channel is ready to be signed by the client. This event will only be triggered | |
/// if at least one input was contributed by the holder and needs to be signed. | |
/// Indicates that a channel funding transaction constructed interactively is ready to be | |
/// signed. This event will only be triggered if at least one input was contributed. |
lightning/src/events/mod.rs
Outdated
/// Indicates that a funding transaction constructed via interactive transaction construction for a | ||
/// channel is ready to be signed by the client. This event will only be triggered | ||
/// if at least one input was contributed by the holder and needs to be signed. |
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.
Not sure if we should we expose "holder" to the user. We might do that elsewhere, but I'm not sure if readers of these docs will understand what that means. Instead, we may want to reference the method that is called to contribute inputs.
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.
Yeah, that method for accepting a channel and contributing inputs would be in #3735. I imagine there would be a similar method to accept a splice. So can't reference it now.
lightning/src/ln/channelmanager.rs
Outdated
/// counterparty's signature(s) the funding transaction will automatically be broadcast via the | ||
/// [`BroadcasterInterface`] provided when this `ChannelManager` was constructed. | ||
/// | ||
/// SIGHASH_ALL MUST be used for all signatures when providing signatures. |
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.
Not resolved. Could you do the same in other docs?
None => { | ||
return Err(APIError::APIMisuseError { | ||
err: format!( | ||
"Channel with id {} not expecting funding signatures", | ||
channel_id | ||
), | ||
}) | ||
}, | ||
}, | ||
None => { | ||
return Err(APIError::ChannelUnavailable { | ||
err: format!( | ||
"Channel with id {} not found for the passed counterparty node_id {}", | ||
channel_id, counterparty_node_id | ||
), | ||
}) | ||
}, |
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.
Could you describe in the docs when each error type is returned?
lightning/src/events/mod.rs
Outdated
// TODO(dual_funding): Enable links when methods are implemented | ||
/// The `user_channel_id` value passed in to `ChannelManager::create_dual_funded_channel` for outbound | ||
/// channels, or to [`ChannelManager::accept_inbound_channel`] or `ChannelManager::accept_inbound_channel_with_contribution` | ||
/// for inbound channels if [`UserConfig::manually_accept_inbound_channels`] config flag is set to true. |
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.
Likewise not yet resolved.
Yeah, they got lost on a rebase and somehow lost the commit. Rebased to get the one CI fix in. Fixing. |
7aa05ee
to
c15f426
Compare
c15f426
to
ff1489d
Compare
Cherry-picked from #3735 as it is relevant to splicing and will unblock testing after #3736 lands.
The
FundingTransactionReadyForSignatures
event requests witnesses from the client for their contributed inputs to an interactively constructed transaction.The client calls
ChannelManager::funding_transaction_signed
to provide the witnesses to LDK.