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] multisig PubKey bombay-11 migration return empty sub-PubKeys #562

Closed
yun-yeo opened this issue Sep 24, 2021 · 0 comments · Fixed by #560
Closed

[BUG] multisig PubKey bombay-11 migration return empty sub-PubKeys #562

yun-yeo opened this issue Sep 24, 2021 · 0 comments · Fixed by #560
Assignees
Labels
bug Something isn't working

Comments

@yun-yeo
Copy link
Contributor

yun-yeo commented Sep 24, 2021

Describe the bug
When we migrate tequila-0004 exported genesis into bombay-11 genesis, cosmos@v040 migration is decoding tendermint/PubKeyMultisigThreshold to LegacyAminoPubkey,

type LegacyAminoPubKey struct {
	Threshold uint32       `protobuf:"varint,1,opt,name=threshold,proto3" json:"threshold,omitempty" yaml:"threshold"`
	PubKeys   []*types.Any `protobuf:"bytes,2,rep,name=public_keys,json=publicKeys,proto3" json:"public_keys,omitempty" yaml:"pubkeys"`
}

, which is registered in here and here.

However, the Any only supports proto style decoding. When we decode amino-json multisig PubKey, it only returns empty sub-PubKeys.

{
   "height":"5944561",
   "result":{
      "type":"core/Account",
      "value":{
         "address":"terra1gufrav46pnpwf03yu7xz76ylkmatsxtplrxnmc",
         "public_key":{
            "type":"tendermint/PubKeyMultisigThreshold",
            "value":{
               "threshold":"2",
               "pubkeys":[
                  
               ]
            }
         },
         "account_number":"55213",
         "sequence":"2"
      }
   }
}

To Reproduce
Migrate core@v0.4.6 state to core@v0.5.3

Context & versions
Make new LegacyAminoPubKey data type for migration and register this as tendermint/PubKeyMultisigThreshold codec to properly decode legacy multisig PubKey.

LegacyAminoPubKey struct {
   Threshold sdk.Int              `json:"threshold"`
   PubKeys   []cryptotypes.PubKey `json:"pubkeys"`
}

(if applicable) suggested solution
If you know the solution to the bug, let us know!

@yun-yeo yun-yeo added the bug Something isn't working label Sep 24, 2021
@yun-yeo yun-yeo self-assigned this Sep 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant