penumbra icon indicating copy to clipboard operation
penumbra copied to clipboard

Calculate voting power as a percentage, as part of the `ValidatorStatus` message

Open jessepinho opened this issue 1 year ago • 0 comments

Is your feature request related to a problem? Please describe. Not sure if this is something we want to implement, but wanted to start the conversation.

It's generally useful for a validator's voting power to be displayed as a percentage of all voting power, rather than an absolute number of delegation tokens. To do that, though, each client has to sum the voting power of all validators, then divide a given validator's voting power by the sum total. It would be convenient to be able to display a given validator's voting power as a percentage without having to load all validators into memory just to get the sum of all voting powers.

Describe the solution you'd like I wanted to propose that we add a field to ValidatorStatus called, e.g., relativeVotingPower, which could be a float between 0-1 representing this validator's share of the total voting power pool. Then, the service responding to the validatorInfo or validatorStatus method call would be responsible for this calculation, rather than the client being responsible.

Describe alternatives you've considered The only alternative I can think of (assuming we do indeed want to show voting power as a percentage) is to do the calculation on every client, as I described above.

jessepinho avatar Feb 23 '24 23:02 jessepinho