Skip to content

Conversation

@joostjager
Copy link
Contributor

With splicing now implemented, a channel may have multiple holder commitment transactions and corresponding balance candidates. ldk-node now reports the confirmed balance candidate rather than a single static balance, ensuring the exposed value matches the channel's onchain state. Other candidate balances remain internal for now.

@ldk-reviews-bot
Copy link

ldk-reviews-bot commented Sep 16, 2025

👋 Thanks for assigning @tnull as a reviewer!
I'll wait for their review and will help manage the review process.
Once they submit their review, I'll check if a second reviewer would be helpful.

@joostjager joostjager requested review from tnull and removed request for tnull September 16, 2025 08:22
Copy link
Collaborator

@tnull tnull left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, mod two nits.

We could also revisit whether to expose the balance candidates when exposing splicing, or whether we'd want to leave as-is (cc @jkczyz).

} => {
let balance = balance_candidates.get(confirmed_balance_candidate_index).unwrap();

Self::ClaimableOnChannelClose {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mind updating the docs on our ClaimableOnChannelClose to note that we're just exposing this balance in a splicing scenario?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added that values are based on the confirmed channel state, ignoring pending splices. I don't think it is what you suggest, that we are just exposing in a splicing scenario?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Noted above that this is not the case. Confirmed but not locked splices are taken into account.

Also, LdkBalance::claimable_amount_satoshis uses a different way of calculating this when the index is 0. But maybe that is just to avoid the unwrap? (cc:: @wpaulino)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah when the index is 0, either we don't have a pending splice, or we do but none of the splice transactions has confirmed. In the latter case, we still want to report some indication of the unconfirmed splice balance.

With splicing now implemented, a channel may have multiple holder
commitment transactions and corresponding balance candidates. ldk-node
now reports the confirmed balance candidate rather than a single static
balance, ensuring the exposed value matches the channel's onchain state.
Other candidate balances remain internal for now.
Copy link
Collaborator

@tnull tnull left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@tnull tnull merged commit f0296d2 into lightningdevkit:develop Sep 16, 2025
8 of 15 checks passed
Comment on lines +76 to +77
/// force-closed now. Values do not take into account any pending splices and are only based
/// on the confirmed state of the channel.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't believe this is the case. It will take into account a pending splice if it is confirmed but not locked (i.e., doesn't have sufficient number of confirmations).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BTW, let us know if there is a way to update the docs to make this clear.

} => {
let balance = balance_candidates.get(confirmed_balance_candidate_index).unwrap();

Self::ClaimableOnChannelClose {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Noted above that this is not the case. Confirmed but not locked splices are taken into account.

Also, LdkBalance::claimable_amount_satoshis uses a different way of calculating this when the index is 0. But maybe that is just to avoid the unwrap? (cc:: @wpaulino)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants