Exit Initial Sync Early (#12659)

* add check

* fix test
This commit is contained in:
Nishant Das
2023-07-26 08:38:25 +08:00
committed by GitHub
parent 2b40c44879
commit 113172d8aa
2 changed files with 14 additions and 0 deletions

View File

@@ -89,6 +89,12 @@ func (s *Service) Start() {
log.Debug("Exiting Initial Sync Service")
return
}
// Exit entering round-robin sync if we require 0 peers to sync.
if flags.Get().MinimumSyncPeers == 0 {
s.markSynced()
log.WithField("genesisTime", gt).Info("Due to number of peers required for sync being set at 0, entering regular sync immediately.")
return
}
if gt.After(prysmTime.Now()) {
s.markSynced()
log.WithField("genesisTime", gt).Info("Genesis time has not arrived - not syncing")