-
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
PubKey proto types #7147
PubKey proto types #7147
Conversation
Codecov Report
@@ Coverage Diff @@
## master #7147 +/- ##
==========================================
+ Coverage 55.60% 56.77% +1.17%
==========================================
Files 457 585 +128
Lines 27440 40678 +13238
==========================================
+ Hits 15257 23094 +7837
- Misses 11083 15644 +4561
- Partials 1100 1940 +840 |
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.
lgtm. Seems easy for this just be merged upstream to Aaron's PR.
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.
This looks good to me, except the question I have below.
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.
Left some comments, but looks good. One question I have is how are addresses and keypairs going to be handled when coming from a live network on a previous version of the SDK? Will there need to be any migration? Will things just work "out-of-the-box" (i.e. addresses remain the same)?
|
||
// MarshalAminoJSON overrides Amino JSON marshalling. | ||
func (privKey PrivKey) MarshalAminoJSON() ([]byte, error) { | ||
// When we marshal to Amino JSON, we don't marshal the "key" field itself, |
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.
Does this actually return JSON?
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.
Yes, AminoJSON prints bytes as base64, so it returns a JSON string here. Same behavior as current hub, e.g. https://api.cosmos.network/auth/accounts/cosmos1y3x7q772u8s25c5zve949fhanrhvmtnu484l8z
There will be migration related to BaseAccount (whose
Yeah, that's the idea behind the go-amino patch:
that's all I can think of, but lmk if you can think of other stuff where it can get messy. |
We have right now, in proto files:
Aaron also proposed:
Since these proto files are going as stable, we won't be able to change them without introducing proto-breaking changes, so it's worth taking some time to have a nomenclature we're happy about. cc @zmanian @alexanderbez @alessio @jackzampolin @ethanfrey ? Edit: Adding my opinion: I personally like having all our proto packages starting with |
Can you elaborate a bit on the proposal? What's wrong with the two proto files we have now? |
Nothing wrong, just inviting people on some thoughts about a good nomenclature for pubkey proto packages, since they are not changeable after 0.40. Some ideas:
|
There's nothing wrong with them. I was just thinking we could maybe make the package name even shorter. But maybe not worth it. I don't have a strong preference |
I like |
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.
aarg, #7147 (comment) is too big a refactor, and is entangled to the old multisig (import cycles). I added a comment there, and will be taken care of in #7284
Description
ref: #7109
Secp256K1PubKey
andLegacyAminoMultisigThresholdPubKey
(which still uses legacy amino address rules).PubKey
interface internal to cosmos-sdk that extendsproto.Message
and tendermintcrypto.PubKey
, we could in a follow-up PR stop relying on tendermintcrypto.PubKey
and redefine its methods signatures so they only handleproto.Message
pub keys.PubKeyMultisigThreshold
Remove old PubKeyMultisigThreshold #7284.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