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 Custom Deadline for Slot Progression #8388

Merged
merged 5 commits into from Feb 3, 2021

Conversation

nisdas
Copy link
Member

@nisdas nisdas commented Feb 3, 2021

What type of PR is this?

Bug Fix

What does this PR do? Why is it needed?

  • Fixes context deadlines when updating the trailing slot cache. There is a race currently in the beacon node
    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

@nisdas nisdas requested a review from a team as a code owner February 3, 2021 12:41
@nisdas nisdas added the Ready For Review A pull request ready for code review label Feb 3, 2021
terencechain
terencechain previously approved these changes Feb 3, 2021
@@ -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)
Copy link
Member

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?

Copy link
Member

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?

@prylabs-bulldozer prylabs-bulldozer bot merged commit d4f241d into develop Feb 3, 2021
@delete-merged-branch delete-merged-branch bot deleted the addCustomDeadline branch February 3, 2021 21:39
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

3 participants