core: drop redundant WaitPrefetch in BAL block stats path

The BAL block has been verified and committed by the time we reach the
read-time accounting block, so the prefetcher (whose workload is bounded
by the BAL contents) has no outstanding tasks to wait on.
This commit is contained in:
CPerezz 2026-05-04 12:46:20 +02:00
parent adb545b20c
commit 3cdb836553
No known key found for this signature in database
GPG key ID: 62045F34B97177DD

View file

@ -684,10 +684,9 @@ func (bc *BlockChain) processBlockWithAccessList(parentRoot common.Hash, block *
stats.Prefetch = m.StatePrefetch
}
// Sum read times across per-tx execution, BAL state-transition, and
// prefetcher async fetches. Sum-of-CPU-time, not wall-clock.
if w, ok := prefetchReader.(interface{ WaitPrefetch() }); ok {
w.WaitPrefetch() // ensure all prefetcher reads are accounted for
}
// prefetcher async fetches. Sum-of-CPU-time, not wall-clock. No
// WaitPrefetch needed: state is already committed, so the prefetcher
// (bounded by BAL contents) has drained.
var prefetchAccountReads, prefetchStorageReads time.Duration
if pr, ok := prefetchReader.(interface {
PrefetchReadTimes() (time.Duration, time.Duration)