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

Missing public-key type in sending ValidatorUpdate Tx #107

Closed
torao opened this issue Jul 16, 2020 · 1 comment
Closed

Missing public-key type in sending ValidatorUpdate Tx #107

torao opened this issue Jul 16, 2020 · 1 comment
Assignees
Labels
D: good first issue Decision: Good for newcomers D: wontfix Decision: This will not be worked on

Comments

@torao
Copy link
Contributor

torao commented Jul 16, 2020

Related to fix #101, there is a code where the ValidatorUpdate transaction in which public key type is dropped is put into the mempool and it's restored as hard-coded ed25519 on the receiver side. For instance, the tx is encoded by MakeValSetChangeTx(),

func MakeValSetChangeTx(pubkey types.PubKey, power int64) []byte {
  pubStr := base64.StdEncoding.EncodeToString(pubkey.Data)
  return []byte(fmt.Sprintf("val:%s!%d", pubStr, power))
}

it'll be distributed via mempool, and restored by Ed25519ValidatorUpdate().

func Ed25519ValidatorUpdate(pubkey []byte, power int64) ValidatorUpdate {
  return ValidatorUpdate{
    PubKey: PubKey{
      Type: "ed25519",
      Data: pubkey,
    },
    Power: power,
  }
}

This issue is different from the nature of #101, so in #101 I simply changed ed25519 to composite. But we should be able to hand over the keys correctly.

  • If this operation is only performed on a test or staging environment, then we should pass and restore the public key type correctly (if possible, in a way where it's already implemented like ProtocolBuffers). And we'd like to be sure that it'll be encoded in a different way in the production environment.
  • If this operation is performed on the production environment, then we'd like to know whether there are side-effects for ABCI protocol and the Cosmos-SDK by fixing addition the key-type into the tx.
@torao torao added D: good first issue Decision: Good for newcomers D: wontfix Decision: This will not be worked on labels Jul 16, 2020
@egonspace
Copy link
Contributor

egonspace commented Aug 10, 2020

ValidatorUpdate tx is processed in cosmos-sdk(x/staking module).
These two functions are only for test or persistent_kvstore(sample app in tendermint).
Of course, these codes should be changed if public key is changed to the composite key.
I think it should be handled together in PR that changes to a composite key.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
D: good first issue Decision: Good for newcomers D: wontfix Decision: This will not be worked on
Projects
None yet
Development

No branches or pull requests

3 participants