From a6122fba0cfa780f38387b051e93c3ea0d038c98 Mon Sep 17 00:00:00 2001 From: forcodedancing Date: Mon, 22 Jan 2024 14:51:38 +0800 Subject: [PATCH] fix: module consensus version is not correctly set when upgrade after state sync (#391) --- x/upgrade/keeper/keeper.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/x/upgrade/keeper/keeper.go b/x/upgrade/keeper/keeper.go index e4aa18f03b..ed2c7cdf79 100644 --- a/x/upgrade/keeper/keeper.go +++ b/x/upgrade/keeper/keeper.go @@ -324,6 +324,12 @@ func (k Keeper) HasHandler(name string) bool { // ApplyUpgrade will execute the handler associated with the Plan and mark the plan as done. func (k Keeper) ApplyUpgrade(ctx sdk.Context, plan types.Plan) { + err := k.InitUpgraded(ctx) + if err != nil { + ctx.Logger().Error("failed to init upgraded", "err", err) + return + } + initializer := k.upgradeInitializer[plan.Name] if initializer != nil {