diff --git a/protocol/app/upgrades.go b/protocol/app/upgrades.go index b71b0bb5b1..41d69b8577 100644 --- a/protocol/app/upgrades.go +++ b/protocol/app/upgrades.go @@ -29,6 +29,7 @@ func (app *App) setupUpgradeHandlers() { v4_0_0.CreateUpgradeHandler( app.ModuleManager, app.configurator, + app.RatelimitKeeper, ), ) } diff --git a/protocol/app/upgrades/v4.0.0/upgrade.go b/protocol/app/upgrades/v4.0.0/upgrade.go index 5342e146b7..5e6e368826 100644 --- a/protocol/app/upgrades/v4.0.0/upgrade.go +++ b/protocol/app/upgrades/v4.0.0/upgrade.go @@ -7,17 +7,26 @@ import ( upgradetypes "cosmossdk.io/x/upgrade/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" + + ratelimitkeeper "github.com/dydxprotocol/v4-chain/protocol/x/ratelimit/keeper" + ratelimittypes "github.com/dydxprotocol/v4-chain/protocol/x/ratelimit/types" ) func CreateUpgradeHandler( mm *module.Manager, configurator module.Configurator, + rateLimitKeepr ratelimitkeeper.Keeper, ) upgradetypes.UpgradeHandler { return func(ctx context.Context, plan upgradetypes.Plan, vm module.VersionMap) (module.VersionMap, error) { sdkCtx := sdk.UnwrapSDKContext(ctx) sdkCtx.Logger().Info(fmt.Sprintf("Running %s Upgrade...", UpgradeName)) - // TODO(CORE-824): Initialize ratelimit module params to desired state. + if err := rateLimitKeepr.SetLimitParams( + sdkCtx, + ratelimittypes.DefaultUsdcRateLimitParams(), + ); err != nil { + panic(fmt.Sprintf("failed to set default x/ratelimit params: %s", err)) + } return mm.RunMigrations(ctx, configurator, vm) }