Skip to content

Simplify how we store HTLC transactions when the local/remote commit tx is published #3084

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

Conversation

sstone
Copy link
Member

@sstone sstone commented May 14, 2025

In #3075 we observed (see #3075 (comment)) that we can easily re-compute HTLC transactions when a local/commit transaction is published and do not need to store them, a list of commit tx outpoints spent by them should be enough.

The actual htlcTxs members have not been modified yet (to avoid updating codecs which is a bit tedious and mechanical) but the code now uses a new propety htlcTxOutpoints: Set[OutPoint] which will eventually replace the current htlcTxs property.

t-bast and others added 5 commits May 12, 2025 16:13
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.
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`.
@sstone sstone requested a review from t-bast May 14, 2025 16:10
@t-bast
Copy link
Member

t-bast commented May 23, 2025

Closing this PR, we decided to go even further and remove all tx instances from XxxCommitPublished. I'm working on this, but it requires a few preparatory PRs.

@t-bast t-bast closed this May 23, 2025
@t-bast t-bast deleted the refactor-replaceable-tx-publisher-update-local-remote-commit-published branch May 23, 2025 08:13
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.

2 participants