-
Notifications
You must be signed in to change notification settings - Fork 28
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
add voting power in VoterInfo
of abci
#102
Conversation
VotingInfo
of abciVoterInfo
of abci
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR only adds Voter.Power
to Protocol Buffers, right? (Is the code to use this added Voter.Power
going to be fixed later?)
No, this PR add
|
abci/types/types.proto
Outdated
@@ -314,7 +314,8 @@ message ValidatorUpdate { | |||
// VoteInfo | |||
message VoteInfo { | |||
Validator validator = 1 [(gogoproto.nullable) = false]; | |||
bool signed_last_block = 2; | |||
int64 power = 2; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've looked at various things, and I think it would be better to put StakingPower
(it is Power
for now) and VotingPower
in the Validator
in here(https://github.com/line/tendermint/blob/e007be020311ca4ae8cf4b50170b600492ffb509/types/protobuf.go#L74)
Because VotingPower
will also be needed to pass Evidence
over, it would be better to put it in the Validator
.(https://github.com/line/tendermint/blob/e007be020311ca4ae8cf4b50170b600492ffb509/types/protobuf.go#L173)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But the Power
of Validator
should be used as Staking value, because we can take all the staking value of byzantine via evidence when the byzantine's fraud is found. If we use the voting power as Valdiator.Power
, we can't get the byzantine's all staking money, because voting power and staking power is difference
And second reasone is that the Validator.Power
is used when update valdiator's staking power.
So I think it's better to remain the Validator.Power
as staking power.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I meant to put both StakingPower
and VotingPower
in the Validator
to sync abci.Validator
with types.Validator
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that's a good point. But as I mentioned above, the abci.Validator
is used three part and there aren't need voting power all part. Voting power is only needed when transfer BeginBlock
.
So, I was thinking about what to do. And then I decide to insert voting power to VoterInfo
not Validator
. Because VoterInfo
is only used when transfer voting information in the BeginBlock
, so the purpose is equals with voting power. And doesn't used others and doesn't have matched structure.
But as you pointed in offline, the name can make confuse with staking power, hence I'll modify the name more clearly.
Closes: #35
Description
Add voting power in
VoterInfo
of abci, and fill it when transfer BeginBlockThe
Power
ofValidator
is used as staking value when update the validator information and slash evidence.So, I didn't use it as
VotingPower
of validator. I add thePower
in theVoterInfo
structure to transfer a votingpower though.But later, we need to change the distribution of cosmos-sdk for referencing right voting power.
https://github.com/cosmos/cosmos-sdk/blob/f8df05f6f15e40dc6c4df6ea4246c594769f5f22/x/distribution/abci.go#L20-L23
For contributor use:
docs/
) and code commentsFiles changed
in the Github PR explorer