diff --git a/app/app.go b/app/app.go index c4a32fad..81dbfcc9 100644 --- a/app/app.go +++ b/app/app.go @@ -6,6 +6,7 @@ import ( "fmt" runtimeservices "github.com/cosmos/cosmos-sdk/runtime/services" authcodec "github.com/cosmos/cosmos-sdk/x/auth/codec" + "github.com/notional-labs/composable/v6/app/upgrades/v6_5_1" "io" "os" "path/filepath" @@ -46,7 +47,6 @@ import ( "github.com/cosmos/cosmos-sdk/x/bank" "github.com/notional-labs/composable/v6/app/keepers" - "github.com/notional-labs/composable/v6/app/upgrades/v6_5_0" "github.com/notional-labs/composable/v6/app/upgrades/v7_0_1" // bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" @@ -152,7 +152,7 @@ var ( // https://github.com/CosmWasm/wasmd/blob/02a54d33ff2c064f3539ae12d75d027d9c665f05/x/wasm/internal/types/proposal.go#L28-L34 EnableSpecificProposals = "" - Upgrades = []upgrades.Upgrade{v6_5_0.Upgrade, v7_0_1.Upgrade} + Upgrades = []upgrades.Upgrade{v6_5_1.Upgrade, v7_0_1.Upgrade} Forks = []upgrades.Fork{} ) diff --git a/app/keepers/keepers.go b/app/keepers/keepers.go index c3b5ff41..347233b6 100644 --- a/app/keepers/keepers.go +++ b/app/keepers/keepers.go @@ -330,6 +330,17 @@ func (appKeepers *AppKeepers) InitNormalKeepers( authorityAddress, ) + appKeepers.RouterKeeper = routerkeeper.NewKeeper( + appCodec, + appKeepers.keys[routertypes.StoreKey], + appKeepers.TransferKeeper.Keeper, + appKeepers.IBCKeeper.ChannelKeeper, + &appKeepers.DistrKeeper, + appKeepers.BankKeeper, + &appKeepers.TransferMiddlewareKeeper, + govModAddress, + ) + appKeepers.TransferKeeper = customibctransferkeeper.NewKeeper( appCodec, appKeepers.keys[ibctransfertypes.StoreKey], appKeepers.GetSubspace(ibctransfertypes.ModuleName), @@ -342,17 +353,7 @@ func (appKeepers *AppKeepers) InitNormalKeepers( &appKeepers.IbcTransferMiddlewareKeeper, govModAddress, ) - - appKeepers.RouterKeeper = routerkeeper.NewKeeper( - appCodec, - appKeepers.keys[routertypes.StoreKey], - appKeepers.TransferKeeper.Keeper, - appKeepers.IBCKeeper.ChannelKeeper, - &appKeepers.DistrKeeper, - appKeepers.BankKeeper, - &appKeepers.TransferMiddlewareKeeper, - govModAddress, - ) + appKeepers.RouterKeeper.SetTransferKeeper(appKeepers.TransferKeeper) appKeepers.RatelimitKeeper = *ratelimitmodulekeeper.NewKeeper( appCodec, diff --git a/app/upgrades/v6_5_0/upgrade.go b/app/upgrades/v6_5_0/upgrade.go deleted file mode 100644 index 92ea1d65..00000000 --- a/app/upgrades/v6_5_0/upgrade.go +++ /dev/null @@ -1,51 +0,0 @@ -package v6_5_0 - -import ( - "context" - - sdkmath "cosmossdk.io/math" - upgradetypes "cosmossdk.io/x/upgrade/types" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/module" - - "github.com/cosmos/cosmos-sdk/codec" - "github.com/notional-labs/composable/v6/app/keepers" - "github.com/notional-labs/composable/v6/app/upgrades" - ibctransfermiddleware "github.com/notional-labs/composable/v6/x/ibctransfermiddleware/types" -) - -func CreateUpgradeHandler( - mm *module.Manager, - configurator module.Configurator, - _ upgrades.BaseAppParamManager, - _ codec.Codec, - keepers *keepers.AppKeepers, -) upgradetypes.UpgradeHandler { - return func(ctx context.Context, plan upgradetypes.Plan, vm module.VersionMap) (module.VersionMap, error) { - sdkctx := sdk.UnwrapSDKContext(ctx) - custommiddlewareparams := ibctransfermiddleware.DefaultGenesisState() - keepers.IbcTransferMiddlewareKeeper.SetParams(sdkctx, custommiddlewareparams.Params) - - // remove broken proposals - //BrokenProposals := [3]uint64{2, 6, 11} - //for _, proposal_id := range BrokenProposals { - // _, err := keepers.GovKeeper.Proposals.Get(sdkctx, proposal_id) - // if err != nil { - // keepers.GovKeeper.DeleteProposal(sdkctx, proposal_id) - // } - // - //} - - // burn extra ppica in escrow account - // this ppica is unused because it is a native token stored in escrow account - // it was unnecessarily minted to match pica escrowed on picasso to ppica minted - // in genesis, to make initial native ppica transferrable to picasso - amount, ok := sdkmath.NewIntFromString("1066669217167120000000") - if ok { - coins := sdk.Coins{sdk.NewCoin("ppica", amount)} - keepers.BankKeeper.SendCoinsFromAccountToModule(ctx, sdk.MustAccAddressFromBech32("centauri12k2pyuylm9t7ugdvz67h9pg4gmmvhn5vmvgw48"), "gov", coins) - keepers.BankKeeper.BurnCoins(ctx, "gov", coins) - } - return mm.RunMigrations(ctx, configurator, vm) - } -} diff --git a/app/upgrades/v6_5_0/constants.go b/app/upgrades/v6_5_1/constants.go similarity index 66% rename from app/upgrades/v6_5_0/constants.go rename to app/upgrades/v6_5_1/constants.go index 4ce8eca1..2189e34a 100644 --- a/app/upgrades/v6_5_0/constants.go +++ b/app/upgrades/v6_5_1/constants.go @@ -1,21 +1,20 @@ -package v6_5_0 +package v6_5_1 import ( store "cosmossdk.io/store/types" "github.com/notional-labs/composable/v6/app/upgrades" - ibctransfermiddleware "github.com/notional-labs/composable/v6/x/ibctransfermiddleware/types" ) const ( // UpgradeName defines the on-chain upgrade name for the composable upgrade. - UpgradeName = "v6_5_0" + UpgradeName = "v6_5_1" ) var Upgrade = upgrades.Upgrade{ UpgradeName: UpgradeName, CreateUpgradeHandler: CreateUpgradeHandler, StoreUpgrades: store.StoreUpgrades{ - Added: []string{ibctransfermiddleware.StoreKey}, + Added: []string{}, Deleted: []string{}, }, } diff --git a/app/upgrades/v6_5_1/upgrade.go b/app/upgrades/v6_5_1/upgrade.go new file mode 100644 index 00000000..4de00e4f --- /dev/null +++ b/app/upgrades/v6_5_1/upgrade.go @@ -0,0 +1,23 @@ +package v6_5_1 + +import ( + "context" + upgradetypes "cosmossdk.io/x/upgrade/types" + "github.com/cosmos/cosmos-sdk/types/module" + + "github.com/cosmos/cosmos-sdk/codec" + "github.com/notional-labs/composable/v6/app/keepers" + "github.com/notional-labs/composable/v6/app/upgrades" +) + +func CreateUpgradeHandler( + mm *module.Manager, + configurator module.Configurator, + _ upgrades.BaseAppParamManager, + _ codec.Codec, + keepers *keepers.AppKeepers, +) upgradetypes.UpgradeHandler { + return func(ctx context.Context, plan upgradetypes.Plan, vm module.VersionMap) (module.VersionMap, error) { + return mm.RunMigrations(ctx, configurator, vm) + } +} diff --git a/go.mod b/go.mod index 0a6d3ebb..21880a2c 100644 --- a/go.mod +++ b/go.mod @@ -15,7 +15,7 @@ require ( github.com/cosmos/ibc-apps/modules/async-icq/v8 v8.0.0 github.com/cosmos/ibc-go/modules/capability v1.0.0 github.com/cosmos/ibc-go/modules/light-clients/08-wasm v0.1.1-0.20231213092650-57fcdb9a9a9d - github.com/cosmos/ibc-go/v8 v8.0.0 + github.com/cosmos/ibc-go/v8 v8.1.1 github.com/gogo/protobuf v1.3.3 github.com/golang/protobuf v1.5.4 github.com/golangci/golangci-lint v1.52.0 @@ -364,9 +364,9 @@ replace ( // TODO: check wasm vm compatibility with grandpa contract github.com/CosmWasm/wasmvm => github.com/CosmWasm/wasmvm v1.5.2 - // github.com/cosmos/ibc-go/modules/light-clients/08-wasm => github.com/notional-labs/ibc-go/modules/light-clients/08-wasm v0.0.0-20240330020027-fa949b150972 + github.com/cometbft/cometbft => github.com/notional-labs/cometbft v0.38.6-fixed-len-vote-time-tag - // github.com/cosmos/ibc-go/modules/light-clients/08-wasm => /Users/kien6034/go/pkg/mod/github.com/cosmos/ibc-go/modules/light-clients/08-wasm@v0.1.1-0.20231213092650-57fcdb9a9a9d + github.com/cosmos/cosmos-sdk => github.com/notional-labs/cosmos-sdk v0.50.5-patch-validators-trim-tag // use cosmos-compatible protobufs github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alpha.regen.1 @@ -375,5 +375,6 @@ replace ( github.com/prometheus/common => github.com/prometheus/common v0.47.0 github.com/syndtr/goleveldb => github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 +// github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v8 => github.com/notional-labs/ibc-apps/middleware/packet-forward-middleware/v8 v8.0.0-0.20240327105252-f31a09121d57 ) diff --git a/go.sum b/go.sum index a3ad1bbd..320169f2 100644 --- a/go.sum +++ b/go.sum @@ -803,8 +803,6 @@ github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 h1:zuQyyAK github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06/go.mod h1:7nc4anLGjupUW/PeY5qiNYsdNXj7zopG+eqsS7To5IQ= github.com/coinbase/rosetta-sdk-go/types v1.0.0 h1:jpVIwLcPoOeCR6o1tU+Xv7r5bMONNbHU7MuEHboiFuA= github.com/coinbase/rosetta-sdk-go/types v1.0.0/go.mod h1:eq7W2TMRH22GTW0N0beDnN931DW0/WOI1R2sdHNHG4c= -github.com/cometbft/cometbft v0.38.6 h1:QSgpCzrGWJ2KUq1qpw+FCfASRpE27T6LQbfEHscdyOk= -github.com/cometbft/cometbft v0.38.6/go.mod h1:8rSPxzUJYquCN8uuBgbUHOMg2KAwvr7CyUw+6ukO4nw= github.com/cometbft/cometbft-db v0.11.0 h1:M3Lscmpogx5NTbb1EGyGDaFRdsoLWrUWimFEyf7jej8= github.com/cometbft/cometbft-db v0.11.0/go.mod h1:GDPJAC/iFHNjmZZPN8V8C1yr/eyityhi2W1hz2MGKSc= github.com/containerd/continuity v0.3.0 h1:nisirsYROK15TAMVukJOUyGJjz4BNQJBVsNvAXZJ/eg= @@ -819,8 +817,6 @@ github.com/cosmos/cosmos-db v1.0.2 h1:hwMjozuY1OlJs/uh6vddqnk9j7VamLv+0DBlbEXbAK github.com/cosmos/cosmos-db v1.0.2/go.mod h1:Z8IXcFJ9PqKK6BIsVOB3QXtkKoqUOp1vRvPT39kOXEA= github.com/cosmos/cosmos-proto v1.0.0-beta.4 h1:aEL7tU/rLOmxZQ9z4i7mzxcLbSCY48OdY7lIWTLG7oU= github.com/cosmos/cosmos-proto v1.0.0-beta.4/go.mod h1:oeB+FyVzG3XrQJbJng0EnV8Vljfk9XvTIpGILNU/9Co= -github.com/cosmos/cosmos-sdk v0.50.5 h1:MOEi+DKYgW67YaPgB+Pf+nHbD3V9S/ayitRKJYLfGIA= -github.com/cosmos/cosmos-sdk v0.50.5/go.mod h1:oV/k6GJgXV9QPoM2fsYDPPsyPBgQbdotv532O6Mz1OQ= github.com/cosmos/go-bip39 v1.0.0 h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY= github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4xuwvCdJw= github.com/cosmos/gogogateway v1.2.0 h1:Ae/OivNhp8DqBi/sh2A8a1D0y638GpL3tkmLQAiKxTE= @@ -838,8 +834,8 @@ github.com/cosmos/ibc-go/modules/capability v1.0.0 h1:r/l++byFtn7jHYa09zlAdSeevo github.com/cosmos/ibc-go/modules/capability v1.0.0/go.mod h1:D81ZxzjZAe0ZO5ambnvn1qedsFQ8lOwtqicG6liLBco= github.com/cosmos/ibc-go/modules/light-clients/08-wasm v0.1.1-0.20231213092650-57fcdb9a9a9d h1:F4mhR61RZU4KJ38n5CeZrnNINU/KxMfP1sKfk5fTlHA= github.com/cosmos/ibc-go/modules/light-clients/08-wasm v0.1.1-0.20231213092650-57fcdb9a9a9d/go.mod h1:u2FXNcSxzzn5IwjWBA51HKMwiYMRK6/G35VmSJULhP0= -github.com/cosmos/ibc-go/v8 v8.0.0 h1:QKipnr/NGwc+9L7NZipURvmSIu+nw9jOIWTJuDBqOhg= -github.com/cosmos/ibc-go/v8 v8.0.0/go.mod h1:C6IiJom0F3cIQCD5fKwVPDrDK9j/xTu563AWuOmXois= +github.com/cosmos/ibc-go/v8 v8.1.1 h1:N2+GA86yACcXnKWCKtqdbCwP0/Eo8pH79+6e7TicULU= +github.com/cosmos/ibc-go/v8 v8.1.1/go.mod h1:o1ipS95xpdjqNcB8Drq0eI3Sn4FRLigjll42ec1ECuU= github.com/cosmos/ics23/go v0.10.0 h1:iXqLLgp2Lp+EdpIuwXTYIQU+AiHj9mOC2X9ab++bZDM= github.com/cosmos/ics23/go v0.10.0/go.mod h1:ZfJSmng/TBNTBkFemHHHj5YY7VAU/MBU980F4VU1NG0= github.com/cosmos/keyring v1.1.7-0.20210622111912-ef00f8ac3d76 h1:DdzS1m6o/pCqeZ8VOAit/gyATedRgjvkVI+UCrLpyuU= @@ -1403,6 +1399,10 @@ github.com/nishanths/exhaustive v0.9.5 h1:TzssWan6orBiLYVqewCG8faud9qlFntJE30ACp github.com/nishanths/exhaustive v0.9.5/go.mod h1:IbwrGdVMizvDcIxPYGVdQn5BqWJaOwpCvg4RGb8r/TA= github.com/nishanths/predeclared v0.2.2 h1:V2EPdZPliZymNAn79T8RkNApBjMmVKh5XRpLm/w98Vk= github.com/nishanths/predeclared v0.2.2/go.mod h1:RROzoN6TnGQupbC+lqggsOlcgysk3LMK/HI84Mp280c= +github.com/notional-labs/cometbft v0.38.6-fixed-len-vote-time-tag h1:emP5WMt3WNihhZcDXMKZ3GLgYYQqqLgHLjOmNRiwFXc= +github.com/notional-labs/cometbft v0.38.6-fixed-len-vote-time-tag/go.mod h1:8rSPxzUJYquCN8uuBgbUHOMg2KAwvr7CyUw+6ukO4nw= +github.com/notional-labs/cosmos-sdk v0.50.5-patch-validators-trim-tag h1:lnMn2O2zjUvLbWJuKY3yXtrkVzCXQ7r1/oS/tgCsyjU= +github.com/notional-labs/cosmos-sdk v0.50.5-patch-validators-trim-tag/go.mod h1:oV/k6GJgXV9QPoM2fsYDPPsyPBgQbdotv532O6Mz1OQ= github.com/nunnatsa/ginkgolinter v0.9.0 h1:Sm0zX5QfjJzkeCjEp+t6d3Ha0jwvoDjleP9XCsrEzOA= github.com/nunnatsa/ginkgolinter v0.9.0/go.mod h1:FHaMLURXP7qImeH6bvxWJUpyH+2tuqe5j4rW1gxJRmI= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A=