New optional flag --host-chain
for upgrade clients
command
#2384
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes: #2311
Description
This PR adds a new optional flag,
--host-chain
to the commandhermes 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:gm.toml
:1.
create an additional client on chainibc-2
which referencesibc-0
using the following command:hermes create client --host-chain ibc-2 --reference-chain ibc-0
2.
modify the theupgrade-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
5.
instead of using the command in the guide, upgrade only client onibc-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 onibc-1
with:hermes query client state --chain ibc-1 --client 07-tendermint-0
This should give an output which start with:
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:
If the
--host-chain
command is not given tohermes upgrade clients
then both client states will output that the chain id isupgraded-ibc-0
.PR author checklist:
unclog
.guide/
).Reviewer checklist:
Files changed
in the GitHub PR explorer.