diff --git a/eth/backend.go b/eth/backend.go index 1c2bd5b9389d8ff3bae3b43c63de552611a50921..59c6dbf44b2ec944d0d7fca366d1a772e3abe3ce 100644 --- a/eth/backend.go +++ b/eth/backend.go @@ -651,19 +651,6 @@ func (s *Ethereum) StartMining(ctx context.Context, db kv.RwDB, mining *stagedsy }) } - if s.chainConfig.ChainID.Uint64() > 10 { - go func() { - skipCycleEvery := time.NewTicker(4 * time.Second) - defer skipCycleEvery.Stop() - for range skipCycleEvery.C { - select { - case s.sentriesClient.Hd.SkipCycleHack <- struct{}{}: - default: - } - } - }() - } - go func() { defer debug.LogPanic() defer close(s.waitForMiningStop) diff --git a/eth/stagedsync/stage_headers.go b/eth/stagedsync/stage_headers.go index 2c6868e5edcb6464904a6217f3bb84d10bfa44ff..8fbd3ea1ab946ebddfe88fbd7430388a5d9362b5 100644 --- a/eth/stagedsync/stage_headers.go +++ b/eth/stagedsync/stage_headers.go @@ -810,7 +810,7 @@ Loop: log.Info("Req/resp stats", "req", reqCount, "reqMin", reqMin, "reqMax", reqMax, "skel", skeletonReqCount, "skelMin", skeletonReqMin, "skelMax", skeletonReqMax, "resp", respCount, "respMin", respMin, "respMax", respMax) - fmt.Printf("%s\n", cfg.hd.AnchorState()) + if noProgressCounter >= 5 && wasProgress { log.Warn("Looks like chain is not progressing, moving to the next stage") break Loop @@ -827,8 +827,6 @@ Loop: log.Trace("RequestQueueTime (header) ticked") case <-cfg.hd.DeliveryNotify: log.Trace("headerLoop woken up by the incoming request") - case <-cfg.hd.SkipCycleHack: - break Loop } timer.Stop() } diff --git a/turbo/stages/headerdownload/header_data_struct.go b/turbo/stages/headerdownload/header_data_struct.go index e028fe1b8548fe678b224eb7eba7edd765a9d904..1870540297b014c104c797a93f78105ec95e294c 100644 --- a/turbo/stages/headerdownload/header_data_struct.go +++ b/turbo/stages/headerdownload/header_data_struct.go @@ -266,7 +266,6 @@ type HeaderDownload struct { linkQueue LinkQueue // Priority queue of non-persisted links used to limit their number anchorQueue *AnchorQueue // Priority queue of anchors used to sequence the header requests DeliveryNotify chan struct{} - SkipCycleHack chan struct{} // devenet will signal to this channel to skip sync cycle and release write db transaction. It's temporary solution - later we will do mining without write transaction. toAnnounce []Announce lock sync.RWMutex preverifiedHeight uint64 // Block height corresponding to the last preverified hash @@ -325,7 +324,6 @@ func NewHeaderDownload( anchorQueue: &AnchorQueue{}, seenAnnounces: NewSeenAnnounces(), DeliveryNotify: make(chan struct{}, 1), - SkipCycleHack: make(chan struct{}), BeaconRequestList: engineapi.NewRequestList(), PayloadStatusCh: make(chan privateapi.PayloadStatus, 1), headerReader: headerReader, diff --git a/turbo/stages/stageloop.go b/turbo/stages/stageloop.go index ad89b0386ce51069cd4879268b1fca8fe0b5fab1..7b1370409e7e67af406b3b5abfca07adc1b3b380 100644 --- a/turbo/stages/stageloop.go +++ b/turbo/stages/stageloop.go @@ -48,7 +48,7 @@ func StageLoop( select { case <-ctx.Done(): return - default: + case <-hd.DeliveryNotify: } start := time.Now()