-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Enforce Ordering in DuplicateVoteEvidence #4151
Conversation
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 also needs a CHANGELOG_PENDING.md entry. |
@melekes Would this be considered a breaking change? I don't believe it is, since the submission of evidence is taken care of completely inside tendermint |
no, just a bugfix |
Codecov Report
@@ Coverage Diff @@
## master #4151 +/- ##
==========================================
+ Coverage 66.66% 66.69% +0.02%
==========================================
Files 247 247
Lines 21221 21233 +12
==========================================
+ Hits 14148 14161 +13
+ Misses 6014 6012 -2
- Partials 1059 1060 +1
|
@@ -209,6 +231,10 @@ func (dve *DuplicateVoteEvidence) ValidateBasic() error { | |||
if err := dve.VoteB.ValidateBasic(); err != nil { | |||
return fmt.Errorf("Invalid VoteB: %v", err) | |||
} | |||
// Enforce Votes are lexicographically sorted on blockID | |||
if strings.Compare(dve.VoteA.BlockID.Key(), dve.VoteB.BlockID.Key()) >= 0 { |
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 is actually breaking since old evidence may not be in correct order.
We should update the spec for this here: https://github.com/tendermint/tendermint/blob/master/docs/spec/blockchain/blockchain.md#evidence-1 |
@ebuchman thanks for pointing this out! |
Fixes issue described in: #4143