Skip to content

Conversation

@t-bast
Copy link
Member

@t-bast t-bast commented Oct 20, 2025

We add support for the zero-fee commitment format specified in lightning/bolts#1228.

Channels using this commitment format benefit from better protection against pinning attacks (thanks to TRUC/v3 transactions), don't need the update_fee mechanism, have less dust exposure risk, and use an overall simpler state machine.

This isn't ready to review yet, important details and tests are missing.

@t-bast t-bast force-pushed the zero-fee-commitments branch 2 times, most recently from 89a2c8e to 107182e Compare October 27, 2025 13:04
We add support for the zero-fee commitment format specified in
lightning/bolts#1228.

Channels using this commitment format benefit from better protection
against pinning attacks (thanks to TRUC/v3 transactions), don't need
the `update_fee` mechanism, have less dust exposure risk, and use an
overall simpler state machine.

In this commit, we simply introduce the commitment format and create
the corresponding transactions.
@t-bast t-bast force-pushed the zero-fee-commitments branch from 107182e to 03d3ac3 Compare October 27, 2025 15:15
Now that we mostly use anchor channels where HTLC txs have a feerate
of `0 sat/byte`, we don't benefit from the output "trimming" mechanism
anymore: we must set a `dust_limit` that ensures that we only create
outputs when they are economical to spend on-chain.
It isn't delayed anymore for v3 transactions. We could use static wallet
public key, but in most cases it wouldn't work and adds extra complexity
so we don't do it. We add a comment in the documentation of this class
to explain why we're always making a 2nd-stage transaction.
We apply slightly different validation for zero-fee commitments:

- the commit feerate must be `0 sat/byte`
- the max number of accepted HTLCs must be at most 114
- `update_fee` cannot be used

We verify those requirements during channel creation and add tests
for normal channel operation.
@codecov-commenter
Copy link

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 94.23077% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 88.95%. Comparing base (f93d02f) to head (7532699).
⚠️ Report is 45 commits behind head on master.

Files with missing lines Patch % Lines
...la/fr/acinq/eclair/transactions/Transactions.scala 89.28% 6 Missing ⚠️
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3192      +/-   ##
==========================================
+ Coverage   86.43%   88.95%   +2.51%     
==========================================
  Files         242      218      -24     
  Lines       22607    20538    -2069     
  Branches      832      810      -22     
==========================================
- Hits        19541    18270    -1271     
+ Misses       3066     2268     -798     
Files with missing lines Coverage Δ
...core/src/main/scala/fr/acinq/eclair/Features.scala 100.00% <100.00%> (ø)
...re/src/main/scala/fr/acinq/eclair/NodeParams.scala 92.54% <100.00%> (+0.27%) ⬆️
...r/acinq/eclair/blockchain/fee/OnChainFeeConf.scala 100.00% <100.00%> (ø)
...cala/fr/acinq/eclair/channel/ChannelFeatures.scala 98.36% <100.00%> (-1.64%) ⬇️
...in/scala/fr/acinq/eclair/channel/Commitments.scala 95.30% <100.00%> (-0.63%) ⬇️
...c/main/scala/fr/acinq/eclair/channel/Helpers.scala 92.86% <100.00%> (+0.22%) ⬆️
...in/scala/fr/acinq/eclair/channel/fsm/Channel.scala 84.04% <100.00%> (-0.27%) ⬇️
...q/eclair/channel/fsm/ChannelOpenSingleFunded.scala 91.75% <100.00%> (-0.42%) ⬇️
...inq/eclair/channel/fsm/CommonFundingHandlers.scala 93.10% <ø> (ø)
...a/fr/acinq/eclair/channel/fsm/CommonHandlers.scala 90.38% <ø> (ø)
... and 5 more

... and 11 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants