Skip to content
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

relayer: scope config per endpoint #8

Merged
merged 45 commits into from
Oct 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
92ea480
wip: make config an endpoint-specific enum
hdevalence Oct 1, 2023
f315763
propagate changes into relayer-cli and add questions
hdevalence Oct 3, 2023
362f4a7
relayer-cli: propagate enum chain config changes
erwanor Oct 11, 2023
9b25ce6
relayer: add `ChainConfig::set_key_name`
erwanor Oct 11, 2023
4b6f769
test-framework: begin propagating config changes
erwanor Oct 11, 2023
71cf297
relayer-cli: momentarily allow irrefutable patterns
erwanor Oct 11, 2023
baad978
relayer: run cargo fmt
erwanor Oct 11, 2023
6b5f8fb
integration-tests: propagate config enum api changes
erwanor Oct 11, 2023
4457c2b
Merge remote-tracking branch 'upstream/master' into config-enum
erwanor Oct 12, 2023
02f9a87
integration-tests: fix errors with `ica` feature
erwanor Oct 12, 2023
c259910
integration-tests: fix errors with `ics29` feature
erwanor Oct 12, 2023
0a6baeb
integration-tests: fix errors with `fee-grant` feature
erwanor Oct 12, 2023
ed1ff5f
integration-tests: fix errors with `mbt` feature
erwanor Oct 13, 2023
25c7cf8
integration-tests: fix errors with `ordered` feature
erwanor Oct 13, 2023
a6eadc0
Merge remote-tracking branch 'upstream/master' into config-enum
erwanor Oct 13, 2023
e891697
relayer-cli: fix conflict introduced by merge
erwanor Oct 13, 2023
29b1bde
integration-test: fix simulation:
erwanor Oct 13, 2023
12c02de
hermes: various linting fixes
erwanor Oct 13, 2023
f28601b
hermes: include chain type in default config file
erwanor Oct 13, 2023
64083a3
hermes: add chain type to all config examples
erwanor Oct 13, 2023
8f02d10
ci: update misbehavior config
erwanor Oct 13, 2023
44032e5
relayer-rest(tests): add chain type to mock config
erwanor Oct 13, 2023
0a09a0c
ci(misbehavior): edit config of forked chain
erwanor Oct 13, 2023
b1a39d7
relayer(config): remove dead code
erwanor Oct 14, 2023
c158cba
relayer: lift keys to `ChainConfig::list_keys`
erwanor Oct 14, 2023
e7028fc
relayer: move config validation to `ibc_relayer::config`
erwanor Oct 14, 2023
3cb9db3
relayer: move cosmos config to `chain::cosmos::config`
erwanor Oct 17, 2023
33e2cf5
relayer: add `chain::cosmos::config` module
erwanor Oct 17, 2023
cddce8d
relayer-cli(chain-registry): update path to `CosmosSdkConfig`
erwanor Oct 17, 2023
db50666
Add `evidence` command for monitoring and reporting misbehavior evide…
romac Oct 18, 2023
458e5f3
Bump Swatinem/rust-cache from 1 to 2 (#3665)
dependabot[bot] Oct 18, 2023
5767001
Bump actions/checkout from 3 to 4 (#3664)
dependabot[bot] Oct 18, 2023
7bce263
Set CompatMode fallback to v0.34 when the version query fails (#3663)
ljoss17 Oct 19, 2023
1520594
Fix commented gas_price line in example config file (#3668)
ljoss17 Oct 19, 2023
3a41f69
Docs improvements (#3661)
seanchen1991 Oct 19, 2023
5417c47
Update to ibc-proto v0.38.0 and remove unneeded object-safe trait def…
romac Oct 20, 2023
ac916f5
Release Hermes 1.7.0 (#3639)
romac Oct 20, 2023
9a7ef31
Fix README badge (#3675)
romac Oct 21, 2023
7e2b14c
Fix a bug in `query_next_sequence_receive`, where if we didnt ask for…
romac Oct 21, 2023
3f8332c
Enable serde feature of ibc-proto (#3678)
romac Oct 23, 2023
4e7b5ee
Merge remote-tracking branch 'upstream/master' into config-enum
erwanor Oct 23, 2023
c42de92
ci(misbehavior-ics): add chain type to config file
erwanor Oct 23, 2023
e588311
relayer(evidence): exit early if chain type is not cosmos sdk
erwanor Oct 23, 2023
979cef4
relayer(cosmos): refactor cosmos-specific config validation
erwanor Oct 23, 2023
d7f8674
Add changelog entries
romac Oct 24, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .changelog/unreleased/breaking-changes/3548-cometbft-0.38.md

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
- The `type` key in the `[[chains]]` section is now required. ([\#3636](https://github.com/informalsystems/hermes/issues/3636))
If you previously did not specify that key, you must now set it to `type = "CosmosSdk"`, eg.

```rust
[[chains]]
id = "osmosis-1"
type = "CosmosSdk"
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- Change config format to scope configs by type. This enables adding support for
more types of chain, even when those have different config options than each
other. ([\#3636](https://github.com/informalsystems/hermes/issues/3636))
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
- Add a new `evidence` command for monitoring the blocks emitted
by a chain for the presence of a misbehaviour evidence, and
report that evidence to all counteparty clients of that chain.
([\#3456](https://github.com/informalsystems/hermes/pull/3456))
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
- When Hermes detects a misbehaviour on a chain that is CCV
consumer, it will now send the misbehaviour evidence to the
provider chain using the new `IcsConsumerMisbehaviour` message.
([\#3219](https://github.com/informalsystems/hermes/issues/3219))
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
- When Hermes detects a misbehaviour from a on-chain client, eg. a light
client attack or a double-sign, it will now submit the misbehaviour
evidence to all counterparty clients of the misbehaving chain
instead of to the counterparty client of the misbehaving client only.
([\#3223](https://github.com/informalsystems/hermes/issues/3223))
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- Change fallback compatibility version for CometBFT from v0.37 to v0.34
([\#3666](https://github.com/informalsystems/hermes/issues/3666))
25 changes: 25 additions & 0 deletions .changelog/v1.7.0/summary.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
*October 20th, 2023*

This v1.7 release introduces new features and improvements to Hermes.

One of the key highlights is the addition of new misbehavior detection features.

Hermes now includes a new command called `evidence`, which monitors the blocks emitted by a chain for any presence of misbehavior evidence.

If misbehavior is detected, the CLI will report that evidence to all counterparty clients of that chain.
On top of that, misbehavior evidence detected on a chain that is a CCV (Cross-Chain Validation) consumer
is now sent to its provider chain, alerting it directly of the misbehaving consumer chain.

Furthermore, when misbehavior is detected from an on-chain client, such as a light client attack or a double-sign,
the evidence is now submitted to all counterparty clients of the misbehaving chain, rather than just the
counterparty client of the misbehaving client.

In addition, the REST server of Hermes now has a `/clear_packets` endpoint which allows triggering
packet clearing for a specific chain or all chains if no specific chain is provided.

Another notable improvement is the ability to change `tracing` directives at runtime.
This feature lets users adjust tracing settings dynamically as needed, providing a more
customizable and efficient debugging experience.

Overall, the new misbehavior detection features in Hermes contribute to a more robust and secure environment,
enabling timely identification and response to potential misbehaving actors.
165 changes: 164 additions & 1 deletion .github/workflows/misbehaviour.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ concurrency:
cancel-in-progress: true

jobs:
misbehaviour:
light-client-attack:
runs-on: ubuntu-20.04
timeout-minutes: 20
strategy:
Expand Down Expand Up @@ -91,3 +91,166 @@ jobs:
run: |
nix shell .#${{ matrix.chain.package }} -c bash misbehaviour_test.sh

ics-light-client-attack:
runs-on: ubuntu-20.04
timeout-minutes: 20
strategy:
fail-fast: false
matrix:
chain:
- package: interchain-security
account_prefix: cosmos
steps:
- uses: actions/checkout@v4
- name: Install Nix
uses: cachix/install-nix-action@v22
with:
extra_nix_config: |
experimental-features = nix-command flakes
- name: Use cachix cache
uses: cachix/cachix-action@v12
with:
name: cosmos
- name: Install sconfig
uses: jaxxstorm/[email protected]
with:
repo: freshautomations/sconfig
platform: linux
arch: amd64
extension-matching: disable
rename-to: sconfig
chmod: 0755
- name: Install stoml
uses: jaxxstorm/[email protected]
with:
repo: freshautomations/stoml
platform: linux
arch: amd64
extension-matching: disable
rename-to: stoml
chmod: 0755
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- name: Use Rust cache
uses: Swatinem/rust-cache@v2
- name: Build Hermes
uses: actions-rs/cargo@v1
with:
command: build
- name: Run test
working-directory: ci/misbehaviour-ics
run: |
nix shell .#cometbft .#${{ matrix.chain.package }} -c bash light_client_attack_test.sh

ics-light-client-attack-freeze:
runs-on: ubuntu-20.04
timeout-minutes: 20
strategy:
fail-fast: false
matrix:
chain:
- package: interchain-security
account_prefix: cosmos
steps:
- uses: actions/checkout@v4
- name: Install Nix
uses: cachix/install-nix-action@v22
with:
extra_nix_config: |
experimental-features = nix-command flakes
- name: Use cachix cache
uses: cachix/cachix-action@v12
with:
name: cosmos
- name: Install sconfig
uses: jaxxstorm/[email protected]
with:
repo: freshautomations/sconfig
platform: linux
arch: amd64
extension-matching: disable
rename-to: sconfig
chmod: 0755
- name: Install stoml
uses: jaxxstorm/[email protected]
with:
repo: freshautomations/stoml
platform: linux
arch: amd64
extension-matching: disable
rename-to: stoml
chmod: 0755
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- name: Use Rust cache
uses: Swatinem/rust-cache@v2
- name: Build Hermes
uses: actions-rs/cargo@v1
with:
command: build
- name: Run test
working-directory: ci/misbehaviour-ics
run: |
nix shell .#${{ matrix.chain.package }} -c bash light_client_attack_freeze_test.sh


ics-double-sign:
runs-on: ubuntu-20.04
timeout-minutes: 20
strategy:
fail-fast: false
matrix:
chain:
- package: interchain-security
account_prefix: cosmos
steps:
- uses: actions/checkout@v4
- name: Install Nix
uses: cachix/install-nix-action@v22
with:
extra_nix_config: |
experimental-features = nix-command flakes
- name: Use cachix cache
uses: cachix/cachix-action@v12
with:
name: cosmos
- name: Install sconfig
uses: jaxxstorm/[email protected]
with:
repo: freshautomations/sconfig
platform: linux
arch: amd64
extension-matching: disable
rename-to: sconfig
chmod: 0755
- name: Install stoml
uses: jaxxstorm/[email protected]
with:
repo: freshautomations/stoml
platform: linux
arch: amd64
extension-matching: disable
rename-to: stoml
chmod: 0755
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- name: Use Rust cache
uses: Swatinem/rust-cache@v2
- name: Build Hermes
uses: actions-rs/cargo@v1
with:
command: build
- name: Run test
working-directory: ci/misbehaviour-ics
run: |
nix shell .#${{ matrix.chain.package }} -c bash double_sign_test.sh

3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,6 @@ mc.log

# Ignore OSX .DS_Store file
.DS_Store

# Ignore tooling Cargo.lock
tools/check-guide/Cargo.lock
76 changes: 76 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,81 @@
# CHANGELOG

## v1.7.0

*October 20th, 2023*

This v1.7 release introduces new features and improvements to Hermes.

One of the key highlights is the addition of new misbehavior detection features.

- Hermes now includes a new command called `evidence`, which monitors the blocks emitted by a chain for any presence of misbehavior evidence.
- If misbehavior is detected, the CLI will report that evidence to all counterparty clients of that chain.
On top of that, misbehavior evidence detected on a chain that is a CCV (Cross-Chain Validation) consumer
is now sent to its provider chain, alerting it directly of the misbehaving consumer chain.
- Furthermore, when misbehavior is detected from an on-chain client, such as a light client attack or a double-sign,
the evidence is now submitted to all counterparty clients of the misbehaving chain, rather than just the
counterparty client of the misbehaving client.

In addition, the REST server of Hermes now has a `/clear_packets` endpoint which allows triggering
packet clearing for a specific chain or all chains if no specific chain is provided.

Another notable improvement is the ability to change `tracing` directives at runtime.
This feature lets users adjust tracing settings dynamically as needed, providing a more
customizable and efficient debugging experience.

Overall, the new misbehavior detection features in Hermes contribute to a more robust and secure environment,
enabling timely identification and response to potential misbehaving actors.

### FEATURES

- [Relayer CLI](relayer-cli)
- Add a new `evidence` command for monitoring the blocks emitted
by a chain for the presence of a misbehaviour evidence, and
report that evidence to all counteparty clients of that chain.
([\#3456](https://github.com/informalsystems/hermes/pull/3456))
- Add a `/clear_packets?chain=CHAIN_ID` endpoint to the built-in
REST server to trigger packet clear for the chain specified in the
chain query param or for all chains if the query param is omitted.
([\#3398](https://github.com/informalsystems/hermes/issues/3398))
- Add support for changing `tracing` directives at runtime.
Please see the [corresponding page in the Hermes guide][tracing-guide] for more information.
([\#3564](https://github.com/informalsystems/hermes/issues/3564))

[tracing-guide]: https://hermes.informal.systems/advanced/troubleshooting/log-level.html


### IMPROVEMENTS

- [Relayer Library](relayer)
- When Hermes detects a misbehaviour on a chain that is CCV
consumer, it will now send the misbehaviour evidence to the
provider chain using the new `IcsConsumerMisbehaviour` message.
([\#3219](https://github.com/informalsystems/hermes/issues/3219))
- When Hermes detects a misbehaviour from a on-chain client, eg. a light
client attack or a double-sign, it will now submit the misbehaviour
evidence to all counterparty clients of the misbehaving chain
instead of to the counterparty client of the misbehaving client only.
([\#3223](https://github.com/informalsystems/hermes/issues/3223))
- Improve error message when scanning unsupported client
([\#3531](https://github.com/informalsystems/hermes/issues/3531))
- Regard the `finalize_block_events` field of the `block_results` RPC endpoint, added in CometBFT 0.38
([\#3548](https://github.com/informalsystems/hermes/issues/3548))
- Change fallback compatibility version for CometBFT from v0.37 to v0.34
([\#3666](https://github.com/informalsystems/hermes/issues/3666))
- [Relayer CLI](relayer-cli)
- The `listen` command now works with both `push` and `pull` event sources
([\#3501](https://github.com/informalsystems/hermes/issues/3501))

### BUG FIXES

- [Relayer CLI](relayer-cli)
- Revert Docker image to Ubuntu LTS and set the UID and GID explicitly
([\#3580](https://github.com/informalsystems/hermes/issues/3580))
- [IBC Data structures](relayer-types)
- Fix build of `ibc-relayer-types` documentation on docs.rs
([\#3549](https://github.com/informalsystems/hermes/issues/3549))


## v1.6.0

*July 19th, 2023*
Expand Down
Loading
Loading