Skip to content
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

[bug]: lnd sends "internal error" to peer, when peer tries to update channel during shutdown #7628

Open
DerEwige opened this issue Apr 22, 2023 · 3 comments
Labels
bug Unintended code behaviour interop interop with other implementations shutdown Issues related to shutdown process of LND

Comments

@DerEwige
Copy link

Background

When the shutdown of lnd is initiated.
LND starts to shudown all internal systems.
If a peer tries to add an HTLC to this channel while LND is shutting down, LND sends back an error to the peer.
On LND you will see this error in the log:
failing link: unable to update commitment: link shutting down with error: internal error
The peer will only get this error: internal error

If the peer follows the specs this will cause a force close.

Currently the only affected implementation seems to be eclair.
LND simply ignores these kind of errors.
CLN currently has a workaround in place to treat lnd "internal error" as a warning

Your environment

LND Version 0.16.1-beta.rc2
eclair version 0.8.0

Steps to reproduce

Shutdown LND
While lnd is shutting down: try to add as many HTLCs to the channel from another peer

2023-04-22 12:35:41.685 [INF] HSWC: ChannelLink(abc425691bacf13aad6749416c17302ebfe2eb8a45bffa05c07c0a78c41d543e:0): stopping
2023-04-22 12:35:41.866 [ERR] HSWC: ChannelLink(abc425691bacf13aad6749416c17302ebfe2eb8a45bffa05c07c0a78c41d543e:0): failing link: unable to update commitment: link shutting down with error: internal error
2023-04-22 12:35:41.866 [ERR] HSWC: ChannelLink(abc425691bacf13aad6749416c17302ebfe2eb8a45bffa05c07c0a78c41d543e:0): link failed, exiting htlcManager
2023-04-22 12:35:41.866 [INF] HSWC: ChannelLink(abc425691bacf13aad6749416c17302ebfe2eb8a45bffa05c07c0a78c41d543e:0): exited

"unable to update commitment: %v", err)

Expected behaviour

I expect one of two behavious:
Option 1.) LND sends a Warning instead of Error in this scenario
Option 2.) LND disconnects the peer and does not allow new connections, before shuting down the link

Actual behaviour

LND just starts to shutdown the channels while the peers are still connected and try to use them.

@DerEwige DerEwige added bug Unintended code behaviour needs triage labels Apr 22, 2023
@saubyk saubyk added interop interop with other implementations channel closing Related to the closing of channels cooperatively and uncooperatively shutdown Issues related to shutdown process of LND and removed channel closing Related to the closing of channels cooperatively and uncooperatively labels Apr 22, 2023
@Roasbeef
Copy link
Member

Will be fixed by #6760

@Crypt-iQ
Copy link
Collaborator

Not fixed by #6760 since this isn't related to coop close. It's because we send an Error in the link and other impl's force close on Error

@DerEwige
Copy link
Author

I think this might be similar/related to:
#6522

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Unintended code behaviour interop interop with other implementations shutdown Issues related to shutdown process of LND
Projects
None yet
Development

No branches or pull requests

4 participants