Skip to content

Commit

Permalink
save
Browse files Browse the repository at this point in the history
  • Loading branch information
AskAlexSharov committed Nov 18, 2024
1 parent 5881af8 commit 3622ac7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions eth/stagedsync/exec3.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ type Progress struct {
logger log.Logger
}

func (p *Progress) Log(suffix string, rs *state.StateV3, in *state.QueueWithRetry, rws *state.ResultsQueue, txCount uint64, gas uint64, inputBlockNum uint64, outputBlockNum uint64, outTxNum uint64, repeatCount uint64, idxStepsAmountInDB float64, shouldGenerateChangesets bool) {
func (p *Progress) Log(suffix string, rs *state.StateV3, in *state.QueueWithRetry, rws *state.ResultsQueue, txCount uint64, gas uint64, inputBlockNum uint64, outputBlockNum uint64, outTxNum uint64, repeatCount uint64, idxStepsAmountInDB float64, shouldGenerateChangesets bool, inMemExec bool) {
mxExecStepsInDB.Set(idxStepsAmountInDB * 100)
var m runtime.MemStats
dbg.ReadMemStats(&m)
Expand All @@ -110,7 +110,7 @@ func (p *Progress) Log(suffix string, rs *state.StateV3, in *state.QueueWithRetr
diffBlocks := max(int(outputBlockNum)-int(p.prevOutputBlockNum)+1, 0)

p.logger.Info(fmt.Sprintf("[%s]"+suffix, p.logPrefix),
"blk", outputBlockNum,
"inMem", inMemExec, "blk", outputBlockNum,
"blks", diffBlocks,
"blk/s", fmt.Sprintf("%.1f", float64(diffBlocks)/interval.Seconds()),
"txs", txCount-p.prevTxCount,
Expand Down Expand Up @@ -309,7 +309,7 @@ func ExecV3(ctx context.Context,

if maxBlockNum > blockNum+16 {
log.Info(fmt.Sprintf("[%s] starting", execStage.LogPrefix()),
"from", blockNum, "to", maxBlockNum, "fromTxNum", doms.TxNum(), "offsetFromBlockBeginning", offsetFromBlockBeginning, "initialCycle", initialCycle, "useExternalTx", useExternalTx, "inMem", inMemExec)
"inMem", inMemExec, "from", blockNum, "to", maxBlockNum, "fromTxNum", doms.TxNum(), "offsetFromBlockBeginning", offsetFromBlockBeginning, "initialCycle", initialCycle, "useExternalTx", useExternalTx)
}

agg.BuildFilesInBackground(outputTxNum.Load())
Expand Down Expand Up @@ -385,7 +385,7 @@ func ExecV3(ctx context.Context,
defer executorCancel()

defer func() {
processed.Log("Done", executor.readState(), in, pe.rws, 0 /*txCount - TODO*/, logGas, inputBlockNum.Load(), outputBlockNum.GetValueUint64(), outputTxNum.Load(), mxExecRepeats.GetValueUint64(), stepsInDB, shouldGenerateChangesets)
processed.Log("Done", executor.readState(), in, pe.rws, 0 /*txCount - TODO*/, logGas, inputBlockNum.Load(), outputBlockNum.GetValueUint64(), outputTxNum.Load(), mxExecRepeats.GetValueUint64(), stepsInDB, shouldGenerateChangesets, inMemExec)
}()

executor = pe
Expand All @@ -409,7 +409,7 @@ func ExecV3(ctx context.Context,
}

defer func() {
processed.Log("Done", executor.readState(), in, nil, se.txCount, logGas, inputBlockNum.Load(), outputBlockNum.GetValueUint64(), outputTxNum.Load(), mxExecRepeats.GetValueUint64(), stepsInDB, shouldGenerateChangesets)
processed.Log("Done", executor.readState(), in, nil, se.txCount, logGas, inputBlockNum.Load(), outputBlockNum.GetValueUint64(), outputTxNum.Load(), mxExecRepeats.GetValueUint64(), stepsInDB, shouldGenerateChangesets, inMemExec)
}()

executor = se
Expand Down Expand Up @@ -649,7 +649,7 @@ Loop:
}

stepsInDB := rawdbhelpers.IdxStepsCountV3(executor.tx())
progress.Log("", executor.readState(), in, nil, count, logGas, inputBlockNum.Load(), outputBlockNum.GetValueUint64(), outputTxNum.Load(), mxExecRepeats.GetValueUint64(), stepsInDB, shouldGenerateChangesets)
progress.Log("", executor.readState(), in, nil, count, logGas, inputBlockNum.Load(), outputBlockNum.GetValueUint64(), outputTxNum.Load(), mxExecRepeats.GetValueUint64(), stepsInDB, shouldGenerateChangesets, inMemExec)

//TODO: https://github.com/erigontech/erigon/issues/10724
//if executor.tx().(state2.HasAggTx).AggTx().(*state2.AggregatorRoTx).CanPrune(executor.tx(), outputTxNum.Load()) {
Expand Down
2 changes: 1 addition & 1 deletion eth/stagedsync/exec3_parallel.go
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ func (pe *parallelExecutor) rwLoop(ctx context.Context, maxTxNum uint64, logger

case <-pe.logEvery.C:
stepsInDB := rawdbhelpers.IdxStepsCountV3(tx)
pe.progress.Log("", pe.rs, pe.in, pe.rws, pe.rs.DoneCount(), 0 /* TODO logGas*/, pe.lastBlockNum.Load(), outputBlockNum.GetValueUint64(), pe.outputTxNum.Load(), mxExecRepeats.GetValueUint64(), stepsInDB, pe.shouldGenerateChangesets)
pe.progress.Log("", pe.rs, pe.in, pe.rws, pe.rs.DoneCount(), 0 /* TODO logGas*/, pe.lastBlockNum.Load(), outputBlockNum.GetValueUint64(), pe.outputTxNum.Load(), mxExecRepeats.GetValueUint64(), stepsInDB, pe.shouldGenerateChangesets, pe.inMemExec)
if pe.agg.HasBackgroundFilesBuild() {
logger.Info(fmt.Sprintf("[%s] Background files build", pe.execStage.LogPrefix()), "progress", pe.agg.BackgroundProgress())
}
Expand Down

0 comments on commit 3622ac7

Please sign in to comment.