Skip to content

Conversation

@t-bast
Copy link
Member

@t-bast t-bast commented May 2, 2025

We previously included confirmation targets directly in HTLC and anchor transactions, which didn't really belong there. We now instead set confirmation targets at publication time, based on the current state of the force-close attempt.

We also extract witness data for HTLCs (preimage and remote signature) when creating the command to publish the transaction, instead of doing it inside the publisher actors.

We improve the checks done in the pre-publisher actors, which now take into account the min-depth for commit txs before aborting anchor txs. The ReplaceableTxFunder is also simpler now, thanks to a better encapsulation of the transaction's contents.

The changes to ReplaceableTxFunder.scala may look daunting at first, but they're actually very simple, fields have just moved from one place to another, which allows a few simplifications. ReplaceableTxPrePublisher.scala is worth a deeper review, as we change the logic of the pre-publishing steps!

@t-bast t-bast force-pushed the refactor-replaceable-tx-publisher branch from 780abad to b189a7d Compare May 6, 2025 17:10
@t-bast t-bast changed the title Clean-up replaceable transaction publishers Refactor replaceable transactions May 7, 2025
We previously included confirmation targets directly in HTLC and anchor
transactions, which didn't really belong there. We now instead set
confirmation targets at publication time, based on the current state of
the force-close attempt.

We also extract witness data for HTLCs (preimage and remote signature)
when creating the command to publish the transaction, instead of doing
it inside the publisher actors.

We improve the checks done in the pre-publisher actors, which now take
into account the min-depth for commit txs before aborting anchor txs.
The `ReplaceableTxFunder` is also simpler now, thanks to a better
encapsulation of the transaction's contents.
@t-bast t-bast force-pushed the refactor-replaceable-tx-publisher branch from b189a7d to c4f5d2d Compare May 12, 2025 14:13
@t-bast t-bast marked this pull request as ready for review May 12, 2025 14:14
@t-bast t-bast requested a review from sstone May 12, 2025 14:14
t-bast added 3 commits May 13, 2025 17:06
We didn't watch our anchor output on the remote commit, which means we
weren't recording in the `AuditDB` the fees we paid to get a remote
commit tx confirmed by spending our anchor output. We only had that
code for the local commit, but we've recently started more aggressively
trying to get the *remote* commitment confirmed, so it's important to
correctly record those fees.
We can re-compute HTLC transactions when publishing for all commitment
formats, which indicates that we may not need to store a map of htlc
txs in `LocalCommitPublished`.
@t-bast t-bast merged commit fdc2077 into master May 15, 2025
1 check passed
@t-bast t-bast deleted the refactor-replaceable-tx-publisher branch May 15, 2025 09:41
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.

3 participants