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 28 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
7991c04
Generalize do_chain_event signature for splicing
jkczyz Apr 10, 2025
d590e2a
Move ChannelContext::funding_tx_confirmed_in to FundingScope
jkczyz Apr 15, 2025
11027f4
Move ChannelContext::funding_tx_confirmation_height to FundingScope
jkczyz Apr 15, 2025
51e300c
Move ChannelContext::short_channel_id to FundingScope
jkczyz Apr 15, 2025
682c459
Refactor funding tx confirmation check into helper
jkczyz Apr 17, 2025
7c872ae
Check FundingScope::funding_transaction for coinbase tx
jkczyz Apr 23, 2025
44671ae
Add FundingScope::get_funding_txid helper
jkczyz Apr 29, 2025
32f0f6b
Reset FundingScope::funding_tx_confirmation_height
jkczyz May 13, 2025
f1f5f1b
f - fix outdated comment
jkczyz May 21, 2025
451c60e
Special case 0-conf in check_funding_meets_minimum_depth
jkczyz May 14, 2025
2a31392
Check confirmation of pending funding transactions
jkczyz Apr 9, 2025
d6e26d7
f - error when pending_splice is None
jkczyz May 16, 2025
fdf11cb
f - add docs
jkczyz May 16, 2025
a0cd76c
f - use early return instead of is_funding_tx_confirmed
jkczyz May 21, 2025
5208684
f - skip check_for_funding_tx_spent
jkczyz May 21, 2025
bd27310
f - DRY splice funding promotion
jkczyz May 21, 2025
5238bdb
Move check_funding_meets_minimum_depth to FundedChannel
jkczyz May 15, 2025
c49f632
Account for coinbase tx in ChannelContext::minimum_depth
jkczyz May 15, 2025
ba60013
Check unconfirmation of pending funding transactions
jkczyz May 13, 2025
de53a88
f - fix compilation error
jkczyz May 19, 2025
8fe756f
Check all FundingScopes in get_relevant_txids
jkczyz May 13, 2025
ea6ab03
Handle splice_locked message
jkczyz Apr 18, 2025
50db5cc
f - proper return values
jkczyz May 16, 2025
89e7aa1
Track historical SCIDs from previous funding
jkczyz May 16, 2025
07908cf
f - add CHANNEL_ANNOUNCEMENT_PROPAGATION_DELAY const
jkczyz May 21, 2025
a06a7de
f - look at next SCID when retaining previous
jkczyz May 21, 2025
0cb7874
Emit SpliceLocked event
jkczyz Apr 30, 2025
61fcbfc
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
Loading