Skip to content

Commit b60e2b2

Browse files
t-bastlightning-developer
authored andcommitted
Add changes from lightning#932
It was decided in the spec meeting to combine lightning#932 and lightning#942 as they are closely related. It was also decided to add a rationale for lightning#932 to clearly state why nodes must wait for an error before force-closing instead of eagerly force-closing when detecting that their peer is behind.
1 parent fdd791a commit b60e2b2

File tree

2 files changed

+21
-21
lines changed

2 files changed

+21
-21
lines changed

02-peer-protocol.md

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1381,7 +1381,7 @@ A node:
13811381
`your_last_per_commitment_secret` is correct for that
13821382
`next_revocation_number` minus 1:
13831383
- MUST NOT broadcast its commitment transaction.
1384-
- SHOULD fail the channel.
1384+
- SHOULD send an `error` to request the peer to fail the channel.
13851385
- otherwise:
13861386
- if `your_last_per_commitment_secret` does not match the expected values:
13871387
- SHOULD fail the channel.
@@ -1390,7 +1390,7 @@ A node:
13901390
`your_last_per_commitment_secret` is correct for that
13911391
`next_revocation_number` minus 1:
13921392
- MUST NOT broadcast its commitment transaction.
1393-
- SHOULD fail the channel.
1393+
- SHOULD send an `error` to request the peer to fail the channel.
13941394
- SHOULD store `my_current_per_commitment_point` to retrieve funds
13951395
should the sending node broadcast its commitment transaction on-chain.
13961396
- otherwise (`your_last_per_commitment_secret` or `my_current_per_commitment_point`
@@ -1466,18 +1466,19 @@ Similarly, for the fundee's `funding_signed` message: it's better to
14661466
remember a channel that never opens (and times out) than to let the
14671467
funder open it while the fundee has forgotten it.
14681468

1469-
`option_data_loss_protect` was added to allow a node, which has somehow fallen behind
1470-
(e.g. has been restored from old backup), to detect that it's fallen-behind. A fallen-behind
1471-
node must know it cannot broadcast its current commitment transaction — which would lead to
1472-
total loss of funds — as the remote node can prove it knows the
1473-
revocation preimage. The error returned by the fallen-behind node
1474-
(or simply the invalid numbers in the `channel_reestablish` it has
1475-
sent) should make the other node drop its current commitment
1476-
transaction to the chain. This will, at least, allow the fallen-behind node to recover
1477-
non-HTLC funds, if the `my_current_per_commitment_point`
1478-
is valid. However, this also means the fallen-behind node has revealed this
1479-
fact (though not provably: it could be lying), and the other node could use this to
1480-
broadcast a previous state.
1469+
`option_data_loss_protect` was added to allow a node, which has somehow fallen
1470+
behind (e.g. has been restored from old backup), to detect that it has fallen
1471+
behind. A fallen-behind node must know it cannot broadcast its current
1472+
commitment transaction — which would lead to total loss of funds — as the
1473+
remote node can prove it knows the revocation preimage. The `error` returned by
1474+
the fallen-behind node should make the other node drop its current commitment
1475+
transaction to the chain. The other node should wait for that `error` to give
1476+
the fallen-behind node an opportunity to fix its state first (e.g by restarting
1477+
with a different backup). If the fallen-behind node doesn't have the latest
1478+
backup, this will, at least, allow it to recover non-HTLC funds, if the
1479+
`my_current_per_commitment_point` is valid. However, this also means the
1480+
fallen-behind node has revealed this fact (though not provably: it could be lying),
1481+
and the other node could use this to broadcast a previous state.
14811482

14821483
`option_static_remotekey` removes the changing `to_remote` key,
14831484
so the `my_current_per_commitment_point` is unnecessary and thus

05-onchain.md

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -143,15 +143,14 @@ A node:
143143
sufficient fee:
144144
- SHOULD use this fee to perform a *mutual close*.
145145
- otherwise:
146-
- if the node knows or assumes its channel state is outdated it
147-
- MUST NOT broadcast its *last commitment transaction*.
148-
- SHOULD send an `error`.
146+
- if the node knows or assumes its channel state is outdated:
147+
- MUST NOT broadcast its *last commitment transaction*.
149148
- otherwise:
150149
- MUST broadcast the *last commitment transaction*, for which it has a
151-
signature, to perform a *unilateral close*.
152-
- MUST spend any `to_local_anchor` output, providing sufficient fees as incentive to include the commitment transaction in a block
153-
Special care must be taken when spending to a third-party, because this re-introduces the vulnerability that was
154-
addressed by adding the CSV delay to the non-anchor outputs.
150+
signature, to perform a *unilateral close*.
151+
- MUST spend any `to_local_anchor` output, providing sufficient fees as incentive to include the commitment transaction in a block.
152+
Special care must be taken when spending to a third-party, because this re-introduces the vulnerability that was
153+
addressed by adding the CSV delay to the non-anchor outputs.
155154
- SHOULD use [replace-by-fee](https://github.com/bitcoin/bips/blob/master/bip-0125.mediawiki) or other mechanism on the spending transaction if it proves insufficient for timely inclusion in a block.
156155

157156
## Rationale

0 commit comments

Comments
 (0)