Skip to content
This repository has been archived by the owner on Oct 22, 2021. It is now read-only.

Fix voting power calculation error #64

Open
wants to merge 2 commits into
base: stargate
Choose a base branch
from

Conversation

WeiJun0827
Copy link

@WeiJun0827 WeiJun0827 commented Aug 16, 2021

Background

There is only one validator in a testnet, the voting power of this validator is expected to be 100% but got 8.21%.

Cause

The original voting power calculation uses supply(total supply) gotten from the getStakingSupply function as the denominator and token of each validator as the numerator. But should use delegator_shares of active validator as the denominator and its sum as the numerator.

Revision

  • Use the amount of delegator_shares of each active validator divides its sum to calculate the voting power.
  • Delete unused function getStakingSupply.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant