mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2024-12-26 05:27:19 +00:00
More header download diagnostics (#4224)
Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>
This commit is contained in:
parent
54cf932652
commit
e6cb086c90
@ -821,7 +821,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)
|
||||
|
||||
cfg.hd.LogAnchorState()
|
||||
if noProgressCounter >= 5 && wasProgress {
|
||||
log.Warn("Looks like chain is not progressing, moving to the next stage")
|
||||
break Loop
|
||||
|
@ -212,13 +212,13 @@ func (hd *HeaderDownload) pruneLinkQueue() {
|
||||
}
|
||||
}
|
||||
|
||||
func (hd *HeaderDownload) AnchorState() string {
|
||||
func (hd *HeaderDownload) LogAnchorState() {
|
||||
hd.lock.RLock()
|
||||
defer hd.lock.RUnlock()
|
||||
return hd.anchorState()
|
||||
hd.logAnchorState()
|
||||
}
|
||||
|
||||
func (hd *HeaderDownload) anchorState() string {
|
||||
func (hd *HeaderDownload) logAnchorState() {
|
||||
//nolint:prealloc
|
||||
var ss []string
|
||||
for anchorParent, anchor := range hd.anchors {
|
||||
@ -276,7 +276,9 @@ func (hd *HeaderDownload) anchorState() string {
|
||||
ss = append(ss, sb.String())
|
||||
}
|
||||
sort.Strings(ss)
|
||||
return strings.Join(ss, "\n")
|
||||
for _, s := range ss {
|
||||
log.Info(s)
|
||||
}
|
||||
}
|
||||
|
||||
func (hd *HeaderDownload) RecoverFromDb(db kv.RoDB) error {
|
||||
@ -877,7 +879,7 @@ func (hd *HeaderDownload) ProcessHeader(sh ChainSegmentHeader, newBlock bool, pe
|
||||
return false
|
||||
}
|
||||
if len(hd.anchors) >= hd.anchorLimit {
|
||||
log.Debug(fmt.Sprintf("too many anchors: %d, limit %d, state: %s", len(hd.anchors), hd.anchorLimit, hd.anchorState()))
|
||||
log.Debug(fmt.Sprintf("too many anchors: %d, limit %d", len(hd.anchors), hd.anchorLimit))
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user