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

R4R: Refactor Bech32 Prefixes and Nomenclature of Validator Pubkey and Operator #2251

Merged
merged 10 commits into from
Sep 8, 2018

Conversation

alexanderbez
Copy link
Contributor

@alexanderbez alexanderbez commented Sep 6, 2018

  • Update Bech32 prefixes
  • Updated staking state spec and other docs to reflect new changes

closes: #2221


  • Targeted PR against correct branch (see CONTRIBUTING.md)

  • Linked to github-issue with discussion and accepted design OR link to spec that describes this work.

  • Wrote tests

  • Updated relevant documentation (docs/)

  • Added entries in PENDING.md with issue #

  • rereviewed Files changed in the github PR explorer


For Admin Use:

  • Added appropriate labels to PR (ex. wip, ready-for-review, docs)
  • Reviewers Assigned
  • Squashed all commits, uses message "Merge pull request #XYZ: [title]" (coding standards)

@alexanderbez alexanderbez changed the title Refactor Bech32 Prefixes and Nomenclature of Validator Pubkey and Operator R4R: Refactor Bech32 Prefixes and Nomenclature of Validator Pubkey and Operator Sep 6, 2018
@alexanderbez alexanderbez added T: API Breaking Breaking changes that impact APIs and the SDK only (not state machine). ready-for-review labels Sep 6, 2018
@codecov
Copy link

codecov bot commented Sep 6, 2018

Codecov Report

Merging #2251 into develop will not change coverage.
The diff coverage is 77.41%.

@@           Coverage Diff            @@
##           develop    #2251   +/-   ##
========================================
  Coverage    63.73%   63.73%           
========================================
  Files          140      140           
  Lines         8642     8642           
========================================
  Hits          5508     5508           
  Misses        2755     2755           
  Partials       379      379

@ValarDragon
Copy link
Contributor

This is going to break all existing pubkeys / have impacts on people who've setup their accounts on their ledger right? Can we make a script to update your pubkey and address from the different bech32 formats as well.

@alexanderbez
Copy link
Contributor Author

@ValarDragon I'm not totally sure what the Ledger stores. It might be the case this does not break the Ledger support as the underlying bytes of the address and key pairs are still the same. But let me test this.

@alexanderbez
Copy link
Contributor Author

Confirmed keys list and send are still working.

@fedekunze
Copy link
Collaborator

@cosmos/cosmos-ui FYI breaking changes

@cwgoes
Copy link
Contributor

cwgoes commented Sep 7, 2018

@ValarDragon I'm not totally sure what the Ledger stores. It might be the case this does not break the Ledger support as the underlying bytes of the address and key pairs are still the same. But let me test this.

Any changes to bech32 encoding will not break any underlying private/public keys (although it might break databases which store a bech32ified string and expect a particular bech32 prefix).

Copy link
Contributor

@cwgoes cwgoes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mostly LGTM, quick comments.

foundVal = true
}
require.True(t, foundVal, "pkBech %v, operator %v", pkBech, validators[0].Operator)
require.True(t, foundVal, "pkBech %v, operator %v", pkBech, validators[0].ConsPubKey)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why does this change the printf? The error is wrong now

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bad copy-pasta job -- good catch.

PubKey:
type: string
description: bech32 encoded public key
example: cosmospub:zgnkwr7eyyv643dllwfpdwensmgdtz89yu73zq
ValidatorPubKey:
type: string
description: bech32 encoded public key
example: cosmosvalpub:zgnkwr7eyyv643dllwfpdwensmgdtz89yu73zq
example: cosmosvaloperpub:zgnkwr7eyyv643dllwfpdwensmgdtz89yu73zq
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wait, is this not the consensus pubkey? If not, why does Voyager need the operator's public key?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed!

@alexanderbez
Copy link
Contributor Author

@cwgoes addressed your comments + merged in latest develop.

@cwgoes cwgoes merged commit 0edfa17 into develop Sep 8, 2018
@cwgoes cwgoes deleted the bez/2221-staking-bech32-refactor branch September 8, 2018 08:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C:x/staking T: API Breaking Breaking changes that impact APIs and the SDK only (not state machine). T: UX
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Staking Bech/Naming Updates
4 participants