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
Include excess counterparty commitment transaction fees in dust exposure #3045
Include excess counterparty commitment transaction fees in dust exposure #3045
Conversation
In most cases we already call both in a pair, and in fact always consolidate some of the returned values across both accessors, so there's not much reason to have them be separate methods. Here we merge them.
The previous commit left indentation in `get_pending_htlc_stats` deliberately wrong, to ease reviewability. This commit fixes the indentation.
As LDK changes, `UserConfig::default()` may imply marginally different behavior, whereas `test_default_channel_config` is intended to tweak defaults to provide a stable behavior for test contexts. This commit changes a few uses of `UserConfig::default()` to `test_default_channel_config` in cases that will fail over the coming commits due to dust changes.
Transaction fees on counterparty commitment transactions are ultimately not our money and thus are really "dust" from our PoV - they're funds that may be ours during off-chain updates but are not ours once we go on-chain. Thus, here, we count any such fees in excess of our own fee estimates towards dust exposure. We don't bother to make an inbound/outbound channel distinction here as in most cases users will use `MaxDustExposure::FeeRateMultiplier` which will scale with the fee we set on outbound channels anyway. Note that this also enables the dust exposure checks on anchor channels during feerate updates. We'd previously elided these as increases in the channel feerates do not change the HTLC dust exposure, but now do for the fee dust exposure.
Now that we're including excess counterparty commitment transaction fees in our dust calculation, we need to update the docs accordingly. We do so here, describing some of the considerations and risks that come with the new changes. We also take this opportunity to double the default value, as users have regularly complained that non-anchor channels fail to send HTLCs with the default settings with some feerates. Fixes lightningdevkit#2922
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 @@
## main #3045 +/- ##
==========================================
+ Coverage 89.16% 90.65% +1.48%
==========================================
Files 118 118
Lines 97726 102485 +4759
Branches 97726 102485 +4759
==========================================
+ Hits 87142 92904 +5762
+ Misses 8345 7135 -1210
- Partials 2239 2446 +207 ☔ View full report in Codecov by Sentry. |
Fuzz tests failing 😢 |
Grr, its just the stupid no_existing_breakage test. I'll work on it but IMO we can merge it with that broken, cut an RC, and then fix for release. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks for the docs :)
…-are-dust Include excess counterparty commitment transaction fees in dust exposure
Transaction fees on counterparty commitment transactions are
ultimately not our money and thus are really "dust" from our PoV -
they're funds that may be ours during off-chain updates but are not
ours once we go on-chain.
Thus, here, we count any such fees in excess of our own fee
estimates towards dust exposure. We don't bother to make an
inbound/outbound channel distinction here as in most cases users
will use
MaxDustExposure::FeeRateMultiplier
which will scalewith the fee we set on outbound channels anyway.
Note that this also enables the dust exposure checks on anchor
channels during feerate updates. We'd previously elided these as
increases in the channel feerates do not change the HTLC dust
exposure, but now do for the fee dust exposure.
Also updates our default limit, fixing #2922