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

New optional flag --host-chain for upgrade clients command #2384

Merged
merged 4 commits into from
Jul 13, 2022

Conversation

ljoss17
Copy link
Contributor

@ljoss17 ljoss17 commented Jul 8, 2022

Closes: #2311

Description

This PR adds a new optional flag, --host-chain to the command hermes upgrade clients. This flag allows to upgrade all clients that target a specific chain, given by --reference-chain, and are hosted on the chain specified by --host-chain.

Testing

In order to test the new flag, follow the instructions to test the upgrade client command in the Hermes guide https://hermes.informal.systems/commands/upgrade/test.html with the following modifications:

  • Use the following gm.toml:
[global]
  add_to_hermes = true
  auto_maintain_config = true
  extra_wallets = 2
  gaiad_binary = "$HOME/go/bin/gaiad"
  hdpath = ""
  home_dir = "$HOME/.gm"
  ports_start_at = 27040
  validator_mnemonic = ""
  wallet_mnemonic = ""

  [global.hermes]
    binary = "$HOME/.hermes/bin/hermes"
    config = "$HOME/.hermes/config.toml"
    log_level = "debug"
    telemetry_enabled = true
    telemetry_host = "127.0.0.1"
    telemetry_port = 3001

[ibc-0]
  ports_start_at = 27000

[ibc-1]
  ports_start_at = 27010

[ibc-2]
  ports_start_at = 27020
  • At step 1. create an additional client on chain ibc-2 which references ibc-0 using the following command:
    hermes create client --host-chain ibc-2 --reference-chain ibc-0
  • At step 2. modify the the upgrade-chain and add the flag --new-chain to have a different chain name after the upgrade:
    hermes tx raw upgrade-chain --dst-chain ibc-0 --src-chain ibc-1 --src-client 07-tendermint-0 --amount 10000000 --height-offset 60 --new-chain upgraded-ibc-0
  • At step 5. instead of using the command in the guide, upgrade only client on ibc-1 using the following command:
    hermes upgrade clients --reference-chain ibc-0 --upgrade-height XX --host-chain ibc-1

The output of the upgrade clients should only show that one client has been successfully upgraded.

Check the state of the clients

Once the upgrade clients command completes, query the state of the client on ibc-1 with:
hermes query client state --chain ibc-1 --client 07-tendermint-0
This should give an output which start with:

Success: Tendermint(
    ClientState {
        chain_id: ChainId {
            id: "upgraded-ibc-0",
            version: 0,
        },
...

And query the state of the client on ibc-2 with:
hermes query client state --chain ibc-2 --client 07-tendermint-0
This should give an output which start with:

Success: Tendermint(
    ClientState {
        chain_id: ChainId {
            id: "ibc-0",
            version: 0,
        },
...

If the --host-chain command is not given to hermes upgrade clients then both client states will output that the chain id is upgraded-ibc-0.


PR author checklist:

  • Added changelog entry, using unclog.
  • Added tests: integration (for Hermes) or unit/mock tests (for modules).
  • Linked to GitHub issue.
  • Updated code comments and documentation (e.g., guide/).

Reviewer checklist:

  • Reviewed Files changed in the GitHub PR explorer.
  • Manually tested (in case integration/unit/mock tests are absent).

Copy link
Contributor

@seanchen1991 seanchen1991 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good 👍

Copy link
Member

@romac romac left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work, thanks for the detailed testing instructions 🙏

@romac romac self-assigned this Jul 12, 2022
@romac romac merged commit 6e31c9d into master Jul 13, 2022
@romac romac deleted the luca_joss/upgrade_clients_host_chain_filter branch July 13, 2022 06:57
hu55a1n1 pushed a commit to hu55a1n1/hermes that referenced this pull request Sep 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add optional flag --host-chain to hermes upgrade clients
3 participants