Skip to content

Commit 18c7a25

Browse files
committed
Clarify channel_reestablish requirements
There are conflicting requirements after applying lightning#942. The only case where a node should fail the channel when receiving an unexpected `channel_reestablish` is when the remote peer is provably lying by sending an invalid `your_last_per_commitment_secret`.
1 parent f7dcc32 commit 18c7a25

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

02-peer-protocol.md

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1445,10 +1445,10 @@ A node:
14451445
- if `next_commitment_number` is not 1 greater than the
14461446
commitment number of the last `commitment_signed` message the receiving
14471447
node has sent:
1448-
- SHOULD send an `error` and fail the channel.
1448+
- SHOULD send an `error`.
14491449
- if it has not sent `commitment_signed`, AND `next_commitment_number`
14501450
is not equal to 1:
1451-
- SHOULD send an `error` and fail the channel.
1451+
- SHOULD send an `error`.
14521452
- if `next_revocation_number` is equal to the commitment number of
14531453
the last `revoke_and_ack` the receiving node sent, AND the receiving node
14541454
hasn't already received a `closing_signed`:
@@ -1460,10 +1460,10 @@ A node:
14601460
- otherwise:
14611461
- if `next_revocation_number` is not equal to 1 greater than the
14621462
commitment number of the last `revoke_and_ack` the receiving node has sent:
1463-
- SHOULD send an `error` and fail the channel.
1463+
- SHOULD send an `error`.
14641464
- if it has not sent `revoke_and_ack`, AND `next_revocation_number`
14651465
is not equal to 0:
1466-
- SHOULD send an `error` and fail the channel.
1466+
- SHOULD send an `error`.
14671467

14681468
A receiving node:
14691469
- if `option_static_remotekey` applies to the commitment transaction:
@@ -1472,9 +1472,10 @@ A node:
14721472
`next_revocation_number` minus 1:
14731473
- MUST NOT broadcast its commitment transaction.
14741474
- SHOULD send an `error` to request the peer to fail the channel.
1475+
- if `your_last_per_commitment_secret` does not match the expected values:
1476+
- SHOULD send an `error` and fail the channel (the sending node is lying).
14751477
- otherwise:
1476-
- if `your_last_per_commitment_secret` does not match the expected values:
1477-
- SHOULD send an `error` and fail the channel.
1478+
- SHOULD send an `error`.
14781479
- otherwise, if it supports `option_data_loss_protect`:
14791480
- if `next_revocation_number` is greater than expected above, AND
14801481
`your_last_per_commitment_secret` is correct for that
@@ -1483,9 +1484,10 @@ A node:
14831484
- SHOULD send an `error` to request the peer to fail the channel.
14841485
- SHOULD store `my_current_per_commitment_point` to retrieve funds
14851486
should the sending node broadcast its commitment transaction on-chain.
1486-
- otherwise (`your_last_per_commitment_secret` or `my_current_per_commitment_point`
1487-
do not match the expected values):
1488-
- SHOULD send an `error` and fail the channel.
1487+
- if `your_last_per_commitment_secret` does not match the expected values:
1488+
- SHOULD send an `error` and fail the channel (the sending node is lying).
1489+
- otherwise:
1490+
- SHOULD send an `error`.
14891491

14901492
A node:
14911493
- MUST NOT assume that previously-transmitted messages were lost,

0 commit comments

Comments
 (0)