From c4597cfdf08a765b8a180ba0410482dabda13e32 Mon Sep 17 00:00:00 2001 From: Csaba Kiraly Date: Sat, 21 Jun 2025 15:26:53 +0200 Subject: [PATCH] core/state: fix prefetch on single core CPU We need at least one prefetch goroutine. SetLimit(0) would block prefetch. Signed-off-by: Csaba Kiraly --- core/state_prefetcher.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/state_prefetcher.go b/core/state_prefetcher.go index 2f40e3dc977a..c0ce705c77ae 100644 --- a/core/state_prefetcher.go +++ b/core/state_prefetcher.go @@ -57,7 +57,7 @@ func (p *statePrefetcher) Prefetch(block *types.Block, statedb *state.StateDB, c workers errgroup.Group reader = statedb.Reader() ) - workers.SetLimit(4 * runtime.NumCPU() / 5) // Aggressively run the prefetching + workers.SetLimit(max(1, 4*runtime.NumCPU()/5)) // Aggressively run the prefetching // Iterate over and process the individual transactions for i, tx := range block.Transactions() {