Skip to content
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

ICS4: Optimize Cancel #1045

Merged
merged 1 commit into from
Dec 6, 2023
Merged

Conversation

AdityaSripal
Copy link
Member

  • Add explanation of out of sequence logic
  • Optimize cancellation

@AdityaSripal AdityaSripal marked this pull request as ready for review November 30, 2023 10:17
@@ -906,6 +909,10 @@ function cancelChannelUpgrade(
// If counterparty sequence is less than the current sequence,
// abort transaction since this error receipt is from a previous upgrade
abortTransactionUnless(errorReceipt.sequence >= channel.upgradeSequence)
// fastforward channel sequence to higher sequence so that we can start
// new handshake on a fresh sequence
channel.upgradeSequence = errorReceipt.sequence
Copy link
Contributor

@sangier sangier Dec 1, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's sweet, indeed without this change we are unable to start a fresh upgrade handshake after a cancelChannelUpgrade datagram is sent.
This PR proposes a different change to achieve the same goal that is in alignment with the implementation. Nonetheless, the solution presented here represents an optimisation, and should be prioritised for the specs.

Copy link
Contributor

@sangier sangier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks @AdityaSripal!

@AdityaSripal AdityaSripal merged commit 6bd99ce into main Dec 6, 2023
@AdityaSripal AdityaSripal deleted the aditya/fastforward-out-of-sync-sequence branch December 6, 2023 13:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants