Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: prepare v1.1.0 upgrade #20

Merged
merged 4 commits into from
Mar 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .github/mergify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
8 changes: 6 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
16 changes: 6 additions & 10 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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,
),
)

Expand All @@ -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 {
Expand Down
55 changes: 55 additions & 0 deletions app/upgrades/v1_1/constants.go
Original file line number Diff line number Diff line change
@@ -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
)
12 changes: 2 additions & 10 deletions app/upgrades/v1_rc1/store.go → app/upgrades/v1_1/store.go
Original file line number Diff line number Diff line change
@@ -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)
}
47 changes: 47 additions & 0 deletions app/upgrades/v1_1/upgrade.go
Original file line number Diff line number Diff line change
@@ -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)
}
3 changes: 0 additions & 3 deletions app/upgrades/v1_rc1/constants.go

This file was deleted.

44 changes: 0 additions & 44 deletions app/upgrades/v1_rc1/upgrade.go

This file was deleted.