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

v18.0.0 upgrade logic #2491

Merged
merged 8 commits into from
Apr 18, 2024
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -895,7 +895,7 @@ func (app *Evmos) setPostHandler() {
func (app *Evmos) BeginBlocker(ctx sdk.Context, req abci.RequestBeginBlock) abci.ResponseBeginBlock {
// Perform any scheduled forks before executing the modules logic

// app.ScheduleForkUpgrade(ctx)
app.ScheduleForkUpgrade(ctx)

return app.mm.BeginBlock(ctx, req)
}
Expand Down
6 changes: 5 additions & 1 deletion app/forks.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ import (

sdk "github.com/cosmos/cosmos-sdk/types"
upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types"
v17 "github.com/evmos/evmos/v17/app/upgrades/v17"
"github.com/evmos/evmos/v17/app/upgrades/v17"
"github.com/evmos/evmos/v17/app/upgrades/v18"
"github.com/evmos/evmos/v17/utils"
)

Expand All @@ -34,6 +35,9 @@ func (app *Evmos) ScheduleForkUpgrade(ctx sdk.Context) {
case v17.MainnetUpgradeHeight:
upgradePlan.Name = v17.UpgradeName
upgradePlan.Info = v17.UpgradeInfo
case v18.MainnetUpgradeHeight:
upgradePlan.Name = v18.UpgradeName
upgradePlan.Info = v18.UpgradeInfo
default:
// No-op
return
Expand Down
13 changes: 13 additions & 0 deletions app/upgrades/v18/constants.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// Copyright Tharsis Labs Ltd.(Evmos)
// SPDX-License-Identifier:ENCL-1.0(https://github.com/evmos/evmos/blob/main/LICENSE)

package v18

const (
// UpgradeName is the shared upgrade plan name for mainnet
UpgradeName = "v18.0.0"
// MainnetUpgradeHeight defines the Evmos mainnet block height on which the upgrade will take place
MainnetUpgradeHeight = 20_396_852
// UpgradeInfo defines the binaries that will be used for the upgrade
UpgradeInfo = `'{"binaries":{"darwin/amd64":"https://github.com/evmos/evmos/releases/download/v18.0.0/evmos_18.0.0_Darwin_arm64.tar.gz","darwin/x86_64":"https://github.com/evmos/evmos/releases/download/v18.0.0/evmos_18.0.0_Darwin_x86_64.tar.gz","linux/arm64":"https://github.com/evmos/evmos/releases/download/v18.0.0/evmos_18.0.0_Linux_arm64.tar.gz","linux/amd64":"https://github.com/evmos/evmos/releases/download/v18.0.0/evmos_18.0.0_Linux_amd64.tar.gz","windows/x86_64":"https://github.com/evmos/evmos/releases/download/v18.0.0/evmos_18.0.0_Windows_x86_64.zip"}}'`
)
21 changes: 21 additions & 0 deletions app/upgrades/v18/upgrades.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// Copyright Tharsis Labs Ltd.(Evmos)
// SPDX-License-Identifier:ENCL-1.0(https://github.com/evmos/evmos/blob/main/LICENSE)

package v18

import (
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/module"
upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types"
)

// CreateUpgradeHandler creates an SDK upgrade handler for v18
func CreateUpgradeHandler(
mm *module.Manager,
configurator module.Configurator,
) upgradetypes.UpgradeHandler {
return func(ctx sdk.Context, _ upgradetypes.Plan, vm module.VersionMap) (module.VersionMap, error) {
// Leave modules as-is to avoid running InitGenesis.
return mm.RunMigrations(ctx, configurator, vm)
}
}