diff --git a/app/upgrades/v5_2_0/constants.go b/app/upgrades/v5_2_0/constants.go index 8198d0e74..528b42a44 100644 --- a/app/upgrades/v5_2_0/constants.go +++ b/app/upgrades/v5_2_0/constants.go @@ -8,7 +8,7 @@ const ( // UpgradeHeight defines the block height at which the Composable v6 upgrade is // triggered. - UpgradeHeight = 1769900 + UpgradeHeight = 1771900 ) var Fork = upgrades.Fork{ diff --git a/app/upgrades/v5_2_0/fork.go b/app/upgrades/v5_2_0/fork.go index 4bed3bb71..5a7593ffa 100644 --- a/app/upgrades/v5_2_0/fork.go +++ b/app/upgrades/v5_2_0/fork.go @@ -16,8 +16,8 @@ import ( const ( newWasmCodeID = "ad84ee3292e28b4e46da16974c118d40093e1a6e28a083f2f045f68fde7fb575" - clientId = "08-wasm-05" - substituteClientId = "08-wasm-132" + subjectClientId = "08-wasm-5" + substituteClientId = "08-wasm-133" ) func RunForkLogic(ctx sdk.Context, keepers *keepers.AppKeepers) { @@ -27,21 +27,21 @@ func RunForkLogic(ctx sdk.Context, keepers *keepers.AppKeepers) { UpdateWasmContract(ctx, keepers.IBCKeeper) - err := ClientUpdate(ctx, keepers.IBCKeeper.Codec(), keepers.IBCKeeper, clientId, substituteClientId) + err := ClientUpdate(ctx, keepers.IBCKeeper.Codec(), keepers.IBCKeeper, subjectClientId, substituteClientId) if err != nil { panic(err) } } func UpdateWasmContract(ctx sdk.Context, ibckeeper *ibckeeper.Keeper) { - unknownClientState, found := ibckeeper.ClientKeeper.GetClientState(ctx, clientId) + unknownClientState, found := ibckeeper.ClientKeeper.GetClientState(ctx, subjectClientId) if !found { - panic("cannot update client with ID") + panic("substitute client client not found ") } clientState, ok := unknownClientState.(*wasm08types.ClientState) if !ok { - panic("cannot update client with ID") + panic("cannot update client") } code, err := transfertypes.ParseHexHash(newWasmCodeID) @@ -51,7 +51,7 @@ func UpdateWasmContract(ctx sdk.Context, ibckeeper *ibckeeper.Keeper) { clientState.CodeId = code - ibckeeper.ClientKeeper.SetClientState(ctx, clientId, clientState) + ibckeeper.ClientKeeper.SetClientState(ctx, substituteClientId, clientState) } func ClientUpdate(ctx sdk.Context, codec codec.BinaryCodec, ibckeeper *ibckeeper.Keeper, subjectClientId string, substituteClientId string) error { @@ -67,10 +67,6 @@ func ClientUpdate(ctx sdk.Context, codec codec.BinaryCodec, ibckeeper *ibckeeper return sdkerrors.Wrapf(clienttypes.ErrClientNotFound, "substitute client with ID %s", substituteClientId) } - if subjectClientState.GetLatestHeight().GTE(substituteClientState.GetLatestHeight()) { - return sdkerrors.Wrapf(clienttypes.ErrInvalidHeight, "subject client state latest height is greater or equal to substitute client state latest height (%s >= %s)", subjectClientState.GetLatestHeight(), substituteClientState.GetLatestHeight()) - } - substituteClientStore := ibckeeper.ClientKeeper.ClientStore(ctx, substituteClientId) if status := ibckeeper.ClientKeeper.GetClientStatus(ctx, substituteClientState, substituteClientId); status != exported.Active {