From 8797d1af8e2ee4f8db3db6c58764ebd570729c99 Mon Sep 17 00:00:00 2001 From: CPerezz Date: Fri, 1 May 2026 00:38:31 +0200 Subject: [PATCH] core: tighten metric doc comments MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Replace reader.go:553 line citation in GetStateStats with the function name; line numbers rot. - Note the BAL sum-of-CPU-time semantics on the read-time field group in ExecuteStats so cross-client consumers don't read total ≤ TotalTime as an invariant. --- core/blockchain_stats.go | 4 +++- core/state/reader_eip_7928.go | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/core/blockchain_stats.go b/core/blockchain_stats.go index 6332f8e22f..dfd12cb546 100644 --- a/core/blockchain_stats.go +++ b/core/blockchain_stats.go @@ -28,7 +28,9 @@ import ( // ExecuteStats includes all the statistics of a block execution in details. type ExecuteStats struct { - // State read times + // State read times. For BAL blocks these are sum-of-CPU-time across + // per-tx, pre-tx, post-tx, BAL state-transition and prefetcher paths; + // can exceed TotalTime by design. Sequential blocks: wall-clock. AccountReads time.Duration // Time spent on the account reads StorageReads time.Duration // Time spent on the storage reads AccountHashes time.Duration // Time spent on the account trie hash diff --git a/core/state/reader_eip_7928.go b/core/state/reader_eip_7928.go index 6c1c63d8c8..6f451960fe 100644 --- a/core/state/reader_eip_7928.go +++ b/core/state/reader_eip_7928.go @@ -375,8 +375,8 @@ func (r *readerTracker) TouchStorage(addr common.Address, slot common.Hash) { } // GetStateStats forwards stats from the wrapped *stateReaderWithStats so the -// reader-aggregator type assertion at reader.go:553 succeeds. Without this, -// account/storage cache hit/miss counts emit zero on BAL blocks. +// (*reader).GetStateStats type assertion succeeds. Without this, account/ +// storage cache hit/miss counts emit zero on BAL blocks. func (r *prefetchStateReader) GetStateStats() StateReaderStats { if stater, ok := r.StateReader.(StateReaderStater); ok { return stater.GetStateStats()