Skip to content

Commit

Permalink
chore: finalise v1.4 migration (backport #156) (#157)
Browse files Browse the repository at this point in the history
Co-authored-by: Maximilian Breithecker <72022235+mbreithecker@users.noreply.github.com>
  • Loading branch information
mergify[bot] and mbreithecker authored Nov 17, 2023
1 parent 7659fa7 commit ee977d3
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 34 deletions.
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ An '!' indicates a state machine breaking change.
### Improvements

- ! (`x/bundles`) [#142](https://github.com/KYVENetwork/chain/pull/142) Halt the pool if a single validator has more than 50% voting power.
- ! (deps) [#33](https://github.com/KYVENetwork/chain/pull/33) Upgrade Cosmos SDK to [v0.47.5](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.47.5) ([`v0.47.5-kyve`](https://github.com/KYVENetwork/cosmos-sdk/releases/tag/v0.47.5-kyve-rc0)).
- ! (deps) [#33](https://github.com/KYVENetwork/chain/pull/33), [#152](https://github.com/KYVENetwork/chain/pull/152) Upgrade Cosmos SDK to [v0.47.6](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.47.6) ([`v0.47.6-kyve`](https://github.com/KYVENetwork/cosmos-sdk/releases/tag/v0.47.6-kyve-rc0)).

### Bug Fixes

- [#149](https://github.com/KYVENetwork/chain/pull/63) add bundles query version map to genesis import/export.

- (`x/delegation`) [#136](https://github.com/KYVENetwork/chain/pull/136) CLI: Use correct args amount for tx redelegate.

## [v1.3.1](https://github.com/KYVENetwork/chain/releases/tag/v1.3.1) - 2023-08-02

Expand Down
16 changes: 0 additions & 16 deletions app/upgrades/v1_4/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,3 @@ const TestnetChainID = "kaon-1"

// MainnetChainID is the Chain ID of the KYVE mainnet.
const MainnetChainID = "kyve-1"

// TestnetProposers is a mapping between Proposal ID and Proposer Address for
// the KYVE testnet (Kaon).
var TestnetProposers = map[uint64]string{
1: "kyve1qfnu3k5vwgfyzsaqe0w4ssqp99delgtg2qz0jc",
2: "kyve1qfnu3k5vwgfyzsaqe0w4ssqp99delgtg2qz0jc",
3: "kyve1qfnu3k5vwgfyzsaqe0w4ssqp99delgtg2qz0jc",
4: "kyve1qfnu3k5vwgfyzsaqe0w4ssqp99delgtg2qz0jc",
}

// MainnetProposers is a mapping between Proposal ID and Proposer Address for
// the KYVE mainnet.
var MainnetProposers = map[uint64]string{
1: "kyve1afu42029ujjcja4yry3rx6x43k33k88ep5wvjz",
2: "kyve1afu42029ujjcja4yry3rx6x43k33k88ep5wvjz",
}
41 changes: 25 additions & 16 deletions app/upgrades/v1_4/upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,12 @@ func CreateUpgradeHandler(
return vm, err
}

// INFO: We do not add the proposer addresses as suggested
// [here](https://github.com/cosmos/cosmos-sdk/blob/v0.47.0/UPGRADING.md#xgov), because there are usually
// one or two weeks between version finalisation and the actual mainnet upgrade. During this time
// new proposals might arise which would then not be covered by the migration.
// Therefore, this migration will be performed in the v1.5 upgrade.

// Migrate funders.
err = migrateFundersAndPools(ctx, cdc, poolKeeper, fundersKeeper, bankKeeper, accountKeeper)
if err != nil {
Expand Down Expand Up @@ -201,18 +207,20 @@ func migrateFundersAndPools(
})

poolKeeper.SetPool(ctx, poolTypes.Pool{
Id: oldPool.Id,
Name: oldPool.Name,
Runtime: oldPool.Runtime,
Logo: oldPool.Logo,
Config: oldPool.Config,
StartKey: oldPool.StartKey,
CurrentKey: oldPool.CurrentKey,
CurrentSummary: oldPool.CurrentSummary,
CurrentIndex: oldPool.CurrentIndex,
TotalBundles: oldPool.TotalBundles,
UploadInterval: oldPool.UploadInterval,
InflationShareWeight: oldPool.OperatingCost,
Id: oldPool.Id,
Name: oldPool.Name,
Runtime: oldPool.Runtime,
Logo: oldPool.Logo,
Config: oldPool.Config,
StartKey: oldPool.StartKey,
CurrentKey: oldPool.CurrentKey,
CurrentSummary: oldPool.CurrentSummary,
CurrentIndex: oldPool.CurrentIndex,
TotalBundles: oldPool.TotalBundles,
UploadInterval: oldPool.UploadInterval,
// Will be set equal to all pools and later be adjusted once the governance has decided
// on the values for each pool.
InflationShareWeight: 1_000_000,
MinDelegation: oldPool.MinDelegation,
MaxBundleSize: oldPool.MaxBundleSize,
Disabled: oldPool.Disabled,
Expand Down Expand Up @@ -244,10 +252,11 @@ func migrateFundersAndPools(
})
for _, funding := range funder.Fundings {
fundersKeeper.SetFunding(ctx, &fundersTypes.Funding{
FunderAddress: funder.Address,
PoolId: funding.PoolId,
Amount: funding.Amount,
AmountPerBundle: fundersTypes.DefaultMinFundingAmountPerBundle,
FunderAddress: funder.Address,
PoolId: funding.PoolId,
Amount: funding.Amount,
// 2 $KYVE is very similar to the current amount funders are paying per bundle right now.
AmountPerBundle: 2_000_000,
// Previous funders will not be considered, as there is no way to calculate this on chain.
// Although almost all funding was only provided by the Foundation itself.
TotalFunded: 0,
Expand Down

0 comments on commit ee977d3

Please sign in to comment.