cosmos-sdk icon indicating copy to clipboard operation
cosmos-sdk copied to clipboard

[Feature]: ability to retrieve current validator's consensus address and public key

Open Pitasi opened this issue 9 months ago • 2 comments

Summary

Currently, there is no way from the "SDK land" to retrieve what the consensus address (or pub key) of the current CometBFT node is.

This becomes particularly relevant when paired with the Vote Extensions. When a node receives a Vote Extension. The ABCI methods only include the consensus address of the validator, without any way for app developers to recognize if it's themselves.

Problem Definition

No response

Proposed Feature

Since Cosmos SDK has access to the CometBFT Node instance, it can also retrieve its PrivValidator and finally, its PubKey object.

Exposing this PubKey object inside the BaseApp should be enough for Cosmos SDK devs.

It might be related to https://github.com/cosmos/cosmos-sdk/issues/21064.

Pitasi avatar Feb 19 '25 11:02 Pitasi

A use case we have is that we store some informations in the app db, something like val_cons_addr -> payload. And later, I want to retrieve the current node's payload.

Pitasi avatar Feb 19 '25 12:02 Pitasi

Good

faddat avatar Feb 20 '25 13:02 faddat