From 5d9c02d7c0f17271bb4d7ee0055c09371c9907ad Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Sat, 31 Aug 2024 18:48:38 +0200 Subject: [PATCH] fix(x/consensus)!: update cons params parsing checks (backport #21484) (#21492) --- x/consensus/keeper/keeper.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/x/consensus/keeper/keeper.go b/x/consensus/keeper/keeper.go index 958d50072c..77de268293 100644 --- a/x/consensus/keeper/keeper.go +++ b/x/consensus/keeper/keeper.go @@ -120,6 +120,10 @@ func (k Keeper) paramCheck(ctx context.Context, consensusParams cmtproto.Consens paramsProto, err := k.ParamsStore.Get(ctx) if err == nil { + // initialize version params with zero value if not set + if paramsProto.Version == nil { + paramsProto.Version = &cmtproto.VersionParams{} + } params = cmttypes.ConsensusParamsFromProto(paramsProto) } else if errors.Is(err, collections.ErrNotFound) { params = cmttypes.ConsensusParams{}