@ethereumjs/statemanager / SimpleStateManager
Defined in: simpleStateManager.ts:26
Simple and dependency-free state manager for basic state access use cases where a merkle-patricia or verkle tree backed state manager is too heavy-weight.
This state manager comes with the basic state access logic for accounts, storage and code (put* and get* methods) as well as a simple implementation of checkpointing but lacks methods implementations of state root related logic as well as some other non-core functions.
Functionality provided is sufficient to be used for simple EVM use cases and the state manager is used as default there.
For a more full fledged and MPT-backed state manager implementation
have a look at the @ethereumjs/statemanager
package docs.
StateManagerInterface
new SimpleStateManager(
opts
):SimpleStateManager
Defined in: simpleStateManager.ts:38
SimpleStateManager
accountStack:
Map
<`0x${string}`
,undefined
|Account
>[] =[]
Defined in: simpleStateManager.ts:27
codeStack:
Map
<`0x${string}`
,Uint8Array
<ArrayBufferLike
>>[] =[]
Defined in: simpleStateManager.ts:28
readonly
optional
common:Common
Defined in: simpleStateManager.ts:36
originalStorageCache:
object
Defined in: simpleStateManager.ts:31
clear():
void
void
get(
address
,key
):Promise
<Uint8Array
<ArrayBufferLike
>>
Address
Uint8Array
Promise
<Uint8Array
<ArrayBufferLike
>>
StateManagerInterface.originalStorageCache
storageStack:
Map
<string
,Uint8Array
<ArrayBufferLike
>>[] =[]
Defined in: simpleStateManager.ts:29
checkpoint():
Promise
<void
>
Defined in: simpleStateManager.ts:116
Promise
<void
>
StateManagerInterface.checkpoint
clearCaches():
void
Defined in: simpleStateManager.ts:132
void
StateManagerInterface.clearCaches
clearStorage():
Promise
<void
>
Defined in: simpleStateManager.ts:114
Promise
<void
>
StateManagerInterface.clearStorage
commit():
Promise
<void
>
Defined in: simpleStateManager.ts:119
Promise
<void
>
StateManagerInterface.commit
deleteAccount(
address
):Promise
<void
>
Defined in: simpleStateManager.ts:77
Address
Promise
<void
>
StateManagerInterface.deleteAccount
flush():
Promise
<void
>
Defined in: simpleStateManager.ts:131
Promise
<void
>
getAccount(
address
):Promise
<undefined
|Account
>
Defined in: simpleStateManager.ts:69
Address
Promise
<undefined
| Account
>
StateManagerInterface.getAccount
getCode(
address
):Promise
<Uint8Array
<ArrayBufferLike
>>
Defined in: simpleStateManager.ts:85
Address
Promise
<Uint8Array
<ArrayBufferLike
>>
StateManagerInterface.getCode
getCodeSize(
address
):Promise
<number
>
Defined in: simpleStateManager.ts:99
Address
Promise
<number
>
StateManagerInterface.getCodeSize
getStateRoot():
Promise
<Uint8Array
<ArrayBufferLike
>>
Defined in: simpleStateManager.ts:145
Promise
<Uint8Array
<ArrayBufferLike
>>
StateManagerInterface.getStateRoot
getStorage(
address
,key
):Promise
<Uint8Array
<ArrayBufferLike
>>
Defined in: simpleStateManager.ts:104
Address
Uint8Array
Promise
<Uint8Array
<ArrayBufferLike
>>
StateManagerInterface.getStorage
hasStateRoot():
Promise
<boolean
>
Defined in: simpleStateManager.ts:151
Promise
<boolean
>
StateManagerInterface.hasStateRoot
modifyAccountFields(
address
,accountFields
):Promise
<void
>
Defined in: simpleStateManager.ts:81
Address
Partial
Promise
<void
>
StateManagerInterface.modifyAccountFields
putAccount(
address
,account?
):Promise
<void
>
Defined in: simpleStateManager.ts:73
Address
Account
Promise
<void
>
StateManagerInterface.putAccount
putCode(
address
,value
):Promise
<void
>
Defined in: simpleStateManager.ts:89
Address
Uint8Array
Promise
<void
>
StateManagerInterface.putCode
putStorage(
address
,key
,value
):Promise
<void
>
Defined in: simpleStateManager.ts:110
Address
Uint8Array
Uint8Array
Promise
<void
>
StateManagerInterface.putStorage
revert():
Promise
<void
>
Defined in: simpleStateManager.ts:125
Promise
<void
>
StateManagerInterface.revert
setStateRoot():
Promise
<void
>
Defined in: simpleStateManager.ts:148
Promise
<void
>
StateManagerInterface.setStateRoot
shallowCopy():
StateManagerInterface
Defined in: simpleStateManager.ts:134
StateManagerInterface
StateManagerInterface.shallowCopy