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

Keyring migration doesn't migrate key names correctly #10219

Closed
4 tasks
amaury1093 opened this issue Sep 23, 2021 · 0 comments · Fixed by #10328
Closed
4 tasks

Keyring migration doesn't migrate key names correctly #10219

amaury1093 opened this issue Sep 23, 2021 · 0 comments · Fixed by #10328
Assignees
Labels
C:Keys Keybase, KMS and HSMs T:Bug

Comments

@amaury1093
Copy link
Contributor

Summary of Bug

After keyring migration, we can't keys show by name anymore

Version

6e70d25, though it's probably after #9695

Steps to Reproduce

  • ./build/simd is a master node built with above commit hash
  • ./build/v042_node is a v0.42.9 node

Add a key on v042

➜  cosmos-sdk git:(master) ./build/v042_node keys add jack --keyring-backend test

- name: jack
  type: local
  address: cosmos15zz5edm79ga3jr6qd2sq5jsthcgutde5emtnhh
  pubkey: cosmospub1addwnpepq2j7xj9esq378vx8yjgrc3k93kkdaetlsn94kjkyj6xzmkf8aggaxpz4as2
# snip

Make sure the key shows up

➜  cosmos-sdk git:(master) ./build/v042_node keys show jack --keyring-backend test
- name: jack
  type: local
  address: cosmos15zz5edm79ga3jr6qd2sq5jsthcgutde5emtnhh
  pubkey: cosmospub1addwnpepq2j7xj9esq378vx8yjgrc3k93kkdaetlsn94kjkyj6xzmkf8aggaxpz4as2
# snip

Run the same command with the master keyring

➜  cosmos-sdk git:(master) ./build/simd keys show jack --keyring-backend test
Error: jack is not a valid name or address: decoding bech32 failed: invalid bech32 string length 4
Usage:
  simd keys show [name_or_address [name_or_address...]] [flags]

Notes:

  1. ./build/simd keys show jack.info --keyring-backend test works and shows the correct key. I think we might have forgotten to migrate the name itself
  2. ./build/simd keys list --keyring-backend test also works and shows jack's key.

For Admin Use

  • Not duplicate issue
  • Appropriate labels applied
  • Appropriate contributors tagged
  • Contributor assigned/self-assigned
@amaury1093 amaury1093 added T:Bug C:Keys Keybase, KMS and HSMs labels Sep 23, 2021
@mergify mergify bot closed this as completed in #10328 Oct 26, 2021
mergify bot pushed a commit that referenced this issue Oct 26, 2021
<!--
The default pull request template is for types feat, fix, or refactor.
For other templates, add one of the following parameters to the url:
- template=docs.md
- template=other.md
-->

## Description

Closes: #10219 

Migrate key names correctly when migrating from v0.42.9 to master keyring

---

### Author Checklist

*All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.*

I have...

- [ ] included the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title
- [ ] added `!` to the type prefix if API or client breaking change
- [ ] targeted the correct branch (see [PR Targeting](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#pr-targeting))
- [ ] provided a link to the relevant issue or specification
- [ ] followed the guidelines for [building modules](https://github.com/cosmos/cosmos-sdk/blob/master/docs/building-modules)
- [ ] included the necessary unit and integration [tests](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#testing)
- [ ] added a changelog entry to `CHANGELOG.md`
- [ ] included comments for [documenting Go code](https://blog.golang.org/godoc)
- [ ] updated the relevant documentation or specification
- [ ] reviewed "Files changed" and left comments if necessary
- [ ] confirmed all CI checks have passed

### Reviewers Checklist

*All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.*

I have...

- [ ] confirmed the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title
- [ ] confirmed `!` in the type prefix if API or client breaking change
- [ ] confirmed all author checklist items have been addressed 
- [ ] reviewed state machine logic
- [ ] reviewed API design and naming
- [ ] reviewed documentation is accurate
- [ ] reviewed tests and test coverage
- [ ] manually tested (if applicable)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C:Keys Keybase, KMS and HSMs T:Bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants