diff --git a/erigon-lib/state/inverted_index.go b/erigon-lib/state/inverted_index.go index d84289061c9..d7df581c27b 100644 --- a/erigon-lib/state/inverted_index.go +++ b/erigon-lib/state/inverted_index.go @@ -822,7 +822,7 @@ func (iit *InvertedIndexRoTx) Prune(ctx context.Context, rwTx kv.RwTx, txFrom, t collector := etl.NewCollector(ii.filenameBase+".prune.ii", ii.dirs.Tmp, etl.NewSortableBuffer(etl.BufferOptimalSize/8), ii.logger) defer collector.Close() - collector.LogLvl(log.LvlDebug) + collector.LogLvl(log.LvlTrace) collector.SortAndFlushInBackground(true) var txKey [8]byte diff --git a/eth/stagedsync/exec3.go b/eth/stagedsync/exec3.go index 68e1607646f..624361dbe47 100644 --- a/eth/stagedsync/exec3.go +++ b/eth/stagedsync/exec3.go @@ -87,7 +87,7 @@ type Progress struct { logger log.Logger } -func (p *Progress) Log(rs *state.StateV3, in *state.QueueWithRetry, rws *state.ResultsQueue, doneCount, inputBlockNum, outputBlockNum, outTxNum, repeatCount uint64, idxStepsAmountInDB float64) { +func (p *Progress) Log(rs *state.StateV3, in *state.QueueWithRetry, rws *state.ResultsQueue, doneCount, inputBlockNum, outputBlockNum, outTxNum, repeatCount uint64, idxStepsAmountInDB float64, shouldGenerateChangesets bool) { execStepsInDB.Set(idxStepsAmountInDB * 100) var m runtime.MemStats dbg.ReadMemStats(&m) @@ -99,14 +99,19 @@ func (p *Progress) Log(rs *state.StateV3, in *state.QueueWithRetry, rws *state.R //if doneCount > p.prevCount { // repeatRatio = 100.0 * float64(repeatCount-p.prevRepeatCount) / float64(doneCount-p.prevCount) //} - p.logger.Info(fmt.Sprintf("[%s] Transaction replay", p.logPrefix), + + var suffix string + if shouldGenerateChangesets { + suffix = " Commit every block" + } + p.logger.Info(fmt.Sprintf("[%s]"+suffix, p.logPrefix), //"workers", workerCount, "blk", outputBlockNum, "tx/s", fmt.Sprintf("%.1f", speedTx), //"pipe", fmt.Sprintf("(%d+%d)->%d/%d->%d/%d", in.NewTasksLen(), in.RetriesLen(), rws.ResultChLen(), rws.ResultChCap(), rws.Len(), rws.Limit()), //"repeatRatio", fmt.Sprintf("%.2f%%", repeatRatio), //"workers", p.workersCount, - "buffer", fmt.Sprintf("%s/%s", common.ByteCount(sizeEstimate), common.ByteCount(p.commitThreshold)), + "buf", fmt.Sprintf("%s/%s", common.ByteCount(sizeEstimate), common.ByteCount(p.commitThreshold)), "stepsInDB", fmt.Sprintf("%.2f", idxStepsAmountInDB), "step", fmt.Sprintf("%.1f", float64(outTxNum)/float64(config3.HistoryV3AggregationStep)), "alloc", common.ByteCount(m.Alloc), "sys", common.ByteCount(m.Sys), @@ -440,7 +445,8 @@ func ExecV3(ctx context.Context, case <-logEvery.C: stepsInDB := rawdbhelpers.IdxStepsCountV3(tx) - progress.Log(rs, in, rws, rs.DoneCount(), inputBlockNum.Load(), outputBlockNum.GetValueUint64(), outputTxNum.Load(), execRepeats.GetValueUint64(), stepsInDB) + + progress.Log(rs, in, rws, rs.DoneCount(), inputBlockNum.Load(), outputBlockNum.GetValueUint64(), outputTxNum.Load(), execRepeats.GetValueUint64(), stepsInDB, shouldGenerateChangesets) if agg.HasBackgroundFilesBuild() { logger.Info(fmt.Sprintf("[%s] Background files build", execStage.LogPrefix()), "progress", agg.BackgroundProgress()) } @@ -876,7 +882,7 @@ Loop: select { case <-logEvery.C: stepsInDB := rawdbhelpers.IdxStepsCountV3(applyTx) - progress.Log(rs, in, rws, count, inputBlockNum.Load(), outputBlockNum.GetValueUint64(), outputTxNum.Load(), execRepeats.GetValueUint64(), stepsInDB) + progress.Log(rs, in, rws, count, inputBlockNum.Load(), outputBlockNum.GetValueUint64(), outputTxNum.Load(), execRepeats.GetValueUint64(), stepsInDB, shouldGenerateChangesets) //if applyTx.(state2.HasAggTx).AggTx().(*state2.AggregatorRoTx).CanPrune(applyTx, outputTxNum.Load()) { // //small prune cause MDBX_TXN_FULL // if _, err := applyTx.(state2.HasAggTx).AggTx().(*state2.AggregatorRoTx).PruneSmallBatches(ctx, 10*time.Hour, applyTx); err != nil { diff --git a/p2p/sentry/sentry_grpc_server.go b/p2p/sentry/sentry_grpc_server.go index b27d791f2ee..c6f57fbb32b 100644 --- a/p2p/sentry/sentry_grpc_server.go +++ b/p2p/sentry/sentry_grpc_server.go @@ -254,7 +254,7 @@ func (pi *PeerInfo) Async(f func(), logger log.Logger) { default: } } - logger.Debug("slow peer or too many requests, dropping its old requests", "name", pi.peer.Name()) + logger.Trace("[sentry] slow peer or too many requests, dropping its old requests", "name", pi.peer.Name()) } } }