Skip to content

Commit

Permalink
update max validator to 45
Browse files Browse the repository at this point in the history
  • Loading branch information
hoank101 committed Aug 1, 2024
1 parent ec62714 commit 510f753
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
1 change: 1 addition & 0 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -1197,6 +1197,7 @@ func (app *MigalooApp) setupUpgradeHandlers() {
v421.UpgradeName,
v421.CreateUpgradeHandler(
app.mm,
app.StakingKeeper,
app.configurator,
),
)
Expand Down
8 changes: 8 additions & 0 deletions app/upgrades/v4_2_1/upgrades.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,23 @@ package v4
import (
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/module"
stakingKeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper"
upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types"
)

// CreateUpgradeHandler that migrates the chain from v4.2.0 to v4.2.1
func CreateUpgradeHandler(
mm *module.Manager,
sk *stakingKeeper.Keeper,
configurator module.Configurator,
) upgradetypes.UpgradeHandler {
return func(ctx sdk.Context, _ upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) {
stakingParams := sk.GetParams(ctx)
stakingParams.MaxValidators = 45
err := sk.SetParams(ctx, stakingParams)
if err != nil {
panic(err)
}
return mm.RunMigrations(ctx, configurator, fromVM)
}
}
4 changes: 2 additions & 2 deletions scripts/upgrade_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
# the upgrade is a fork, "true" otherwise
FORK=${FORK:-"false"}

OLD_VERSION=v4.1.3
OLD_VERSION=v4.2.0
UPGRADE_WAIT=${UPGRADE_WAIT:-20}
HOME=mytestnet
ROOT=$(pwd)
DENOM=uwhale
CHAIN_ID=localmigaloo
SOFTWARE_UPGRADE_NAME="v4.2.0"
SOFTWARE_UPGRADE_NAME="v4.2.1"
ADDITIONAL_PRE_SCRIPTS=${ADDITIONAL_PRE_SCRIPTS:-""}
ADDITIONAL_AFTER_SCRIPTS=${ADDITIONAL_AFTER_SCRIPTS:-""}

Expand Down

0 comments on commit 510f753

Please sign in to comment.