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

[Bug]: Migration v0.46.X -> v0.47.X new proposal messages migration error #17782

Closed
1 task done
dawid-kruk opened this issue Sep 18, 2023 · 1 comment
Closed
1 task done
Labels
S:needs more info This bug can't be addressed until more information is provided by the reporter.

Comments

@dawid-kruk
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

What happened?

When a chain in the v0.46.X version implemented the module parameters in the kv store and therefore added custom messages to change the parameters, the migration of the Cosmos SDK in the gov module to the v4 version does not occur. This is probably related to the fact that the package names have changed according to this information: cosmos-sdk migration protobuf and the proposal voting period migration does not work due to the lack of registered types:

func migrateProposalVotingPeriod(ctx sdk.Context, storeKey storetypes.StoreKey, cdc codec.BinaryCodec) error {
    store := ctx.KVStore(storeKey)
    propStore := prefix.NewStore(store, v1.ProposalsKeyPrefix)

    iter := propStore.Iterator(nil, nil)
    defer iter.Close()

    for ; iter.Valid(); iter.Next() {
        var prop govv1.Proposal
        err := cdc.Unmarshal(iter.Value(), &prop)
        if err != nil {
        return err
    }

    if prop.Status == govv1.StatusVotingPeriod {
         store.Set(VotingPeriodProposalKey(prop.Id), []byte{1})
    }
    }

return nil
}

Error message:

1:21PM INF migrating module gov from version 3 to version 4 module=server
panic: no concrete type registered for type URL /xxxxx.xxx.xxx.MsgUpdateMintersParams against interface *types.Msg

Cosmos SDK Version

v0.46, v0.47

How to reproduce?

  1. In version v0.46.X add parameters that are stored in kv store to a given module.
  2. Add custom message do change this parameters.
  3. Start the chain and execute parameter change on this module
  4. Submit software upgrade to v0.47.X
  5. Perform the upgrade (when upgrading there should be an error after log "INF migrating module gov from version 3 to version 4 "
@julienrbrt
Copy link
Member

Can you show us how you have registered your message MsgUpdateMintersParams?
It seems like your modules does not register its messages.

// RegisterInterfaces registers the interfaces types with the interface registry
func RegisterInterfaces(registry types.InterfaceRegistry) {
	registry.RegisterImplementations((*sdk.Msg)(nil),
		&MsgUpdateMintersParams{},
	)
}

@julienrbrt julienrbrt added S:needs more info This bug can't be addressed until more information is provided by the reporter. and removed T:Bug labels Sep 18, 2023
@cosmos cosmos locked and limited conversation to collaborators Sep 18, 2023
@julienrbrt julienrbrt converted this issue into a discussion Sep 18, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
S:needs more info This bug can't be addressed until more information is provided by the reporter.
Projects
None yet
Development

No branches or pull requests

2 participants