Referring to "Potential Tendermint Power" as the tokens reduced by a threshold (as is currently used within the ABCI)
|
func TokensToTendermintPower(tokens Int) int64 { |
This issue is followup to this comment in the code which contains incorrect variable names:
|
func getValidatorPowerRank(validator types.Validator) []byte { |
|
|
|
potentialPower := validator.Tokens |
|
|
|
// todo: deal with cases above 2**64, ref https://github.com/cosmos/cosmos-sdk/issues/2439#issuecomment-427167556 |
|
tendermintPower := potentialPower.Int64() |
|
tendermintPowerBytes := make([]byte, 8) |
|
binary.BigEndian.PutUint64(tendermintPowerBytes[:], uint64(tendermintPower)) |
Which was referenced recently in #2439
By using the Potential Tendermint Power we remove any Int64 overflow issues, not to mention make the variable names in the code reflective of reality (currently these variable names are misleading/incorrect - this is NOT the tendermint power, the tendermint power is equivalent to Potential Tendermint Power)
CC @alexanderbez @keichiri @cwgoes
Referring to "Potential Tendermint Power" as the tokens reduced by a threshold (as is currently used within the ABCI)
cosmos-sdk/types/staking.go
Line 48 in d00a15b
This issue is followup to this comment in the code which contains incorrect variable names:
cosmos-sdk/x/staking/keeper/key.go
Lines 72 to 79 in 9cf9e6f
Which was referenced recently in #2439
By using the Potential Tendermint Power we remove any Int64 overflow issues, not to mention make the variable names in the code reflective of reality (currently these variable names are misleading/incorrect - this is NOT the tendermint power, the tendermint power is equivalent to Potential Tendermint Power)
CC @alexanderbez @keichiri @cwgoes