-
Notifications
You must be signed in to change notification settings - Fork 639
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
Handle NextSequenceReceive for unordered channels. #3357
Merged
DimitrisJim
merged 2 commits into
main
from
jim/1783-confusion-regarding-next-sequence-recv
Mar 29, 2023
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Thanks @DimitrisJim! Code looks great!
Just want to note that if we add another channel ordering, like
ORDERED_ALLOW_TIMEOUT
we may need to adjust this handling. It's not incredibly clear whetherORDERED
channels orUNORDERED
channels are the exception here, but since we are referring to the next sequence receive, it probably makes sense to add an if statement for the channel types which do not use that value (UNORDERED). I see the referenced issue suggested this structure of code.An alternative solution:
In this scenario, since we perform the query by default,
ORDERED_ALLOW_TIMEOUT
would function properly without additional changes. I believe we will need to modify this code with the addition of ordered allow timeout channels (not yet implemented)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.
Yep, can totally see that point, wasn't aware of the possibility of another ordered variant. Does it make sense to fix it pronto? (Note that some grep-ing found one other case where we special case on
ORDERED
during packet acknowledgement but I'm unsure if the same semantics would apply).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.
Yea, the new ordered variant is a bit of a new concept for us as well, which is why this issue wasn't so obvious. I only barely made the connection thinking about explicit return values (I prefer the code to be explicit with what it returns rather than being implicit by not executing some conditional)
I think it could make sense to fix since we know it will be an issue? Might save someone some time debugging later. I'm also perfectly happy having an issue opened.
When implementing the new channel ordering, we will need to modify this code (already specified in the spec). We will likely need to do some grep-ing to look into all switches/conditionals on channel ordering. Core IBC isn't too well setup abstraction wise for new channel types. It's somewhat unclear how many different ordering types will ever exist
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'll fix this up today. Better to keep things future proof as much as possible.