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

Better Error Message if Failing to Exit Initial Sync #2483

Merged
merged 4 commits into from
May 4, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions beacon-chain/sync/initial-sync/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@ func (s *InitialSync) exitInitialSync(ctx context.Context, block *pb.BeaconBlock
}
state, err = s.chainService.ApplyBlockStateTransition(ctx, block, state)
if err != nil {
log.Error("OH NO - looks like you synced with a bad peer, try restarting your node!")
switch err.(type) {
case *blockchain.BlockFailedProcessingErr:
// If the block fails processing, we delete it from our DB.
Expand All @@ -244,6 +245,7 @@ func (s *InitialSync) exitInitialSync(ctx context.Context, block *pb.BeaconBlock

if stateRoot != s.highestObservedRoot {
// TODO(#2155): Instead of a fatal call, drop the peer and restart the initial sync service.
log.Error("OH NO - looks like you synced with a bad peer, try restarting your node!")
log.Fatalf(
"Canonical state root %#x does not match highest observed root from peer %#x",
stateRoot,
Expand Down