Skip to content

Broadcast holder commitment for currently confirmed funding #3939

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 4 commits into
base: main
Choose a base branch
from

Conversation

wpaulino
Copy link
Contributor

A splice's FundingScope can only be promoted once a ChannelMonitorUpdateStep::RenegotiatedFundingLocked is applied, or if the monitor is no longer accepting updates, once the splice transaction is no longer under reorg risk. Because of this, our current FundingScope may not reflect the latest confirmed state in the chain. Before making a holder commitment broadcast, we must check which FundingScope is currently confirmed to ensure that it can propagate throughout the network.

Depends on #3894.

wpaulino added 4 commits July 15, 2025 17:25
This is a new `ChannelMonitorUpdateStep` variant intended to be used
whenever a new funding transaction that was negotiated and applied via
the `RenegotiatedFunding` update reaches its intended confirmation depth
and both sides of the channel exchange `channel_ready`/`splice_locked`.
This commit primarily focuses on its use for splices, but future work
will expand where needed to support RBFs for a dual funded channel.

This monitor update ensures that the monitor can safely drop all prior
commitment data since it is now considered invalid/unnecessary. Once the
update is applied, only state for the new funding transaction is tracked
going forward, until the monitor receives another `RenegotiatedFunding`
update.
It's only intended to be set during initialization and used to check if
the channel is v1 or v2. We rename it to `first_negotiated_funding_txo`
to better reflect its purpose.
A `ChannelMonitor` will always consider a channel closed once a
confirmed spend for the funding transaction is detected. This is no
longer the case with splicing, as the channel will remain open and
capable of accepting updates while its funding transaction is being
replaced.
A splice's `FundingScope` can only be promoted once a
`ChannelMonitorUpdateStep::RenegotiatedFundingLocked` is applied, or if
the monitor is no longer accepting updates, once the splice transaction
is no longer under reorg risk. Because of this, our current
`FundingScope` may not reflect the latest confirmed state in the chain.
Before making a holder commitment broadcast, we must check which
`FundingScope` is currently confirmed to ensure that it can propogate
throughout the network.
@ldk-reviews-bot
Copy link

ldk-reviews-bot commented Jul 17, 2025

👋 I see @joostjager was un-assigned.
If you'd like another reviewer assignment, please click here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

2 participants