Skip to content

Exchange splice_locked messages #3741

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

Open
wants to merge 23 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
2f6c2fb
Generalize do_chain_event signature for splicing
jkczyz Apr 10, 2025
cee02cc
Move ChannelContext::funding_tx_confirmed_in to FundingScope
jkczyz Apr 15, 2025
3969264
Move ChannelContext::funding_tx_confirmation_height to FundingScope
jkczyz Apr 15, 2025
fc88b9f
Move ChannelContext::short_channel_id to FundingScope
jkczyz Apr 15, 2025
dd0164a
Refactor funding tx confirmation check into helper
jkczyz Apr 17, 2025
80c8f6e
Check FundingScope::funding_transaction for coinbase tx
jkczyz Apr 23, 2025
b238d2d
Add FundingScope::get_funding_txid helper
jkczyz Apr 29, 2025
331b869
Reset FundingScope::funding_tx_confirmation_height
jkczyz May 13, 2025
d39141f
Special case 0-conf in check_funding_meets_minimum_depth
jkczyz May 14, 2025
a6eb6d1
Check confirmation of pending funding transactions
jkczyz Apr 9, 2025
a2cdf9c
f - add logging to maybe_promote_splice_funding
jkczyz Jun 3, 2025
5d72742
f - update minimum_depth docs
jkczyz Jun 4, 2025
d0c9491
Move check_funding_meets_minimum_depth to FundedChannel
jkczyz May 15, 2025
6de3864
Account for coinbase tx in ChannelContext::minimum_depth
jkczyz May 15, 2025
4eda555
Check unconfirmation of pending funding transactions
jkczyz May 13, 2025
9f16c0a
f - fix CI
jkczyz Jun 4, 2025
f734bff
f - add logging to transaction_unconfirmed
jkczyz Jun 3, 2025
3ae66bf
Check all FundingScopes in get_relevant_txids
jkczyz May 13, 2025
eed13e8
Handle splice_locked message
jkczyz Apr 18, 2025
a473983
f - add logging to splice_locked
jkczyz Jun 3, 2025
1811e72
Track historical SCIDs from previous funding
jkczyz May 16, 2025
4f5af9f
Emit SpliceLocked event
jkczyz Apr 30, 2025
bff123e
Add funding_txo to ChannelReady event
jkczyz May 6, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 17 additions & 4 deletions lightning/src/events/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1353,10 +1353,13 @@ pub enum Event {
/// Will be `None` for channels created prior to LDK version 0.0.122.
channel_type: Option<ChannelTypeFeatures>,
},
/// Used to indicate that a channel with the given `channel_id` is ready to
/// be used. This event is emitted either when the funding transaction has been confirmed
/// on-chain, or, in case of a 0conf channel, when both parties have confirmed the channel
/// establishment.
/// Used to indicate that a channel with the given `channel_id` is ready to be used. This event
/// is emitted when
/// - the initial funding transaction has been confirmed on-chain to an acceptable depth
/// according to both parties (i.e., `channel_ready` messages were exchanged),
/// - a splice funding transaction has been confirmed on-chain to an acceptable depth according
/// to both parties (i.e., `splice_locked` messages were exchanged), or,
/// - in case of a 0conf channel, when both parties have confirmed the channel establishment.
///
/// # Failure Behavior and Persistence
/// This event will eventually be replayed after failures-to-handle (i.e., the event handler
Expand All @@ -1375,6 +1378,11 @@ pub enum Event {
user_channel_id: u128,
/// The `node_id` of the channel counterparty.
counterparty_node_id: PublicKey,
/// The outpoint of the channel's funding transaction.
///
/// Will be `None` if the channel's funding transaction reached an acceptable depth prior to
/// version 0.2.
funding_txo: Option<OutPoint>,
/// The features that this channel will operate with.
channel_type: ChannelTypeFeatures,
},
Expand Down Expand Up @@ -1926,11 +1934,13 @@ impl Writeable for Event {
ref channel_id,
ref user_channel_id,
ref counterparty_node_id,
ref funding_txo,
ref channel_type,
} => {
29u8.write(writer)?;
write_tlv_fields!(writer, {
(0, channel_id, required),
(1, funding_txo, option),
(2, user_channel_id, required),
(4, counterparty_node_id, required),
(6, channel_type, required),
Expand Down Expand Up @@ -2437,9 +2447,11 @@ impl MaybeReadable for Event {
let mut channel_id = ChannelId::new_zero();
let mut user_channel_id: u128 = 0;
let mut counterparty_node_id = RequiredWrapper(None);
let mut funding_txo = None;
let mut channel_type = RequiredWrapper(None);
read_tlv_fields!(reader, {
(0, channel_id, required),
(1, funding_txo, option),
(2, user_channel_id, required),
(4, counterparty_node_id, required),
(6, channel_type, required),
Expand All @@ -2449,6 +2461,7 @@ impl MaybeReadable for Event {
channel_id,
user_channel_id,
counterparty_node_id: counterparty_node_id.0.unwrap(),
funding_txo,
channel_type: channel_type.0.unwrap(),
}))
};
Expand Down
Loading