@ethereumjs/statemanager / StatelessVerkleStateManager
Defined in: statelessVerkleStateManager.ts:69
Stateless Verkle StateManager implementation for the VM.
Experimental.
This State Manager enables stateless block execution by building a temporary (1-block) state from the verkle block witness. The Stateless Verkle State Manager then uses that populated state to fetch data requested by the the VM.
StateManagerInterface
new StatelessVerkleStateManager(
opts
):StatelessVerkleStateManager
Defined in: statelessVerkleStateManager.ts:113
Instantiate the StateManager interface.
StatelessVerkleStateManagerOpts
StatelessVerkleStateManager
optional
_cachedStateRoot:Uint8Array
<ArrayBufferLike
>
Defined in: statelessVerkleStateManager.ts:70
readonly
common:Common
Defined in: statelessVerkleStateManager.ts:80
originalStorageCache:
OriginalStorageCache
Defined in: statelessVerkleStateManager.ts:72
StateManagerInterface.originalStorageCache
verkleCrypto:
VerkleCrypto
Defined in: statelessVerkleStateManager.ts:74
checkChunkWitnessPresent(
address
,codeOffset
):Promise
<boolean
>
Defined in: statelessVerkleStateManager.ts:206
Address
number
Promise
<boolean
>
StateManagerInterface.checkChunkWitnessPresent
checkpoint():
Promise
<void
>
Defined in: statelessVerkleStateManager.ts:639
Checkpoints the current state of the StateManager instance.
State changes that follow can then be committed by calling
commit
or reverted
by calling rollback.
Promise
<void
>
StateManagerInterface.checkpoint
clearCaches():
void
Defined in: statelessVerkleStateManager.ts:698
Clears all underlying caches
void
StateManagerInterface.clearCaches
clearStorage(
address
):Promise
<void
>
Defined in: statelessVerkleStateManager.ts:388
Clears all storage entries for the account corresponding to address
.
Address
Address to clear the storage of
Promise
<void
>
StateManagerInterface.clearStorage
commit():
Promise
<void
>
Defined in: statelessVerkleStateManager.ts:648
Commits the current change-set to the instance since the last call to checkpoint.
Promise
<void
>
StateManagerInterface.commit
deleteAccount(
address
):Promise
<void
>
Defined in: statelessVerkleStateManager.ts:489
Deletes an account from state under the provided address
.
Address
Address of the account which should be deleted
Promise
<void
>
StateManagerInterface.deleteAccount
flush():
Promise
<void
>
Defined in: statelessVerkleStateManager.ts:671
Writes all cache items to the trie
Promise
<void
>
generateCanonicalGenesis(
_initState
):Promise
<void
>
Defined in: statelessVerkleStateManager.ts:706
any
Promise
<void
>
StateManagerInterface.generateCanonicalGenesis
getAccount(
address
):Promise
<undefined
|Account
>
Defined in: statelessVerkleStateManager.ts:396
Address
Promise
<undefined
| Account
>
StateManagerInterface.getAccount
getCode(
address
):Promise
<Uint8Array
<ArrayBufferLike
>>
Defined in: statelessVerkleStateManager.ts:257
Gets the code corresponding to the provided address
.
Address
Address to get the code
for
Promise
<Uint8Array
<ArrayBufferLike
>>
Uint8Array
if the account has no associated code.StateManagerInterface.getCode
getCodeSize(
address
):Promise
<number
>
Defined in: statelessVerkleStateManager.ts:312
Address
Promise
<number
>
StateManagerInterface.getCodeSize
getComputedValue(
accessedState
):null
|`0x${string}`
Defined in: statelessVerkleStateManager.ts:581
VerkleAccessedStateWithAddress
null
| `0x${string}`
getStateRoot():
Promise
<Uint8Array
<ArrayBufferLike
>>
Defined in: statelessVerkleStateManager.ts:679
Gets the cache state root. This is used to persist the stateRoot between blocks, so that blocks can retrieve the stateRoot of the parent block. This is required to verify and prove verkle execution witnesses.
Promise
<Uint8Array
<ArrayBufferLike
>>
StateManagerInterface.getStateRoot
getStorage(
address
,key
):Promise
<Uint8Array
<ArrayBufferLike
>>
Defined in: statelessVerkleStateManager.ts:342
Gets the storage value associated with the provided address
and key
. This method returns
the shortest representation of the stored value.
Address
Address of the account to get the storage for
Uint8Array
Key in the account’s storage to get the value for. Must be 32 bytes long.
Promise
<Uint8Array
<ArrayBufferLike
>>
Uint8Array
is returned.StateManagerInterface.getStorage
getTransitionStateRoot(
_
,__
):Promise
<Uint8Array
<ArrayBufferLike
>>
Defined in: statelessVerkleStateManager.ts:138
Uint8Array
Promise
<Uint8Array
<ArrayBufferLike
>>
hasStateRoot(
_
):Promise
<boolean
>
Defined in: statelessVerkleStateManager.ts:654
Uint8Array
Promise
<boolean
>
StateManagerInterface.hasStateRoot
initVerkleExecutionWitness(
blockNum
,executionWitness?
):void
Defined in: statelessVerkleStateManager.ts:142
bigint
null |
VerkleExecutionWitness |
void
StateManagerInterface.initVerkleExecutionWitness
modifyAccountFields(
address
,accountFields
):Promise
<void
>
Defined in: statelessVerkleStateManager.ts:497
Address
Partial
Promise
<void
>
StateManagerInterface.modifyAccountFields
putAccount(
address
,account
):Promise
<void
>
Defined in: statelessVerkleStateManager.ts:465
Address
Account
Promise
<void
>
StateManagerInterface.putAccount
putCode(
address
,value
):Promise
<void
>
Defined in: statelessVerkleStateManager.ts:233
Adds value
to the state trie as code, and sets codeHash
on the account
corresponding to address
to reference this.
Address
Address of the account
to add the code
for
Uint8Array
The value of the code
Promise
<void
>
StateManagerInterface.putCode
putStorage(
address
,key
,value
):Promise
<void
>
Defined in: statelessVerkleStateManager.ts:368
Adds value to the state for the account
corresponding to address
at the provided key
.
Address
Address to set a storage value for
Uint8Array
Key to set the value at. Must be 32 bytes long.
Uint8Array
Value to set at key
for account corresponding to address
. Cannot be more than 32 bytes. Leading zeros are stripped. If it is a empty or filled with zeros, deletes the value.
Promise
<void
>
StateManagerInterface.putStorage
revert():
Promise
<void
>
Defined in: statelessVerkleStateManager.ts:662
Reverts the current change-set to the instance since the last call to checkpoint.
Promise
<void
>
StateManagerInterface.revert
setStateRoot(
stateRoot
):Promise
<void
>
Defined in: statelessVerkleStateManager.ts:691
Sets the cache state root. This is used to persist the stateRoot between blocks, so that blocks can retrieve the stateRoot of the parent block.
Uint8Array
The stateRoot to set
Promise
<void
>
StateManagerInterface.setStateRoot
shallowCopy(
downlevelCaches
):StatelessVerkleStateManager
Defined in: statelessVerkleStateManager.ts:219
Copies the current instance of the StateManager
at the last fully committed point, i.e. as if all current
checkpoints were reverted.
boolean
= true
StatelessVerkleStateManager
StateManagerInterface.shallowCopy
verifyVerklePostState(
accessWitness
):Promise
<boolean
>
Defined in: statelessVerkleStateManager.ts:503
VerkleAccessWitnessInterface
Promise
<boolean
>
StateManagerInterface.verifyVerklePostState