-
Notifications
You must be signed in to change notification settings - Fork 412
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
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.
👋 Thanks for assigning @jkczyz as a reviewer! |
/// 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"
/// 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?
// 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.
/// 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
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
.
@@ -396,9 +396,14 @@ impl InteractiveTxSigningSession { | |||
/// unsigned transaction. | |||
pub fn provide_holder_witnesses( | |||
&mut self, channel_id: ChannelId, witnesses: Vec<Witness>, |
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.
Predates the PR, but looks like there is an unnecessary into_iter().collect()
on witnesses
.
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.