Skip to content

Commit 26f7fe3

Browse files
colin-axnerDimitrisJimdamiannolancharleenfeicrodriguezvega
authored
refactor!: migrate to gov v1 via the additions of MsgRecoverClient and MsgIBCSoftwareUpgrade. The legacy proposal types ClientUpdateProposal and UpgradeClientProposal have been removed. (#4620)
* Add proto message, implement sdk.Msg for Recover Client. (#4494) * Add proto message for Recover client, implement sdk.Message interface. * Update modules/core/02-client/types/msgs.go Co-authored-by: Damian Nolan <[email protected]> * Apply suggestions from code review Co-authored-by: Charly <[email protected]> * Remove gogoproto false for cmp, lint, move ibctesting address inline. --------- Co-authored-by: Damian Nolan <[email protected]> Co-authored-by: Charly <[email protected]> * add protos, msgs, keeper handler to upgrade clients using v1 governance proposals (#4436) * add protos and keeper function placeholder * add keeper functions/tests, msgs and tests * update to 0.47.5 release branch * Move signer as last proto field. (#4510) * msg server function and tests for MsgScheduleIBCClientUpgrade (#4442) * Add 02-client implementation for Recover client. (#4499) * Add 02-client implementation for Recover client. * Partially address feedback. * Docu RecoverClient, add label, re-use error. * Add implementation for recover client on message server. (#4503) * Add message server handler for recovering a client * Don't assign to deprecated attrs, clean up unused fields. * Further clean-up, remove declaration of unmutated vars. * Add cmd for submitting a recover client prop. (#4522) * Add cmd for submitting a recover client prop. * Bump cosmossdk in e2e. * Use govtypes.ModuleName, rename old govtypes to govv1beta1 * Update modules/core/02-client/client/cli/tx.go Co-authored-by: Damian Nolan <[email protected]> * Add auth flag. --------- Co-authored-by: Damian Nolan <[email protected]> * rename command * docs: fixed broken links (#4571) * Add e2e test for recovering a client. (#4543) Co-authored-by: Colin Axnér <[email protected]> * feat: add unpacket inerfaces message assertion (#4588) * add cli for MsgIBCSoftwareUpgrade (#4558) * docs: use MsgRecoverClient in docs (#4580) * docs: recover client update * Update docs/ibc/proposals.md * Apply suggestions from code review Co-authored-by: Carlos Rodriguez <[email protected]> --------- Co-authored-by: Carlos Rodriguez <[email protected]> * refactor: remove legacy client update proposal (#4581) * refactor: remove legacy client update proposal * e2e: swap from ClientUpdateProposal e2e to RecoverClient * refactor: remove unused events * feat: add proposal simulator interface function and tests (#4466) Co-authored-by: colin axner <[email protected]> * refactor!: remove UpgradeProposal type (#4602) * create separate event emission for ibc software upgrades vs an upgraded client (#4594) * add new event type * update event name * fix build * remove: legacy event emissions * remove: unnecessary assignments, apply suggestion from code review * e2e: schedule IBC software upgrade (#4585) * wip e2e test * query proposal * update upgrade height in plan * rm unnecessary wait/authority * rm test artifact from merge * add checks for scheduled plan * hook up upgrade query client * plan height * pr fixes * update test * import space * update newchainID value * update clientID upgrade * linter * gci * rm unnecessary event --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Damian Nolan <[email protected]> Co-authored-by: colin axnér <[email protected]> Co-authored-by: Sishir Giri <[email protected]> Co-authored-by: srdtrk <[email protected]> Co-authored-by: Cian Hatton <[email protected]> Co-authored-by: Julien Robert <[email protected]> Co-authored-by: Carlos Rodriguez <[email protected]> Co-authored-by: Jim Fasarakis-Hilliard <[email protected]> Co-authored-by: sontrinh16 <[email protected]> Co-authored-by: catShaark <[email protected]> Co-authored-by: khanh-notional <[email protected]> * chore: docs for MsgIBCSoftwareUpgrade (#4601) * chore: update docs for UpgradeProposal -> MsgIBCSoftwareUpgrade * chore: anticipate link change * fix event docs * refactor: s.Assert -> s.Require * Apply suggestions from code review Co-authored-by: Damian Nolan <[email protected]> * make proto-all * chore: update compiler assertion * refactor: ordering, order as follows: create, update, upgrade, misbheaviour, recover, ibcsoftwareupgrade, update params * refactor: simplify ibc software upgrade emitted event * lint lint lint * Apply suggestions from code review Co-authored-by: Charly <[email protected]> * review of feat/govv1 * pr nits * fix tests for error wrapping --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: Jim Fasarakis-Hilliard <[email protected]> Co-authored-by: Damian Nolan <[email protected]> Co-authored-by: Charly <[email protected]> Co-authored-by: Charly <[email protected]> Co-authored-by: Carlos Rodriguez <[email protected]> Co-authored-by: srdtrk <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Sishir Giri <[email protected]> Co-authored-by: Cian Hatton <[email protected]> Co-authored-by: Julien Robert <[email protected]> Co-authored-by: sontrinh16 <[email protected]> Co-authored-by: catShaark <[email protected]> Co-authored-by: khanh-notional <[email protected]>
1 parent 70a0f76 commit 26f7fe3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+2637
-1927
lines changed

.github/compatibility-test-matrices/main/client-chain-a.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"TestClientTestSuite"
1919
],
2020
"test": [
21-
"TestClientUpdateProposal_Succeeds",
21+
"TestRecoverClient_Succeeds",
2222
"TestClient_Update_Misbehaviour",
2323
"TestAllowedClientsParam"
2424
],

.github/compatibility-test-matrices/main/client-chain-b.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"TestClientTestSuite"
1919
],
2020
"test": [
21-
"TestClientUpdateProposal_Succeeds",
21+
"TestRecoverClient_Succeeds",
2222
"TestClient_Update_Misbehaviour"
2323
],
2424
"relayer-type": [

.github/compatibility-test-matrices/release-v6.1.x/client-chain-a.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"TestClientTestSuite"
1818
],
1919
"test": [
20-
"TestClientUpdateProposal_Succeeds",
20+
"TestRecoverClient_Succeeds",
2121
"TestClient_Update_Misbehaviour",
2222
"TestAllowedClientsParam"
2323
],

.github/compatibility-test-matrices/release-v6.1.x/client-chain-b.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"TestClientTestSuite"
1818
],
1919
"test": [
20-
"TestClientUpdateProposal_Succeeds",
20+
"TestRecoverClient_Succeeds",
2121
"TestClient_Update_Misbehaviour"
2222
],
2323
"relayer-type": [

.github/compatibility-test-matrices/release-v6.2.x/client-chain-a.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"TestClientTestSuite"
1818
],
1919
"test": [
20-
"TestClientUpdateProposal_Succeeds",
20+
"TestRecoverClient_Succeeds",
2121
"TestClient_Update_Misbehaviour",
2222
"TestAllowedClientsParam"
2323
],

.github/compatibility-test-matrices/release-v6.2.x/client-chain-b.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"TestClientTestSuite"
1818
],
1919
"test": [
20-
"TestClientUpdateProposal_Succeeds",
20+
"TestRecoverClient_Succeeds",
2121
"TestClient_Update_Misbehaviour"
2222
],
2323
"relayer-type": [

.github/compatibility-test-matrices/release-v7.2.x/client-chain-a.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"TestClientTestSuite"
1818
],
1919
"test": [
20-
"TestClientUpdateProposal_Succeeds",
20+
"TestRecoverClient_Succeeds",
2121
"TestClient_Update_Misbehaviour",
2222
"TestAllowedClientsParam"
2323
],

.github/compatibility-test-matrices/release-v7.2.x/client-chain-b.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"TestClientTestSuite"
1818
],
1919
"test": [
20-
"TestClientUpdateProposal_Succeeds",
20+
"TestRecoverClient_Succeeds",
2121
"TestClient_Update_Misbehaviour"
2222
],
2323
"relayer-type": [

.github/compatibility-test-matrices/release-v7.3.x/client-chain-a.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"TestClientTestSuite"
1818
],
1919
"test": [
20-
"TestClientUpdateProposal_Succeeds",
20+
"TestRecoverClient_Succeeds",
2121
"TestClient_Update_Misbehaviour",
2222
"TestAllowedClientsParam"
2323
],

.github/compatibility-test-matrices/release-v7.3.x/client-chain-b.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"TestClientTestSuite"
1818
],
1919
"test": [
20-
"TestClientUpdateProposal_Succeeds",
20+
"TestRecoverClient_Succeeds",
2121
"TestClient_Update_Misbehaviour"
2222
],
2323
"relayer-type": [

.github/compatibility-test-matrices/unreleased/client.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"TestClientTestSuite"
2222
],
2323
"test": [
24-
"TestClientUpdateProposal_Succeeds",
24+
"TestRecoverClient_Succeeds",
2525
"TestClient_Update_Misbehaviour",
2626
"TestAllowedClientsParam"
2727
],

docs/architecture/adr-026-ibc-client-recovery-mechanisms.md

+7-2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
- 2021/05/20: Revision to simplify consensus state copying, remove initial height
99
- 2022/04/08: Revision to deprecate AllowUpdateAfterExpiry and AllowUpdateAfterMisbehaviour
1010
- 2022/07/15: Revision to allow updating of TrustingPeriod
11+
- 2023/09/05: Revision to migrate from gov v1beta1 to gov v1
1112

1213
## Status
1314

@@ -44,16 +45,19 @@ We elect not to deal with chains which have actually halted, which is necessaril
4445
1. `allow_update_after_misbehaviour` (boolean, default true). Note that this flag has been deprecated, it remains to signal intent but checks against this value will not be enforced.
4546
1. Require Tendermint light clients (ICS 07) to expose the following additional state mutation functions
4647
1. `Unfreeze()`, which unfreezes a light client after misbehaviour and clears any frozen height previously set
47-
1. Add a new governance proposal type, `ClientUpdateProposal`, in the `x/ibc` module
48-
1. Extend the base `Proposal` with two client identifiers (`string`).
48+
1. Add a new governance proposal with `MsgRecoverClient`.
49+
1. Create a new Msg with two client identifiers (`string`) and a signer.
4950
1. The first client identifier is the proposed client to be updated. This client must be either frozen or expired.
5051
1. The second client is a substitute client. It carries all the state for the client which may be updated. It must have identitical client and chain parameters to the client which may be updated (except for latest height, frozen height, and chain-id). It should be continually updated during the voting period.
5152
1. If this governance proposal passes, the client on trial will be updated to the latest state of the substitute.
53+
1. The signer must be the authority set for the ibc module.
5254

5355
Previously, `AllowUpdateAfterExpiry` and `AllowUpdateAfterMisbehaviour` were used to signal the recovery options for an expired or frozen client, and governance proposals were not allowed to overwrite the client if these parameters were set to false. However, this has now been deprecated because a code migration can overwrite the client and consensus states regardless of the value of these parameters. If governance would vote to overwrite a client or consensus state, it is likely that governance would also be willing to perform a code migration to do the same.
5456

5557
In addition, `TrustingPeriod` was initally not allowed to be updated by a client upgrade proposal. However, due to the number of situations experienced in production where the `TrustingPeriod` of a client should be allowed to be updated because of ie: initial misconfiguration for a canonical channel, governance should be allowed to update this client parameter.
5658

59+
In versions older than ibc-go v8, `MsgRecoverClient` was a governance proposal type `ClientUpdateProposal`. It has been removed and replaced by `MsgRecoverClient` in the migration from governance v1beta1 to governance v1.
60+
5761
Note that this should NOT be lightly updated, as there may be a gap in time between when misbehaviour has occured and when the evidence of misbehaviour is submitted. For example, if the `UnbondingPeriod` is 2 weeks and the `TrustingPeriod` has also been set to two weeks, a validator could wait until right before `UnbondingPeriod` finishes, submit false information, then unbond and exit without being slashed for misbehaviour. Therefore, we recommend that the trusting period for the 07-tendermint client be set to 2/3 of the `UnbondingPeriod`.
5862

5963
Note that clients frozen due to misbehaviour must wait for the evidence to expire to avoid becoming refrozen.
@@ -83,3 +87,4 @@ No neutral consequences.
8387
- [Prior discussion](https://github.com/cosmos/ics/issues/421)
8488
- [Epoch number discussion](https://github.com/cosmos/ics/issues/439)
8589
- [Upgrade plan discussion](https://github.com/cosmos/ics/issues/445)
90+
- [Migration from gov v1beta1 to gov v1](https://github.com/cosmos/ibc-go/issues/3672)

docs/ibc/events.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,12 @@ callbacks to IBC applications.
5858
| update_client_proposal | client_type | {clientType} |
5959
| update_client_proposal | consensus_height | {consensusHeight} |
6060

61-
### UpgradeProposal
61+
### IBCSoftwareUpgrade
6262

63-
| Type | Attribute Key | Attribute Value |
64-
|-------------------------|-----------------|-------------------|
65-
| upgrade_client_proposal | title | {title} |
66-
| upgrade_client_proposal | height | {height} |
63+
| Type | Attribute Key | Attribute Value |
64+
|-------------------------------|---------------------|---------------------------------|
65+
| schedule_ibc_software_upgrade | title | {title} |
66+
| schedule_ibc_software_upgrade | upgrade_plan_height | {plan.height} |
6767

6868
## ICS 03 - Connection
6969

docs/ibc/proposals.md

+10-24
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ See also the relevant documentation: [ADR-026, IBC client recovery mechanisms](.
5151
5252
## Preconditions
5353

54-
- The chain is updated with ibc-go >= v1.1.0.
5554
- There exists an active client (with a known client identifier) for the same counterparty chain as the expired client.
5655
- The governance deposit.
5756

@@ -76,11 +75,10 @@ The client is attached to the expected Akash `chain-id`. Note that although the
7675

7776
### Step 2
7877

79-
If the chain has been updated to ibc-go >= v1.1.0, anyone can submit the governance proposal to recover the client by executing this via CLI.
78+
Anyone can submit the governance proposal to recover the client by executing the following via CLI.
79+
If the chain is on an ibc-go version older than v8, please see the [relevant documentation](https://ibc.cosmos.network/v7.3.0/ibc/proposals.html).
8080

81-
> Note that the Cosmos SDK has updated how governance proposals are submitted in SDK v0.46, now requiring to pass a .json proposal file
82-
83-
- From SDK v0.46.x onwards
81+
- From ibc-go v8 onwards
8482

8583
```shell
8684
<binary> tx gov submit-proposal [path-to-proposal-json]
@@ -92,30 +90,20 @@ If the chain has been updated to ibc-go >= v1.1.0, anyone can submit the governa
9290
{
9391
"messages": [
9492
{
95-
"@type": "/ibc.core.client.v1.ClientUpdateProposal",
96-
"title": "title_string",
97-
"description": "description_string",
93+
"@type": "/ibc.core.client.v1.MsgRecoverClient",
9894
"subject_client_id": "expired_client_id_string",
99-
"substitute_client_id": "active_client_id_string"
95+
"substitute_client_id": "active_client_id_string",
96+
"signer": "<gov-address>"
10097
}
10198
],
10299
"metadata": "<metadata>",
103100
"deposit": "10stake"
101+
"title": "My proposal",
102+
"summary": "A short summary of my proposal",
103+
"expedited": false
104104
}
105105
```
106106

107-
Alternatively there's a legacy command (that is no longer recommended though):
108-
109-
```shell
110-
<binary> tx gov submit-legacy-proposal update-client <expired-client-id> <active-client-id>
111-
```
112-
113-
- Until SDK v0.45.x
114-
115-
```shell
116-
<binary> tx gov submit-proposal update-client <expired-client-id> <active-client-id>
117-
```
118-
119107
The `<expired-client-id>` identifier is the proposed client to be updated. This client must be either frozen or expired.
120108

121109
The `<active-client-id>` represents a substitute client. It carries all the state for the client which may be updated. It must have identical client and chain parameters to the client which may be updated (except for latest height, frozen height, and chain ID). It should be continually updated during the voting period.
@@ -124,6 +112,4 @@ After this, all that remains is deciding who funds the governance deposit and en
124112

125113
## Important considerations
126114

127-
Please note that from v1.0.0 of ibc-go it will not be allowed for transactions to go to expired clients anymore, so please update to at least this version to prevent similar issues in the future.
128-
129-
Please also note that if the client on the other end of the transaction is also expired, that client will also need to update. This process updates only one client.
115+
Please note that if the counterparty client is also expired, that client will also need to update. This process updates only one client.

docs/ibc/upgrades/genesis-restart.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -20,18 +20,18 @@ Genesis restarts still require the usage of an IBC upgrade proposal in order to
2020

2121
If the IBC-connected chain is conducting an upgrade that will break counterparty clients, it must ensure that the upgrade is first supported by IBC using the [IBC Client Breaking Upgrade List](https://github.com/cosmos/ibc-go/blob/main/docs/ibc/upgrades/quick-guide.md#ibc-client-breaking-upgrades) and then execute the upgrade process described below in order to prevent counterparty clients from breaking.
2222

23-
1. Create a 02-client [`UpgradeProposal`](https://github.com/cosmos/ibc-go/blob/main/docs/ibc/proto-docs.md#upgradeproposal) with an `UpgradePlan` and a new IBC ClientState in the `UpgradedClientState` field. Note that the `UpgradePlan` must specify an upgrade height **only** (no upgrade time), and the `ClientState` should only include the fields common to all valid clients and zero out any client-customizable fields (such as TrustingPeriod).
24-
2. Vote on and pass the `UpgradeProposal`.
23+
1. Create a governance proposal with the [`MsgIBCSoftwareUpgrade`](https://buf.build/cosmos/ibc/docs/main:ibc.core.client.v1#ibc.core.client.v1.MsgIBCSoftwareUpgrade) which contains an `UpgradePlan` and a new IBC `ClientState` in the `UpgradedClientState` field. Note that the `UpgradePlan` must specify an upgrade height **only** (no upgrade time), and the `ClientState` should only include the fields common to all valid clients and zero out any client-customizable fields (such as `TrustingPeriod`).
24+
2. Vote on and pass the governance proposal.
2525
3. Halt the node after successful upgrade.
2626
4. Export the genesis file.
2727
5. Swap to the new binary.
2828
6. Run migrations on the genesis file.
29-
7. Remove the `UpgradeProposal` plan from the genesis file. This may be done by migrations.
29+
7. Remove the upgrade plan set by the governance proposal from the genesis file. This may be done by migrations.
3030
8. Change desired chain-specific fields (chain id, unbonding period, etc). This may be done by migrations.
3131
8. Reset the node's data.
3232
9. Start the chain.
3333

34-
Upon the `UpgradeProposal` passing, the upgrade module will commit the UpgradedClient under the key: `upgrade/UpgradedIBCState/{upgradeHeight}/upgradedClient`. On the block right before the upgrade height, the upgrade module will also commit an initial consensus state for the next chain under the key: `upgrade/UpgradedIBCState/{upgradeHeight}/upgradedConsState`.
34+
Upon passing the governance proposal, the upgrade module will commit the `UpgradedClient` under the key: `upgrade/UpgradedIBCState/{upgradeHeight}/upgradedClient`. On the block right before the upgrade height, the upgrade module will also commit an initial consensus state for the next chain under the key: `upgrade/UpgradedIBCState/{upgradeHeight}/upgradedConsState`.
3535

3636
Once the chain reaches the upgrade height and halts, a relayer can upgrade the counterparty clients to the last block of the old chain. They can then submit the proofs of the `UpgradedClient` and `UpgradedConsensusState` against this last block and upgrade the counterparty client.
3737

docs/ibc/upgrades/quick-guide.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@ Note: Since upgrades are only implemented for Tendermint clients, this doc only
3030

3131
If the IBC-connected chain is conducting an upgrade that will break counterparty clients, it must ensure that the upgrade is first supported by IBC using the list above and then execute the upgrade process described below in order to prevent counterparty clients from breaking.
3232

33-
1. Create a 02-client [`UpgradeProposal`](https://github.com/cosmos/ibc-go/blob/main/docs/ibc/proto-docs.md#upgradeproposal) with an `UpgradePlan` and a new IBC ClientState in the `UpgradedClientState` field. Note that the `UpgradePlan` must specify an upgrade height **only** (no upgrade time), and the `ClientState` should only include the fields common to all valid clients and zero out any client-customizable fields (such as TrustingPeriod).
34-
2. Vote on and pass the `UpgradeProposal`.
33+
1. Create a governance proposal with the [`MsgIBCSoftwareUpgrade`](https://buf.build/cosmos/ibc/docs/main:ibc.core.client.v1#ibc.core.client.v1.MsgIBCSoftwareUpgrade) message which contains an `UpgradePlan` and a new IBC `ClientState` in the `UpgradedClientState` field. Note that the `UpgradePlan` must specify an upgrade height **only** (no upgrade time), and the `ClientState` should only include the fields common to all valid clients (chain-specified parameters) and zero out any client-customizable fields (such as `TrustingPeriod`).
34+
2. Vote on and pass the governance proposal.
3535

36-
Upon the `UpgradeProposal` passing, the upgrade module will commit the UpgradedClient under the key: `upgrade/UpgradedIBCState/{upgradeHeight}/upgradedClient`. On the block right before the upgrade height, the upgrade module will also commit an initial consensus state for the next chain under the key: `upgrade/UpgradedIBCState/{upgradeHeight}/upgradedConsState`.
36+
Upon passing the governance proposal, the upgrade module will commit the `UpgradedClient` under the key: `upgrade/UpgradedIBCState/{upgradeHeight}/upgradedClient`. On the block right before the upgrade height, the upgrade module will also commit an initial consensus state for the next chain under the key: `upgrade/UpgradedIBCState/{upgradeHeight}/upgradedConsState`.
3737

3838
Once the chain reaches the upgrade height and halts, a relayer can upgrade the counterparty clients to the last block of the old chain. They can then submit the proofs of the `UpgradedClient` and `UpgradedConsensusState` against this last block and upgrade the counterparty client.
3939

0 commit comments

Comments
 (0)