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 Custom Deadline for Slot Progression #8388
Conversation
@@ -104,6 +108,9 @@ func (s *Service) onBlock(ctx context.Context, signed *ethpb.SignedBeaconBlock, | |||
// Updating next slot state cache can happen in the background. It shouldn't block rest of the process. | |||
if featureconfig.Get().EnableNextSlotStateCache { | |||
go func() { | |||
// Use a custom deadline here, since this method runs asynchronously. | |||
ctx, cancel := context.WithTimeout(context.Background(), slotDeadline) |
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.
Why does this use context.Background() instead of the parent context?
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.
Oh, I see in the PR description. Could you please add more information in the code commentary please?
What type of PR is this?
Bug Fix
What does this PR do? Why is it needed?
when updating the cache, as the context used can be canceled prematurely before the state has had a chance to
advance. This instead uses a custom deadline so that it doesn't exit prematurely.
Which issues(s) does this PR fix?
N.A
Other notes for review