-
Notifications
You must be signed in to change notification settings - Fork 491
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
Remove HTLC amount restriction #877
Conversation
Discussed at meeting. c-lightning and rust-lightning do not enforce on recv, LND needs checking. However, since Electrum does check on recv, this needs a feature bit. I've grabbed the next one in the title. |
I added the option, and restored the send-side restriction when it's not set. |
bbd0dae
to
8b750d5
Compare
Imported from lightning/bolts#877 Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
I'm not sure we need a feature bit if that is already the behavior of most of the network today. |
The feature bit is to stop you sending these to electrum, until they upgrade? Otherwise you'll get an error from them on the channel. |
Imported from lightning/bolts#877 Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
But adding a feature bit now will not stop existing nodes from sending anyway until they upgrade? I guess the decision really depends on lnd's current behavior, let's see what @Roasbeef says. I'm pretty sure they don't enforce it on receive (since we never had reports about this issue before), but the important point is whether they enforce this restriction on send or not. Fortunately, this doesn't cause a channel close with Electrum (@ghost43 can you confirm my understanding here?). Could we re-use the existing |
The channel does not get force-closed, the receiver just disconnects the transport. |
Looking at lnd code, I think the limits have been removed in lightningnetwork/lnd#3804 and lightningnetwork/lnd#4335. |
Thanks for the investigation @ghost43. If that's the case, that means in the currently deployed network, everyone except Electrum accepts receiving these big HTLCs. What do you prefer on the Electrum side:
My personal preference is for option 1) which has minimal impact on the spec and implementation code (less |
I would have preferred using option (3) when implementations originally lifted the limit, but now that there are already lots of nodes out there without the restriction, I agree it is easiest to do (1). It would take time for other implementations to deploy (3) (or (2)) and get it adopted; with (1) it is only Electrum that needs to change. Further, once Electrum releases a new version with the restriction removed, our users who encounter the issue could even upgrade at that point (if they had not upgraded before then). Still, I am ok with either option. |
I agree, it's our bad that we didn't notice that earlier and did the right thing then. |
Btw I am curious, hypothetically, if we went with option (2) or (3) and required some option for wumbo htlcs, what onion error would you suggest a forwarding node to send back? EDIT: my point is that we might even need a new error just for this... |
Good point, there isn't a great onion error for that...it would be |
OK, I have moved the c-lightning implementation to draft (not in this release). Once Electrum is updated and widely deployed, we can remove this sending restriction altogether. |
lightning/bolts#877 talks about removing this restriction (only Electrum actually enforced it on receive), so start by allowing creation of giant invoices, though we mark them as requiring mpp. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
lightning/bolts#877 talks about removing this restriction (only Electrum actually enforced it on receive), so start by allowing creation of giant invoices, though we mark them as requiring mpp. Changelog-Changed: JSON-RPC: `invoice` now allows creation of giant invoices (>= 2^32 msat) Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
lightning/bolts#877 talks about removing this restriction (only Electrum actually enforced it on receive), so start by allowing creation of giant invoices, though we mark them as requiring mpp. Changelog-Changed: JSON-RPC: `invoice` now allows creation of giant invoices (>= 2^32 msat) Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
lightning/bolts#877 talks about removing this restriction (only Electrum actually enforced it on receive), so start by allowing creation of giant invoices, though we mark them as requiring mpp. Changelog-Changed: JSON-RPC: `invoice` now allows creation of giant invoices (>= 2^32 msat) Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
We previously had a restriction on HTLC amounts to avoid big losses during the early phases of the network, but it shouldn't be necessary anymore. As long as we honor `max_htlc_value_in_flight_msat` and implementations provide safe defaults for that parameter, we don't need that additional restriction.
8b750d5
to
6093296
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.
LGTM 💈
Ack. Recommend delaying removing sending for a few weeks(?) until Electrum widely rolled out though. (t-bast points out, that if this happens to an Electrum node, they can simply upgrade to fix it. But they might lose the channel due to the stuck HTLC first, so still a good idea to wait). |
ACK 6093296 |
Merging as discussed during the meeting. |
This was missed in lightning#877 (84213f4). Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This was missed in #877 Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
We previously had a restriction on HTLC amounts to avoid big losses during the early phases of the network, but it shouldn't be necessary anymore.
As long as we honor
max_htlc_value_in_flight_msat
and implementations provide safe defaults for that parameter, we don't need that additional restriction.I'm curious to know whether other implementations enforce this restriction or not (eclair doesn't).