-
Notifications
You must be signed in to change notification settings - Fork 276
Remove non-final transactions from XxxCommitPublished
#3097
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
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
caf8877 to
d8da778
Compare
|
Codecov ReportAttention: Patch coverage is
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## master #3097 +/- ##
==========================================
+ Coverage 85.80% 86.06% +0.26%
==========================================
Files 236 238 +2
Lines 21299 21548 +249
Branches 859 849 -10
==========================================
+ Hits 18275 18546 +271
+ Misses 3024 3002 -22
🚀 New features to boost your workflow:
|
When a channel was force-closed, we previously stored partially created closing transactions for each output of the commitment transaction. In some cases those transactions didn't include any on-chain fee (HTLC txs with 0-fee anchors) and weren't signed. The fee is set in the publisher actors which then sign those transactions. This was an issue because we used those partial transactions as if they were the final transaction that would eventually confirm: this made it look like RBF wasn't an option to callers, and was thus easy to misuse. We now change our data model to only store the outputs of the commit tx that we may spend, without any actual spending transaction. We only store spending transactions once they are confirmed, at which point they can safely be used as closing transactions by callers such as our balance checks. This lets us get rid of some codec migration code related to closing transactions, and is more future-proof because we now don't need to encode closing transactions and can thus change their format easily. This also reduces the size of our channel state during force-close.
d8da778 to
64b81e1
Compare
t-bast
commented
Jun 4, 2025
eclair-core/src/main/scala/fr/acinq/eclair/channel/fsm/ErrorHandlers.scala
Show resolved
Hide resolved
sstone
reviewed
Jun 5, 2025
pm47
reviewed
Jun 5, 2025
eclair-core/src/main/scala/fr/acinq/eclair/channel/ChannelData.scala
Outdated
Show resolved
Hide resolved
We add a `max-closing-feerate` config parameter to cap the feerate used for closing transactions which aren't at risk of being double-spent. Node operators should generally use a low value here, and update it when they need to reclaim liquidity if needed.
Instead of introducing a `DirectedHtlcId`, we split incoming and outgoing HTLCs into separate maps, which is more natural.
pm47
approved these changes
Jun 12, 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.
When a channel was force-closed, we previously stored partially created closing transactions for each output of the commitment transaction. In some cases those transactions didn't include any on-chain fee (HTLC txs
with 0-fee anchors) and weren't signed. The fee is set in the publisher actors which then sign those transactions.
This was an issue because we used those partial transactions as if they were the final transaction that would eventually confirm: this made it look like RBF wasn't an option to callers, and was thus easy to misuse.
We now change our data model to only store the outputs of the commit tx that we may spend, without any actual spending transaction. We only store spending transactions once they are confirmed, at which point they can safely be used as closing transactions by callers such as our balance checks.
This lets us get rid of some codec migration code related to closing transactions, and is more future-proof because we now don't need to encode closing transactions and can thus change their format easily. This also reduces the size of our channel state during force-close.
When we restart, we re-compute pending closing transactions, which means we potentially RBF transactions claiming our main output, which is a good thing. In the longer term, once we stop supporting non-anchor commitment formats, we should probably re-work the publisher actors to always automatically RBF those transactions.
❗ Reviewers should start reviewing the changes made to
ChannelData.scala: that's the main change and goal of this PR. Then another important change is inChannel.scalawhen restoring a channel (reconnection) where we re-compute 2nd-stage and 3rd-stage transactions. The rest of the PR is just fixing existing code to work with the new format.