-
Notifications
You must be signed in to change notification settings - Fork 266
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
Lower minimum remote dust limit #1900
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1900 +/- ##
==========================================
- Coverage 87.67% 87.65% -0.02%
==========================================
Files 158 158
Lines 12407 12420 +13
Branches 519 512 -7
==========================================
+ Hits 10878 10887 +9
- Misses 1529 1533 +4
|
If our peer uses non-segwit shutdown scripts and we lower the dust limit below what is acceptable for non-segwit outputs (546 instead of 330), then we may end up creating mutual close transactions with dust outputs ? |
I started a discussion on the spec regarding this issue: lightning/bolts#905 |
00d7b2f
to
705cc91
Compare
We are slowly dropping support for non-segwit outputs, as proposed in lightning/bolts#894 We can thus safely allow dust limits all the way down to 354 satoshis.
In very rare cases where dust_limit_satoshis is negotiated to a low value, our peer may generate closing txs that will not correctly relay on the bitcoin network due to dust relay policies. When that happens, we detect it and force-close instead of completing the mutual close flow.
We shouldn't use non-segwit scripts anymore as they can in theory mess with the dust limits (and we should encourage migration to segwit).
705cc91
to
ca2c87f
Compare
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.
I was expecting a check on the script with a force close branch here:
case Event(remoteShutdown@Shutdown(_, remoteScriptPubKey, _), d: DATA_NORMAL) => |
I was also expecting a check there for the case where we initiate the mutual close:
case Event(c: CMD_CLOSE, d: DATA_NORMAL) => |
CMD_CLOSE
to prevent unnecessary force closes if used directly (e.g. from a plugin).
Yes, that was the least invasive option, because we need to have decided on a fee before we can check whether we need to force-close (since the fee impacts the output amounts). But it's mostly because it was easiest to do here than elsewhere.
I don't think it's worth explicitly rejecting here. But this was a good opportunity to promote segwit-only at the API level to encourage our users to migrate (if not already done), because there's just no reason to use non-segwit today. |
Implement lightning/bolts#894
We can safely accept dust limits as small as 354 sats, as long as we explicitly handle the case where a closing tx is generated with an output below dust (when that happens, we force-close to get our funds back).
The spec PR received broad agreement during yesterday's spec meeting, so we can safely merge this change now.