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

Flexible identifier selection #482

Merged
merged 10 commits into from
Oct 2, 2020
Merged

Flexible identifier selection #482

merged 10 commits into from
Oct 2, 2020

Conversation

cwgoes
Copy link
Contributor

@cwgoes cwgoes commented Sep 15, 2020

Flexible identifier & version selection.

Closes #462
Closes #465

@cwgoes cwgoes added the tao Transport, authentication, & ordering layer. label Sep 15, 2020
@cwgoes cwgoes marked this pull request as ready for review September 28, 2020 10:29
colin-axner added a commit to cosmos/cosmos-sdk that referenced this pull request Oct 1, 2020
Update ConnOpenInit to reflect changes in cosmos/ibc#482. An additional version field is added to the connection handshake and connection open init message to take in an optional field. If this field is empty, then the default versions are used for connection handshake version negotiation.
@@ -306,6 +317,7 @@ function connOpenInit(
```typescript
function connOpenTry(
desiredIdentifier: Identifier,
provedIdentifier: Identifier,
Copy link
Contributor

Choose a reason for hiding this comment

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

couldn't this just be a boolean indicating if the sending chain decided to choose the identifier or not?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sure, though we'll still construct a "provedIdentifier" since we need to check it

Copy link
Contributor

@ethanfrey ethanfrey left a comment

Choose a reason for hiding this comment

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

Looks good, a few detail comments

@@ -318,24 +330,27 @@ function connOpenTry(
abortTransactionUnless(validateConnectionIdentifier(desiredIdentifier))
abortTransactionUnless(consensusHeight < getCurrentHeight())
expectedConsensusState = getConsensusState(consensusHeight)
expected = ConnectionEnd{INIT, desiredIdentifier, getCommitmentPrefix(), counterpartyClientIdentifier,
abortTransationUnless(
provedIdentifier === desiredIdentifier ||
Copy link
Contributor

Choose a reason for hiding this comment

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

This is a bit confusing to me.

proved identifier is empty or comes from the init chain.

Desired Identifier comes from the receiving chain. But where? There doesn't seem to be a way to say "use whatever name they suggest", or "use whatever name they suggest if it starts with 'foo'" for example.

Rather than comparing here, it would make more sense to have

function desiredIdentifier(provedIdentifier) -> Identifier {}

So the receiving module can make this decision and about if desired

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Right, that's the intended usage, it just doesn't need to happen "within" the IBC module, per se. I can add a note about it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added a comment with your example.

spec/ics-003-connection-semantics/README.md Outdated Show resolved Hide resolved
mergify bot pushed a commit to cosmos/cosmos-sdk that referenced this pull request Oct 1, 2020
* update connopeninit

Update ConnOpenInit to reflect changes in cosmos/ibc#482. An additional version field is added to the connection handshake and connection open init message to take in an optional field. If this field is empty, then the default versions are used for connection handshake version negotiation.

* add version compatibility check in open init

* implement partial changes to conn open try

* partial implementation of conn open ack changes

* fix tests

* add handshake tests

* make proto

* fix conflicts

* fix lint

* fix lint

* increase code cov

Co-authored-by: Federico Kunze <federico.kunze94@gmail.com>
cwgoes and others added 4 commits October 2, 2020 14:33
Co-authored-by: colin axnér <25233464+colin-axner@users.noreply.github.com>
@cwgoes
Copy link
Contributor Author

cwgoes commented Oct 2, 2020

Merging this as we've implemented it downstream, but let me know if comments were not adequately addressed.

@cwgoes cwgoes merged commit 699422b into master Oct 2, 2020
@cwgoes cwgoes deleted the cwgoes/fixed-variables-fields branch October 2, 2020 12:41
daeMOn63 pushed a commit to fetchai/cosmos-sdk that referenced this pull request May 5, 2021
* update connopeninit

Update ConnOpenInit to reflect changes in cosmos/ibc#482. An additional version field is added to the connection handshake and connection open init message to take in an optional field. If this field is empty, then the default versions are used for connection handshake version negotiation.

* add version compatibility check in open init

* implement partial changes to conn open try

* partial implementation of conn open ack changes

* fix tests

* add handshake tests

* make proto

* fix conflicts

* fix lint

* fix lint

* increase code cov

Co-authored-by: Federico Kunze <federico.kunze94@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tao Transport, authentication, & ordering layer.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug: Chan Blocker can keep chains from hooking up Alter handshake to allow fixed/variable fields
3 participants