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

Add aggregation metrics #12417

Merged
merged 2 commits into from May 17, 2023
Merged

Add aggregation metrics #12417

merged 2 commits into from May 17, 2023

Conversation

potuz
Copy link
Contributor

@potuz potuz commented May 17, 2023

This PR removes the logs when batching attestations for forkchoice and adds metrics for the first two intervals in the slot where we aggregate.

@potuz potuz added the Ready For Review A pull request ready for code review label May 17, 2023
@potuz potuz requested a review from a team as a code owner May 17, 2023 16:48
@@ -39,7 +39,11 @@ func (s *Service) prepareForkChoiceAtts() {
if err := s.batchForkChoiceAtts(s.ctx); err != nil {
log.WithError(err).Error("Could not prepare attestations for fork choice")
}
log.WithField("latency", time.Since(t).Milliseconds()).Debug("batched forkchoice attestations")
if slots.TimeIntoSlot(s.genesisTime) < intervals[1] {
Copy link
Member

Choose a reason for hiding this comment

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

panic if intervals is length 0. Probably better to do a length check

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Preston had the same comment, but interval is a hardcoded configuration flag, this can never be 0

Copy link
Contributor Author

Choose a reason for hiding this comment

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

solved by converting to array

Comment on lines +256 to +260
// TimeIntoSlot returns the time duration elapsed between the current time and
// the start of the current slot
func TimeIntoSlot(genesisTime uint64) time.Duration {
return time.Since(StartTime(genesisTime, CurrentSlot(genesisTime)))
}
Copy link
Member

Choose a reason for hiding this comment

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

Very useful helper! Can replace this on many things that we do

@terencechain terencechain merged commit 537236e into develop May 17, 2023
16 checks passed
@terencechain terencechain deleted the remove-aggregation-logs branch May 17, 2023 19:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Ready For Review A pull request ready for code review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants