Skip to content

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

Open
@ziggie1984

Description

@ziggie1984

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    channel managementThe management of the nodes channelsenhancementImprovements to existing features / behaviourrecoveryRelated to the backup/restoration of LND data (e.g. wallet seeds)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions