Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
mmsqe committed May 1, 2024
2 parents bd88a2c + 84f610d commit 79d1957
Show file tree
Hide file tree
Showing 159 changed files with 109,018 additions and 51,073 deletions.
5 changes: 5 additions & 0 deletions .codespellrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[codespell]
skip = *.pulsar.go,*.pb.go,*.pb.gw.go,*.json,*.git,*.bin,*.sum,*.mod,query_test.go
ignore-words-list = usera
count =
quiet-level = 3
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# CODEOWNERS: https://help.github.com/articles/about-codeowners/
* @jackzampolin @jtieri @boojamya @mark-rushakoff
* @jtieri @boojamya @agouin
35 changes: 35 additions & 0 deletions .github/workflows/chores.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: chores

on:
pull_request:

jobs:
link-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: gaurav-nelson/[email protected]

typos:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Run codespell
continue-on-error: true
run: |
# .codespellrc is used
sudo apt-get install codespell -y
codespell -w --config .codespellrc
exit $?
pr-title-format:
name: Lint PR Title
permissions:
pull-requests: read
statuses: write
contents: read
runs-on: ubuntu-latest
steps:
- uses: amannn/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
23 changes: 14 additions & 9 deletions .github/workflows/interchaintest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -147,15 +147,20 @@ jobs:
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
- name: Set up Go 1.21
uses: actions/setup-go@v4
with:
go-version: '1.21'

- 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 " | grep -v "proto: duplicate proto type registered" | 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:
Expand Down
20 changes: 20 additions & 0 deletions .github/workflows/strangelove-project-management.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Strangelove Project Management

on:
issues:
types:
- opened
- transferred
- reopened

jobs:
add-to-project:
name: Add issue to project
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
with:
# You can target a project in a different organization
# to the issue
project-url: https://github.com/orgs/strangelove-ventures/projects/4
github-token: ${{ secrets.strangelove_motherboard_access_token }}
13 changes: 6 additions & 7 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,15 @@
* [\#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.
* [\#1225](https://github.com/cosmos/relayer/pull/1225) Support build EVM messages to allow signing Ethereum transactions.
* [\#4](https://github.com/crypto-org-chain/relayer/pull/4) Avoid packet get relayed when estimated gas is higher than max gas.
* [\#6](https://github.com/crypto-org-chain/relayer/pull/6) Support accurate estimate gas with eth_estimateGas for evm tx.
* [\#1302](https://github.com/cosmos/relayer/pull/1302) Avoid packet get relayed when estimated gas is higher than max gas.
* [\#1303](https://github.com/cosmos/relayer/pull/1303) Add missing max gas amount on txf to avoid estimate less gas when simualte runTx.
* [\#1303](https://github.com/cosmos/relayer/pull/1303) Add missing max gas amount on txf to avoid estimate less gas when simulate runTx.
* [\#1324](https://github.com/cosmos/relayer/pull/1324) Add log-level in global config.
* [\#1325](https://github.com/cosmos/relayer/pull/1325) Ignore only file not exist error when loadConfigFile.
* [\#1326](https://github.com/cosmos/relayer/pull/1326) Avoid sending channel close confirm message after channel get closed successfully.
* [\#11](https://github.com/crypto-org-chain/relayer/pull/11) Fix gasFeeCap and gasPrice when new evm tx.
* [\#1364](https://github.com/cosmos/relayer/pull/1364) Include feegrant message when calculate gas.
* [\#1390](https://github.com/cosmos/relayer/pull/1390) Avoid no concrete type registered for type URL error of EthAccount.
* [\#6](https://github.com/crypto-org-chain/relayer/pull/6) Support accurate estimate gas with eth_estimateGas for evm tx.
* [\#11](https://github.com/crypto-org-chain/relayer/pull/11) Fix gasFeeCap and gasPrice when new evm tx.

## v0.9.3

Expand Down Expand Up @@ -140,7 +139,7 @@
### CLI/scripts

* [\#412](https://github.com/cosmos/relayer/pull/412) Auto update clients to prevent expiry. `rly start` command supports auto updating a client if it is about to expire. Use the `--time-threshold` flag.
* [\#323](https://github.com/cosmos/relayer/pull/323) Implmenet an API server. A rest server with API endpoints to support interacting with the relayer
* [\#323](https://github.com/cosmos/relayer/pull/323) Implement an API server. A rest server with API endpoints to support interacting with the relayer
* [\#406](https://github.com/cosmos/relayer/pull/406) Split `add-dir` into `add-chains` and `add-paths`. You must add a chain, then the keys, and then the paths. This enables support of bottom up validation.
* [\#428](https://github.com/cosmos/relayer/pull/428) Fix add-paths failure when called on exiting configuration
* [\#427](https://github.com/cosmos/relayer/pull/427) Fix nil paths bug which occurred when validating paths
Expand All @@ -157,5 +156,5 @@

* (deps) Bump SDK version to [v0.41.0](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.41.0).
* Bug fixes and minor improvements
* (relayer)[\#329](https://github.com/cosmos/relayer/issues/329) client, conenction, and channel handshake refactor (identifiers generated auto generated on-chain)
* (relayer)[\#329](https://github.com/cosmos/relayer/issues/329) client, connection, and channel handshake refactor (identifiers generated auto generated on-chain)
* (relayer)[\#386](https://github.com/cosmos/relayer/pull/386) client, connection and channel identifier reuse
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -115,15 +115,15 @@ get-gaia:
@git clone --branch $(GAIA_VERSION) --depth=1 https://github.com/cosmos/gaia.git $(GAIA_REPO)

build-gaia:
@[ -d $(GAIA_REPO) ] || { echo "Repositry for gaia does not exist at $(GAIA_REPO). Try running 'make get-gaia'..." ; exit 1; }
@[ -d $(GAIA_REPO) ] || { echo "Repository for gaia does not exist at $(GAIA_REPO). Try running 'make get-gaia'..." ; exit 1; }
@cd $(GAIA_REPO) && \
make install &> /dev/null
@gaiad version --long

.PHONY: two-chains test test-integration interchaintest install build lint coverage clean

PACKAGE_NAME := github.com/cosmos/relayer
GOLANG_CROSS_VERSION ?= v1.19.4
GOLANG_CROSS_VERSION ?= v1.21.5

SYSROOT_DIR ?= sysroots
SYSROOT_ARCHIVE ?= sysroots.tar.bz2
Expand Down
85 changes: 43 additions & 42 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@
[![Go Report Card](https://goreportcard.com/badge/github.com/cosmos/relayer)](https://goreportcard.com/report/github.com/cosmos/relayer)
[![License: Apache-2.0](https://img.shields.io/github/license/cosmos/relayer.svg?style=flat-square)](https://github.com/cosmos/relayer/blob/main/LICENSE)
[![Lines Of Code](https://img.shields.io/tokei/lines/github/cosmos/relayer?style=flat-square)](https://github.com/cosmos/relayer)
[![Version](https://img.shields.io/github/tag/cosmos/relayer.svg?style=flat-square)](https://github.com/cosmos/relayer/latest)
[![Version](https://img.shields.io/github/tag/cosmos/relayer.svg?style=flat-square)](https://github.com/cosmos/relayer/releases/latest)
</div>

In IBC, blockchains do not directly pass messages to each other over the network. This is where `relayer` comes in.
In IBC, blockchains do not directly pass messages to each other over the network. This is where `relayer` comes in.
A relayer process monitors for updates on opens paths between sets of [IBC](https://ibcprotocol.org/) enabled chains.
The relayer submits these updates in the form of specific message types to the counterparty chain. Clients are then used to
The relayer submits these updates in the form of specific message types to the counterparty chain. Clients are then used to
track and verify the consensus state.

In addition to relaying packets, this relayer can open paths across chains, thus creating clients, connections and channels.
Expand All @@ -24,7 +24,7 @@ Additional information on how IBC works can be found [here](https://ibc.cosmos.n
---

## Table Of Contents
- [Basic Usage - Relaying Across Chains](#Basic-Usage---Relaying-Packets-Across-Chains)
- [Basic Usage - Relaying Across Chains](#basic-usage---relaying-packets-across-chains)
- [Create Path Across Chains](./docs/create-path-across-chain.md)
- [Advanced Usage](./docs/advanced_usage.md)
- [Troubleshooting](./docs/troubleshooting.md)
Expand All @@ -35,6 +35,7 @@ Additional information on how IBC works can be found [here](https://ibc.cosmos.n
- [Demo/Dev-Environment](./examples/README.md)

---

## Basic Usage - Relaying Packets Across Chains

> The `-h` (help) flag tailing any `rly` command will be your best friend. USE THIS IN YOUR RELAYING JOURNEY.
Expand All @@ -47,64 +48,64 @@ 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.4.0
$ cd relayer && git checkout v2.5.2
$ make install
```

2. **Initialize the relayer's configuration directory/file.**
```shell
$ rly config init
```
**Default config file location:** `~/.relayer/config/config.yaml`
By default, transactions will be relayed with a memo of `rly(VERSION)` e.g. `rly(v2.4.0)`.
By default, transactions will be relayed with a memo of `rly(VERSION)` e.g. `rly(v2.5.2)`.
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.4.0` would result in a transaction memo of `My custom memo | rly(v2.4.0)`.
Custom memos will have `rly(VERSION)` appended. For example, a memo of `My custom memo` running on relayer version `v2.5.2` would result in a transaction memo of `My custom memo | rly(v2.5.2)`.
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.
To omit the memo entirely, including the default value of `rly(VERSION)`, use `-` for the memo.
3. **Configure the chains you want to relay between.**
In our example, we will configure the relayer to operate on the canonical path between the Cosmos Hub and Osmosis.
In our example, we will configure the relayer to operate on the canonical path between the Cosmos Hub and Osmosis.
<br>
The `rly chains add` command fetches chain meta-data from the [chain-registry](https://github.com/cosmos/chain-registry) and adds it to your config file.
```shell
$ rly chains add cosmoshub osmosis
```
Adding chains from the chain-registry randomly selects an RPC address from the registry entry.
If you are running your own node, manually go into the config and adjust the `rpc-addr` setting.
> NOTE: `rly chains add` will check the liveliness of the available RPC endpoints for that chain in the chain-registry.
Adding chains from the chain-registry randomly selects an RPC address from the registry entry.
If you are running your own node, manually go into the config and adjust the `rpc-addr` setting.
> NOTE: `rly chains add` will check the liveliness of the available RPC endpoints for that chain in the chain-registry.
> It is possible that the command will fail if none of these RPC endpoints are available. In this case, you will want to manually add the chain config.
To add the chain config files manually, example config files have been included [here](https://github.com/cosmos/relayer/tree/main/docs/example-configs/)
```shell
$ rly chains add --url https://raw.githubusercontent.com/cosmos/relayer/main/docs/example-configs/cosmoshub-4.json cosmoshub
$ rly chains add --url https://raw.githubusercontent.com/cosmos/relayer/main/docs/example-configs/osmosis-1.json osmosis
```
4. **Import OR create new keys for the relayer to use when signing and relaying transactions.**
>`key-name` is an identifier of your choosing.
>`key-name` is an identifier of your choosing.
If you need to generate a new private key you can use the `add` subcommand.
```shell
$ rly keys add cosmoshub [key-name]
$ rly keys add osmosis [key-name]
$ rly keys add cosmoshub [key-name]
$ rly keys add osmosis [key-name]
```
If you already have a private key and want to restore it from your mnemonic you can use the `restore` subcommand.
```shell
Expand All @@ -115,18 +116,18 @@ Additional information on how IBC works can be found [here](https://ibc.cosmos.n
5. **Use the `key-name` created above.**
>This step is necessary if you chose a `key-name` other than "default"
```shell
$ rly keys use cosmoshub [key-name]
$ rly keys use osmosis [key-name]
$ rly keys use cosmoshub [key-name]
$ rly keys use osmosis [key-name]
```
6. **Ensure the keys associated with the configured chains are funded.**
>Your configured addresses will need to contain some of the respective native tokens for paying relayer fees.
>Your configured addresses will need to contain some of the respective native tokens for paying relayer fees.
<br>
You can query the balance of each configured key by running:
You can query the balance of each configured key by running:
```shell
$ rly q balance cosmoshub
Expand All @@ -135,7 +136,7 @@ Additional information on how IBC works can be found [here](https://ibc.cosmos.n
7. **Configure path meta-data in config file.**
<br>
We have the chain meta-data configured, now we need path meta-data. For more info on `path` terminology visit [here](docs/troubleshooting.md).
We have the chain meta-data configured, now we need path meta-data. For more info on `path` terminology visit [here](docs/troubleshooting.md).
>NOTE: Thinking of chains in the config as "source" and "destination" can be confusing. Be aware that most path are bi-directional.
<br>
Expand All @@ -145,22 +146,22 @@ Additional information on how IBC works can be found [here](https://ibc.cosmos.n
```shell
$ rly paths fetch
```
> **NOTE:** Don't see the path metadata for paths you want to relay on?
> **NOTE:** Don't see the path metadata for paths you want to relay on?
> Please open a PR to add this metadata to the GitHub repo!

8. #### **Configure the channel filter.**
By default, the relayer will relay packets over all channels on a given connection.

By default, the relayer will relay packets over all channels on a given connection.
<br>
Each path has a `src-channel-filter` which you can utilize to specify which channels you would like to relay on.
Each path has a `src-channel-filter` which you can utilize to specify which channels you would like to relay on.
<br>
The `rule` can be one of three values:
The `rule` can be one of three values:
- `allowlist` which tells the relayer to relay on _ONLY_ the channels in `channel-list`
- `denylist` which tells the relayer to relay on all channels _BESIDES_ the channels in `channel-list`
- empty value, which is the default setting, and tells the relayer to relay on all channels
- empty value, which is the default setting, and tells the relayer to relay on all channels
<br>
Since we are only worried about the canonical channel between the Cosmos Hub and Osmosis our filter settings would look like the following.

Since we are only worried about the canonical channel between the Cosmos Hub and Osmosis our filter settings would look like the following.
<br>
Example:
```yaml
Expand All @@ -175,9 +176,9 @@ Additional information on how IBC works can be found [here](https://ibc.cosmos.n
connection-id: connection-1
src-channel-filter:
rule: allowlist
channel-list: [channel-141]
channel-list: [channel-141]
```

>Because two channels between chains are tightly coupled, there is no need to specify the dst channels.
>If you only know the "dst" channel-ID you can query the "src" channel-ID by running: `rly q channel <dst_chain_name> <dst_channel_id> <port> | jq '.channel.counterparty.channel_id'`

Expand All @@ -189,9 +190,9 @@ Additional information on how IBC works can be found [here](https://ibc.cosmos.n
$ rly paths list
$ rly start [path]
# Optionally you can omit the `path` argument to start all configured paths
$ rly start
$ rly start
```

>When running multiple instances of `rly start`, you will need to use the `--debug-addr` flag and provide an address:port. You can also pass an empty string `''` to turn off this feature or pass `localhost:0` to randomly select a port.

---
Expand All @@ -200,8 +201,8 @@ Additional information on how IBC works can be found [here](https://ibc.cosmos.n

## Security Notice

If you would like to report a security critical bug related to the relayer repo,
please reach out @jackzampolin or @Ethereal0ne on telegram.
If you would like to report a security bug related to the relayer repo,
please follow the instructions in [SECURITY.md](SECURITY.md).

## Code of Conduct

Expand Down
Loading

0 comments on commit 79d1957

Please sign in to comment.