-
Notifications
You must be signed in to change notification settings - Fork 912
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
test: poc that locks up a channel #3498
test: poc that locks up a channel #3498
Conversation
This poc demonstrates how a remote channel can be locked by an attacker, so that no one can use this channel again except by making a small trimmed payment first. This is based on test_pay test_channel_drainage. Impact: Network health affected. One could build a plugin that locks up strategic channels to gain advantage over routing fees or make certain routes unusable. The attacker can find out by trying which side was the founder and use several circular payments throug higher capacity routes through the victims bottleneck in order to lock up a channel. Suggestion: Prevent running into the 'trimmed only state' by raising CAPACITY_EXCEEDED when a channel is too low already. Changelog-None
Have not seen the code yet, but then my grasp of the Python test framework is iffy at best. In any case @rustyrussell is reportedly coding a fix (which I presume he will push on top of this PR). For those watching, the explanation is this: Remember three things:
This lockup condition in this PR is triggered by doing the following:
@m-schmoock please check correctness of my explanation. A basic solution would be to have a higher-than-reserve "soft" limit, and the funder will refuse to send out outgoing HTLCs via that channel if the funder has less than this soft limit on its side of this channel; this "soft reserve" will instead be used only for paying for incoming HTLCs (i.e. HTLCs from the non-funding side will spend it to fund the onchain fees for those HTLCs). @rustyrussell please check my understanding of the proposed solution. |
Related: lightning/bolts#728 |
The proposal to uses 5 * htlcFee seems reasonable as well; we were thinking 1.5 * htlcFee, but sudden spikes in onchain feerate should probably be protected against as well, so 5 * seems better. |
We already have a lot of padding in fees: if we make the multiplier too great, we end up with small channels being completely unusable. On my node, we're already paying a fee of $0.45 USD for unilateral close. Requiring $5 as extra reserve is pretty bad :( |
This is inspired by @m-schmook's ElementsProject#3498 except this is simply a two-channel version which probes for the amount. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This is inspired by @m-schmook's ElementsProject#3498 except this is simply a two-channel version which probes for the amount. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This is inspired by @m-schmook's ElementsProject#3498 except this is simply a two-channel version which probes for the amount. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This is inspired by @m-schmook's #3498 except this is simply a two-channel version which probes for the amount. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This poc demonstrates how a remote channel can be locked by an attacker,
so that no one can use this channel again except by making a small trimmed
payment first. This is based on test_pay test_channel_drainage.
Impact: Network health affected. One could build a plugin that locks up
strategic channels to gain advantage over routing fees or make certain routes
unusable. The attacker can find out by trying which side was the founder
and use several circular payments through higher capacity routes that contains
the victims bottleneck in order to lock up a channel.
Suggestion: Prevent running into the 'trimmed only state'
by raising CAPACITY_EXCEEDED when a channel is already so low that
only a trimmed HTLC would fit. Thus, trimmed HTLCs will only be
possible if there is enough remaining capacity to let the next HTLC
to be untrimmed.