core: address comments from marius

This commit is contained in:
Gary Rong 2025-05-08 10:14:36 +08:00
parent 21be8b4740
commit 8be2f847a9
2 changed files with 6 additions and 3 deletions

View file

@ -472,7 +472,7 @@ func (r *readerWithCache) Storage(addr common.Address, slot common.Hash) (common
var ( var (
value common.Hash value common.Hash
ok bool 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 // Try to resolve the requested storage slot in the local cache
bucket.lock.RLock() bucket.lock.RLock()

View file

@ -69,9 +69,12 @@ func (p *statePrefetcher) Prefetch(block *types.Block, statedb *state.StateDB, c
} }
// Preload the touched accounts and storage slots in advance // Preload the touched accounts and storage slots in advance
sender, err := types.Sender(signer, tx) sender, err := types.Sender(signer, tx)
if err == nil { if err != nil {
reader.Account(sender) fails.Add(1)
return nil
} }
reader.Account(sender)
if tx.To() != nil { if tx.To() != nil {
account, _ := reader.Account(*tx.To()) account, _ := reader.Account(*tx.To())