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

ICS004: Remove last packet sent #1026

Merged
merged 3 commits into from
Nov 12, 2023
Merged

Conversation

AdityaSripal
Copy link
Member

@AdityaSripal AdityaSripal commented Oct 24, 2023

closes: #1024
closes: #1015
closes: #1023

@AdityaSripal AdityaSripal marked this pull request as ready for review October 24, 2023 14:19
Copy link
Contributor

@crodriguezvega crodriguezvega left a comment

Choose a reason for hiding this comment

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

Nice! 🧹

spec/core/ics-004-channel-and-packet-semantics/README.md Outdated Show resolved Hide resolved
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.

If I understand correctly, the core idea here is that we can remove the lastPacketSent field because the following statements remain true:

  1. 'Any packet sent to the channel with a packet sequence number greater than the lastPacketSent will be rejected until the upgrade is complete.'

    • This statement remains valid because, even without the lastPacketSent field, the transition to the FLUSHING state during the startFlushUpgradeHandshake operation effectively blocks the sendPacket function. As a result, no additional packets can be sent over this channel during the upgrade process.
    • Considering that we were storing the lastPacketSent when we were moving to FLUSHING, the system without lastPacketSent achieve the same result.
  2. We still have a way to check if there are pending inflight packets.

    • pendingInflightPacket does not depend on lastPacketSent. Indeed is designed to monitor the pending in-flight packet verifying the presence/absence of packet commitment given that packet commitments are deleted only when the packet lifecycle is complete. Therefore, if a packet commitment exists on the sender's chain, it indicates that the packet lifecycle is still incomplete.

Am I missing something? If all the above is correct, IMO, removing lastPacketSent is safe.

Copy link
Contributor

@damiannolan damiannolan left a comment

Choose a reason for hiding this comment

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

Also closes #1015 as it won't be required after this PR 👍
Thanks @AdityaSripal ❤️

@crodriguezvega crodriguezvega merged commit ae6554c into main Nov 12, 2023
3 checks passed
@crodriguezvega crodriguezvega deleted the aditya/rm-last-packet-sent branch November 12, 2023 19:25
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
4 participants