ethereumjs-monorepo

@ethereumjs/statemanager


@ethereumjs/statemanager / StatefulBinaryTreeStateManager

Class: StatefulBinaryTreeStateManager

Defined in: statefulBinaryTreeStateManager.ts:72

@ethereumjs/common!StateManagerInterface backed by an EIP-7864 @ethereumjs/binarytree!BinaryTree.

Supports execution witnesses, binary-tree access lists, and checkpointing for VM use.

Implements

Constructors

Constructor

new StatefulBinaryTreeStateManager(opts): StatefulBinaryTreeStateManager

Defined in: statefulBinaryTreeStateManager.ts:102

Parameters

opts

StatefulBinaryTreeStateManagerOpts

Returns

StatefulBinaryTreeStateManager

Properties

hashFunction

hashFunction: (input) => Uint8Array

Defined in: statefulBinaryTreeStateManager.ts:80

Parameters

input

Uint8Array

Returns

Uint8Array


originalStorageCache

originalStorageCache: OriginalStorageCache

Defined in: statefulBinaryTreeStateManager.ts:79

Implementation of

StateManagerInterface.originalStorageCache


preStateRoot

preStateRoot: Uint8Array

Defined in: statefulBinaryTreeStateManager.ts:78

Accessors

tree

Get Signature

get tree(): BinaryTree

Defined in: statefulBinaryTreeStateManager.ts:733

The underlying binary tree holding the state, as exposed through BinaryTreeStateManagerInterface for interface-based consumers (e.g. execution witness generation in @ethereumjs/evm).

Returns

BinaryTree

Implementation of

BinaryTreeStateManagerInterface.tree

Methods

checkChunkWitnessPresent()

checkChunkWitnessPresent(_address, _codeOffset): Promise<boolean>

Defined in: statefulBinaryTreeStateManager.ts:770

Parameters

_address

Address

_codeOffset

number

Returns

Promise<boolean>

Implementation of

StateManagerInterface.checkChunkWitnessPresent


checkpoint()

checkpoint(): Promise<void>

Defined in: statefulBinaryTreeStateManager.ts:464

Returns

Promise<void>

Implementation of

StateManagerInterface.checkpoint


clearCaches()

clearCaches(): void

Defined in: statefulBinaryTreeStateManager.ts:764

Returns

void

Implementation of

StateManagerInterface.clearCaches


clearStorage()

clearStorage(address): Promise<void>

Defined in: statefulBinaryTreeStateManager.ts:460

Parameters

address

Address

Returns

Promise<void>

Implementation of

StateManagerInterface.clearStorage


commit()

commit(): Promise<void>

Defined in: statefulBinaryTreeStateManager.ts:469

Returns

Promise<void>

Implementation of

StateManagerInterface.commit


consumeBAL()

consumeBAL(bal, expectedStateRoot?): Promise<void>

Defined in: statefulBinaryTreeStateManager.ts:746

Apply an EIP-7928 BAL onto this state. See consumeBAL.

Parameters

bal

BALJSONBlockAccessList

expectedStateRoot?

Uint8Array<ArrayBufferLike>

Returns

Promise<void>

Remarks

Experimental (Amsterdam): may change on patch releases.

Implementation of

StateManagerInterface.consumeBAL


deleteAccount()

deleteAccount(address): Promise<void>

Defined in: statefulBinaryTreeStateManager.ts:259

Deletes an account from state under the provided address.

Parameters

address

Address

Address of the account which should be deleted

Returns

Promise<void>

Implementation of

StateManagerInterface.deleteAccount


dumpStorage()?

optional dumpStorage(_address): Promise<StorageDump>

Defined in: statefulBinaryTreeStateManager.ts:758

Parameters

_address

Address

Returns

Promise<StorageDump>

Implementation of

StateManagerInterface.dumpStorage


dumpStorageRange()?

optional dumpStorageRange(_address, _startKey, _limit): Promise<StorageRange>

Defined in: statefulBinaryTreeStateManager.ts:761

Parameters

_address

Address

_startKey

bigint

_limit

number

Returns

Promise<StorageRange>

Implementation of

StateManagerInterface.dumpStorageRange


flush()

flush(): Promise<void>

Defined in: statefulBinaryTreeStateManager.ts:495

Returns

Promise<void>


generateCanonicalGenesis()

generateCanonicalGenesis(genesisState): Promise<void>

Defined in: statefulBinaryTreeStateManager.ts:773

Parameters

genesisState

GenesisState

Returns

Promise<void>

Implementation of

StateManagerInterface.generateCanonicalGenesis


getAccount()

getAccount(address): Promise<Account | undefined>

Defined in: statefulBinaryTreeStateManager.ts:132

Gets the account associated with address or undefined if account does not exist

Parameters

address

Address

Address of the account to get

Returns

Promise<Account | undefined>

Implementation of

StateManagerInterface.getAccount


getCode()

getCode(address): Promise<Uint8Array<ArrayBufferLike>>

Defined in: statefulBinaryTreeStateManager.ts:338

Parameters

address

Address

Returns

Promise<Uint8Array<ArrayBufferLike>>

Implementation of

StateManagerInterface.getCode


getCodeSize()

getCodeSize(address): Promise<number>

Defined in: statefulBinaryTreeStateManager.ts:413

Parameters

address

Address

Returns

Promise<number>

Implementation of

StateManagerInterface.getCodeSize


getComputedValue()

getComputedValue(accessedState): Promise<`0x${string}` | null>

Defined in: statefulBinaryTreeStateManager.ts:535

Parameters

accessedState

BinaryTreeAccessedStateWithAddress

Returns

Promise<`0x${string}` | null>


getStateRoot()

getStateRoot(): Promise<Uint8Array<ArrayBufferLike>>

Defined in: statefulBinaryTreeStateManager.ts:737

Returns

Promise<Uint8Array<ArrayBufferLike>>

Implementation of

StateManagerInterface.getStateRoot


getStorage()

getStorage(address, key): Promise<Uint8Array<ArrayBufferLike>>

Defined in: statefulBinaryTreeStateManager.ts:422

Parameters

address

Address

key

Uint8Array

Returns

Promise<Uint8Array<ArrayBufferLike>>

Implementation of

StateManagerInterface.getStorage


hasStateRoot()

hasStateRoot(root): Promise<boolean>

Defined in: statefulBinaryTreeStateManager.ts:755

Parameters

root

Uint8Array

Returns

Promise<boolean>

Implementation of

StateManagerInterface.hasStateRoot


initBinaryTreeExecutionWitness()

initBinaryTreeExecutionWitness(_blockNum, executionWitness?): void

Defined in: statefulBinaryTreeStateManager.ts:179

Parameters

_blockNum

bigint

executionWitness?

BinaryTreeExecutionWitness | null

Returns

void

Implementation of

StateManagerInterface.initBinaryTreeExecutionWitness


modifyAccountFields()

modifyAccountFields(address, accountFields): Promise<void>

Defined in: statefulBinaryTreeStateManager.ts:277

Parameters

address

Address

accountFields

AccountFields

Returns

Promise<void>

Implementation of

StateManagerInterface.modifyAccountFields


putAccount()

putAccount(address, account?): Promise<void>

Defined in: statefulBinaryTreeStateManager.ts:223

Saves an account into state under the provided address.

Parameters

address

Address

Address under which to store account

account?

Account

The account to store or undefined if to be deleted

Returns

Promise<void>

Implementation of

StateManagerInterface.putAccount


putCode()

putCode(address, value): Promise<void>

Defined in: statefulBinaryTreeStateManager.ts:280

Parameters

address

Address

value

Uint8Array

Returns

Promise<void>

Implementation of

StateManagerInterface.putCode


putStorage()

putStorage(address, key, value): Promise<void>

Defined in: statefulBinaryTreeStateManager.ts:448

Parameters

address

Address

key

Uint8Array

value

Uint8Array

Returns

Promise<void>

Implementation of

StateManagerInterface.putStorage


revert()

revert(): Promise<void>

Defined in: statefulBinaryTreeStateManager.ts:483

Returns

Promise<void>

Implementation of

StateManagerInterface.revert


setStateRoot()

setStateRoot(stateRoot, clearCache?): Promise<void>

Defined in: statefulBinaryTreeStateManager.ts:750

Parameters

stateRoot

Uint8Array

clearCache?

boolean

Returns

Promise<void>

Implementation of

StateManagerInterface.setStateRoot


shallowCopy()

shallowCopy(_downlevelCaches?): StateManagerInterface

Defined in: statefulBinaryTreeStateManager.ts:767

Parameters

_downlevelCaches?

boolean

Returns

StateManagerInterface

Implementation of

StateManagerInterface.shallowCopy


verifyBinaryTreePostState()

verifyBinaryTreePostState(accessWitness): Promise<boolean>

Defined in: statefulBinaryTreeStateManager.ts:629

Parameters

accessWitness

BinaryTreeAccessWitnessInterface

Returns

Promise<boolean>

Implementation of

StateManagerInterface.verifyBinaryTreePostState