Skip to content

Commit

Permalink
chore: release v2.3.0-mainnet (#660)
Browse files Browse the repository at this point in the history
## Description
This PR implements the changes needed in order to tag `v2.1.0-mainnet` of Desmos. Refer to #657 for major details.

---

### Author Checklist

*All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.*

I have...

- [x] included the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title
- [ ] added `!` to the type prefix if API or client breaking change
- [x] targeted the correct branch (see [PR Targeting](https://github.com/desmos-labs/desmos/blob/master/CONTRIBUTING.md#pr-targeting))
- [ ] provided a link to the relevant issue or specification
- [ ] followed the guidelines for [building modules](https://docs.cosmos.network/v0.44/building-modules/intro.html)
- [ ] included the necessary unit and integration [tests](https://github.com/desmos-labs/desmos/blob/master/CONTRIBUTING.md#testing)
- [x] added a changelog entry to `CHANGELOG.md`
- [ ] included comments for [documenting Go code](https://blog.golang.org/godoc)
- [ ] updated the relevant documentation or specification
- [ ] reviewed "Files changed" and left comments if necessary
- [ ] confirmed all CI checks have passed

### Reviewers Checklist

*All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.*

I have...

- [ ] confirmed the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title
- [ ] confirmed `!` in the type prefix if API or client breaking change
- [ ] confirmed all author checklist items have been addressed
- [ ] reviewed state machine logic
- [ ] reviewed API design and naming
- [ ] reviewed documentation is accurate
- [ ] reviewed tests and test coverage
- [ ] manually tested (if applicable)
  • Loading branch information
RiccardoM authored Nov 10, 2021
1 parent b0ee01f commit 90aa668
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 10 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/on-chain-upgrade.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 30
env:
GENESIS_DESMOS_VERSION: "v2.2.1-testnet"
GENESIS_URL: "https://raw.githubusercontent.com/RiccardoM/desmos-states/master/morpheus-apollo-2-2721215.json"
GENESIS_DESMOS_VERSION: "v1.0.1"
GENESIS_URL: "https://raw.githubusercontent.com/RiccardoM/desmos-states/master/desmos-mainnet-780000.json"
UPGRADE_NAME: "v2.3.0"
steps:
- name: Checkout 🛎️
Expand Down
32 changes: 29 additions & 3 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ import (
ibc "github.com/cosmos/ibc-go/modules/core"
ibcclientclient "github.com/cosmos/ibc-go/modules/core/02-client/client"
ibcclienttypes "github.com/cosmos/ibc-go/modules/core/02-client/types"
ibcconnectiontypes "github.com/cosmos/ibc-go/modules/core/03-connection/types"
porttypes "github.com/cosmos/ibc-go/modules/core/05-port/types"
ibchost "github.com/cosmos/ibc-go/modules/core/24-host"
ibckeeper "github.com/cosmos/ibc-go/modules/core/keeper"
Expand Down Expand Up @@ -99,6 +100,7 @@ import (
upgradekeeper "github.com/cosmos/cosmos-sdk/x/upgrade/keeper"

storetypes "github.com/cosmos/cosmos-sdk/store/types"
vestingtypes "github.com/cosmos/cosmos-sdk/x/auth/vesting/types"
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
crisistypes "github.com/cosmos/cosmos-sdk/x/crisis/types"
distrtypes "github.com/cosmos/cosmos-sdk/x/distribution/types"
Expand Down Expand Up @@ -689,8 +691,30 @@ func (app *DesmosApp) RegisterTendermintService(clientCtx client.Context) {
}

func (app *DesmosApp) registerUpgradeHandlers() {
app.upgradeKeeper.SetUpgradeHandler("v2.3.0", func(ctx sdk.Context, plan upgradetypes.Plan, vm module.VersionMap) (module.VersionMap, error) {
return app.mm.RunMigrations(ctx, app.configurator, vm)
app.upgradeKeeper.SetUpgradeHandler("v2.3.0", func(ctx sdk.Context, plan upgradetypes.Plan, _ module.VersionMap) (module.VersionMap, error) {
app.IBCKeeper.ConnectionKeeper.SetParams(ctx, ibcconnectiontypes.DefaultParams())
fromVM := map[string]uint64{
authtypes.ModuleName: 1,
banktypes.ModuleName: 1,
capabilitytypes.ModuleName: 1,
crisistypes.ModuleName: 1,
distrtypes.ModuleName: 1,
evidencetypes.ModuleName: 1,
govtypes.ModuleName: 1,
minttypes.ModuleName: 1,
paramstypes.ModuleName: 1,
slashingtypes.ModuleName: 1,
stakingtypes.ModuleName: 1,
upgradetypes.ModuleName: 1,
vestingtypes.ModuleName: 1,
ibchost.ModuleName: 1,
genutiltypes.ModuleName: 1,
ibctransfertypes.ModuleName: 1,

profilestypes.ModuleName: 1,
}

return app.mm.RunMigrations(ctx, app.configurator, fromVM)
})

upgradeInfo, err := app.upgradeKeeper.ReadUpgradeInfoFromDisk()
Expand All @@ -699,7 +723,9 @@ func (app *DesmosApp) registerUpgradeHandlers() {
}

if upgradeInfo.Name == "v2.3.0" && !app.upgradeKeeper.IsSkipHeight(upgradeInfo.Height) {
storeUpgrades := storetypes.StoreUpgrades{}
storeUpgrades := storetypes.StoreUpgrades{
Added: []string{authz.ModuleName, feegrant.ModuleName},
}

// configure store loader that checks if version == upgradeHeight and applies store upgrades
app.SetStoreLoader(upgradetypes.UpgradeStoreLoader(upgradeInfo.Height, &storeUpgrades))
Expand Down
8 changes: 4 additions & 4 deletions contrib/upgrade_testnet/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ version: '3'
services:
desmosnode0:
container_name: desmosnode0
image: "desmoslabs/desmos-cosmovisor:v2.0.0"
image: "desmoslabs/desmos-cosmovisor:v1.0.1"
command: "start"
ports:
- "26656-26657:26656-26657"
Expand All @@ -19,7 +19,7 @@ services:

desmosnode1:
container_name: desmosnode1
image: "desmoslabs/desmos-cosmovisor:v2.0.0"
image: "desmoslabs/desmos-cosmovisor:v1.0.1"
command: "start"
ports:
- "26666-26667:26656-26657"
Expand All @@ -35,7 +35,7 @@ services:

desmosnode2:
container_name: desmosnode2
image: "desmoslabs/desmos-cosmovisor:v2.0.0"
image: "desmoslabs/desmos-cosmovisor:v1.0.1"
command: "start"
ports:
- "26676-26677:26656-26657"
Expand All @@ -51,7 +51,7 @@ services:

desmosnode3:
container_name: desmosnode3
image: "desmoslabs/desmos-cosmovisor:v2.0.0"
image: "desmoslabs/desmos-cosmovisor:v1.0.1"
command: "start"
ports:
- "26686-26687:26656-26657"
Expand Down
2 changes: 1 addition & 1 deletion contrib/upgrade_testnet/submit_upgrade_proposal.sh
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ sleep 6s

echo ""
echo "===> Getting proposal id"
PROPOSAL_ID=$(desmos q tx $TX_HASH --output json 2>&1 | jq .logs[0].events[4].attributes[0].value -r)
PROPOSAL_ID=$(desmos q tx $TX_HASH --output json 2>&1 | jq .logs[0].events[2].attributes[0].value -r)
echo "Proposal ID: $PROPOSAL_ID"

echo ""
Expand Down

0 comments on commit 90aa668

Please sign in to comment.