@ethereumjs/statemanager / CodeCache
Defined in: cache/code.ts:19
Cachenew CodeCache(
opts):CodeCache
Defined in: cache/code.ts:34
CodeCache
Cache.constructor
_checkpoints:
number=0
Defined in: cache/cache.ts:9
Cache._checkpoints
_debug:
Debugger
Defined in: cache/cache.ts:7
Cache._debug
_diffCache:
Map<string,CodeCacheElement|undefined>[] =[]
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:
LRUCache<string,CodeCacheElement,unknown> |undefined
Defined in: cache/code.ts:20
_orderedMapCache:
OrderedMap<string,CodeCacheElement> |undefined
Defined in: cache/code.ts:21
_stats:
object
Defined in: cache/cache.ts:11
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:223
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:267
Clears the cache.
void
commit():
void
Defined in: cache/code.ts:203
Commits the current state of the cache (no effect on trie).
void
del(
address):void
Defined in: cache/code.ts:122
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:146
Flushes the cache by returning codes that have been modified or deleted and resetting the diff cache (at checkpoint height).
[string, CodeCacheElement][]
get(
address):CodeCacheElement|undefined
Defined in: cache/code.ts:97
Returns the queried code or undefined if it doesn’t exist.
Address
Account address for which code is being fetched.
CodeCacheElement | undefined
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.
Uint8Array<ArrayBufferLike> |
undefined |
void
revert():
void
Defined in: cache/code.ts:175
Revert changes to the cache to the last checkpoint (no effect on trie).
void
size():
number
Defined in: cache/code.ts:235
Returns the size of the cache
number
stats(
reset):any
Defined in: cache/code.ts:249
Returns a dictionary with cache statistics.
boolean = true
Whether to reset statistics after retrieval.
any
A dictionary with cache statistics.