-
Notifications
You must be signed in to change notification settings - Fork 17
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
ci: Add ibc-rs/Hermes integration test #35
Conversation
Signed-off-by: Thane Thomson <[email protected]>
Signed-off-by: Thane Thomson <[email protected]>
Signed-off-by: Thane Thomson <[email protected]>
ci/tests/update-channel.sh
Outdated
@@ -0,0 +1,11 @@ | |||
#!/bin/bash | |||
set -euo pipefail |
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 this be called update-client
(instead of channel)?
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.
Not sure why I named it that. I think I may have been half asleep 😅 I've updated the whole test now to be called create-connection.sh
, and it instead executes a whole create connection operation as per the work in #20.
ci/README.md
Outdated
ID `basecoin-0`). | ||
7. If no `CMD` arguments are provided for the container, it will automatically | ||
execute the [`update-channel.sh`](./tests/update-channel.sh) script, which | ||
creates and updates an IBC channel between `basecoin-0` and `ibc-0`. If `CMD` |
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 guess the plan is to eventually go all the way up to channels, but at the moment we stop at clients because connection handshake fails (cf. https://github.com/informalsystems/ibc-rs/issues/1710)?
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 a good point, but ATM we've been pinning ibc
deps to specific branches (e.g. basecoin/phase-4-1
or basecoin/phase-5
) in Cargo.toml
. This was done to account for missing non-SDK chain support in ibc-rs. Now that proof verification and other things like custom proof-spec support have been implemented, we can finally start to depend on ibc-rs releases (once the fix for https://github.com/informalsystems/ibc-rs/issues/1710 is merged).
That said, we still haven't merged #27 yet, so I suggest we only run hermes create connection
for now.
ci/tests/update-channel.sh
Outdated
HERMES_BIN=${HERMES_BIN:-${HOME}/build/ibc-rs/release/hermes} | ||
|
||
echo "Creating client..." | ||
"${HERMES_BIN}" tx raw create-client basecoin-0 ibc-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.
Can we also create a client in the opposite direction, namely a client hosted on ibc-0
for chain basecoin-0
?
Probably:
"${HERMES_BIN}" tx raw create-client ibc-0 basecoin-0
"${HERMES_BIN}" tx raw update-client ibc-0 07-tendermint-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 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.
Sorry, that comment is outdated. 😅 The connection creation shouldn't fail now. 🤞
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.
Awesome, looks like the bidirectional connection integration test passes 😁 👍
ci/Dockerfile
Outdated
@@ -0,0 +1,45 @@ | |||
ARG TENDERMINT_VERSION=0.34.9 | |||
ARG GAIA_VERSION=4.2.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.
It may be better to use Gaiad v5 or v6 (mainnet hub-4 is at v6).
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 can currently only get this working for Gaiad v5.0.5 (that's the latest image we have from cephalopodequipment
in the v5.x series). v6.0.0 fails at the point where I try to add the generated user key to the basecoin-0
chain via Hermes:
Configuring Hermes...
2021-12-23T14:10:10.979891Z TRACE ThreadId(01) deserialized the encoded pub key into a ProtoAny of type '/cosmos.crypto.secp256k1.PubKey'
Success: Added key 'testkey' (cosmos1va7pcr6gt6p8vvyexrmzwrm6k8uuc7rq2z96w0) on chain ibc-0
Generating user key...
{"name":"user","type":"local","address":"cosmos177vu4gpafpzd9f39kwc64m3tevk628dr3xe6d0","pubkey":"{\"@type\":\"/cosmos.crypto.secp256k1.PubKey\",\"key\":\"A1QTDg0L9pZeHs0WHf73tTjyUBa8UI2Z931CHjUCSCVN\"}","mnemonic":"safe defense winter glide ladder belt clip inform they forest utility record feature cannon deliver stomach will mean destroy border matter sleep gospel involve"}
Adding user key to basecoin-0 chain...
Error: error encoding key: EOF while parsing a value at line 1 column 0
I'm assuming the serialization format changed between Gaiad v5 and v6?
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 tested this and it seems gaiad-v0.6.0 writes the output of the keys add
command to stderr
instead of stdout
, so the user_seed.json
file is empty leading to this problem.
I tried to run locally
and got this error:
Note that my |
Signed-off-by: Thane Thomson <[email protected]>
Signed-off-by: Thane Thomson <[email protected]>
Signed-off-by: Thane Thomson <[email protected]>
Signed-off-by: Thane Thomson <[email protected]>
Check out branch |
echo "Generating user key..." | ||
gaiad keys add user --keyring-backend="test" --output json > "${HOME}/user_seed.json" | ||
echo "Adding user key to basecoin-0 chain..." | ||
"${HERMES_BIN}" -c "${HERMES_CONFIG}" keys add basecoin-0 -f "${HOME}/user_seed.json" |
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.
Signed-off-by: Thane Thomson <[email protected]>
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.
Thanks, @thanethomson! Awesome stuff! 💯👌
Related to informalsystems/hermes#17.
See the README for details as to what this integration test does.
One major drawback to the generalized approach I've taken is that it's pretty slow to execute. In follow-up issues we can try to figure out ways to accelerate its execution (especially i.t.o. stashing build artifacts).
In terms of the large PR, half of it's just a Tendermint
config.toml
file that I bake into the image.