@ethereumjs/statemanager / CodeCache
Defined in: cache/code.ts:19
Cache
new CodeCache(
opts
):CodeCache
Defined in: cache/code.ts:34
CodeCache
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
|CodeCacheElement
>[] =[]
Defined in: cache/code.ts:32
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 code), the element didn’t exist in the cache before.
_lruCache:
undefined
|LRUCache
<string
,CodeCacheElement
,unknown
>
Defined in: cache/code.ts:20
_orderedMapCache:
undefined
|OrderedMap
<string
,CodeCacheElement
>
Defined in: cache/code.ts:21
_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/code.ts:54
Saves the state of the code cache before making changes to it.
string
Account key for which code is being modified.
void
checkpoint():
void
Defined in: cache/code.ts:220
Marks the current state of the cache as a checkpoint, which can later be reverted or committed.
void
clear():
void
Defined in: cache/code.ts:264
Clears the cache.
void
commit():
void
Defined in: cache/code.ts:200
Commits the current state of the cache (no effect on trie).
void
del(
address
):void
Defined in: cache/code.ts:120
Marks code as deleted in the cache.
Address
Account address for which code is being fetched.
void
flush(): [
string
,CodeCacheElement
][]
Defined in: cache/code.ts:143
Flushes the cache by returning codes that have been modified or deleted and resetting the diff cache (at checkpoint height).
[string
, CodeCacheElement
][]
get(
address
):undefined
|CodeCacheElement
Defined in: cache/code.ts:96
Returns the queried code or undefined if it doesn’t exist.
Address
Account address for which code is being fetched.
undefined
| CodeCacheElement
put(
address
,code
):void
Defined in: cache/code.ts:73
Puts code into the cache under its hash.
Address
Address of account code is being modified for.
Bytecode or undefined if code doesn’t exist.
undefined |
Uint8Array <ArrayBufferLike > |
void
revert():
void
Defined in: cache/code.ts:172
Revert changes to the cache to the last checkpoint (no effect on trie).
void
size():
number
Defined in: cache/code.ts:232
Returns the size of the cache
number
stats(
reset
):any
Defined in: cache/code.ts:246
Returns a dictionary with cache statistics.
boolean
= true
Whether to reset statistics after retrieval.
any
A dictionary with cache statistics.