diff --git a/CHANGELOG.md b/CHANGELOG.md index 05dd8b5b018..1c5d3bcd041 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -64,6 +64,15 @@ Ref: https://keepachangelog.com/en/1.0.0/ * (gaia) bump [Liquidity](https://github.com/Gravity-Devs/liquidity) module to [v1.5.1](https://github.com/Gravity-Devs/liquidity/releases/tag/v1.5.1). * (gaia) bump [cosmos ledger](https://github.com/cosmos/ledger-go) to [v0.9.3](https://github.com/cosmos/ledger-go/releases/tag/v0.9.3) to fix issue [#1573](https://github.com/cosmos/gaia/issues/1573) - Ledger Nano S Plus not detected by gaiad. +## [v7.1.0] -2022-10-14 +* (gaia) bump [cosmos-sdk](https://github.com/cosmos/cosmos-sdk) to [v0.45.9](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.45.9) to fix the security vulnerability! See [CHANGELOG.md](https://github.com/cosmos/cosmos-sdk/blob/v0.45.9/CHANGELOG.md) for details. + +## [v7.0.3] -2022-08-03 +* (gaia) update go to 1.18. +* (gaia) bump [cosmos-sdk](https://github.com/cosmos/cosmos-sdk) to [v0.45.6](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.45.6). See [CHANGELOG.md](https://github.com/cosmos/cosmos-sdk/blob/v0.45.6/CHANGELOG.md) for details. +* (gaia) bump [Liquidity](https://github.com/Gravity-Devs/liquidity) module to [v1.5.1](https://github.com/Gravity-Devs/liquidity/releases/tag/v1.5.1). +* (gaia) bump [cosmos ledger](https://github.com/cosmos/ledger-go) to [v0.9.3](https://github.com/cosmos/ledger-go/releases/tag/v0.9.3) to fix issue [#1573](https://github.com/cosmos/gaia/issues/1573) - Ledger Nano S Plus not detected by gaiad. +* ## [v7.0.2] -2022-05-09 * (gaia) bump [cosmos-sdk](https://github.com/cosmos/cosmos-sdk) to [v0.45.4](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.45.4). See [CHANGELOG.md](https://github.com/cosmos/cosmos-sdk/blob/v0.45.4/CHANGELOG.md#v0454---2022-04-25) for details. diff --git a/app/upgrades/v8/upgrades.go b/app/upgrades/v8/upgrades.go index f053d537b70..32fc9a1d08a 100644 --- a/app/upgrades/v8/upgrades.go +++ b/app/upgrades/v8/upgrades.go @@ -9,6 +9,8 @@ import ( banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" icahosttypes "github.com/cosmos/ibc-go/v3/modules/apps/27-interchain-accounts/host/types" + icatypes "github.com/cosmos/ibc-go/v3/modules/apps/27-interchain-accounts/types" + ibcchanneltypes "github.com/cosmos/ibc-go/v3/modules/core/04-channel/types" "github.com/cosmos/gaia/v8/app/keepers" ) @@ -48,6 +50,45 @@ func FixBankMetadata(ctx sdk.Context, keepers *keepers.AppKeepers) error { return nil } +func QuicksilverFix(ctx sdk.Context, keepers *keepers.AppKeepers) error { + // Refund stuck coins from ica address + sourceAddress, err := sdk.AccAddressFromBech32("cosmos13dqvh4qtg4gzczuktgnw8gc2ewnwmhdwnctekxctyr4azz4dcyysecgq7e") + if err != nil { + return errors.New("invalid source address") + } + destinationAddress, err := sdk.AccAddressFromBech32("cosmos1jc24kwznud9m3mwqmcz3xw33ndjuufnghstaag") + if err != nil { + return errors.New("invalid destination address") + } + + // Get balance from stuck address and subtract 1 uatom sent by bad actor + sourceBalance := keepers.BankKeeper.GetBalance(ctx, sourceAddress, "uatom") + if sourceBalance.IsGTE(sdk.NewCoin("uatom", sdk.NewInt(1))) { + refundBalance := sourceBalance.SubAmount(sdk.NewInt(1)) + err = keepers.BankKeeper.SendCoins(ctx, sourceAddress, destinationAddress, sdk.NewCoins(refundBalance)) + if err != nil { + return errors.New("unable to refund coins") + } + } + + // Close channels + closeChannel(keepers, ctx, "channel-462") + closeChannel(keepers, ctx, "channel-463") + closeChannel(keepers, ctx, "channel-464") + closeChannel(keepers, ctx, "channel-465") + closeChannel(keepers, ctx, "channel-466") + + return nil +} + +func closeChannel(keepers *keepers.AppKeepers, ctx sdk.Context, channelID string) { + channel, found := keepers.IBCKeeper.ChannelKeeper.GetChannel(ctx, icatypes.PortID, channelID) + if found { + channel.State = ibcchanneltypes.CLOSED + keepers.IBCKeeper.ChannelKeeper.SetChannel(ctx, icatypes.PortID, channelID, channel) + } +} + func CreateUpgradeHandler( mm *module.Manager, configurator module.Configurator, @@ -68,6 +109,11 @@ func CreateUpgradeHandler( return vm, err } + err = QuicksilverFix(ctx, keepers) + if err != nil { + return vm, err + } + // Change hostParams allow_messages = [*] instead of whitelisting individual messages hostParams := icahosttypes.Params{ HostEnabled: true, diff --git a/tests/e2e/e2e_setup_test.go b/tests/e2e/e2e_setup_test.go index 11f2d230d9d..77b9570de36 100644 --- a/tests/e2e/e2e_setup_test.go +++ b/tests/e2e/e2e_setup_test.go @@ -58,7 +58,6 @@ const ( gas = 200000 govProposalBlockBuffer = 35 relayerAccountIndex = 0 - icaOwnerAccountIndex = 1 numberOfEvidences = 10 slashingShares int64 = 10000