From 659af06a4c008aea8c8c64fec8978287df998795 Mon Sep 17 00:00:00 2001 From: CPerezz Date: Fri, 8 May 2026 12:51:24 +0200 Subject: [PATCH] core, core/state: fold prefetcher elapsed into StateReadMs for BAL blocks MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit For BAL blocks AccountReads/StorageReads/CodeReads stay zero by design, so the slow-block JSON state_read_ms read 0 — misleading to cross-client consumers. Sum s.Prefetch (the prefetcher's elapsed time) into the field; it's already zero on the pre-BAL path so the formula is unchanged there. Also gofmt -w on reader.go and reader_eip_7928.go (trailing blank lines left over from earlier cleanup). --- core/blockchain_stats.go | 2 +- core/state/reader.go | 1 - core/state/reader_eip_7928.go | 1 - 3 files changed, 1 insertion(+), 3 deletions(-) diff --git a/core/blockchain_stats.go b/core/blockchain_stats.go index b1dfca1751..81f0e5149b 100644 --- a/core/blockchain_stats.go +++ b/core/blockchain_stats.go @@ -222,7 +222,7 @@ func buildSlowBlockLog(s *ExecuteStats, block *types.Block) slowBlockLog { }, Timing: slowBlockTime{ ExecutionMs: durationToMs(s.Execution), - StateReadMs: durationToMs(s.AccountReads + s.StorageReads + s.CodeReads), + StateReadMs: durationToMs(s.AccountReads + s.StorageReads + s.CodeReads + s.Prefetch), StateHashMs: durationToMs(s.AccountHashes + s.AccountUpdates + s.StorageUpdates), CommitMs: durationToMs(max(s.AccountCommits, s.StorageCommits) + s.DatabaseCommit + s.BlockWrite), TotalMs: durationToMs(s.TotalTime), diff --git a/core/state/reader.go b/core/state/reader.go index c892803967..cee207d30f 100644 --- a/core/state/reader.go +++ b/core/state/reader.go @@ -607,4 +607,3 @@ func (r *reader) GetStats() ReaderStats { StateStats: r.GetStateStats(), } } - diff --git a/core/state/reader_eip_7928.go b/core/state/reader_eip_7928.go index ab9dcabcb8..224d7b00e9 100644 --- a/core/state/reader_eip_7928.go +++ b/core/state/reader_eip_7928.go @@ -395,4 +395,3 @@ func (r *prefetchStateReader) GetStateStats() StateReaderStats { } return StateReaderStats{} } -