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

Allow querying for validator public key #1828

Open
maurolacy opened this issue Aug 22, 2023 · 8 comments
Open

Allow querying for validator public key #1828

maurolacy opened this issue Aug 22, 2023 · 8 comments
Milestone

Comments

@maurolacy
Copy link
Contributor

Ideally, the pubkey would be returned as part of the Validator struct

https://github.com/CosmWasm/cosmwasm/blob/ebb378517fbf2c2093c873e5c99a2ea12ce640cf/packages/std/src/query/staking.rs#L131C10-L139

That means it'll be part of the StakingQuery::AllValidators and StakingQuery::Validator query responses.
It can be an optional field for backwards compatibility / non-breaking change.

Alternatively / non-ideally, add a new query type so that the pubkey can be queried.

We need this as part of Mesh Security. See by example osmosis-labs/mesh-security#88.

@webmaster128
Copy link
Member

Do you need the consensus public key or the operator public key? In the Cosmos SDK query, only the consensus public key is easily available:
https://github.com/cosmos/cosmos-sdk/blob/v0.47.4/proto/cosmos/staking/v1beta1/staking.proto#L97-L98

What do you need the public key for?

@maurolacy
Copy link
Contributor Author

maurolacy commented Aug 22, 2023

The one that is used to sign blocks, that is the one we need. I think that would be the consensus one.

We need the validator public key in order to verify signatures on the Provider side, as part of cross-slashing.

@maurolacy
Copy link
Contributor Author

maurolacy commented Aug 22, 2023

See also: osmosis-labs/mesh-security#72.

@webmaster128
Copy link
Member

I see. Yeah, this is google.protobuf.Any consensus_pubkey = 2 [(cosmos_proto.accepts_interface) = "cosmos.crypto.PubKey"];.

Adding this is source code breaking but we can do it as first thing of the CosmWasm 2.0 work and you can start using a development branch.

@webmaster128
Copy link
Member

By the way, in https://twitter.com/Rarma_/status/1693977352823533666 you see a case where the operator address is not derived from a pubkey but is a CosmWasm contract address. This means you cannot rely on operator pubkeys/addresses to connect the same operator across chains. This matches the Cosmos SDK return data where you only get an operator address but not pubkey.

@maurolacy
Copy link
Contributor Author

maurolacy commented Nov 13, 2023

We do not need to connect operators across chains.

In fact, in the current design of mesh-security, we ended up not needing the public keys at all.

So, this can be closed. Or left open as a nice to have, if you want.

@webmaster128
Copy link
Member

Thanks! I'll leave it open for now as it is a reasonable addition.

@chipshort
Copy link
Collaborator

Let's not increase the response of the list, but for querying a single validator it makes sense to add this to the response.
However, this requires a breaking change since both responses currently use the same type. Adding to the 3.0 milestone.

@chipshort chipshort added this to the 3.0.0 milestone Sep 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants