From 01649de12eb917b9a7556fbd35132dbecbe04ec3 Mon Sep 17 00:00:00 2001 From: Sina Mahmoodi Date: Fri, 25 Apr 2025 11:37:20 +0200 Subject: [PATCH] error on minus evm time --- eth/tracers/live/perf.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/eth/tracers/live/perf.go b/eth/tracers/live/perf.go index 19072d9448..7535e890bc 100644 --- a/eth/tracers/live/perf.go +++ b/eth/tracers/live/perf.go @@ -28,10 +28,11 @@ import ( "github.com/ethereum/go-ethereum/core/tracing" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/eth/tracers" + "github.com/ethereum/go-ethereum/log" ) func init() { - tracers.LiveDirectory.Register("perfTracer", newPerfTracer) + tracers.LiveDirectory.Register("perf", newPerfTracer) } type perfTracerConfig struct { @@ -127,8 +128,13 @@ func (t *perfTracer) OnTxEnd(receipt *types.Receipt, err error) { accumulatedIO = t.statedb.GetAccumulatedIOMeasurements() ioTime = (accumulatedIO.AccountReads - t.prevAccountReads) + (accumulatedIO.StorageReads - t.prevStorageReads) - evmTime = totalTime - ioTime + evmTime time.Duration ) + if ioTime > totalTime { + log.Error("PerfTracer: IO time exceeds total time", "ioTime", ioTime, "totalTime", totalTime) + } else { + evmTime = totalTime - ioTime + } row := []string{ t.currentBlock.Number().String(),