Skip to content

crypto / encoding: type multisig.PubKeyMultisigThreshold is not assignable to type crypto.PubKey #3101

@liamsi

Description

@liamsi

Tendermint version :
current develop branch

What happened:
A marshalled PubKeyMultisigThreshold does not unmarshall to a crypto.PubKey.

What you expected to happen:

Like the other implementations of crypto.PubKey, PubKeyMultisigThreshold should be unmarshall into its interface. This is used for instance in the sdk via cosmos-sdk/client/keys.GetKeyInfo which decodes into a localInfo: https://github.com/cosmos/cosmos-sdk/blob/03bdd3f870946b996da1e316a5ee05560e508ec6/crypto/keys/types.go#L94-L96

Have you tried the latest version: yes

How to reproduce it (as minimally and precisely as possible):
Failing test in 8eef647 see
https://circleci.com/gh/tendermint/tendermint/39785#tests/containers/3

Logs (paste a small part showing an error (< 10 lines) or link a pastebin, gist, etc. containing more of the log file):

Click to expand!
panic: reflect.Set: value of type multisig.PubKeyMultisigThreshold is not assignable to type crypto.PubKey

goroutine 1 [running]:
reflect.Value.assignTo(0xdd9500, 0xc00000c940, 0x199, 0xeaed45, 0xb, 0xdc0640, 0xc00000c8d0, 0x0, 0x7, 0xc00003a4e0)
	/usr/local/go/src/reflect/value.go:2269 +0x44c
reflect.Value.Set(0xdc0640, 0xc00000c8d0, 0x194, 0xdd9500, 0xc00000c940, 0x199)
	/usr/local/go/src/reflect/value.go:1403 +0xa7
github.com/cosmos/cosmos-sdk/vendor/github.com/tendermint/go-amino.(*Codec).decodeReflectBinaryInterface(0xc00014c540, 0xc00020a184, 0x0, 0x0, 0xc0001c7d10, 0xdc0640, 0xc00000c8d0, 0x194, 0xceaa11, 0x6, ...)
	/home/alessio/work/tendermint/src/github.com/cosmos/cosmos-sdk/vendor/github.com/tendermint/go-amino/binary-decode.go:381 +0x4e1
github.com/cosmos/cosmos-sdk/vendor/github.com/tendermint/go-amino.(*Codec).decodeReflectBinary(0xc00014c540, 0xc000a0a1c0, 0x7f, 0x80, 0xc0001c7d10, 0xdc0640, 0xc00000c8d0, 0x194, 0xceaa11, 0x6, ...)
	/home/alessio/work/tendermint/src/github.com/cosmos/cosmos-sdk/vendor/github.com/tendermint/go-amino/binary-decode.go:86 +0x18f8
github.com/cosmos/cosmos-sdk/vendor/github.com/tendermint/go-amino.(*Codec).decodeReflectBinaryStruct(0xc00014c540, 0xc000a0a1c0, 0x7f, 0x80, 0xc0009b8a50, 0xe23ac0, 0xc00000c8c0, 0x199, 0x0, 0x0, ...)
	/home/alessio/work/tendermint/src/github.com/cosmos/cosmos-sdk/vendor/github.com/tendermint/go-amino/binary-decode.go:802 +0x853
github.com/cosmos/cosmos-sdk/vendor/github.com/tendermint/go-amino.(*Codec).decodeReflectBinary(0xc00014c540, 0xc000a0a1b6, 0x89, 0x8a, 0xc0009b8a50, 0xe23ac0, 0xc00000c8c0, 0x199, 0x0, 0x0, ...)
	/home/alessio/work/tendermint/src/github.com/cosmos/cosmos-sdk/vendor/github.com/tendermint/go-amino/binary-decode.go:113 +0x1bae
github.com/cosmos/cosmos-sdk/vendor/github.com/tendermint/go-amino.(*Codec).decodeReflectBinaryInterface(0xc00014c540, 0xc000a0a1b6, 0x89, 0x8a, 0xc0009b85a0, 0xdbfac0, 0xc00007e510, 0x194, 0x0, 0x0, ...)
	/home/alessio/work/tendermint/src/github.com/cosmos/cosmos-sdk/vendor/github.com/tendermint/go-amino/binary-decode.go:363 +0x3c4
github.com/cosmos/cosmos-sdk/vendor/github.com/tendermint/go-amino.(*Codec).decodeReflectBinary(0xc00014c540, 0xc000a0a1b2, 0x8d, 0x8e, 0xc0009b85a0, 0xdbfac0, 0xc00007e510, 0x194, 0x0, 0x0, ...)
	/home/alessio/work/tendermint/src/github.com/cosmos/cosmos-sdk/vendor/github.com/tendermint/go-amino/binary-decode.go:86 +0x18f8
github.com/cosmos/cosmos-sdk/vendor/github.com/tendermint/go-amino.(*Codec).UnmarshalBinaryBare(0xc00014c540, 0xc000a0a1b2, 0x8d, 0x8e, 0xd15a40, 0xc00007e510, 0x7ff6182c66c0, 0x0)
	/home/alessio/work/tendermint/src/github.com/cosmos/cosmos-sdk/vendor/github.com/tendermint/go-amino/amino.go:344 +0x208
github.com/cosmos/cosmos-sdk/vendor/github.com/tendermint/go-amino.(*Codec).UnmarshalBinaryLengthPrefixed(0xc00014c540, 0xc000a0a1b0, 0x8d, 0x90, 0xd15a40, 0xc00007e510, 0x0, 0xd45700)
	/home/alessio/work/tendermint/src/github.com/cosmos/cosmos-sdk/vendor/github.com/tendermint/go-amino/amino.go:253 +0x162
github.com/cosmos/cosmos-sdk/crypto/keys.readInfo(0xc000a0a1b0, 0x8f, 0x90, 0x10, 0xc000a0a1b0, 0x8f, 0x90)
	/home/alessio/work/tendermint/src/github.com/cosmos/cosmos-sdk/crypto/keys/types.go:191 +0x7a
github.com/cosmos/cosmos-sdk/crypto/keys.dbKeybase.Get(0x1344ee0, 0xc0000c2268, 0x7ffc3a8f2f59, 0x7, 0x13467c0, 0xc00007e4b0, 0x0, 0x0)
	/home/alessio/work/tendermint/src/github.com/cosmos/cosmos-sdk/crypto/keys/keybase.go:224 +0x109
github.com/cosmos/cosmos-sdk/client/keys.GetKeyInfo(0x7ffc3a8f2f59, 0x7, 0x727115, 0xc000acde00, 0xc000a6bad8, 0x0)
	/home/alessio/work/tendermint/src/github.com/cosmos/cosmos-sdk/client/keys/utils.go:35 +0x78
github.com/cosmos/cosmos-sdk/client/keys.runShowCmd(0xc000ae2780, 0xc000ac8a80, 0x1, 0x1, 0x0, 0x0)
	/home/alessio/work/tendermint/src/github.com/cosmos/cosmos-sdk/client/keys/show.go:67 +0x5e
github.com/cosmos/cosmos-sdk/vendor/github.com/spf13/cobra.(*Command).execute(0xc000ae2780, 0xc000ac8a50, 0x1, 0x1, 0xc000ae2780, 0xc000ac8a50)
	/home/alessio/work/tendermint/src/github.com/cosmos/cosmos-sdk/vendor/github.com/spf13/cobra/command.go:762 +0x473
github.com/cosmos/cosmos-sdk/vendor/github.com/spf13/cobra.(*Command).ExecuteC(0xc0001c2500, 0x6, 0xc000ae0f00, 0x0)
	/home/alessio/work/tendermint/src/github.com/cosmos/cosmos-sdk/vendor/github.com/spf13/cobra/command.go:852 +0x2fd
github.com/cosmos/cosmos-sdk/vendor/github.com/spf13/cobra.(*Command).Execute(0xc0001c2500, 0xeaa4b3, 0x6)
	/home/alessio/work/tendermint/src/github.com/cosmos/cosmos-sdk/vendor/github.com/spf13/cobra/command.go:800 +0x2b
github.com/cosmos/cosmos-sdk/vendor/github.com/tendermint/tendermint/libs/cli.Executor.Execute(0xc0001c2500, 0x126b568, 0x0, 0xc000955380)
	/home/alessio/work/tendermint/src/github.com/cosmos/cosmos-sdk/vendor/github.com/tendermint/tendermint/libs/cli/setup.go:89 +0x4e
main.main()
	/home/alessio/work/tendermint/src/github.com/cosmos/cosmos-sdk/cmd/gaia/cmd/gaiacli/main.go:99 +0x50c

Anything else we need to know:
ref: #3100

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions