-
Notifications
You must be signed in to change notification settings - Fork 461
splice_locked + channel_reestablish bug fixes
#4654
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -10714,6 +10714,9 @@ where | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| let required_revoke = if msg.next_remote_commitment_number == our_commitment_transaction { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // Remote isn't waiting on any RevokeAndACK from us! | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // Note that if we need to repeat our ChannelReady we'll do that in the next if block. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // If a stale ChannelManager replayed a completed update, the monitor-pending state may | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // still think we owe one; the reestablish proof is authoritative here. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| self.context.monitor_pending_revoke_and_ack = false; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| None | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } else if msg.next_remote_commitment_number + 1 == our_commitment_transaction { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if self.context.channel_state.is_monitor_update_in_progress() { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -10784,9 +10787,24 @@ where | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| channel_id: self.context.channel_id, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| splice_txid, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }).or_else(|| { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // If a splice confirms after we've sent `channel_reestablish` but before we've | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // received theirs, we may promote the splice while disconnected and clear | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // `pending_splice`. We still need to send `splice_locked` after reestablishing | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // unless the promoted txid was already included in our `channel_reestablish`. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| let current_funding_txid = self.funding.get_funding_txid()?; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| (self.funding.channel_transaction_parameters.splice_parent_funding_txid.is_some() | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| && Some(current_funding_txid) != funding_locked_txid_sent_in_reestablish) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| .then(|| msgs::SpliceLocked { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| channel_id: self.context.channel_id, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| splice_txid: current_funding_txid, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+10790
to
10802
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This In a sequential-splice scenario (first splice promoted, second splice negotiated and confirmed locally, then reconnect), this would send Consider adding
Suggested change
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if msg.next_local_commitment_number == next_counterparty_commitment_number { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // Likewise, don't let a stale monitor-pending resend survive when they tell us | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // they've already received our latest commitment. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| self.context.monitor_pending_commitment_signed = false; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if required_revoke.is_some() || self.context.signer_pending_revoke_and_ack { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| log_debug!(logger, "Reconnected with only lost outbound RAA"); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
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.
I don't understand the "we may promote the splice while disconnected and clear" part. Isn't the fact that we've sent channel_reestablish indicate we are connected? Should this have said, "we may have promoted the splice while disconnected and have cleared"?
Commit message is similarly confusing to me.
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.
Disconnected as in the
PEER_DISCONNECTEDstate flag, i.e., the channel not being reestablished yet.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.
Ah, ok. Could you rephrase the comment for clarity?