@ethereumjs/statemanager / StorageCache
Defined in: cache/storage.ts:20
Cache
new StorageCache(
opts
):StorageCache
Defined in: cache/storage.ts:35
StorageCache
Cache.constructor
_checkpoints:
number
=0
Defined in: cache/cache.ts:8
Cache._checkpoints
_debug:
Debugger
Defined in: cache/cache.ts:6
Cache._debug
_diffCache:
Map
<string
,DiffStorageCacheMap
>[] =[]
Defined in: cache/storage.ts:33
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:
undefined
|LRUCache
<string
,StorageCacheMap
,unknown
>
Defined in: cache/storage.ts:21
_orderedMapCache:
undefined
|OrderedMap
<string
,StorageCacheMap
>
Defined in: cache/storage.ts:22
_stats:
object
Defined in: cache/cache.ts:10
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:53
string
string
void
checkpoint():
void
Defined in: cache/storage.ts:301
Marks current state of cache as checkpoint, which can later on be reverted or committed.
void
clear():
void
Defined in: cache/storage.ts:343
Clears cache.
void
clearStorage(
address
):void
Defined in: cache/storage.ts:175
Deletes all storage slots for address from the cache
Address
void
commit():
void
Defined in: cache/storage.ts:268
Commits to current state of cache (no effect on trie).
void
del(
address
,key
):void
Defined in: cache/storage.ts:145
Marks storage key for address as deleted in cache.
Address
Address
Uint8Array
Storage key
void
dump(
address
):undefined
|StorageCacheMap
Defined in: cache/storage.ts:359
Dumps the RLP-encoded storage values for an account
specified by address
.
Address
The address of the account
to return storage for
undefined
| StorageCacheMap
account
or undefined if the account
is not in the cacheflush(): [
string
,string
,undefined
|Uint8Array
<ArrayBufferLike
>][]
Defined in: cache/storage.ts:188
Flushes cache by returning storage slots that have been modified or deleted and resetting the diff cache (at checkpoint height).
[string
, string
, undefined
| Uint8Array
<ArrayBufferLike
>][]
get(
address
,key
):undefined
|Uint8Array
<ArrayBufferLike
>
Defined in: cache/storage.ts:120
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
Address of account
Uint8Array
Storage key
undefined
| Uint8Array
<ArrayBufferLike
>
Storage value or undefined
put(
address
,key
,value
):void
Defined in: cache/storage.ts:82
Puts storage value to cache under address_key cache key.
Address
Account address
Uint8Array
Storage key
Uint8Array
void
revert():
void
Defined in: cache/storage.ts:226
Revert changes to cache last checkpoint (no effect on trie).
void
size():
number
Defined in: cache/storage.ts:313
Returns the size of the cache
number
stats(
reset
):object
Defined in: cache/storage.ts:325
Returns a dict with cache stats
boolean
= true
object
deletions:
number
=0
hits:
number
=0
reads:
number
=0
size:
number
=0
writes:
number
=0