-
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 VotingPower to abci.Evidence #312
Changes from 4 commits
cbef796
12a7452
71349c2
a1be081
b15862e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -54,6 +54,7 @@ type DuplicateVoteEvidence struct { | |
|
||
// abci specific information | ||
TotalVotingPower int64 | ||
VotingPower int64 | ||
ValidatorPower int64 | ||
Timestamp time.Time | ||
} | ||
|
@@ -83,6 +84,7 @@ func NewDuplicateVoteEvidence(vote1, vote2 *Vote, blockTime time.Time, voterSet | |
VoteA: voteA, | ||
VoteB: voteB, | ||
TotalVotingPower: voterSet.TotalVotingPower(), | ||
VotingPower: val.VotingPower, | ||
ValidatorPower: val.StakingPower, | ||
Timestamp: blockTime, | ||
} | ||
|
@@ -93,8 +95,9 @@ func (dve *DuplicateVoteEvidence) ABCI() []abci.Evidence { | |
return []abci.Evidence{{ | ||
Type: abci.EvidenceType_DUPLICATE_VOTE, | ||
Validator: abci.Validator{ | ||
Address: dve.VoteA.ValidatorAddress, | ||
Power: dve.ValidatorPower, | ||
Address: dve.VoteA.ValidatorAddress, | ||
Power: dve.ValidatorPower, | ||
VotingPower: dve.VotingPower, | ||
}, | ||
Height: dve.VoteA.Height, | ||
Time: dve.Timestamp, | ||
|
@@ -163,6 +166,7 @@ func (dve *DuplicateVoteEvidence) ToProto() *tmproto.DuplicateVoteEvidence { | |
VoteA: voteA, | ||
VoteB: voteB, | ||
TotalVotingPower: dve.TotalVotingPower, | ||
VotingPower: dve.VotingPower, | ||
ValidatorPower: dve.ValidatorPower, | ||
Timestamp: dve.Timestamp, | ||
} | ||
|
@@ -189,6 +193,7 @@ func DuplicateVoteEvidenceFromProto(pb *tmproto.DuplicateVoteEvidence) (*Duplica | |
VoteA: vA, | ||
VoteB: vB, | ||
TotalVotingPower: pb.TotalVotingPower, | ||
VotingPower: pb.VotingPower, | ||
ValidatorPower: pb.ValidatorPower, | ||
Timestamp: pb.Timestamp, | ||
} | ||
|
@@ -220,8 +225,9 @@ func (l *LightClientAttackEvidence) ABCI() []abci.Evidence { | |
abciEv := make([]abci.Evidence, len(l.ByzantineValidators)) | ||
for idx, val := range l.ByzantineValidators { | ||
pb := abci.Validator{ | ||
Address: val.Address, | ||
Power: val.StakingPower, | ||
Address: val.Address, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How about update to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sounds good, I'll fix it |
||
Power: val.StakingPower, | ||
VotingPower: val.VotingPower, | ||
} | ||
abciEv[idx] = abci.Evidence{ | ||
Type: abci.EvidenceType_LIGHT_CLIENT_ATTACK, | ||
|
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.
Could you update the comment
The voting power
toThe staking power
? and also put the commentThe staking power
in themessage ValidatorUpdate.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.
fixed