diff --git a/.github/mergify.yml b/.github/mergify.yml index 2148caf3..91146c56 100644 --- a/.github/mergify.yml +++ b/.github/mergify.yml @@ -14,3 +14,11 @@ pull_request_rules: backport: branches: - release/v1.0.x + - name: backport patches to v1.1.x branch + conditions: + - base=main + - label=backport/v1.1.x + actions: + backport: + branches: + - release/v1.1.x diff --git a/CHANGELOG.md b/CHANGELOG.md index 27dee1ad..1b18e2ed 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,20 +14,24 @@ ## [Unreleased] +### Bug Fixes + +- [#20](https://github.com/KYVENetwork/chain/pull/20) Adjust investor vesting schedules from second funding round. + ## [v1.0.0](https://github.com/KYVENetwork/chain/releases/tag/v1.0.0) - 2023-03-10 Release for the KYVE network launch. ## [v1.0.0-rc1](https://github.com/KYVENetwork/chain/releases/tag/v1.0.0-rc1) - 2023-03-07 -Second `v1.0.0` release candidate for a Kaon network upgrade. +`v1.0.0` Release Candidate for a Kaon network upgrade. ### Improvements - (deps) [#3](https://github.com/KYVENetwork/chain/pull/3), [#7](https://github.com/KYVENetwork/chain/pull/7) Bump Cosmos SDK to [v0.46.10](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.46.10) ([`v0.46.10-kyve-rc0`](https://github.com/KYVENetwork/cosmos-sdk/releases/tag/v0.46.10-kyve-rc0)). - (deps) [#3](https://github.com/KYVENetwork/chain/pull/3) Bump IBC to [v6.1.0](https://github.com/cosmos/ibc-go/releases/tag/v6.1.0). - (deps) [#7](https://github.com/KYVENetwork/chain/pull/7) Bump Tendermint to [v0.34.26](https://github.com/informalsystems/tendermint/releases/tag/v0.34.26). -- (`x/team`) [#7](https://github.com/KYVENetwork/chain/pull/7) Switched to a co-minting approach. +- (`x/team`) [#7](https://github.com/KYVENetwork/chain/pull/7) Switch to a co-minting approach. ### State Machine Breaking diff --git a/app/app.go b/app/app.go index 0a4d969a..d5ec4ed4 100644 --- a/app/app.go +++ b/app/app.go @@ -7,7 +7,7 @@ import ( "os" "path/filepath" - v1rc1 "github.com/KYVENetwork/chain/app/upgrades/v1_rc1" + v11 "github.com/KYVENetwork/chain/app/upgrades/v1_1" "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/client" @@ -776,15 +776,11 @@ func NewKYVEApp( app.SetEndBlocker(app.EndBlocker) app.UpgradeKeeper.SetUpgradeHandler( - v1rc1.UpgradeName, - v1rc1.CreateUpgradeHandler( + v11.UpgradeName, + v11.CreateUpgradeHandler( app.mm, app.configurator, - app.BundlesKeeper, - app.appCodec, - app.keys[capabilitytypes.ModuleName], - app.CapabilityKeeper, - "", + app.AccountKeeper, ), ) @@ -793,8 +789,8 @@ func NewKYVEApp( panic(err) } - if upgradeInfo.Name == v1rc1.UpgradeName && !app.UpgradeKeeper.IsSkipHeight(upgradeInfo.Height) { - app.SetStoreLoader(v1rc1.CreateStoreLoader(upgradeInfo.Height)) + if upgradeInfo.Name == v11.UpgradeName && !app.UpgradeKeeper.IsSkipHeight(upgradeInfo.Height) { + app.SetStoreLoader(v11.CreateStoreLoader(upgradeInfo.Height)) } if loadLatest { diff --git a/app/upgrades/v1_1/constants.go b/app/upgrades/v1_1/constants.go new file mode 100644 index 00000000..1b47b53b --- /dev/null +++ b/app/upgrades/v1_1/constants.go @@ -0,0 +1,55 @@ +package v1_1 + +// UpgradeName is the name of this specific software upgrade used on-chain. +const UpgradeName = "v1.1.0" + +// MainnetChainID is the Chain ID of KYVE mainnet. +const MainnetChainID = "kyve-1" + +// InvestorAccounts is a list of accounts from our second funding round. +var InvestorAccounts = []string{ + "kyve1lmmvd34rn05uuxyzyajyht5eykksvas9gpz9ln", + "kyve10ucfmct7epngs7k3y77qrfpvjlsgfv2qqjytm4", + "kyve10we97qv6nujhx4eyzskw9p23s0qfnr5rq6uadp", + "kyve1z2d4fvcv8gf72zvdp23x6ryswywh0ptrjrkdhp", + "kyve1hae0u8jqfedpm7u5ng6k464xsxx32tvluqus8t", + "kyve1gcz2tjuel4w6q3v4ec92eu4nvey6fkgnyfcavm", + "kyve1matxpxlw4cna4xr77jaqqmst74j35puy0nf87f", + "kyve1946pdjdg6dqxfd5et4g3k6glkkvt8l9r5zqmp9", + "kyve1ag2mctnvgwqea7au0lh92xd4ncfysw8gs94r6v", + "kyve1e7rmpdrrnjeuypn733c9lt2vg2cvkj788pvtvr", + "kyve1ewy2yfxr8aw3v9jv2kjgt4z6tj9ved3a9qyjh2", + "kyve1u26sz6kydnmpr5zq6nureav4xhasak8nu5q8d8", + "kyve194rvm2rjxhe0gfnv2095z6k5tnyszxh9sdyzhy", + "kyve1j7p7jg4cuw9ww6zyjf2gvpjxgseffjuhaj4qcq", + "kyve1kcmdhddxnwvmnekrsejnr4n87xqyxq9tlqlyqn", + "kyve13agpsm0r2sr3wl0yqqfxdncl7mxla0nh6jteum", + "kyve1jp7tv4g2ks855spj4cppmdnx4jtx26h5u5y3x2", + "kyve1hlsaz3fegeze2mk6a9f7mh93y72edfmxuq2as7", + "kyve1a9zlytywun0sq8gxjkqhsc4knzm8zw3tprq4x8", + "kyve1uqm9n8a769nvwagz7gmpx5x52nmqn3z05gdrqe", + "kyve1tmjvtgv6a447dewwhd4j2ehqsm8x4d2ttm053n", + "kyve1xlg7pgptqujg72csewpx7rytr4f0sgngqrj3gu", + "kyve1th6v7yygmxsfm2x2uwsp582eagnrcrjywwaf7f", + "kyve159ufwz58rzkcvjk94wkxv5uyz877pwpf6h7xy2", + "kyve1z73v6kqhutr5fq5eem2256l5a45empuk0xkxxm", + "kyve17rdl2fadf82qx4r0wd2ehtqyy3qsazeqyun9dd", + "kyve1tp5uz49gvvl5kys795re80e3mf9w9up0yzhzq7", + "kyve18d8t7nj9jqyyrzr76wea38u7er3ljzzqqys5nl", + "kyve14l2zxt75ylgnumjevxxans20uapctnke698vq2", + "kyve17zfy84an63jqdmm632th7sp2tj2tmh82hrysn9", + "kyve1m297tfaystezangz7wrm9j5s55a3j8xz7g5nkp", + "kyve1yxt5u93an2as4csf2xqv8sw96rgm2y3rrzmj2g", + "kyve1eddmugm8k5eyaa96v7e3rwrw97040q8awmkwdy", + "kyve1uxarsjawzcu3xjvydnmlgmceq3eldx2yas2djf", + "kyve1rtx3akgca36lrevmzal050ehxpxnwtn9xv7taz", +} + +const ( + // StartTime - Sep 14th, 2023. + // This is 6-months after KYVE mainnet launch. + StartTime = 1694649600 + // EndTime - Sep 14th, 2025. + // This is 2 years after StartTime. + EndTime = 1757808000 +) diff --git a/app/upgrades/v1_rc1/store.go b/app/upgrades/v1_1/store.go similarity index 55% rename from app/upgrades/v1_rc1/store.go rename to app/upgrades/v1_1/store.go index 71cb8b81..2d95215a 100644 --- a/app/upgrades/v1_rc1/store.go +++ b/app/upgrades/v1_1/store.go @@ -1,21 +1,13 @@ -package v1rc1 +package v1_1 import ( "github.com/cosmos/cosmos-sdk/baseapp" storeTypes "github.com/cosmos/cosmos-sdk/store/types" - - // ICA Controller - icaControllerTypes "github.com/cosmos/ibc-go/v6/modules/apps/27-interchain-accounts/controller/types" - // Upgrade upgradeTypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" ) func CreateStoreLoader(upgradeHeight int64) baseapp.StoreLoader { - storeUpgrades := storeTypes.StoreUpgrades{ - Added: []string{ - icaControllerTypes.StoreKey, - }, - } + storeUpgrades := storeTypes.StoreUpgrades{} return upgradeTypes.UpgradeStoreLoader(upgradeHeight, &storeUpgrades) } diff --git a/app/upgrades/v1_1/upgrade.go b/app/upgrades/v1_1/upgrade.go new file mode 100644 index 00000000..b531b730 --- /dev/null +++ b/app/upgrades/v1_1/upgrade.go @@ -0,0 +1,47 @@ +package v1_1 + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/module" + + // Auth + authKeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper" + authTypes "github.com/cosmos/cosmos-sdk/x/auth/types" + vestingExported "github.com/cosmos/cosmos-sdk/x/auth/vesting/exported" + vestingTypes "github.com/cosmos/cosmos-sdk/x/auth/vesting/types" + // Upgrade + upgradeTypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" +) + +func CreateUpgradeHandler( + mm *module.Manager, + configurator module.Configurator, + accountKeeper authKeeper.AccountKeeper, +) upgradeTypes.UpgradeHandler { + return func(ctx sdk.Context, _ upgradeTypes.Plan, vm module.VersionMap) (module.VersionMap, error) { + if ctx.ChainID() == MainnetChainID { + for _, address := range InvestorAccounts { + AdjustInvestorVesting(ctx, accountKeeper, sdk.MustAccAddressFromBech32(address)) + } + } + + return mm.RunMigrations(ctx, configurator, vm) + } +} + +// AdjustInvestorVesting correctly adjusts the vesting schedules of investors +// from our second funding round. In genesis, the accounts were set up with an +// 18-month cliff instead of a 6-month cliff. +func AdjustInvestorVesting(ctx sdk.Context, accountKeeper authKeeper.AccountKeeper, address sdk.AccAddress) { + rawAccount := accountKeeper.GetAccount(ctx, address) + account := rawAccount.(vestingExported.VestingAccount) + + baseAccount := authTypes.NewBaseAccount( + account.GetAddress(), account.GetPubKey(), account.GetAccountNumber(), account.GetSequence(), + ) + updatedAccount := vestingTypes.NewContinuousVestingAccount( + baseAccount, account.GetOriginalVesting(), StartTime, EndTime, + ) + + accountKeeper.SetAccount(ctx, updatedAccount) +} diff --git a/app/upgrades/v1_rc1/constants.go b/app/upgrades/v1_rc1/constants.go deleted file mode 100644 index 4f74d1ce..00000000 --- a/app/upgrades/v1_rc1/constants.go +++ /dev/null @@ -1,3 +0,0 @@ -package v1rc1 - -const UpgradeName = "v1.0.0-rc1" diff --git a/app/upgrades/v1_rc1/upgrade.go b/app/upgrades/v1_rc1/upgrade.go deleted file mode 100644 index 1262dbea..00000000 --- a/app/upgrades/v1_rc1/upgrade.go +++ /dev/null @@ -1,44 +0,0 @@ -package v1rc1 - -import ( - "github.com/cosmos/cosmos-sdk/codec" - storeTypes "github.com/cosmos/cosmos-sdk/store/types" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/module" - - // Bundles - bundlesKeeper "github.com/KYVENetwork/chain/x/bundles/keeper" - bundlesTypes "github.com/KYVENetwork/chain/x/bundles/types" - // Capability - capabilityKeeper "github.com/cosmos/cosmos-sdk/x/capability/keeper" - // ICA Controller - v6 "github.com/cosmos/ibc-go/v6/modules/apps/27-interchain-accounts/controller/migrations/v6" - // Upgrade - upgradeTypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" -) - -func CreateUpgradeHandler( - mm *module.Manager, - configurator module.Configurator, - bundlesKeeper bundlesKeeper.Keeper, - cdc codec.BinaryCodec, - capabilityStoreKey *storeTypes.KVStoreKey, - capabilityKeeper *capabilityKeeper.Keeper, - moduleName string, -) upgradeTypes.UpgradeHandler { - return func(ctx sdk.Context, _ upgradeTypes.Plan, vm module.VersionMap) (module.VersionMap, error) { - if err := v6.MigrateICS27ChannelCapability(ctx, cdc, capabilityStoreKey, capabilityKeeper, moduleName); err != nil { - return nil, err - } - - ReinitialiseBundlesParams(ctx, bundlesKeeper) - - return mm.RunMigrations(ctx, configurator, vm) - } -} - -// ReinitialiseBundlesParams ... -func ReinitialiseBundlesParams(ctx sdk.Context, bundlesKeeper bundlesKeeper.Keeper) { - params := bundlesTypes.DefaultParams() - bundlesKeeper.SetParams(ctx, params) -}