-
Notifications
You must be signed in to change notification settings - Fork 492
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
Shutdown retransmission clarifications #199
Shutdown retransmission clarifications #199
Conversation
If we've completed shutdown, you must have received revoke_and_ack, so don't require us to re-xmit in that case. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
…exmit. closing_signed means we've completed shutdown, which means the other side knows. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
@@ -980,7 +980,7 @@ last `commitment_signed` message the receiving node has sent, it | |||
SHOULD fail the channel. | |||
|
|||
If `next_remote_revocation_number` is equal to the commitment number of | |||
the last `revoke_and_ack` the receiving node has sent, it MUST re-send | |||
the last `revoke_and_ack` the receiving node has sent and the receiving node has not already received a `closing_signed`, it MUST re-send |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As you state in the rationale below, the sender won't send a closing_signed
until it has sent the last revoke_and_ack
.
Thus I don't see how this scenario is possible?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, exactly. It shouldn't happen, thus you don't need to handle it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we mention it though? There are an infinity of other scenarii that shouldn't happen, that we don't specify. Why is this specific one more important than the others? I might be missing something but to me it isn't really different from a node sending, say, two funding_locked
in a row. That sounds silly I know but my concern is consistency.
How about stating somewhere else more generally what a node should do when the counterparty violates the order of messages of the protocol, eg. always fail the channel? I think that would be a reasonable thing, since AFAICT we were careful to specify when to ignore messages.
On reconnection if the node has sent a previous `shutdown` it MUST | ||
retransmit it, and if the node has sent a previous `closing_signed` it | ||
MUST then retransmit the last `closing_signed`. | ||
On reconnection if the node has sent a previous `closing_signed` it |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we even require sending an identical closing_signed
message? I don't see a reason to make nodes worry about an additional layer of persistence.
It seems that upon re-connect, the closing negotiation should just start from scratch (similar to a failed funding negotiation). It also could be the case the the fee preferences of either side have changed significantly since the last connection.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done, added new patch.
Pierre-Marie Padiou <notifications@github.com> writes:
pm47 commented on this pull request.
> @@ -980,7 +980,7 @@ last `commitment_signed` message the receiving node has sent, it
SHOULD fail the channel.
If `next_remote_revocation_number` is equal to the commitment number of
-the last `revoke_and_ack` the receiving node has sent, it MUST re-send
+the last `revoke_and_ack` the receiving node has sent and the receiving node has not already received a `closing_signed`, it MUST re-send
Should we mention it though? There are an infinity of other scenarii that shouldn't happen, that we don't specify. Why is this specific one more important than the others? I might be missing something but to me it isn't really different from a node sending, say, two `funding_locked` in a row. That sounds silly I know but my concern is consistency.
We should be specifying the requirements in *every* case, not relying on
the reader to know that things shouldn't happen.
Here, we say you MUST re-send, but my implementation won't if we're
already in closing_signed, which I think is reasonable, but violated the
spec before this change.
How about stating somewhere else more generally what a node should do when the counterparty violates the order of messages of the protocol, eg. always fail the channel? I think that would be a reasonable thing, since AFAICT we were careful to specify when to ignore messages.
I'd prefer each requirement to be spelled out in each case. eg. you
should receive X or Y, if you receive anything else for that channel,
you SHOULD fail the channel.
That's much easier to implement, and test!
We should fix places which don't do this...
Thanks,
Rusty.
|
Olaoluwa Osuntokun <notifications@github.com> writes:
Roasbeef requested changes on this pull request.
> @@ -992,9 +992,9 @@ transaction is broadcast by the other side at any time. This is
particularly important if a node does not simply retransmit the exact
same `update_` messages as previously sent.
-On reconnection if the node has sent a previous `shutdown` it MUST
-retransmit it, and if the node has sent a previous `closing_signed` it
-MUST then retransmit the last `closing_signed`.
+On reconnection if the node has sent a previous `closing_signed` it
Why do we even require sending an _identical_ `closing_signed` message? I don't see a reason to make nodes worry about an _additional_ layer of persistence.
It seems that upon re-connect, the closing negotiation should just start from scratch (similar to a failed funding negotiation). It also could be the case the the fee preferences of either side have changed significantly since the last connection.
Agreed. Let me create a patch.
Should we mark the closing tx RBF? I don't expect any implementation to
do this any time soon, but it would allow us to use a prior closing tx
with higher fee if the current one gets stuck (or even, the final
commitment tx)?
|
1. Change descriptions of closing tx construction to references to BOLT 3. 2. Recipient *should* check the fee offer has improved in closing_signed. 3. Therefore, sender *must* improve closing offer. 4. Offers do not persist across reconnection, so no state req'd, and also helps if fee has changed. 5. You don't need to re-send `shutdown` if you received `closing_signed` (implicit acknowledgement). 6. You don't have to accept a `channel_reestablish` which requests the last revoke_and_ack be retransmitted if you've already received `closing_signed` (which is an implicit acknowledgement). Closes: lightning#201 Closes: lightning#199 Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
1. Change descriptions of closing tx construction to references to BOLT 3. 2. Recipient *should* check the fee offer has improved in closing_signed. 3. Therefore, sender *must* improve closing offer. 4. Offers do not persist across reconnection, so no state req'd, and also helps if fee has changed. 5. You don't need to re-send `shutdown` if you received `closing_signed` (implicit acknowledgement). 6. You don't have to accept a `channel_reestablish` which requests the last revoke_and_ack be retransmitted if you've already received `closing_signed` (which is an implicit acknowledgement). Closes: lightning#201 Closes: lightning#199 Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
1. Change descriptions of closing tx construction to references to BOLT 3. 2. Recipient *should* check the fee offer has improved in closing_signed. 3. Therefore, sender *must* improve closing offer. 4. Offers do not persist across reconnection, so no state req'd, and also helps if fee has changed. 5. You don't need to re-send `shutdown` if you received `closing_signed` (implicit acknowledgement). 6. You don't have to accept a `channel_reestablish` which requests the last revoke_and_ack be retransmitted if you've already received `closing_signed` (which is an implicit acknowledgement). Closes: lightning#201 Closes: lightning#199 Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Fairly self-explanatory, I think.