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

Upgrade proto to ibc-go v1.2 and sdk v0.44 #1438

Merged
merged 18 commits into from
Nov 8, 2021
Merged

Conversation

adizere
Copy link
Member

@adizere adizere commented Oct 7, 2021

Closes: #1408

Changes introduced by this PR:

Proto files

Proto files are even with ibc-go v1.2.2 and SDK v0.44.3.

Compatibility

Hermes is fully compatible with ibc-go v1.2 and SDK v0.44 with one exception:

  • there is unsupported behavior when two chains having ibc-go version pre-v1.2 and the other post-v1.2 try to handshake on a new channel and the channel's port identifier has length bigger than 64 characters.
    • we will tackle this corner case in a separate PR

Bootstrap method semantics

The method CosmosSdk::bootstrap can potentially return with error if it fails to query the SDK version from the full node (via gRPC GetNodeInfoRequest).

  • This means that the semantics of bootstrap changed: this method returns successfully only if the the full node is up-and-running and Hermes obtains a successful response to GetNodeInfoRequest.
  • Before this PR, the semantics of bootstrap were more lax and this method returned Ok even if the full node was entirely inaccessible.
  • For this reason, this PR eliminates some of the bootstrap(..).unwrap() calls. These unwraps would result in a panic when the full node is inaccessible.

TODOs

  • document in a separate issue the incompatibilty corner-case we're not handling yet re: port id length > 64

For contributor use:

  • Added a changelog entry, using unclog.
  • If applicable: Unit tests written, added test to CI.
  • Linked to Github issue with discussion and accepted design OR link to spec that describes this work.
  • Updated relevant documentation (docs/) and code comments.
  • Re-reviewed Files changed in the Github PR explorer.

@adizere adizere changed the title Regenerated proto files with ibc-go v1.2 and sdk v0.44 Upgrade proto to ibc-go v1.2 and sdk v0.44 Oct 7, 2021
@ancazamfir ancazamfir self-requested a review October 28, 2021 12:01
@ancazamfir ancazamfir requested review from romac, soareschen and hu55a1n1 and removed request for ancazamfir October 28, 2021 12:02
@adizere adizere marked this pull request as ready for review November 2, 2021 11:09
@adizere adizere requested a review from ancazamfir as a code owner November 2, 2021 11:09
Comment on lines 1478 to 1489
// TODO: Request should be a domain type
let version_compatible_request = if self.version_specs.ibc_go_pre_v1_2() {
// if < v1.2 overwrite with empty `packet_commitment_sequences` field
let mut r = request;
r.packet_commitment_sequences = vec![];
r
} else {
// if >= v1.2 leave the request unchanged
request
};

let request = tonic::Request::new(version_compatible_request);
Copy link
Collaborator

Choose a reason for hiding this comment

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

After looking more into this, doing more tests, reading on proto, I think we should undo this change. See unknowns.
It turns out unknown fields are just dropped or retained as unknown fields (depending on the proto and parser versions) but the parser should still be able to work with all fields present in the old proto version. I tested without these checks with old gaia versions and all looks good.
(fwiw for ibc-rs/modules and basecoin, prost drops unknown fields iiuc)
Would still keep the versions_specs boilerplate to deal with incompatibilities not handled by proto, e.g. chann-init with >64 len portsPortId-s where we need to check the version of the chain potentially receiving the chann-try.

Copy link
Member Author

@adizere adizere left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Member

@romac romac left a comment

Choose a reason for hiding this comment

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

🎉

@adizere adizere linked an issue Nov 8, 2021 that may be closed by this pull request
5 tasks
@adizere adizere merged commit 0cb7cbd into master Nov 8, 2021
@adizere adizere deleted the adi/1408_vega_protos branch November 8, 2021 09:22
hu55a1n1 pushed a commit to hu55a1n1/hermes that referenced this pull request Sep 13, 2022
* Regenerated proto files with ibc-go v1.2 and sdk v0.44

* Make the code compile

* Restructure packet queries

* Added support to fetch chain version in bootstrap()

* Updated validation for port identifier (informalsystems#1523)

* Fix for compat. packet_commitment_sequences with ibc-go pre v1.2

* Fixed tests, better comments

* Re-generated using most recent commits.

* Fix bootstrap() unwraps in CLIs.

* Changelog

* Add log traces for version parsing

* FMT

* More test fixes

* Add commitment sequences to query ack request

* Remove version compatibility check in query_packet_acknowledgements

Co-authored-by: Anca Zamfir <zamfiranca@gmail.com>
Co-authored-by: Valery Litvin <litvintech@gmail.com>
Co-authored-by: Romain Ruetschi <romain@informal.systems>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants