-
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
evidence: fix usage of time field in abci evidence #5170
Conversation
👋 Thanks for creating a PR! Before we can merge this PR, please make sure that all the following items have been
Thank you for your contribution to Tendermint! 🚀 |
Codecov Report
@@ Coverage Diff @@
## master #5170 +/- ##
==========================================
- Coverage 63.49% 62.48% -1.01%
==========================================
Files 141 259 +118
Lines 12345 27110 +14765
==========================================
+ Hits 7838 16941 +9103
- Misses 3774 8694 +4920
- Partials 733 1475 +742
|
Is this evidence stuff present in the 0.33.x versions? If so, we need a changelog entry and upgrading note. |
Yes but this PR just fixes the time. I'm working on another PR to update the abci with the correct evidence |
Sure, but it's still a change in behavior that users need to be aware of when upgrading. |
Ok yeah definitely agree |
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.
nice initiative 👍 but see my comment about validating time field
} | ||
|
||
return abci.Evidence{ | ||
Type: evType, | ||
Validator: TM2PB.Validator(val), | ||
Height: ev.Height(), | ||
Time: evTime, | ||
Time: ev.Time(), |
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 believe we have to verify time now (since we allow arbitrary values) - "it doesn't solve the problem if we need to verify that time is actually correct, where we'd need to load the old block anyways. So one way or another we need to get access to the old time." #4150 in state#VerifyEvidence
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.
hmm are you suggesting that we need to load the block for the height that the infraction occurred and use that time? What about all the other times we use ev.Time() for checking expiration?
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.
hmm are you suggesting that we need to load the block for the height that the infraction occurred and use that time?
yep
What about all the other times we use ev.Time() for checking expiration?
can u point me to them?
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.
tendermint/state/validation.go
Line 199 in 3c21c35
ageDuration = state.LastBlockTime.Sub(evidence.Time()) |
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.
Line 287 in 3c21c35
return evpool.IsExpired(evidence.Height(), evidence.Time()) |
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.
yep
That's annoying
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.
make sure to read #4150 for more context.
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.
@melekes, we've decided to separate the issue such that this PR just addresses the issue of the wrong usage of time (using time it was committed on the block instead of the time of infraction). In another PR we will look to change where evidence sources it's time (i.e. currently with votes) to a more reliable source.
bb8fb8d
to
2cf721a
Compare
Description
This PR fixes a bug where we were sending the time that evidence was committed to a block not the time that the actual infraction occurred to abci.
NOTE: This PR just addresses the issue of the wrong usage of time. There is a separate issue posted below which is that the evidence time (the time of infraction) itself is unreliably sourced from votes and should be changed to a more reliable source. This aims to be solved in a later PR
Addresses: #4150