-
Notifications
You must be signed in to change notification settings - Fork 1.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
Add aggregation metrics #12417
Add aggregation metrics #12417
Conversation
@@ -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] { |
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.
panic if intervals
is length 0. Probably better to do a length check
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.
Preston had the same comment, but interval is a hardcoded configuration flag, this can never be 0
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.
solved by converting to array
// 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))) | ||
} |
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.
Very useful helper! Can replace this on many things that we do
This PR removes the logs when batching attestations for forkchoice and adds metrics for the first two intervals in the slot where we aggregate.