Skip to content

Commit

Permalink
stageloop: Add dbg logs (#13802)
Browse files Browse the repository at this point in the history
Closes #9788
  • Loading branch information
somnathb1 authored Feb 14, 2025
1 parent 10d1815 commit caf9077
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions eth/stagedsync/sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -520,6 +520,7 @@ func CollectTableSizes(db kv.RoDB, tx kv.Tx, buckets []string) []interface{} {

func (s *Sync) runStage(stage *Stage, db kv.RwDB, txc wrap.TxContainer, initialCycle, firstCycle bool, badBlockUnwind bool) (err error) {
start := time.Now()
s.logger.Debug(fmt.Sprintf("[%s] Starting Stage run", s.LogPrefix()))
stageState, err := s.StageState(stage.ID, txc.Tx, db, initialCycle, firstCycle)
if err != nil {
return err
Expand Down
4 changes: 2 additions & 2 deletions turbo/stages/stageloop.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ func StageLoop(
}
}

logger.Debug("[stageloop] Starting iteration")
initialCycle := true
for {
start := time.Now()
Expand All @@ -111,7 +112,7 @@ func StageLoop(
if recoveryErr := hd.RecoverFromDb(db); recoveryErr != nil {
logger.Error("Failed to recover header sentriesClient", "err", recoveryErr)
}
time.Sleep(500 * time.Millisecond) // just to avoid too much similar errors in logs
time.Sleep(500 * time.Millisecond) // just to avoid too many similar error logs
continue
}
if time.Since(t) < 5*time.Minute {
Expand Down Expand Up @@ -275,7 +276,6 @@ func StageLoopIteration(ctx context.Context, db kv.RwDB, txc wrap.TxContainer, s
if canRunCycleInOneTransaction && !externalTx && commitTime > 500*time.Millisecond {
logger.Info("Commit cycle", "in", commitTime)
}
//if len(logCtx) > 0 { // No printing of timings or table sizes if there were no progress
var m runtime.MemStats
dbg.ReadMemStats(&m)
if gasUsed > 0 {
Expand Down

0 comments on commit caf9077

Please sign in to comment.