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

[feature]: Adopt new BOLT spec. update for the channel reestablishment msg. #8589

Open
ziggie1984 opened this issue Mar 26, 2024 · 0 comments
Labels
channel management The management of the nodes channels enhancement Improvements to existing features / behaviour recovery Related to the backup/restoration of LND data (e.g. wallet seeds)

Comments

@ziggie1984
Copy link
Collaborator

ziggie1984 commented Mar 26, 2024

The behaviour in case a node loses its channel state changed with lightning/bolts#942 and will be further clarified by lightning/bolts#1049.

During the channel re-establishment process the local LND node would realize that the remote node suffered from a data-loss and would force-close the channel. However the new spec requires to wait for the peer (who suffered the data-loss) to send us an error upon which the channel is force closed by the peer who still has all the data available. This allows the peer who messed up his local data view to fix it by for example using a different data-backup. So it's definitely a useful feature.

Apart from the potential tests, this should be a small change because we already send an error in case of the local data loss.

Code part which needs to be adopted:

lnd/htlcswitch/link.go

Lines 1119 to 1146 in b76f733

case err == lnwallet.ErrCommitSyncRemoteDataLoss:
fallthrough
// The remote sent us an invalid last commit secret, we
// should force close the channel.
// TODO(halseth): and permanently ban the peer?
case err == lnwallet.ErrInvalidLastCommitSecret:
fallthrough
// The remote sent us a commit point different from
// what they sent us before.
// TODO(halseth): ban peer?
case err == lnwallet.ErrInvalidLocalUnrevokedCommitPoint:
// We'll fail the link and tell the peer to
// force close the channel. Note that the
// database state is not updated here, but will
// be updated when the close transaction is
// ready to avoid that we go down before
// storing the transaction in the db.
l.fail(
LinkFailureError{
code: ErrSyncError,
FailureAction: LinkFailureForceClose, //nolint:lll
},
"unable to synchronize channel "+
"states: %v", err,
)
return

@Roasbeef maybe this is a redundant issue already feel free to close.

@ziggie1984 ziggie1984 added enhancement Improvements to existing features / behaviour channel management The management of the nodes channels recovery Related to the backup/restoration of LND data (e.g. wallet seeds) labels Mar 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
channel management The management of the nodes channels enhancement Improvements to existing features / behaviour recovery Related to the backup/restoration of LND data (e.g. wallet seeds)
Projects
None yet
Development

No branches or pull requests

1 participant