core/state: add codesize to cache

This commit is contained in:
cuiweixie 2025-12-01 19:12:27 +08:00
parent 6f2cbb7a27
commit e7ff54fcbc
No known key found for this signature in database
GPG key ID: 16DF64EE15E495A3

View file

@ -147,7 +147,9 @@ func (r *cachingCodeReader) CodeSize(addr common.Address, codeHash common.Hash)
if err != nil {
return 0, err
}
return len(code), nil
n := len(code)
r.codeSizeCache.Add(codeHash, n)
return n, nil
}
// flatReader wraps a database state reader and is safe for concurrent access.