core: improve descripotion of ReadersWithCacheStats

Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
This commit is contained in:
Csaba Kiraly 2025-06-20 20:00:33 +02:00
parent e977772252
commit 0cceb45d68
No known key found for this signature in database
GPG key ID: 0FE274EE8C95166E
2 changed files with 4 additions and 3 deletions

View file

@ -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 // Note: the main processor and prefetcher share the same reader with a local
// cache for mitigating the overhead of state access. // 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 { if err != nil {
return nil, err return nil, err
} }

View file

@ -209,9 +209,10 @@ func (db *CachingDB) Reader(stateRoot common.Hash) (Reader, error) {
return newReader(newCachingCodeReader(db.disk, db.codeCache, db.codeSizeCache), combined), nil 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. // 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) reader, err := db.Reader(stateRoot)
if err != nil { if err != nil {
return nil, nil, err return nil, nil, err