-
Notifications
You must be signed in to change notification settings - Fork 360
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
Conversation
relayer/src/chain/cosmos.rs
Outdated
// 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); |
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.
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
.
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.
LGTM!
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.
🎉
* 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>
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:
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 gRPCGetNodeInfoRequest
).bootstrap
changed: this method returns successfully only if the the full node is up-and-running and Hermes obtains a successful response toGetNodeInfoRequest
.bootstrap
were more lax and this method returned Ok even if the full node was entirely inaccessible.bootstrap(..).unwrap()
calls. These unwraps would result in a panic when the full node is inaccessible.TODOs
For contributor use:
unclog
.docs/
) and code comments.Files changed
in the Github PR explorer.