From 8be2f847a90cc520d21fd139e07f0820c8addb9f Mon Sep 17 00:00:00 2001 From: Gary Rong Date: Thu, 8 May 2025 10:14:36 +0800 Subject: [PATCH] core: address comments from marius --- core/state/reader.go | 2 +- core/state_prefetcher.go | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/core/state/reader.go b/core/state/reader.go index fafddd2d32..5ad0385e9e 100644 --- a/core/state/reader.go +++ b/core/state/reader.go @@ -472,7 +472,7 @@ func (r *readerWithCache) Storage(addr common.Address, slot common.Hash) (common var ( value common.Hash ok bool - bucket = &r.storageBuckets[addr[0]&0x04] + bucket = &r.storageBuckets[addr[0]&0x0f] ) // Try to resolve the requested storage slot in the local cache bucket.lock.RLock() diff --git a/core/state_prefetcher.go b/core/state_prefetcher.go index c6ce423e51..f3129f57cd 100644 --- a/core/state_prefetcher.go +++ b/core/state_prefetcher.go @@ -69,9 +69,12 @@ func (p *statePrefetcher) Prefetch(block *types.Block, statedb *state.StateDB, c } // Preload the touched accounts and storage slots in advance sender, err := types.Sender(signer, tx) - if err == nil { - reader.Account(sender) + if err != nil { + fails.Add(1) + return nil } + reader.Account(sender) + if tx.To() != nil { account, _ := reader.Account(*tx.To())