Add Ability to Resync Node (#4279)

* add resyncing functionality

* add more validation to status message

* lint and build

* jim's review

* preston's review

* clean up

* remove log

* remove no sync

* change again

* change back

* remove spaces

* Update shared/slotutil/slottime.go

Co-Authored-By: Raul Jordan <raul@prysmaticlabs.com>

* Apply suggestions from code review

Co-Authored-By: Raul Jordan <raul@prysmaticlabs.com>

* fix refs

* raul's review

* goimports

* goimports

* add counter

* removed condition

* change back

* gaz

Co-authored-by: Raul Jordan <raul@prysmaticlabs.com>
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
This commit is contained in:
Nishant Das
2020-01-02 16:09:28 +08:00
committed by GitHub
parent bdc4045e23
commit 03356fc7b5
17 changed files with 232 additions and 63 deletions

View File

@@ -7,6 +7,7 @@ import (
"time"
"github.com/pkg/errors"
ethpb "github.com/prysmaticlabs/ethereumapis/eth/v1alpha1"
"github.com/prysmaticlabs/go-ssz"
"github.com/prysmaticlabs/prysm/beacon-chain/core/helpers"
"github.com/prysmaticlabs/prysm/shared/bytesutil"
@@ -146,3 +147,10 @@ func (r *Service) validatePendingSlots() error {
oldBlockRoots = nil
return nil
}
func (r *Service) clearPendingSlots() {
r.pendingQueueLock.Lock()
defer r.pendingQueueLock.Unlock()
r.slotToPendingBlocks = make(map[uint64]*ethpb.BeaconBlock)
r.seenPendingBlocks = make(map[[32]byte]bool)
}