Skip to content

agreement: Add validatedAt to proposal type and BlockAcceptedEventDetails message#3703

Merged
tsachiherman merged 5 commits into
algorand:masterfrom
cce:proposal-validated-at
Mar 3, 2022
Merged

agreement: Add validatedAt to proposal type and BlockAcceptedEventDetails message#3703
tsachiherman merged 5 commits into
algorand:masterfrom
cce:proposal-validated-at

Conversation

@cce
Copy link
Copy Markdown
Contributor

@cce cce commented Mar 1, 2022

Summary

This pulls a bit of code from the the pipelining branch to add a "validatedAt" duration field to the agreement.proposal type. This is used to provide an extra field in the BlockAcceptedEventDetails message describing how soon into the round each block was validated.

Test Plan

Existing tests should pass, and a new test might be helpful to show that the value is getting filled in correctly.

@cce cce changed the title Add validatedAt to proposal type and BlockAcceptedEventDetails message telemetry: Add validatedAt to proposal type and BlockAcceptedEventDetails message Mar 1, 2022
@cce cce changed the title telemetry: Add validatedAt to proposal type and BlockAcceptedEventDetails message agreement: Add validatedAt to proposal type and BlockAcceptedEventDetails message Mar 1, 2022
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Mar 1, 2022

Codecov Report

Merging #3703 (ee83ea1) into master (1bb149d) will increase coverage by 0.00%.
The diff coverage is 62.50%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #3703   +/-   ##
=======================================
  Coverage   49.91%   49.91%           
=======================================
  Files         382      382           
  Lines       64412    64421    +9     
=======================================
+ Hits        32150    32155    +5     
- Misses      28832    28836    +4     
  Partials     3430     3430           
Impacted Files Coverage Δ
agreement/proposal.go 71.96% <ø> (ø)
util/timers/frozen.go 0.00% <0.00%> (ø)
util/timers/monotonic.go 80.00% <0.00%> (-2.76%) ⬇️
agreement/actions.go 72.24% <50.00%> (-0.22%) ⬇️
agreement/agreementtest/simulate.go 87.83% <100.00%> (+0.16%) ⬆️
agreement/demux.go 92.85% <100.00%> (+0.07%) ⬆️
agreement/events.go 61.17% <100.00%> (+0.46%) ⬆️
agreement/msgp_gen.go 41.46% <100.00%> (ø)
ledger/roundlru.go 90.56% <0.00%> (-5.67%) ⬇️
data/abi/abi_type.go 87.67% <0.00%> (-0.95%) ⬇️
... and 4 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1bb149d...ee83ea1. Read the comment docs.

@cce cce added the Enhancement label Mar 1, 2022
@cce cce requested a review from zeldovich March 2, 2022 14:00
Copy link
Copy Markdown
Contributor

@tsachiherman tsachiherman left a comment

Choose a reason for hiding this comment

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

Overall, I think that the PR makes sense. It uses relative timing and log the relative offset correctly.
I have few small requests:

  1. The DurationUntil is abit problematic, since it would break the concept of detachable clock, since it would pass-in a timestamp.
  2. In order to solve the above, please port from the feature/txnsync branch the following method; it should perform the same work and would not get duplicated once the txnsync get merged in :
// Since returns the time that has passed between the time the clock was last zeroed out and now
func (m *Monotonic) Since() time.Duration {
	return time.Since(m.zero)
}
  1. Since you've changed a serialized data structure, please rebuild the msgp. It will make a comment only change, but it's important to avoid accumulating undesired changes.

tsachiherman
tsachiherman previously approved these changes Mar 3, 2022
Copy link
Copy Markdown
Contributor

@tsachiherman tsachiherman left a comment

Choose a reason for hiding this comment

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

Looks good

Comment thread agreement/actions.go Outdated
Address: a.Certificate.Proposal.OriginalProposer.String(),
Hash: a.Certificate.Proposal.BlockDigest.String(),
Round: uint64(a.Certificate.Round),
ValidatedAt: a.Payload.validatedAt,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Could you add to the telemetryspec.BlockAcceptedEventDetails another field to indicate whether it's a prevalidated block or not ?
( i.e. so that this branching would be visible on the telemetry ? )

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

oh, that would be interesting to know, sure

@cce cce requested review from a user and tolikzinovyev March 3, 2022 16:22
@tsachiherman tsachiherman merged commit c51ed6a into algorand:master Mar 3, 2022
@cce cce deleted the proposal-validated-at branch March 3, 2022 18:51
tsachiherman pushed a commit that referenced this pull request Mar 4, 2022
## Summary

There was one Clock implementation not updated in #3703 in the agreement fuzzer testing package's NetworkFacade type. This updates it to fully implement the Clock interface.
@egieseke egieseke mentioned this pull request Mar 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants