-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
refactor!: Kerying migration #9222
Conversation
This pull request introduces 1 alert when merging bcd9f81 into a2911d0 - view on LGTM.com new alerts:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- pubkeys should be Any, not bytes, and we shouldn't cast to
"crypto/ed25519.PublicKey"
- A lot of information is already in pubkey (threshold, algo...), we don't need to duplicate anymore.
I'm also proposing a new model for representing *Info, using oneof.
…rotoUnmarshalKeyringEntry
f42ca2b
to
36311a3
Compare
ca7ff77
to
2421d02
Compare
@robert-zaremba Can you review it, please? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to update the proto definitions. Amaury has a good idea how to construct the KeyEntry. Moreover:
- the migration is not correct
- everywhere else (outside migration) we must use proto encoding
- we need to add tests
d82c38c
to
3a420d2
Compare
This pull request introduces 1 alert when merging b0685fe into c23f386 - view on LGTM.com new alerts:
|
d3de827
to
b0685fe
Compare
This pull request introduces 1 alert when merging 24f44e8 into c23f386 - view on LGTM.com new alerts:
|
This pull request introduces 1 alert when merging 8f239df into c23f386 - view on LGTM.com new alerts:
|
35009b3
to
7beebb2
Compare
This pull request introduces 1 alert when merging 8652e00 into 7040387 - view on LGTM.com new alerts:
|
a7c3b2e
to
8652e00
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
some initial comments
private/*.sh | ||
test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
private/*.sh | |
test |
@@ -118,8 +118,7 @@ func runAddCmd(ctx client.Context, cmd *cobra.Command, args []string, inBuf *buf | |||
} | |||
|
|||
if dryRun, _ := cmd.Flags().GetBool(flags.FlagDryRun); dryRun { | |||
// use in memory keybase | |||
kb = keyring.NewInMemory() | |||
kb = keyring.NewInMemory(ctx.Codec) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
kb = keyring.NewInMemory(ctx.Codec) | |
// use in memory keybase | |
kb = keyring.NewInMemory(ctx.Codec) |
@@ -1,50 +1,51 @@ | |||
package keyring |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how about doing like in module, and creating a crypto/keyring/migrations
package. Then all migration logic (including this legacyInfo) can go in that package.
@@ -0,0 +1,18 @@ | |||
syntax = "proto3"; | |||
package cosmos.crypto.hd; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
package cosmos.crypto.hd; | |
package cosmos.crypto.hd.v1; |
oneof item { | ||
Local local = 3; | ||
Ledger ledger = 4; | ||
Empty empty = 5; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are we using empty? I think using Multi
and Offline
would be clearer, even both of them are empty structs
superseded by #9695 |
<!-- 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 The draft PR #9222 Closes: #7108 <!-- Add a description of the changes that this PR introduces and the files that are the most critical to review. --> - implement proto definition for `Record` - rename `Info.go` to `legacyInfo.go` within `keyring` package - implement CLI `migrate` command that migrates all keys from legacyInfo to proto according to @robert-zaremba migration [algorithm](#9222) - remove legacy keybase entirely. - add `Migrate` and `MigrateAll` functions in `keyring.go` for single key and all keys migration - add tests - fix tests --- ### 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) - [x] 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 - [x] 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)
Description
This is draft PR
closes: #7108
Before we can merge this PR, please make sure that all the following items have been
checked off. If any of the checklist items are not applicable, please leave them but
write a little note why.
docs/
) or specification (x/<module>/spec/
)godoc
comments.Unreleased
section inCHANGELOG.md
Files changed
in the Github PR explorerCodecov Report
in the comment section below once CI passes