-
Notifications
You must be signed in to change notification settings - Fork 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 log message if in da check at slot end #13776
Conversation
@@ -558,6 +559,17 @@ func (s *Service) isDataAvailable(ctx context.Context, root [32]byte, signed int | |||
// The gossip handler for blobs writes the index of each verified blob referencing the given | |||
// root to the channel returned by blobNotifiers.forRoot. | |||
nc := s.blobNotifiers.forRoot(root) | |||
nextSlot := slots.BeginsAt(signed.Block().Slot()+1, s.genesisTime) | |||
// Avoid underflow if Now is somehow after the next slot start. |
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.
I think instead of an error it's fine to simply not log these cases:
- On init sync it won't be noisy.
- For very late blocks anyway the logs already show all logs out of order, so the context deadline error we already have is good enough.
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.
init-sync won't go into this path so no issue there, but I can remove the else error log you mention since we'll see the deadline anyway.
if nextSlot.After(time.Now()) { | ||
nextSlotDur = time.Until(nextSlot) | ||
} | ||
slotEnd := time.NewTimer(nextSlotDur) |
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.
I think this may cause a timer that expires very quickly still, the guarantee that time.NewTimer()
gives is that it has a minimum wait time.
I'd rather simply not log this at all if the block is coming after the slot's end.
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.
LGTM thanks!
What type of PR is this?
Feature
What does this PR do? Why is it needed?
This changes the DA check so that it will log if the check is running at the end of the slot for the given block, which provides helpful debugging information for blocks with late blobs.