@ethereumjs/statemanager / StorageCache
Defined in: cache/storage.ts:21
In-memory storage slot cache with checkpoint/revert support.
Cachenew StorageCache(
opts):StorageCache
Defined in: cache/storage.ts:36
StorageCache
Cache.constructor
_checkpoints:
number=0
Defined in: cache/cache.ts:10
Cache._checkpoints
_debug:
Debugger
Defined in: cache/cache.ts:8
Cache._debug
_diffCache:
Map<string,DiffStorageCacheMap>[] =[]
Defined in: cache/storage.ts:34
Diff cache collecting the state of the cache at the beginning of checkpoint height (respectively: before a first modification)
If the whole cache element is undefined (in contrast to the account), the element didn’t exist in the cache before.
_lruCache:
LRUCache<string,StorageCacheMap,unknown> |undefined
Defined in: cache/storage.ts:22
_orderedMapCache:
OrderedMap<string,StorageCacheMap> |undefined
Defined in: cache/storage.ts:23
_stats:
object
Defined in: cache/cache.ts:12
deletions:
number=0
hits:
number=0
reads:
number=0
size:
number=0
writes:
number=0
Cache._stats
_saveCachePreState(
addressHex,keyHex):void
Defined in: cache/storage.ts:54
string
string
void
checkpoint():
void
Defined in: cache/storage.ts:304
Marks current state of cache as checkpoint, which can later on be reverted or committed.
void
clear():
void
Defined in: cache/storage.ts:344
Clears cache.
void
clearStorage(
address):void
Defined in: cache/storage.ts:178
Remove all cached storage slots for an account.
Account whose storage map should be cleared
void
commit():
void
Defined in: cache/storage.ts:271
Commits to current state of cache (no effect on trie).
void
del(
address,key):void
Defined in: cache/storage.ts:147
Marks storage key for address as deleted in cache.
Address
Uint8Array
Storage key
void
dump(
address):StorageCacheMap|undefined
Defined in: cache/storage.ts:360
Dumps the RLP-encoded storage values for an account specified by address.
Account to dump from the cache
StorageCacheMap | undefined
Map of slot hex keys to values, or undefined when the account is not cached
flush(): [
string,string,Uint8Array<ArrayBufferLike> |undefined][]
Defined in: cache/storage.ts:191
Flushes cache by returning storage slots that have been modified or deleted and resetting the diff cache (at checkpoint height).
[string, string, Uint8Array<ArrayBufferLike> | undefined][]
get(
address,key):Uint8Array<ArrayBufferLike> |undefined
Defined in: cache/storage.ts:122
Returns the queried slot as the RLP encoded storage value hexToBytes(‘0x80’): slot is known to be empty undefined: slot is not in cache
Address of account
Uint8Array
Storage key
Uint8Array<ArrayBufferLike> | undefined
Storage value or undefined
put(
address,key,value):void
Defined in: cache/storage.ts:83
Puts storage value to cache under address_key cache key.
Account address
Uint8Array
Storage key
Uint8Array
RLP-encoded storage value
void
revert():
void
Defined in: cache/storage.ts:229
Revert changes to cache last checkpoint (no effect on trie).
void
size():
number
Defined in: cache/storage.ts:313
Current number of accounts with cached storage maps.
number
stats(
reset?):object
Defined in: cache/storage.ts:326
Read/write statistics for this cache.
boolean = true
When true (default), zero counters after reading
object
deletions:
number=0
hits:
number=0
reads:
number=0
size:
number=0
writes:
number=0