From 0cceb45d68926b596ffdabafb46d76e1b39499ae Mon Sep 17 00:00:00 2001 From: Csaba Kiraly Date: Fri, 20 Jun 2025 20:00:33 +0200 Subject: [PATCH] core: improve descripotion of ReadersWithCacheStats Signed-off-by: Csaba Kiraly --- core/blockchain.go | 2 +- core/state/database.go | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/core/blockchain.go b/core/blockchain.go index 48e11d25ae..2bc42d1972 100644 --- a/core/blockchain.go +++ b/core/blockchain.go @@ -1935,7 +1935,7 @@ func (bc *BlockChain) processBlock(parentRoot common.Hash, block *types.Block, s // // Note: the main processor and prefetcher share the same reader with a local // cache for mitigating the overhead of state access. - prefetch, process, err := bc.statedb.ReaderWithCacheStats(parentRoot) + prefetch, process, err := bc.statedb.ReadersWithCacheStats(parentRoot) if err != nil { return nil, err } diff --git a/core/state/database.go b/core/state/database.go index 8e7b1175c1..5fb198a629 100644 --- a/core/state/database.go +++ b/core/state/database.go @@ -209,9 +209,10 @@ func (db *CachingDB) Reader(stateRoot common.Hash) (Reader, error) { return newReader(newCachingCodeReader(db.disk, db.codeCache, db.codeSizeCache), combined), nil } -// ReaderWithCacheStats creates a pair of state readers with internal local cache +// ReadersWithCacheStats creates a pair of state readers sharing the same internal cache and +// same backing Reader, but exposing separate statistics. // and statistics. -func (db *CachingDB) ReaderWithCacheStats(stateRoot common.Hash) (ReaderWithStats, ReaderWithStats, error) { +func (db *CachingDB) ReadersWithCacheStats(stateRoot common.Hash) (ReaderWithStats, ReaderWithStats, error) { reader, err := db.Reader(stateRoot) if err != nil { return nil, nil, err