core, core/state: fold prefetcher elapsed into StateReadMs for BAL blocks

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).
This commit is contained in:
CPerezz 2026-05-08 12:51:24 +02:00 committed by Jared Wasinger
parent e4f27275cf
commit 659af06a4c
3 changed files with 1 additions and 3 deletions

View file

@ -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),

View file

@ -607,4 +607,3 @@ func (r *reader) GetStats() ReaderStats {
StateStats: r.GetStateStats(),
}
}

View file

@ -395,4 +395,3 @@ func (r *prefetchStateReader) GetStateStats() StateReaderStats {
}
return StateReaderStats{}
}