Persist counterparty_claimable_outpoints out of channel_monitor#4461
Persist counterparty_claimable_outpoints out of channel_monitor#4461TheBlueMatt wants to merge 8 commits intolightningdevkit:mainfrom
Conversation
When a splice locks in, consumers need to know which previous funding outpoint was spent. Add a new field to Event::ChannelReady to surface this information: - spent_funding_txo: the previous funding outpoint consumed by the splice (None for initial channel funding) The field uses an odd TLV tag (3) for backward compatibility. Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Introduce two new events i.e. PersistClaimInfo and ClaimInfoRequest. PersistClaimInfo: Indicates that [ClaimInfo] may be durably persisted to reduce `ChannelMonitor` in-memory size. ClaimInfoRequest: Used to request [ClaimInfo] for a specific counterparty commitment transaction.
Introduces two new functions in the chainmonitor:
* `provide_claim_info` - is called in response to a `ClaimInfoRequest`
to provide the necessary claim data that was previously persisted using
the `PersistClaimInfo` event.
* `claim_info_persisted` - should be called after `ClaimInfo` is persisted
via the `PersistClaimInfo` event to confirm that the data is durably
stored.
Also introduces tracking of transactions which spend a commitment
transaction we're waiting on claim info for so that we can replay
them once we receive the claim info.
Original commit by G8XSU <3442979+G8XSU@users.noreply.github.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
When we're waiting for claim info for a counterparty-broadcasted revoked commitment transaction, we confused our claimable `Balance` logic. Here we fix that, also including a new `Balance` to ensure that a `ChannelMonitor` which is waiting on claim info can not be pruned. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Indicates that a [`ClaimInfo`] for a specific counterparty commitment transaction must be supplied to LDK if available.
Indicates that [`ClaimInfo`] may be durably persisted to reduce `ChannelMonitor` in-memory size.
|
I've assigned @jkczyz as a reviewer! |
While downstream code can always ignore `Event::PersistClaimInfo`, the generation of them can be somewhat expensive, so we thus allow downstream logic to disable them entirely here. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
dd0662a to
a09467c
Compare
| handler(ev).await | ||
| { | ||
| if !self.offload_claim_info { | ||
| if let Event::PersistClaimInfo { .. } = &ev { |
There was a problem hiding this comment.
This should actually not be generated instead of simply filtered.
|
🔔 1st Reminder Hey @jkczyz! This PR has been waiting for your review. |
|
🔔 2nd Reminder Hey @jkczyz! This PR has been waiting for your review. |
|
🔔 3rd Reminder Hey @jkczyz! This PR has been waiting for your review. |
Rebase + rework of #3106