From f0e2e67a7590bab04decba25ab056105538ec82c Mon Sep 17 00:00:00 2001 From: Sai Kumar <17549398+gsk967@users.noreply.github.com> Date: Tue, 23 Jul 2024 20:30:10 +0530 Subject: [PATCH] chore: upgrade handler for v6_6-rc1 for canon-4 network (#2574) * adding upgrade v6.6-rc1 for canon network * change the bid duration to 4 hours for canon network * fix:fix the lint --- app/upgrades.go | 9 ++++++--- x/auction/genesis.go | 4 +++- x/auction/msgs.go | 1 + 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/app/upgrades.go b/app/upgrades.go index 8577e29b16..81ddbb512d 100644 --- a/app/upgrades.go +++ b/app/upgrades.go @@ -54,11 +54,12 @@ func (app UmeeApp) RegisterUpgradeHandlers() { app.registerUpgrade6_4(upgradeInfo) app.registerUpgrade("v6.5", upgradeInfo, nil, nil, nil) - app.registerUpgrade6_6(upgradeInfo) + // this upgrade is only for testnet (canon-4) network + app.registerUpgrade6_6RC1(upgradeInfo) } -func (app *UmeeApp) registerUpgrade6_6(upgradeInfo upgradetypes.Plan) { - planName := "v6.6" +func (app *UmeeApp) registerUpgrade6_6RC1(upgradeInfo upgradetypes.Plan) { + planName := "v6.6-rc1" app.UpgradeKeeper.SetUpgradeHandler(planName, func(ctx sdk.Context, _ upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) { @@ -66,6 +67,7 @@ func (app *UmeeApp) registerUpgrade6_6(upgradeInfo upgradetypes.Plan) { // update leverage and metoken params to include burn auction fee share. lparams := app.LeverageKeeper.GetParams(ctx) + // TODO: need to check the reward auction fee params value for v6.6 lparams.RewardsAuctionFee = sdk.MustNewDecFromStr("0.01") if err := app.LeverageKeeper.SetParams(ctx, lparams); err != nil { return nil, err @@ -73,6 +75,7 @@ func (app *UmeeApp) registerUpgrade6_6(upgradeInfo upgradetypes.Plan) { mekeeper := app.MetokenKeeperB.Keeper(&ctx) meparams := mekeeper.GetParams() + // TODO: need to check the Rewards Auction Fee Factor params value for v6.6 meparams.RewardsAuctionFeeFactor = 10000 // 100% of fees goes to rewards auction if err := mekeeper.SetParams(meparams); err != nil { return nil, err diff --git a/x/auction/genesis.go b/x/auction/genesis.go index 867993839e..8157cb9bf3 100644 --- a/x/auction/genesis.go +++ b/x/auction/genesis.go @@ -10,7 +10,9 @@ import ( // DefaultGenesis creates a default genesis state func DefaultGenesis() *GenesisState { return &GenesisState{ - RewardsParams: RewardsParams{BidDuration: 14 * 24 * 3600}, // 14 days + // check bid duration value for v6.6 upgrade + // RewardsParams: RewardsParams{BidDuration: 14 * 24 * 3600}, // 14 days + RewardsParams: RewardsParams{BidDuration: 4 * 3600}, // 4 hours for bid duration this is only for canon-4 network RewardAuctionId: 0, RewardsAuctions: []RewardsKV{}, RewardsBids: []BidKV{}, diff --git a/x/auction/msgs.go b/x/auction/msgs.go index ed08668da6..6a06d3d928 100644 --- a/x/auction/msgs.go +++ b/x/auction/msgs.go @@ -19,6 +19,7 @@ const minBidDuration = 3600 // 1h in seconds // MinRewardsBid is the minimum increase of the previous bid or the minimum bid if it's the // first one. 50 UX = 50e6uumee +// TODO: need to check the value for v6.6 upgrade var MinRewardsBid = sdk.NewInt(50_000_000) //