Skip to content
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

agreement: use proposal-vote verified timing for dynamic lambda calculation #5671

Merged

Conversation

cce
Copy link
Contributor

@cce cce commented Aug 16, 2023

After talking to @yossigi we discussed using the proposal-vote (vote for step 0) arrival or verified time — rather than the payload arrival or verified time — when aggregating timings to use for calculating dynamic lambda. This matches the original definition of lambda as the time to send the initial proposal-vote, rather than the full payload.

We did a little digging together and landed on adding a new readLowestVote query event to accompany the readLowestValue/readLowestPayload events that were added as part of the feature/pipeline and speculative assembly branches.

This also adds a validatedAt time to the vote type similar to the similar receivedAt and validatedAt timings added to proposal payloads from #5041, #4583, and #3703 (and originally from the feature/pipeline branch).

It also updates the TestPlayerRetainsReceivedValidatedAt and TestPlayerRetainsReceivedValidatedAtPP tests to check these timings are making it through.

The PP message contains its own copy of the proposal-vote, but since it is redundant in most cases (since you would have already received the AV message of the proposal-vote) it will be discarded and only one voteVerified event per unique proposal-vote will be delivered. Since we are stamping the time at voteVerified time that should be enough to ensure the first timing is what is retained.

@codecov
Copy link

codecov bot commented Aug 16, 2023

Codecov Report

Merging #5671 (e178503) into feature/dynamic-lambda (69633c7) will increase coverage by 0.02%.
The diff coverage is 82.92%.

@@                    Coverage Diff                     @@
##           feature/dynamic-lambda    #5671      +/-   ##
==========================================================
+ Coverage                   55.16%   55.18%   +0.02%     
==========================================================
  Files                         465      465              
  Lines                       65072    65097      +25     
==========================================================
+ Hits                        35897    35926      +29     
+ Misses                      26783    26780       -3     
+ Partials                     2392     2391       -1     
Files Changed Coverage Δ
agreement/eventtype_string.go 50.00% <ø> (ø)
agreement/proposal.go 74.35% <ø> (ø)
agreement/vote.go 83.33% <ø> (ø)
agreement/events.go 67.27% <63.63%> (-0.28%) ⬇️
agreement/player.go 93.09% <84.21%> (-0.40%) ⬇️
agreement/demux.go 91.32% <100.00%> (+0.12%) ⬆️
agreement/proposalStore.go 100.00% <100.00%> (ø)
agreement/proposalTracker.go 94.73% <100.00%> (+0.29%) ⬆️
agreement/proposalTrackerContract.go 42.46% <100.00%> (ø)

... and 14 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

cce added 2 commits August 16, 2023 12:13
remove commented out code from when we were trying to get receivedAt for proposal-votes
fix comment to say validated instead of received
if e.T == payloadVerified {
e.Input.Proposal.validatedAt = d
} else if e.T == voteVerified && e.Input.UnauthenticatedVote.R.Step == 0 {
// if this is a proposal vote (step 0), record the validatedAt time on the vote
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that attaching it to votes of any step might be okay.
The overhead of reading the clock is already there, so just storing it along with the vote doesn't seem too much of an overhead. It also keeps it more consistent (I can now read the time any vote was verified, no matter the step)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK ... I could just pull it up into the demux.go code so it isn't here (and could remove the overhead of reading the clock for all voteValidated if we wanted)

@cce cce force-pushed the dynamic-lambda-vote-validatedAt branch from df24501 to e178503 Compare August 16, 2023 19:24
@cce cce merged commit b161d7d into algorand:feature/dynamic-lambda Aug 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants