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

chore: upgrade handler for v6_6-rc1 for canon-4 network #2574

Merged
merged 4 commits into from
Jul 23, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions app/upgrades.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,25 +54,28 @@
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_6_rc1(upgradeInfo)
}

func (app *UmeeApp) registerUpgrade6_6(upgradeInfo upgradetypes.Plan) {
planName := "v6.6"
func (app *UmeeApp) registerUpgrade6_6_rc1(upgradeInfo upgradetypes.Plan) {

Check failure on line 61 in app/upgrades.go

View workflow job for this annotation

GitHub Actions / Run golangci-lint

var-naming: don't use underscores in Go names; method registerUpgrade6_6_rc1 should be registerUpgrade6_6Rc1 (revive)
planName := "v6.6-rc1"
gsk967 marked this conversation as resolved.
Show resolved Hide resolved

app.UpgradeKeeper.SetUpgradeHandler(planName,
func(ctx sdk.Context, _ upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) {
printPlanName(planName, ctx.Logger())

// 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
}

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
Expand Down
4 changes: 3 additions & 1 deletion x/auction/genesis.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
gsk967 marked this conversation as resolved.
Show resolved Hide resolved
RewardAuctionId: 0,
RewardsAuctions: []RewardsKV{},
RewardsBids: []BidKV{},
Expand Down
1 change: 1 addition & 0 deletions x/auction/msgs.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)

//
Expand Down
Loading