Skip to content

Commit

Permalink
Update go relayer & integration test timing (#668)
Browse files Browse the repository at this point in the history
  • Loading branch information
sampocs authored Apr 6, 2023
1 parent 16dee3e commit edeffb3
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
path = deps/hermes
url = https://github.com/informalsystems/ibc-rs.git
[submodule "deps/relayer"]
# Commit: 2d9fe1acf9081ec7bdcefd8c212a21d28febaba7
# Commit: v2.3.0-rc3
path = deps/relayer
url = https://github.com/cosmos/relayer.git
[submodule "deps/gaia"]
Expand Down
2 changes: 1 addition & 1 deletion deps/relayer
Submodule relayer updated 95 files
+5 −12 .github/workflows/build.yml
+8 −8 .github/workflows/interchaintest.yml
+1 −1 .github/workflows/release.yml
+1 −1 Dockerfile
+1 −1 Makefile
+4 −5 cmd/appstate.go
+8 −22 cmd/chains.go
+10 −1 cmd/flags.go
+24 −7 cmd/keys.go
+71 −0 cmd/keys_test.go
+205 −23 cmd/query.go
+1 −1 cmd/root.go
+18 −2 cmd/start.go
+106 −46 cmd/tx.go
+268 −0 cregistry/chain_info.go
+91 −0 cregistry/chain_info_test.go
+19 −0 cregistry/chain_registry.go
+85 −0 cregistry/cosmos_github_registry.go
+1 −1 docs/chain_implementation.md
+71 −71 go.mod
+503 −160 go.sum
+99 −94 interchaintest/go.mod
+552 −233 interchaintest/go.sum
+1 −1 interchaintest/ibc_test.go
+318 −0 interchaintest/interchain_accounts_test.go
+315 −0 interchaintest/misbehaviour_test.go
+1 −1 interchaintest/poll_test.go
+8 −12 interchaintest/relay_many_test.go
+11 −10 interchaintest/relayer.go
+1 −1 local.Dockerfile
+26 −0 proto/ethermint/crypto/v1/ethsecp256k1/keys.proto
+29 −0 proto/ethermint/types/v1/account.proto
+18 −0 proto/ethermint/types/v1/dynamic_fee.proto
+23 −0 proto/injective/crypto/v1beta1/ethsecp256k1/keys.proto
+26 −0 proto/injective/types/v1beta1/account.proto
+75 −0 relayer/chains/cosmos/account.go
+23 −0 relayer/chains/cosmos/bech32_hack.go
+19 −0 relayer/chains/cosmos/broadcast.go
+102 −0 relayer/chains/cosmos/codec.go
+20 −14 relayer/chains/cosmos/cosmos_chain_processor.go
+5 −2 relayer/chains/cosmos/event_parser.go
+1 −1 relayer/chains/cosmos/event_parser_test.go
+215 −0 relayer/chains/cosmos/grpc_query.go
+211 −0 relayer/chains/cosmos/keys.go
+4 −1 relayer/chains/cosmos/log.go
+3 −0 relayer/chains/cosmos/module/app_module.go
+115 −101 relayer/chains/cosmos/provider.go
+269 −117 relayer/chains/cosmos/query.go
+11 −0 relayer/chains/cosmos/stride/codec.go
+27 −27 relayer/chains/cosmos/stride/messages.pb.go
+489 −150 relayer/chains/cosmos/tx.go
+20 −4 relayer/chains/mock/message_handlers.go
+9 −1 relayer/chains/mock/mock_chain_processor.go
+4 −3 relayer/chains/mock/mock_chain_processor_test.go
+2 −0 relayer/channel.go
+26 −0 relayer/client.go
+374 −0 relayer/codecs/ethermint/account.pb.go
+109 −0 relayer/codecs/ethermint/algorithm.go
+47 −0 relayer/codecs/ethermint/chain_id.go
+28 −0 relayer/codecs/ethermint/codec.go
+325 −0 relayer/codecs/ethermint/dynamic_fee.pb.go
+288 −0 relayer/codecs/ethermint/eip712.go
+475 −0 relayer/codecs/ethermint/encoding.go
+235 −0 relayer/codecs/ethermint/ethsecp256k1.go
+503 −0 relayer/codecs/ethermint/keys.pb.go
+399 −0 relayer/codecs/ethermint/web3.pb.go
+376 −0 relayer/codecs/injective/account.pb.go
+100 −0 relayer/codecs/injective/algorithm.go
+40 −0 relayer/codecs/injective/codec.go
+202 −0 relayer/codecs/injective/ethsecp256k1.go
+3,924 −0 relayer/codecs/injective/evm.pb.go
+501 −0 relayer/codecs/injective/keys.pb.go
+103 −0 relayer/codecs/injective/params.go
+1,555 −0 relayer/codecs/injective/tx.pb.go
+1 −0 relayer/connection.go
+323 −0 relayer/ethermint/dynamic_fee.pb.go
+0 −78 relayer/misbehaviour.go
+4 −1 relayer/processor/event_processor.go
+461 −0 relayer/processor/message_processor.go
+165 −89 relayer/processor/path_end_runtime.go
+0 −1 relayer/processor/path_end_test.go
+58 −8 relayer/processor/path_processor.go
+702 −749 relayer/processor/path_processor_internal.go
+30 −0 relayer/processor/types.go
+323 −86 relayer/processor/types_internal.go
+1 −0 relayer/processor/types_test.go
+101 −3 relayer/provider/matcher.go
+73 −8 relayer/provider/provider.go
+8 −35 relayer/query.go
+25 −1 relayer/strategies.go
+1 −1 scripts/protocgen.sh
+80 −0 third_party/proto/amino/amino.proto
+1 −1 third_party/proto/buf.yaml
+23 −0 third_party/proto/cosmos/auth/v1beta1/auth.proto
+1 −1 third_party/proto/tendermint/crypto/proof.proto
6 changes: 1 addition & 5 deletions dockernet/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,6 @@ while getopts sgojhir{n} flag; do
{CHAIN}_DENOM="{min_denom}"
ST{CHAIN}_DENOM="st{min_denom}"
# if the network uses a new coin type, add it to the top and reference it below
# most chains will use either the cosmos coin type (118) or eth coin type (60)
# add in the new chain's config section
{CHAIN}_CHAIN_ID={NEW-HOST-ZONE}
{CHAIN}_NODE_PREFIX={new-host-zone}
Expand All @@ -69,7 +66,6 @@ ST{CHAIN}_DENOM="st{min_denom}"
{CHAIN}_ADDRESS_PREFIX=stars
{CHAIN}_REV_ACCT={n}rev1
{CHAIN}_DENOM=${CHAIN}_DENOM
{CHAIN}_COIN_TYPE=${TYPE}_COIN_TYPE
{CHAIN}_RPC_PORT={the one included in the docker-compose above}
{CHAIN}_MAIN_CMD="${CHAIN}_CMD --home $DOCKERNET_HOME/state/${${CHAIN}_NODE_PREFIX}1"
{CHAIN}_RECEIVER_ADDRESS={any random address on the chain}
Expand All @@ -96,7 +92,7 @@ ${CHAIN_ID}_ADDRESS() {
```
* Add the IBC denom's for the host zone across each channel to `dockernet/config.sh` (e.g. `IBC_{HOST}_CHANNEL_{N}_DENOM)`). You can generate the variables by uncommenting `x/stakeibc/keeper/get_denom_traces_test.go`, specifying the ChainID and denom, and running `make test-unit`. Add the output to `dockernet/config.sh`. Note: You have to run the test using the "run test" button in VSCode, or pass in the `-v` flag and run the tests using `go test -mod=readonly ./x/stakeibc/...`, for the output to show up.
* Add a section to the `dockernet/config/relayer_config.yaml`
* Add a section to the `dockernet/config/relayer_config.yaml`. Most chains will use either the cosmos coin type (118) or eth coin type (60). If a new coin type is used, add it to the top of `config.sh` for future reference.
```
chains:
...
Expand Down
5 changes: 0 additions & 5 deletions dockernet/config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,6 @@ GAIA_REV_ACCT=grev1
GAIA_ADDRESS_PREFIX=cosmos
GAIA_DENOM=$ATOM_DENOM
GAIA_RPC_PORT=26557
GAIA_COIN_TYPE=$COSMOS_COIN_TYPE
GAIA_MAIN_CMD="$GAIA_BINARY --home $DOCKERNET_HOME/state/${GAIA_NODE_PREFIX}1"
GAIA_RECEIVER_ADDRESS='cosmos1g6qdx6kdhpf000afvvpte7hp0vnpzapuyxp8uf'

Expand All @@ -172,7 +171,6 @@ JUNO_REV_ACCT=jrev1
JUNO_ADDRESS_PREFIX=juno
JUNO_DENOM=$JUNO_DENOM
JUNO_RPC_PORT=26457
JUNO_COIN_TYPE=$COSMOS_COIN_TYPE
JUNO_MAIN_CMD="$JUNO_BINARY --home $DOCKERNET_HOME/state/${JUNO_NODE_PREFIX}1"
JUNO_RECEIVER_ADDRESS='juno1sy0q0jpaw4t3hnf6k5wdd4384g0syzlp7rrtsg'

Expand All @@ -186,7 +184,6 @@ OSMO_REV_ACCT=orev1
OSMO_ADDRESS_PREFIX=osmo
OSMO_DENOM=$OSMO_DENOM
OSMO_RPC_PORT=26357
OSMO_COIN_TYPE=$COSMOS_COIN_TYPE
OSMO_MAIN_CMD="$OSMO_BINARY --home $DOCKERNET_HOME/state/${OSMO_NODE_PREFIX}1"
OSMO_RECEIVER_ADDRESS='osmo1w6wdc2684g9h3xl8nhgwr282tcxx4kl06n4sjl'

Expand All @@ -200,7 +197,6 @@ STARS_REV_ACCT=sgrev1
STARS_ADDRESS_PREFIX=stars
STARS_DENOM=$STARS_DENOM
STARS_RPC_PORT=26257
STARS_COIN_TYPE=$COSMOS_COIN_TYPE
STARS_MAIN_CMD="$STARS_BINARY --home $DOCKERNET_HOME/state/${STARS_NODE_PREFIX}1"
STARS_RECEIVER_ADDRESS='stars15dywcmy6gzsc8wfefkrx0c9czlwvwrjenqthyq'

Expand All @@ -213,7 +209,6 @@ HOST_VAL_PREFIX=hval
HOST_ADDRESS_PREFIX=stride
HOST_REV_ACCT=hrev1
HOST_DENOM=$WALK_DENOM
HOST_COIN_TYPE=$COSMOS_COIN_TYPE
HOST_RPC_PORT=26157
HOST_MAIN_CMD="$HOST_BINARY --home $DOCKERNET_HOME/state/${HOST_NODE_PREFIX}1"
HOST_RECEIVER_ADDRESS='stride1trm75t8g83f26u4y8jfds7pms9l587a7q227k9'
Expand Down
7 changes: 7 additions & 0 deletions dockernet/config/relayer_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ chains:
keyring-backend: test
gas-adjustment: 1.2
gas-prices: 0.01ustrd
coin-type: 118
debug: false
timeout: 20s
output-format: json
Expand All @@ -28,6 +29,7 @@ chains:
keyring-backend: test
gas-adjustment: 1.2
gas-prices: 0.01uatom
coin-type: 118
debug: false
timeout: 20s
output-format: json
Expand All @@ -42,6 +44,7 @@ chains:
keyring-backend: test
gas-adjustment: 1.2
gas-prices: 0.01ujuno
coin-type: 118
debug: false
timeout: 20s
output-format: json
Expand All @@ -56,6 +59,7 @@ chains:
keyring-backend: test
gas-adjustment: 1.2
gas-prices: 0.01uosmo
coin-type: 118
debug: false
timeout: 20s
output-format: json
Expand All @@ -70,6 +74,7 @@ chains:
keyring-backend: test
gas-adjustment: 1.2
gas-prices: 0.01ustars
coin-type: 118
debug: false
timeout: 20s
output-format: json
Expand All @@ -84,6 +89,7 @@ chains:
keyring-backend: test
gas-adjustment: 1.2
gas-prices: 0.01uwalk
coin-type: 118
debug: false
timeout: 20s
output-format: json
Expand All @@ -98,6 +104,7 @@ chains:
# keyring-backend: test
# gas-adjustment: 1.2
# gas-prices: 0.01{minimal_denom}
# coin-type: {coin-type}
# debug: false
# timeout: 20s
# output-format: json
Expand Down
2 changes: 1 addition & 1 deletion dockernet/dockerfiles/Dockerfile.relayer
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ FROM golang:1.19-alpine3.15 AS builder

WORKDIR /src/

ENV COMMIT_HASH=2d9fe1acf9081ec7bdcefd8c212a21d28febaba7
ENV COMMIT_HASH=v2.3.0-rc3

RUN apk add --update git make gcc linux-headers libc-dev eudev-dev
RUN git clone https://github.com/cosmos/relayer.git \
Expand Down
3 changes: 1 addition & 2 deletions dockernet/src/start_relayers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ for chain in ${HOST_CHAINS[@]}; do
chain_name=$(printf "$chain" | awk '{ print tolower($0) }')
account_name=$(GET_VAR_VALUE RELAYER_${chain}_ACCT)
mnemonic=$(GET_VAR_VALUE RELAYER_${chain}_MNEMONIC)
coin_type=$(GET_VAR_VALUE ${chain}_COIN_TYPE)

relayer_logs=${LOGS}/relayer-${chain_name}.log
relayer_config=$STATE/relayer-${chain_name}/config
Expand All @@ -21,7 +20,7 @@ for chain in ${HOST_CHAINS[@]}; do

printf "STRIDE <> $chain - Adding relayer keys..."
$relayer_exec rly keys restore stride $RELAYER_STRIDE_ACCT "$mnemonic" >> $relayer_logs 2>&1
$relayer_exec rly keys restore $chain_name $account_name "$mnemonic" --coin-type $coin_type >> $relayer_logs 2>&1
$relayer_exec rly keys restore $chain_name $account_name "$mnemonic" >> $relayer_logs 2>&1
echo "Done restoring relayer keys"

printf "STRIDE <> $chain - Creating client, connection, and transfer channel..." | tee -a $relayer_logs
Expand Down
4 changes: 2 additions & 2 deletions dockernet/tests/integration_tests.bats
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,8 @@ setup_file() {
# liquid stake
$STRIDE_MAIN_CMD tx stakeibc liquid-stake $STAKE_AMOUNT $HOST_DENOM --from $STRIDE_VAL -y

# sleep two block for the tx to settle on stride
WAIT_FOR_BLOCK $STRIDE_LOGS 2
# wait for the stTokens to get minted
WAIT_FOR_BALANCE_CHANGE STRIDE $(STRIDE_ADDRESS) st$HOST_DENOM

# make sure IBC_DENOM went down
token_balance_end=$($STRIDE_MAIN_CMD q bank balances $(STRIDE_ADDRESS) --denom $HOST_IBC_DENOM | GETBAL)
Expand Down

0 comments on commit edeffb3

Please sign in to comment.