-
Notifications
You must be signed in to change notification settings - Fork 618
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
imp(ica/host): removed previous version validation check #5613
Merged
srdtrk
merged 5 commits into
feat/allow-unordered-ica-channels
from
serdar/issue#5605-icahost-allow-channel-change
Jan 16, 2024
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
36e664b
imp: removed validation check
srdtrk 67074b3
test: updated icahost test
srdtrk 69221f8
Merge branch 'feat/allow-unordered-ica-channels' into serdar/issue#56…
srdtrk ef55c7e
docs: added godocs
srdtrk 198b525
docs: added godocs
srdtrk 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
Oops, something went wrong.
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.
just for my own reasoning. The previous metadata has:
version, controller/host connection id's, address, encoding, tx type
Only the host connection id and address cannot change? The host connection id check above in
ValidateHostMetadata
, but is the address? What happens if the controller reopens a channel modifying the interchain acc address to be different than what it is. It looks like it'll be overwritten later on. I feel like we should document these cases or make them more explicitThere 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.
If I'm understanding correctly, the address is looked up with a key built from host connection id and counterparty port id, right? And counterparty port ID needs to proven by core before getting here (correction: is used for the key in proving, not value) and if host connection id cannot change then it should be all fine.
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.
It's just a bit odd to me because the relayer can pass in:
metadata.Address = invalid-address
and our code won't error
it'll return
metadata.Address = valid-address
just feels a bit odd if a middleware relies on the value before the callback
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.
That's right. Moreover, the removed code (
IsPreviousMetadataEqual
) never actually checked if the addresses were the same... It only checked other fieldsThere 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.
So this was always 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.
But this damages the backwards compatibility if we check the address since the users are used to being able to pass invalid stuff there (it is common to pass
""
! This is because a normal channel handshake must start with this field empty, so users just usually reuse the same version string, including my hackathon project. There are other reasons it is convenient to pass""
).Try step allows the app to propose a new version anyway, so any middleware should use the result of the Try step, and not what the counterparty proposes. Also, #5533 is going to allow host connection id to be fully empty anyway.
So I suggest we don't add these checks, but if you still want the check, then I can add, I suspect it will break some stuff for our users initially.
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 okay, thanks for the context. Should we add a comment in case someone has the same question as me?
maybe something like:
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.
Added the comment
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 check at least that version is
ics27-1
?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.
This is still being checked here @crodriguezvega