From 4b5373eaed9511345798acea9bebac1a22ee1830 Mon Sep 17 00:00:00 2001 From: Alex Sharov Date: Fri, 16 Aug 2024 01:48:57 +0700 Subject: [PATCH] print lru stats after exec stage (#11601) --- cmd/state/exec3/state.go | 2 ++ eth/stagedsync/exec3.go | 1 + 2 files changed, 3 insertions(+) diff --git a/cmd/state/exec3/state.go b/cmd/state/exec3/state.go index 41328801b66..a0e84c6b935 100644 --- a/cmd/state/exec3/state.go +++ b/cmd/state/exec3/state.go @@ -98,6 +98,8 @@ func NewWorker(lock sync.Locker, logger log.Logger, ctx context.Context, backgro return w } +func (rw *Worker) LogLRUStats() { rw.evm.JumpDestCache.LogStats() } + func (rw *Worker) ResetState(rs *state.StateV3, accumulator *shards.Accumulator) { rw.rs = rs if rw.background { diff --git a/eth/stagedsync/exec3.go b/eth/stagedsync/exec3.go index 54a6a816fef..13f7f4d1a29 100644 --- a/eth/stagedsync/exec3.go +++ b/eth/stagedsync/exec3.go @@ -385,6 +385,7 @@ func ExecV3(ctx context.Context, applyWorker = cfg.applyWorkerMining } applyWorker.ResetState(rs, accumulator) + defer applyWorker.LogLRUStats() commitThreshold := batchSize.Bytes() progress := NewProgress(blockNum, commitThreshold, workerCount, false, execStage.LogPrefix(), logger)