the start of some changes I was experimenting with. broken

This commit is contained in:
Jared Wasinger 2026-05-05 11:33:39 -04:00
parent f5d50d065b
commit b01202e3fe
3 changed files with 23 additions and 7 deletions

View file

@ -681,6 +681,8 @@ func (bc *BlockChain) processBlockWithAccessList(parentRoot common.Hash, block *
}); ok {
prefetchAccountReads, prefetchStorageReads = pr.PrefetchReadTimes()
}
prefetchAccountReads, prefetchStorageReads = prefetchReader.(*.PrefetchReadTimes()
balAccountReads, balStorageReads := stateTransition.ReadTimes()
stats.AccountReads = res.Reads.Account + prefetchAccountReads + balAccountReads
stats.StorageReads = res.Reads.Storage + prefetchStorageReads + balStorageReads

View file

@ -18,6 +18,7 @@ package state
import (
"fmt"
"time"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/overlay"
@ -240,6 +241,26 @@ func (db *CachingDB) ReadersWithCacheStats(stateRoot common.Hash) (Reader, Reade
return ra, rb, nil
}
type ReaderEIP7928Metrics struct {
// the total amount of time it took to complete the scheduled workload
WallElapsed time.Duration
// the aggregated total time spent on state loading by all workers
TotalElapsed time.Duration
// the amount of accounts loaded
Accounts int
// the amount of storage slots loaded
Storages int
// number of accounts with code loaded
Codes int
// total amount of code bytes loaded
CodeBytes int
}
type ReaderEIP7928 interface {
Reader
Metrics() *ReaderEIP7928Metrics
}
// ReaderEIP7928 creates a state reader with the manner of Block-level accessList.
func (db *CachingDB) ReaderEIP7928(stateRoot common.Hash, accessList map[common.Address][]common.Hash, threads int) (Reader, error) {
base, err := db.StateReader(stateRoot)

View file

@ -574,10 +574,3 @@ func (r *reader) PrefetchReadTimes() (account, storage time.Duration) {
}
return 0, 0
}
// WaitPrefetch blocks until the wrapped prefetcher drains; no-op otherwise.
func (r *reader) WaitPrefetch() {
if pr, ok := r.StateReader.(interface{ Wait() error }); ok {
_ = pr.Wait()
}
}