-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Standardize connection versioning + channel versioning docs #6640
Conversation
Should we add some way for application modules to register their own versions? Like I develop an application module and import 1.0 of TAO, but wanna include version X and Y for my app module. I guess this should be done on genesis? |
channel versions? are they your own app channel versions or the counterparty's channel version? I guess adding a parameter makes sense for the latter |
they are the application versions being negotiated on during the channel handshake (version string stored in channel). I am referring to your own application version. I think I have a general idea of how to approach it. I'm going to add in calls to ibc-transfer which registers its supported version in |
oh nvm @fedekunze I realized this is simpler than connection versioning and I don't need to add too much extra since the channel version and counterparty version selection are happening off chain by the caller (application module). I just need to add in |
Codecov Report
@@ Coverage Diff @@
## master #6640 +/- ##
==========================================
+ Coverage 55.60% 61.26% +5.66%
==========================================
Files 457 385 -72
Lines 27440 23682 -3758
==========================================
- Hits 15257 14509 -748
+ Misses 11083 8127 -2956
+ Partials 1100 1046 -54 |
@@ -13,9 +13,6 @@ var ( | |||
_ exported.CounterpartyI = (*Counterparty)(nil) | |||
) | |||
|
|||
// DefaultChannelVersion defines the default channel version used during handshake. | |||
const DefaultChannelVersion = "1.0.0" |
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.
there is no "channel version" only application versions for the associated channel.
x/ibc/04-channel/keeper/handshake.go
Outdated
@@ -238,6 +238,11 @@ func (k Keeper) ChanOpenAck( | |||
panic("cannot find connection") | |||
} | |||
|
|||
// verify that chainB's proposed version identifier is supported by chainA | |||
if err := connectiontypes.VerifyProposedVersion(channel.Version, counterpartyVersion, nil); err != nil { |
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.
note: no support for disallowing nil feature sets. this is a little more tricky for channel version negotiation. I think it would require creating a channel keeper with the application version set inside a keeper field (perhaps a map). this seems like too much overhead for functionality that hasn't actually been requested 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.
I completely forgot there are ChanOpen
callbacks. Applications can just throw an error on any version identifier/feature set they disagree with on ChanOpenAck
.
@@ -52,7 +53,7 @@ func NewChannelOpenInitCmd() *cobra.Command { | |||
}, | |||
} | |||
cmd.Flags().Bool(FlagOrdered, true, "Pass flag for opening ordered channels") | |||
cmd.Flags().String(FlagIBCVersion, types.DefaultChannelVersion, "supported IBC version") |
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 maybe should just be an argument, since the default depends on what application you are creating a channel for, follow up pr since there is a todo for fixing counterparty version as well
I'm realizing now the addition to the I guess this pr should just be adding the nil feature set addition for connection versions. I don't see any need to impose any restrictions on the application level version. I don't think it needs to follow the same scheme as connections since the negotiation happens off chain really and by the callbacks |
Plans for this pr:
|
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.
utACK
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.
utACK though see one minor comment for docs clarity
x/ibc/spec/01_concepts.md
Outdated
During `ChanOpenInit`, a version string is passed in and set in party A's | ||
channel state. | ||
|
||
During `ChanOpenTry`, a version string and counterparty version string are |
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.
Maybe worth noting that which chain is the counterparty switches between this and the next paragraph, it's a bit confusing to read, might be helpful to label them A/B
@colin-axner I just saw the notification on this PR, sorry for the late response. The docs look great and I agree with the design. A large part of this PR updates the connection versioning which is good. As far as I can see no changes were made to channel versioning except the docs. ie. I see no implementation of the connection versioning in the On the other hand, if this PR does implementation for connection versioing and just docs for channel versioning (which the title implies), then please don't close #5846 yet. I assume closing that one will include a demo implementation of the spec on |
@ethanfrey Channel Versioning happened to be already implemented for the required functionality.
Since channel versioning is intended to be very abstract and left to application developers no modifications were needed for the handshake calls. |
Okay, so this was just formalizing what was used for the string there. And how apps could use that to make a more complex one. I will try out a more complex workflow then |
Description
closes: #5846
Before we can merge this PR, please make sure that all the following items have been
checked off. If any of the checklist items are not applicable, please leave them but
write a little note why.
docs/
) or specification (x/<module>/spec/
)godoc
comments.Unreleased
section inCHANGELOG.md
Files changed
in the Github PR explorerCodecov Report
in the comment section below once CI passes