Implement anchor outputs zero fee htlc txs#1932
Merged
Conversation
1ca266d to
fae57ae
Compare
Codecov Report
@@ Coverage Diff @@
## master #1932 +/- ##
==========================================
- Coverage 87.66% 87.63% -0.03%
==========================================
Files 159 159
Lines 12424 12438 +14
Branches 527 519 -8
==========================================
+ Hits 10891 10900 +9
- Misses 1533 1538 +5
|
f3fa135 to
57140b3
Compare
pm47
reviewed
Sep 7, 2021
eclair-core/src/main/scala/fr/acinq/eclair/blockchain/fee/FeeEstimator.scala
Show resolved
Hide resolved
eclair-core/src/main/scala/fr/acinq/eclair/channel/ChannelFeatures.scala
Show resolved
Hide resolved
eclair-core/src/main/scala/fr/acinq/eclair/transactions/CommitmentSpec.scala
Show resolved
Hide resolved
eclair-core/src/main/scala/fr/acinq/eclair/channel/publish/ReplaceableTxPublisher.scala
Outdated
Show resolved
Hide resolved
57140b3 to
c537fcb
Compare
Create the corresponding feature bit and channel type. Ensure it can be correctly negotiated and propagated to the channel commitments.
When the channel type is anchor outputs with zero fee htlc txs, we set the fees for the htlc txs to 0. An important side-effect is that it changes the trimmed to dust calculation, and outputs that were previously dust can now be included in the commit tx.
It makes sense to decouple the transaction code that doesn't need to know anything about the channel type, but only the format of the transactions that should be built.
c537fcb to
80941c2
Compare
pm47
approved these changes
Sep 10, 2021
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
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.
Implement lightning/bolts#824
This is a small variation of the original anchor outputs proposal, where the fees of the htlc 2nd-stage txs are set to 0 to fix a fee inflating attack when you're fundee (see https://lists.linuxfoundation.org/pipermail/lightning-dev/2020-September/002796.html for details).
The first commit creates the corresponding feature bit and lets peers negotiate its activation.
The second commit actually sets the htlc txs fee to 0 when this new channel type is negotiated.
I've tested cross-compatibility with lnd 0.13.1-beta (their latest release).
I verified that we were able to open channels and send payments to each other.
I also verified that HTLCs that were exactly at the dust limit were included in the commit tx (so the trimmed to dust calculation is compatible and correctly uses a 0-fee htlc tx) and htlcs just below the dust limit were not included in the commit tx.