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 log message if in da check at slot end #13776

Merged
merged 4 commits into from
Mar 20, 2024
Merged

add log message if in da check at slot end #13776

merged 4 commits into from
Mar 20, 2024

Conversation

kasey
Copy link
Contributor

@kasey kasey commented Mar 20, 2024

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.

@kasey kasey requested a review from a team as a code owner March 20, 2024 14:55
@kasey kasey force-pushed the log-da-deadline branch from eed2173 to 4749b18 Compare March 20, 2024 15:03
@@ -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.
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 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.

Copy link
Contributor Author

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.

@kasey kasey force-pushed the log-da-deadline branch from 4749b18 to 9db994d Compare March 20, 2024 15:16
if nextSlot.After(time.Now()) {
nextSlotDur = time.Until(nextSlot)
}
slotEnd := time.NewTimer(nextSlotDur)
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 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.

@kasey kasey force-pushed the log-da-deadline branch from ca49475 to 2558d38 Compare March 20, 2024 17:26
Copy link
Contributor

@potuz potuz left a comment

Choose a reason for hiding this comment

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

LGTM thanks!

@kasey kasey added this pull request to the merge queue Mar 20, 2024
Merged via the queue into develop with commit 02abb3e Mar 20, 2024
17 checks passed
@kasey kasey deleted the log-da-deadline branch March 20, 2024 19:52
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