@ethereumjs/statemanager / AccountCache
Defined in: cache/account.ts:21
Cache
new AccountCache(
opts
):AccountCache
Defined in: cache/account.ts:35
AccountCache
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
,undefined
|AccountCacheElement
>[] =[]
Defined in: cache/account.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:
undefined
|LRUCache
<string
,AccountCacheElement
,unknown
>
Defined in: cache/account.ts:22
_orderedMapCache:
undefined
|OrderedMap
<string
,AccountCacheElement
>
Defined in: cache/account.ts:23
_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(
cacheKeyHex
):void
Defined in: cache/account.ts:50
string
void
checkpoint():
void
Defined in: cache/account.ts:222
Marks current state of cache as checkpoint, which can later on be reverted or committed.
void
clear():
void
Defined in: cache/account.ts:264
Clears cache.
void
commit():
void
Defined in: cache/account.ts:202
Commits to current state of cache (no effect on trie).
void
del(
address
):void
Defined in: cache/account.ts:122
Marks address as deleted in cache.
Address
Address
void
flush(): [
string
,AccountCacheElement
][]
Defined in: cache/account.ts:145
Flushes cache by returning accounts that have been modified or deleted and resetting the diff cache (at checkpoint height).
[string
, AccountCacheElement
][]
get(
address
):undefined
|AccountCacheElement
Defined in: cache/account.ts:99
Returns the queried account or undefined if account doesn’t exist
Address
Address of account
undefined
| AccountCacheElement
put(
address
,account
,couldBePartialAccount
):void
Defined in: cache/account.ts:68
Puts account to cache under its address.
Address
Address of account
Account or undefined if account doesn’t exist in the trie
undefined |
Account |
boolean
= false
void
revert():
void
Defined in: cache/account.ts:174
Revert changes to cache last checkpoint (no effect on trie).
void
size():
number
Defined in: cache/account.ts:234
Returns the size of the cache
number
stats(
reset
):object
Defined in: cache/account.ts:246
Returns a dict with cache stats
boolean
= true
object
deletions:
number
=0
hits:
number
=0
reads:
number
=0
size:
number
=0
writes:
number
=0