-
Notifications
You must be signed in to change notification settings - Fork 276
Refactor replaceable transactions #3075
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
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
780abad to
b189a7d
Compare
t-bast
commented
May 6, 2025
eclair-core/src/main/scala/fr/acinq/eclair/wire/internal/channel/version4/ChannelCodecs4.scala
Show resolved
Hide resolved
This was referenced 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.
b189a7d to
c4f5d2d
Compare
sstone
reviewed
May 13, 2025
eclair-core/src/main/scala/fr/acinq/eclair/channel/publish/ReplaceableTxFunder.scala
Outdated
Show resolved
Hide resolved
eclair-core/src/main/scala/fr/acinq/eclair/channel/publish/ReplaceableTxFunder.scala
Outdated
Show resolved
Hide resolved
eclair-core/src/main/scala/fr/acinq/eclair/channel/fsm/Channel.scala
Outdated
Show resolved
Hide resolved
eclair-core/src/main/scala/fr/acinq/eclair/channel/publish/ReplaceableTx.scala
Show resolved
Hide resolved
eclair-core/src/main/scala/fr/acinq/eclair/channel/fsm/ErrorHandlers.scala
Outdated
Show resolved
Hide resolved
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
approved these changes
May 14, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
ReplaceableTxFunderis also simpler now, thanks to a better encapsulation of the transaction's contents.The changes to
ReplaceableTxFunder.scalamay 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.scalais worth a deeper review, as we change the logic of the pre-publishing steps!