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

rpcserver: no manual close of restored channels #4525

Merged
merged 3 commits into from
Aug 13, 2020

Conversation

guggero
Copy link
Collaborator

@guggero guggero commented Aug 12, 2020

Fixes #3321.

When restoring a channel from SCB we don't always guard it from being manually closed. For example if no connection to the remote peer can be established, the channel only hast the status ChanStatusRestored but not ChanStatusLocalDataLoss so the force close check in the channel arbitrator doesn't work correctly and lnd crashes. On restart the channel then has a state that cannot be recovered from.
Therefore we need to disallow closing channels (coop and force) for any restored channel, no matter what resolution state it currently has.

To avoid the scenario where the user tries to force close a channel too
early that was restored through SCB, we check the channel status in the
RPC server already. If a restored channel cannot connect to its peer and
mark it as local data loss the channel arbitrator would try to publish
the commitment TX it does not have and crash.
@guggero guggero added recovery Related to the backup/restoration of LND data (e.g. wallet seeds) bug fix backups SCB Related to static channel backup v0.12 labels Aug 12, 2020
@guggero guggero added this to the 0.12.0 milestone Aug 12, 2020
@guggero guggero added this to In progress in v0.12.0-beta via automation Aug 12, 2020
Copy link
Member

@Roasbeef Roasbeef left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🌊

@Roasbeef Roasbeef modified the milestones: 0.12.0, 0.11.0 Aug 13, 2020
v0.12.0-beta automation moved this from In progress to Reviewer approved Aug 13, 2020
Copy link
Contributor

@cfromknecht cfromknecht left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@cfromknecht cfromknecht added this to In progress in v0.11.0-beta via automation Aug 13, 2020
@cfromknecht cfromknecht merged commit 4674573 into lightningnetwork:master Aug 13, 2020
v0.11.0-beta automation moved this from In progress to Done Aug 13, 2020
v0.12.0-beta automation moved this from Reviewer approved to Done Aug 13, 2020
@guggero guggero deleted the no-restore-close branch August 13, 2020 07:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backups bug fix recovery Related to the backup/restoration of LND data (e.g. wallet seeds) SCB Related to static channel backup v0.12
Projects
No open projects
v0.11.0-beta
  
Done
v0.12.0-beta
  
Done
Development

Successfully merging this pull request may close these issues.

Don't allow manual close of restored channels
3 participants