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

Update tm pubkey references #7102

Merged
merged 23 commits into from
Aug 28, 2020
Merged

Update tm pubkey references #7102

merged 23 commits into from
Aug 28, 2020

Conversation

sahith-narahari
Copy link
Contributor

@sahith-narahari sahith-narahari commented Aug 18, 2020

Description

This PR updates pubkey references from tendermint to sdk/crypto/keys/*
closes: #7008
ref: #7047


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.

  • 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.
  • Code follows the module structure standards.
  • Wrote unit and integration tests
  • Updated relevant documentation (docs/) or specification (x/<module>/spec/)
  • Added relevant godoc comments.
  • Added a relevant changelog entry to the Unreleased section in CHANGELOG.md
  • Re-reviewed Files changed in the Github PR explorer
  • Review Codecov Report in the comment section below once CI passes

@tac0turtle
Copy link
Member

any update on this?

@tac0turtle
Copy link
Member

tac0turtle commented Aug 26, 2020

@alexanderbez @aaronc it seems this PR is failing because it is trying to use the sdk's ed25519 in places tendermint's ed25519 key is supposed to be used. Any idea why this is the case being that they are both []byte

EDIT: IGNORE

@codecov
Copy link

codecov bot commented Aug 26, 2020

Codecov Report

Merging #7102 into master will increase coverage by 0.22%.
The diff coverage is 87.50%.

@@            Coverage Diff             @@
##           master    #7102      +/-   ##
==========================================
+ Coverage   54.51%   54.74%   +0.22%     
==========================================
  Files         566      563       -3     
  Lines       38755    38624     -131     
==========================================
+ Hits        21128    21145      +17     
+ Misses      15897    15748     -149     
- Partials     1730     1731       +1     

@@ -19,6 +19,8 @@ var _ crypto.PrivKey = PrivKey{}
const (
PrivKeySize = 32
keyType = "secp256k1"
PrivKeyName = "tendermint/PrivKeySecp256k1"
Copy link
Member

Choose a reason for hiding this comment

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

this is to keep backwards compatibility

@blushi
Copy link
Contributor

blushi commented Aug 27, 2020

It looks like we're gonna stick with tendermint ed25519 keys, given how tightly coupled sdk is with tendermint.

But then that raises another issue with regards to defining pubkeys proto types: #7109.
In this draft PR #7147, I have just changed the proto ed25519 key types to use tendermint ed25519 (instead of cosmos ed25519). As you can see this test is failing

"tm ed25519 equals pb ed25519",
because it's trying to compare a tendermint pubkey with a cosmos proto pubkey, which will always return false since it'll use:
https://github.com/tendermint/tendermint/blob/9e98c74e3c00962a02732da3486b6f4d84ae5aaf/crypto/ed25519/ed25519.go#L165 instead of using Type() and Bytes() methods. @marbar3778 would there be a way to address this in tendermint?

@tac0turtle
Copy link
Member

I think more or less this PR can be moved for review. Unless we want to further decouple areas that can be decoupled from tendermint?c

@tac0turtle tac0turtle marked this pull request as ready for review August 27, 2020 15:16
@tac0turtle tac0turtle requested a review from aaronc August 27, 2020 15:16
Copy link
Contributor

@amaury1093 amaury1093 left a comment

Choose a reason for hiding this comment

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

lgtm overall

x/staking/types/validator.go Outdated Show resolved Hide resolved
crypto/keys/sr25519/encoding.go Outdated Show resolved Hide resolved
Co-authored-by: Amaury Martiny <amaury.martiny@protonmail.com>
@tac0turtle
Copy link
Member

aaron asked to add ed25519 back. Will add it back..

@tac0turtle tac0turtle added the A:automerge Automatically merge PR once all prerequisites pass. label Aug 28, 2020
@tac0turtle
Copy link
Member

as per discussion on the sdk call, we will be removing ed25519 & sr25519 keys for now.

@tac0turtle tac0turtle removed the A:automerge Automatically merge PR once all prerequisites pass. label Aug 28, 2020
@tac0turtle tac0turtle added the A:automerge Automatically merge PR once all prerequisites pass. label Aug 28, 2020
@mergify mergify bot merged commit 23a9f46 into master Aug 28, 2020
@mergify mergify bot deleted the sahith/update-keys-ref branch August 28, 2020 16:02
@blushi blushi mentioned this pull request Sep 3, 2020
@amaury1093 amaury1093 mentioned this pull request Sep 4, 2020
9 tasks
larry0x pushed a commit to larry0x/cosmos-sdk that referenced this pull request May 22, 2023
* Update pubkey references

* Update ledger_mock

* Migrate encoding from tm

* Update pubkey prefix

* revert ed25519 to tendermint key

* random account revert

* Revert ed25519 references

* revert secp key name

* test revert

* remove ed25519

* Update x/staking/types/validator.go

Co-authored-by: Amaury Martiny <amaury.martiny@protonmail.com>

* Revert "remove ed25519"

This reverts commit 66d2e1d.

* remove ed25519 & sr25519

* Apply suggestions from code review

* remove codec

Co-authored-by: Marko Baricevic <marbar3778@yahoo.com>
Co-authored-by: Amaury Martiny <amaury.martiny@protonmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A:automerge Automatically merge PR once all prerequisites pass. C:Crypto
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Migrate Tendermint PubKey types to the SDK
6 participants