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

Fix Unsafe Sync Flag #7563

Merged
merged 3 commits into from
Oct 18, 2020
Merged

Fix Unsafe Sync Flag #7563

merged 3 commits into from
Oct 18, 2020

Conversation

nisdas
Copy link
Member

@nisdas nisdas commented Oct 18, 2020

What type of PR is this?

Bug Fix

What does this PR do? Why is it needed?

  • Uses StateByRoot to retrieve head state instead of retrieving it from the db.

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 October 18, 2020 10:00
@@ -434,7 +434,7 @@ func (s *Service) initializeChainInfo(ctx context.Context) error {
if err != nil {
return errors.Wrap(err, "could not hash head block")
}
headState, err := s.beaconDB.HeadState(ctx)
headState, err := s.stateGen.StateByRoot(ctx, headRoot)
Copy link
Member

Choose a reason for hiding this comment

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

If headState in DB != headRoot generated state, then it is pretty concerning and makes me wonder if there's missing underlying bug. Can this behavior be reproduced by a test?

Copy link
Member Author

Choose a reason for hiding this comment

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

Not exactly a test but right now in medalla. Our headstate is actually nil, which is why this never works.

@prylabs-bulldozer prylabs-bulldozer bot merged commit f31d40c into master Oct 18, 2020
@delete-merged-branch delete-merged-branch bot deleted the fixUnsafeSync branch October 18, 2020 22:28
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.

None yet

3 participants