From 3cdb8365531e3d3a63d30bc6b5b01f7f88739731 Mon Sep 17 00:00:00 2001 From: CPerezz Date: Mon, 4 May 2026 12:46:20 +0200 Subject: [PATCH] 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. --- core/blockchain.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/core/blockchain.go b/core/blockchain.go index 82e9c35719..9a98ba2896 100644 --- a/core/blockchain.go +++ b/core/blockchain.go @@ -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)