Skip to content

Commit

Permalink
Upgrade relayer (#4)
Browse files Browse the repository at this point in the history
* Better Error Messaging when failing to query the Block Height (cosmos#1189)

* better block data errors

* remove redundant field

* penumbra: update protos (cosmos#1181)

Matches the latest protos shipped with the Penumbra Testnet 52.

Co-authored-by: Conor Schaefer <conor@penumbralabs.xyz>
Co-authored-by: Justin Tieri <37750742+jtieri@users.noreply.github.com>

* Neutron launch fixes and optimizations (cosmos#1185)

* pipe max msgs through path processor

* only apply max msgs to packet msgs

* multiple msgs simultaneously on ordered chans

* flush should be more frequent if it fails or does not complete

* fix legacy

* handle feedback

* Problem: fixes in ibc-go v7.0.1 are not included (cosmos#1205)

* Problem: fixes in ibc-go v7.0.1 are not included

* add change doc

* Harry/rly address (cosmos#1204)

* added addresCmd to root and keys.go

* nicks

* nick

* made a common method "showAddressByChainAndKey" to be used by both addressCmd and keysShowCmd

---------

Co-authored-by: Harry <harrycosmos@Harrys-MacBook-Pro.local>
Co-authored-by: Andrew Gouin <andrew@gouin.io>

* deps: update to ibc-go v7.1.0-rc0 (cosmos#1207)

* Export wallet address for Prometheus metrics (cosmos#1206)

* export relayer address for pro

* address in updateFeesSpent

* make error messages consistent

* log error rather than return

* handle 0 balance

* chore: replace gogo/protobuf to cosmos/gogoproto (cosmos#1208)

* rm dup pb

* add missing cp for messages.proto

* make proto-gen

* migrate gogo/protobuf to cosmos/gogoproto

* add change log

* mod tidy

* feat: add extension_options parameter in chain configs (cosmos#1179)

* support extension options for build tx

* add test

* add change doc

* rm dup pb

* update mod

* point to v0.47.3

* feat: support localhost ibc (cosmos#1191)

* WIP: testing localhost ibc client

* WIP: localhost ibc support

* WIP: debugging channel handshake correlation bug

* WIP: debugging localhost IBC

* debugging failed ibc transfers

* chore: remove debug output

* fix: get acks working + cleanup localhost data handling

* test: add additional assertions, debug failing timeouts

* fix: remove redundant chankey assignment

* fix: update to latest interchaintest commit + fix test

* fix: hack to get ordered channels working on localhost

* test: implement ica test case for localhost

* fix: update reverted Go version

* test: fix flaky scenario e2e test

* fix: address suggestions from code review

* dep: bump cometbft and ibc-go (cosmos#1221)

* bump cometbft to v0.37.2

* bump ibc-go to v7.2.0

* add change doc

* add missing stop relayer to avoid log after test complete (cosmos#1229)

Co-authored-by: Justin Tieri <37750742+jtieri@users.noreply.github.com>

* fix: avoid invalid Bech32 prefix in scenario test (cosmos#1226)

* avoid invalid Bech32 prefix

due to singleton GetConfig

* add change doc

* separate process in ci

* separate fee middleware test for juno

* wait more blks for ack (cosmos#1222)

* penumbra provider: update proof spec (cosmos#1232)

* fix: flag accessed but not defined: flush-interval (cosmos#1238)

* penumbra provider: update protos (cosmos#1245)

* fix: Suppressing scary SDK error on redundant packets (cosmos#1214)

Co-authored-by: Andrew Gouin <andrew@gouin.io>

* catch error if type is missing (cosmos#1234)

Co-authored-by: Andrew Gouin <andrew@gouin.io>

* Export client expiration metric to prometheus (cosmos#1235)

* export client expiration metric

* finalize

* add path name

* snake case

* change label to `chain`

* trusting period as string

* Export configured gas prices to prometheus wallet balance metric (cosmos#1236)

* export gas price to prom

* update label

* update fees spent metric

* snake case

* Exports block query errors to prometheus metrics (counter) (cosmos#1239)

* separate by type

* add help info

* remove new line in help and fix readme

* feedback

* Export TX failures to prometheus metrics (counter) (cosmos#1240)

* export tx failures to prometheus

* change label to `cause`

* use the name given by the user to generate the fetch URL (cosmos#1233)

* use the name given by the user to generate the fetch URL

* add example

---------

Co-authored-by: Andrew Gouin <andrew@gouin.io>
Co-authored-by: Dan Kanefsky <56059752+boojamya@users.noreply.github.com>

* feegrant PR (cosmos#1140)

* Feegrant support

* Test case for address caching bugfix

* Bugfix for SDK account prefix. Feegrant test passing.

* Mutex for signer expanded to include feegrantees

* Cleaned up feegrant test case

* Cleaned up feegrant test case

* Cleaned up feegrant test case

* check round robin feegrant behavior by counting number of TXs each grantee signer

* module updates from merge

* v0.47.0 with bech32 address cache fix

* Move SetAddrCacheEnabled to NewRelayer func for full coverage

* Do not hardcode chain id in feegrant test case

* Wait more blocks for ibc transfers

* disable cosmos SDK bech32 address cache for rly start command

* Fix sloppy comments/remove unnecessary code

* Faster acc caching unit test

* Penumbra provider feegrant support

* Merge upstream

* Fixed merge issue where feegrant config wasn't being written to file

* feegrant patch for cosmos-sdk v0.47.1

* merge from main

* Update to cosmos-sdk v0.47.2

* Increase test case blocks to wait

* Fixed data race by moving test parallelization after relayer wallet build

* Increased TestScenarioICAChannelClose timeout height

* Cleanup feegrant test case

* Fixed race condition in sequence guard w/ mutex

* Automatic retry for TX lookup in feegrant test case

---------

Co-authored-by: Andrew Gouin <andrew@gouin.io>

* Export Client Trusting Period to Prometheus metrics (cosmos#1246)

* export client trusting period

* update docs

* separate feegrant test to avoid no space left on device (cosmos#1250)

from scenarios test in ci

* Add extra client info when querying client expiration (cosmos#1247)

* extra client info

* cleanup print

* remove extra comments

* add alias

* allow only one client

* spelling

* remainingTime

---------

Co-authored-by: Justin Tieri <37750742+jtieri@users.noreply.github.com>

* next seq ack handling (cosmos#1244)

* next seq ack handling and chan order

* use max msgs for ack flush

* improve logs

* fix check

* don't override unless not chantypes.NONE

* fix: Suppressing scary SDK error on redundant packets (cosmos#1214)

Co-authored-by: Andrew Gouin <andrew@gouin.io>

* tidy logic

* improve logic and order detection

* shorten flushFailureRetry

* check empty string

* tidy logs. better account sequence regex. don't split up ordered channel batches

---------

Co-authored-by: Joe Abbey <joe.abbey@gmail.com>
Co-authored-by: jtieri <justin@thetieris.com>

* chore: update penumbra protos to v0.57.0 (cosmos#1249)

Version 0.57.0 of Penumbra was released on 2023-07-26 [0].
This commit pulls in the latest proto defs from BSR.

[0] https://github.com/penumbra-zone/penumbra/releases/tag/v0.57.0

Co-authored-by: Conor Schaefer <conor@penumbralabs.xyz>
Co-authored-by: Justin Tieri <37750742+jtieri@users.noreply.github.com>

* fix: reduce get bech32 prefix when get signer (cosmos#1231)

* add missing getFeePayer for clienttypes

* add missing getFeePayer for feetypes

* apply in penumbra

* add change doc

---------

Co-authored-by: Justin Tieri <37750742+jtieri@users.noreply.github.com>

* update setup-go action (cosmos#1251)

* fix for feegrants (cosmos#1256)

* Feegrant support

* Test case for address caching bugfix

* Bugfix for SDK account prefix. Feegrant test passing.

* Mutex for signer expanded to include feegrantees

* Cleaned up feegrant test case

* Cleaned up feegrant test case

* Cleaned up feegrant test case

* check round robin feegrant behavior by counting number of TXs each grantee signer

* module updates from merge

* v0.47.0 with bech32 address cache fix

* Move SetAddrCacheEnabled to NewRelayer func for full coverage

* Do not hardcode chain id in feegrant test case

* Wait more blocks for ibc transfers

* disable cosmos SDK bech32 address cache for rly start command

* Fix sloppy comments/remove unnecessary code

* Faster acc caching unit test

* Penumbra provider feegrant support

* Merge upstream

* Fixed merge issue where feegrant config wasn't being written to file

* feegrant patch for cosmos-sdk v0.47.1

* merge from main

* Update to cosmos-sdk v0.47.2

* Increase test case blocks to wait

* Fixed data race by moving test parallelization after relayer wallet build

* Increased TestScenarioICAChannelClose timeout height

* Cleanup feegrant test case

* Fixed race condition in sequence guard w/ mutex

* Automatic retry for TX lookup in feegrant test case

* Disable cosmos SDK address cache on app initialization via main package init()

* Added docs for feegrant in the advanced usage guide

* Removed commented out code

* Removed commented out code

* Added detail to feegrant docs, fixed minor issue with test case

* Added detail to feegrant docs, fixed minor issue with test case

---------

Co-authored-by: Andrew Gouin <andrew@gouin.io>
Co-authored-by: Kyle <kyle@strange.love>

* chore: update penumbra protos (cosmos#1260)

Updating to the latest Penumbra upstream protos.
We'll likely submit another round of changes ahead of the next public
testnet release, as a heads up.

Co-authored-by: Conor Schaefer <conor@penumbralabs.xyz>

* Change 2.3.0 to 2.4.0 (cosmos#1253)

Co-authored-by: Justin Tieri <37750742+jtieri@users.noreply.github.com>

* rename path to path_name for consistency (cosmos#1262)

* Use unique names for relayer images & cleanup when purpose served (cosmos#1269)

* Use unique names for relayer images & cleanup when purpose served

* move random tag generation and teardown image to within BuildRelayerImage

* fix return line

* use ibc-go capability module (cosmos#1277)

* use ibc-go capability module

* tidy interchaintest

* fix: use resp.Events to parse events instead of logs (cosmos#1271)

* fix: use resp.Events to parse events instead of logs

* revert: use legacy behaviour as fallback mechanism

* refactor: use legacy approach first, fallback onto new parsing approach

---------

Co-authored-by: Justin Tieri <37750742+jtieri@users.noreply.github.com>

* working correctly with 7.3 and 0.47.5 (cosmos#1280)

Co-authored-by: Justin Tieri <37750742+jtieri@users.noreply.github.com>

* Add use command to "rly keys" (cosmos#1282)

* Update README.md with an update to leverage 'rly key use' in step 5 (cosmos#1289)

* Update README.md with an update to leverage 'rly key use' in step 5

* change alias from 'a' to 'u' for use subcommand

* Ability to fetch specific chain paths only (cosmos#1291)

* feat: allow a relayer to fetch a specific chain only

* minor: check specific path pair logic earlier

* faddat/upgrade go (cosmos#1279)

* upgrade ci to go 1.21

* upgrade to go1.21

---------

Co-authored-by: Justin Tieri <37750742+jtieri@users.noreply.github.com>

* Split scenarios test (cosmos#1294)

* Split scenarios test

* use matrix

* updates

* need to cd into dir first

* handle deprication

* Remove rouge entry into the matrix

* Ensure other parallel tests run to completion even if one of them fail

* Add explanation

* Remove rougue whitespace

* Add verbosity and timeout for scenarios tests (cosmos#1295)

* Add output flag for query sub commands  results printed to console.  (cosmos#1281)

* output json for query cmd's  balance & clients-expirations
* print proper json instead of bytes for headers command
* Add output flag . Use legacy,json options
* Update according to reviews

* Add ability to fetch testnet chains and paths + force-add ability (cosmos#1285)

* add testnet and force-add

* update cmd examples

* improve usage description

* update interchaintest workflow (cosmos#1298)

* Query param prop directly (cosmos#1264)

* Query param prop directly

* Flip order of queries for QueryUnbondingPeriod

* Add fallback for chains using cosmos-sdk 47+

* Trusting period logic remains same

* Add Fallback

* Consolidate functions into a single queryParamsSubspaceTime

* Saga IBC transfers between SPC and chainlet

* Set keystore password

* Poll chainlet until it's up and running

* Remove unused mnemonic file

* Rename example .json files to .json.example

* Env vars renaming

* Rename SPC_EXTERNAL_ADDRESS -> SPC_RPC_EXTERNAL_ADDRESS

* Feature/ccv (#2)

* Updates to support CCV

* Re-added out/err redirect to log files

* Add multiple tries for linking. Upd chain waiting

* Minor fix to Github action. Update rly start

---------

Co-authored-by: Ashish Chandra <ashish@saga.xyz>

* Committing go.work.sum

---------

Co-authored-by: Keefer Taylor | Tessellated <keefer@tessellated.io>
Co-authored-by: Conor Schaefer <conorsch@users.noreply.github.com>
Co-authored-by: Conor Schaefer <conor@penumbralabs.xyz>
Co-authored-by: Justin Tieri <37750742+jtieri@users.noreply.github.com>
Co-authored-by: Andrew Gouin <andrew@gouin.io>
Co-authored-by: mmsqe <mavis@crypto.com>
Co-authored-by: Cosmos-Harry <110472914+Cosmos-Harry@users.noreply.github.com>
Co-authored-by: Harry <harrycosmos@Harrys-MacBook-Pro.local>
Co-authored-by: Dan Kanefsky <56059752+boojamya@users.noreply.github.com>
Co-authored-by: Ava Howell <ava@avahowell.me>
Co-authored-by: mindcarver <32150062+mindcarver@users.noreply.github.com>
Co-authored-by: Joe Abbey <joe.abbey@gmail.com>
Co-authored-by: murataniloener <anil@b9lab.com>
Co-authored-by: KyleMoser <KyleMoser@users.noreply.github.com>
Co-authored-by: jtieri <justin@thetieris.com>
Co-authored-by: Kyle <kyle@strange.love>
Co-authored-by: Sr20de <106104431+Sr20dem@users.noreply.github.com>
Co-authored-by: danb <dan@bryanlabs.net>
Co-authored-by: vimystic <122659254+vimystic@users.noreply.github.com>
Co-authored-by: Jacob Gadikian <jacobgadikian@gmail.com>
Co-authored-by: colin axnér <25233464+colin-axner@users.noreply.github.com>
Co-authored-by: Reece Williams <31943163+Reecepbcups@users.noreply.github.com>
Co-authored-by: Konstantin Munichev <toobwn@gmail.com>
Co-authored-by: Ashish Chandra <ashish@saga.xyz>
  • Loading branch information
1 parent 25fea58 commit f8c7dd7
Show file tree
Hide file tree
Showing 107 changed files with 12,198 additions and 7,922 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ jobs:
runs-on: ubuntu-latest
steps:
# Install and setup go
- name: Set up Go 1.20
- name: Set up Go 1.21
uses: actions/setup-go@v4
with:
go-version: 1.20.2
go-version: '1.21'

# setup gopath
- name: Set PATH
Expand All @@ -40,4 +40,4 @@ jobs:
uses: actions/upload-artifact@v1
with:
name: rly
path: ./build/rly
path: ./build/rly
156 changes: 127 additions & 29 deletions .github/workflows/interchaintest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,19 @@ jobs:
events:
runs-on: self-hosted
steps:
- name: Set up Go 1.20
uses: actions/setup-go@v1
- name: Set up Go 1.21
uses: actions/setup-go@v4
with:
go-version: 1.20
id: go
go-version: '1.21'

- name: checkout relayer
uses: actions/checkout@v2
uses: actions/checkout@v4

- uses: actions/cache@v1
- uses: actions/cache@v3
with:
path: ~/go/pkg/mod
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
Expand All @@ -32,18 +33,19 @@ jobs:
legacy:
runs-on: self-hosted
steps:
- name: Set up Go 1.20
uses: actions/setup-go@v1
- name: Set up Go 1.21
uses: actions/setup-go@v4
with:
go-version: 1.20
id: go
go-version: '1.21'

- name: checkout relayer
uses: actions/checkout@v2
uses: actions/checkout@v4

- uses: actions/cache@v1
- uses: actions/cache@v3
with:
path: ~/go/pkg/mod
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
Expand All @@ -54,43 +56,139 @@ jobs:
multiple-paths:
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.20
uses: actions/setup-go@v1
- name: Set up Go 1.21
uses: actions/setup-go@v4
with:
go-version: 1.20
id: go
go-version: '1.21'

- name: checkout relayer
uses: actions/checkout@v2
uses: actions/checkout@v4

- uses: actions/cache@v1
- uses: actions/cache@v3
with:
path: ~/go/pkg/mod
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: interchaintest
run: make interchaintest-multiple

misbehaviour:
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.21
uses: actions/setup-go@v4
with:
go-version: '1.21'

- name: checkout relayer
uses: actions/checkout@v4

- uses: actions/cache@v3
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: interchaintest
run: make interchaintest-misbehaviour

fee-middleware:
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.21
uses: actions/setup-go@v4
with:
go-version: '1.21'

- name: checkout relayer
uses: actions/checkout@v4

- uses: actions/cache@v3
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: interchaintest
run: make interchaintest-fee-middleware

fee-grant:
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.21
uses: actions/setup-go@v4
with:
go-version: '1.21'

- name: checkout relayer
uses: actions/checkout@v4

- uses: actions/cache@v3
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: interchaintest
run: make interchaintest-fee-grant

prepare-scenario-matrix:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Generate matrix
id: set-matrix
run: |
# Run the command and convert its output to a JSON array
TESTS=$(cd interchaintest && go test -list ^TestScenario | grep -v "^ok " | jq -R -s -c 'split("\n")[:-1]')
echo "matrix=${TESTS}" >> $GITHUB_OUTPUT
# Note : This job will not start until prepare-scenario-matrix completes sucessfully
scenarios:
needs: prepare-scenario-matrix
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
test: ${{fromJson(needs.prepare-scenario-matrix.outputs.matrix)}}

steps:
- name: Set up Go 1.20
uses: actions/setup-go@v1
- name: Set up Go 1.21
uses: actions/setup-go@v4
with:
go-version: 1.20
id: go
go-version: '1.21'

- name: checkout relayer
uses: actions/checkout@v2
uses: actions/checkout@v4

- uses: actions/cache@v1
- uses: actions/cache@v3
with:
path: ~/go/pkg/mod
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: interchaintest
run: make interchaintest-scenario
run: |
cd interchaintest
go test -timeout 30m -race -v -run ${{ matrix.test }}
8 changes: 4 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: "Release"
name: 'Release'

on:
push:
Expand All @@ -15,11 +15,11 @@ jobs:
fetch-depth: 0

- name: Set up Go
uses: actions/setup-go@v2
uses: actions/setup-go@v4
with:
go-version: 1.20
go-version: '1.21'

- run: echo https://github.com/cosmos/relayer/blob/${GITHUB_REF#refs/tags/}/CHANGELOG.md#${GITHUB_REF#refs/tags/} > ../release_notes.md
- run: echo https://github.com/cosmos/relayer/blob/${GITHUB_REF#refs/tags/}/CHANGELOG.md#${GITHUB_REF#refs/tags/} > ../release_notes.md

- name: setup release environment
run: |-
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@
* [\#1177](https://github.com/cosmos/relayer/pull/1177) Avoid panic due to nil map when add new path and ensure path get written to config.
* [\#1178](https://github.com/cosmos/relayer/pull/1178) Add max-gas-amount parameter in chain configs.
* [\#1180](https://github.com/cosmos/relayer/pull/1180) Update SDK from v0.47.0 to v0.47.2.
* [\#1205](https://github.com/cosmos/relayer/pull/1205) Update ibc-go to v7.0.1.
* [\#1179](https://github.com/cosmos/relayer/pull/1179) Add extension-options parameter in chain configs and update SDK to v0.47.3.
* [\#1208](https://github.com/cosmos/relayer/pull/1208) Replace gogo/protobuf to cosmos/gogoproto.
* [\#1221](https://github.com/cosmos/relayer/pull/1221) Update cometbft to v0.37.2 and ibc-go to v7.2.0.
* [\#1226](https://github.com/cosmos/relayer/pull/1226) Avoid invalid Bech32 prefix error in parallel tests when sdk Config get overwritten by each other in single process.
* [\#1231](https://github.com/cosmos/relayer/pull/1231) Reduce get bech32 prefix when get signer.

## v0.9.3

Expand Down
10 changes: 5 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
FROM --platform=$BUILDPLATFORM golang:1.20-alpine3.16 AS build-env
FROM --platform=$BUILDPLATFORM golang:1.21-alpine3.17 AS build-env

RUN apk add --update --no-cache curl make git libc-dev bash gcc linux-headers eudev-dev

ARG TARGETARCH
ARG BUILDARCH

RUN if [ "${TARGETARCH}" = "arm64" ] && [ "${BUILDARCH}" != "arm64" ]; then \
wget -c https://musl.cc/aarch64-linux-musl-cross.tgz -O - | tar -xzvv --strip-components 1 -C /usr; \
wget -c https://musl.cc/aarch64-linux-musl-cross.tgz -O - | tar -xzvv --strip-components 1 -C /usr; \
elif [ "${TARGETARCH}" = "amd64" ] && [ "${BUILDARCH}" != "amd64" ]; then \
wget -c https://musl.cc/x86_64-linux-musl-cross.tgz -O - | tar -xzvv --strip-components 1 -C /usr; \
wget -c https://musl.cc/x86_64-linux-musl-cross.tgz -O - | tar -xzvv --strip-components 1 -C /usr; \
fi

ADD . .

RUN if [ "${TARGETARCH}" = "arm64" ] && [ "${BUILDARCH}" != "arm64" ]; then \
export CC=aarch64-linux-musl-gcc CXX=aarch64-linux-musl-g++;\
export CC=aarch64-linux-musl-gcc CXX=aarch64-linux-musl-g++;\
elif [ "${TARGETARCH}" = "amd64" ] && [ "${BUILDARCH}" != "amd64" ]; then \
export CC=x86_64-linux-musl-gcc CXX=x86_64-linux-musl-g++; \
export CC=x86_64-linux-musl-gcc CXX=x86_64-linux-musl-g++; \
fi; \
GOOS=linux GOARCH=$TARGETARCH CGO_ENABLED=1 LDFLAGS='-linkmode external -extldflags "-static"' make install

Expand Down
9 changes: 9 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,15 @@ interchaintest-legacy:
interchaintest-multiple:
cd interchaintest && go test -race -v -run TestRelayerMultiplePathsSingleProcess .

interchaintest-misbehaviour:
cd interchaintest && go test -race -v -run TestRelayerMisbehaviourDetection .

interchaintest-fee-middleware:
cd interchaintest && go test -race -v -run TestRelayerFeeMiddleware .

interchaintest-fee-grant:
cd interchaintest && go test -race -v -run TestRelayerFeeGrant .

interchaintest-scenario: ## Scenario tests are suitable for simple networks of 1 validator and no full nodes. They test specific functionality.
cd interchaintest && go test -timeout 30m -race -v -run TestScenario ./...

Expand Down
20 changes: 8 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ Additional information on how IBC works can be found [here](https://ibc.cosmos.n

```shell
$ git clone https://github.com/cosmos/relayer.git
$ cd relayer && git checkout v2.3.0
$ cd relayer && git checkout v2.4.0
$ make install
```

Expand All @@ -58,15 +58,15 @@ Additional information on how IBC works can be found [here](https://ibc.cosmos.n
```
**Default config file location:** `~/.relayer/config/config.yaml`
By default, transactions will be relayed with a memo of `rly(VERSION)` e.g. `rly(v2.3.0)`.
By default, transactions will be relayed with a memo of `rly(VERSION)` e.g. `rly(v2.4.0)`.
To customize the memo for all relaying, use the `--memo` flag when initializing the configuration.
```shell
$ rly config init --memo "My custom memo"
```
Custom memos will have `rly(VERSION)` appended. For example, a memo of `My custom memo` running on relayer version `v2.3.0` would result in a transaction memo of `My custom memo | rly(v2.3.0)`.
Custom memos will have `rly(VERSION)` appended. For example, a memo of `My custom memo` running on relayer version `v2.4.0` would result in a transaction memo of `My custom memo | rly(v2.4.0)`.
The `--memo` flag is also available for other `rly` commands also that involve sending transactions such as `rly tx link` and `rly start`. It can be passed there to override the `config.yaml` value if desired.
Expand Down Expand Up @@ -112,18 +112,14 @@ Additional information on how IBC works can be found [here](https://ibc.cosmos.n
$ rly keys restore osmosis [key-name] "mnemonic words here"
```
5. **Edit the relayer's `key` values in the config file to match the `key-name`'s chosen above.**
5. **Use the `key-name` created above.**
>This step is necessary if you chose a `key-name` other than "default"
Example:
```yaml
- type: cosmos
value:
key: YOUR-KEY-NAME-HERE
chain-id: cosmoshub-4
rpc-addr: http://localhost:26657
```
```shell
$ rly keys use cosmoshub [key-name]
$ rly keys use osmosis [key-name]
```
6. **Ensure the keys associated with the configured chains are funded.**
Expand Down
31 changes: 31 additions & 0 deletions cmd/appstate.go
Original file line number Diff line number Diff line change
Expand Up @@ -251,3 +251,34 @@ func (a *appState) updatePathConfig(
return nil
})
}

func (a *appState) useKey(chainName, key string) error {

chain, exists := a.config.Chains[chainName]
if !exists {
return fmt.Errorf("chain %s not found in config", chainName)
}

cc := chain.ChainProvider

info, err := cc.ListAddresses()
if err != nil {
return err
}
value, exists := info[key]
currentValue := a.config.Chains[chainName].ChainProvider.Key()

if currentValue == key {
return fmt.Errorf("config is already using %s -> %s for %s", key, value, cc.ChainName())
}

if exists {
fmt.Printf("Config will now use %s -> %s for %s\n", key, value, cc.ChainName())
} else {
return fmt.Errorf("key %s does not exist for chain %s", key, cc.ChainName())
}
return a.performConfigLockingOperation(context.Background(), func() error {
a.config.Chains[chainName].ChainProvider.UseKey(key)
return nil
})
}
Loading

0 comments on commit f8c7dd7

Please sign in to comment.