agreement: update AttachReceivedAt to handle compound (PP) messages#5142
Merged
algorandskiy merged 4 commits intoalgorand:masterfrom Mar 10, 2023
Merged
agreement: update AttachReceivedAt to handle compound (PP) messages#5142algorandskiy merged 4 commits intoalgorand:masterfrom
algorandskiy merged 4 commits intoalgorand:masterfrom
Conversation
Codecov Report
@@ Coverage Diff @@
## master #5142 +/- ##
=======================================
Coverage 53.45% 53.46%
=======================================
Files 431 431
Lines 54364 54368 +4
=======================================
+ Hits 29061 29066 +5
+ Misses 23049 23048 -1
Partials 2254 2254
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
c7ea113 to
e5d0e59
Compare
…ceivedValidatedAt
e5d0e59 to
d1133ff
Compare
algorandskiy
approved these changes
Mar 8, 2023
Contributor
algorandskiy
left a comment
There was a problem hiding this comment.
I did not dig deep into assertCorrectReceivedAtSet but the new AttachReceivedAt looks safe and valid.
iansuvak
approved these changes
Mar 8, 2023
Contributor
iansuvak
left a comment
There was a problem hiding this comment.
Read through both changes and the tests and it looks good to me.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
PP messages in the first period are compound messages, containing both a vote and a proposal, which are converted into a special
messageEventbysetupCompoundMessage()with a structure like this:In TestPlayerRetainsReceivedValidatedAt in #5041 I was only testing sending in two separate vote and proposal
messageEvents, not a single compoundmessageEventlike this, and so I missed this important case when attaching receivedAt timings.Test Plan
add some additional player tests that send in messageEvents with non-nilWill do this in separate PR — requires updating the rest of player_test.goTailfields for additional coverageupdate testing helper functionWould require updating other player_test.go tests that rely on the current getTrace().Contains() behavior, will do in separate PRgetTrace().Contains(ev)to do a more thorough job comparing all the fields of expected events/actions against the trace, instead of just the action type. This would have helped me catch this more quickly (for example complaining that the verifyVote action's TaskIndex was not the same as the expected value I was passing intoContains())