ethereumjs-monorepo

@ethereumjs/verkle / WalkController

Class: WalkController

WalkController is an interface to control how the tree is being traversed.

Table of contents

Properties

Methods

Properties

onNode

Readonly onNode: FoundNodeFunction

Defined in

util/walkController.ts:13


taskExecutor

Readonly taskExecutor: PrioritizedTaskExecutor

Defined in

util/walkController.ts:14


tree

Readonly tree: VerkleTree

Defined in

util/walkController.ts:15

Methods

allChildren

allChildren(node, key?): void

Run all children of a node. Priority of these nodes are the key length of the children.

Parameters

Name Type Description
node VerkleNode Node to retrieve all children from of and call onNode on.
key Uint8Array The current key which would yield the node when trying to get this node with a get operation.

Returns

void

Defined in

util/walkController.ts:70


pushChildrenAtIndex

pushChildrenAtIndex(node, key?, childIndex, priority?): void

Push the child of an internal node to the event queue.

Parameters

Name Type Description
node InternalNode The node to select a children from. Should be an InternalNode.
key Uint8Array The current key which leads to the corresponding node.
childIndex number The child index to add to the event queue.
priority? number Optional priority of the event, defaults to the total key length.

Returns

void

Defined in

util/walkController.ts:117


pushNodeToQueue

pushNodeToQueue(nodeRef, key?, priority?): void

Push a node to the queue. If the queue has places left for tasks, the node is executed immediately, otherwise it is queued.

Parameters

Name Type Description
nodeRef Uint8Array Push a node reference to the event queue. This reference is a 32-byte keccak hash of the value corresponding to the key.
key Uint8Array The current key.
priority? number Optional priority, defaults to key length

Returns

void

Defined in

util/walkController.ts:94


newWalk

Static newWalk(onNode, tree, root, poolSize?): Promise<void>

Async function to create and start a new walk over a tree.

Parameters

| Name | Type | Description | | :—— | :—— | :—— | | onNode | FoundNodeFunction | The FoundNodeFunction to call if a node is found. | | tree | [VerkleTree](/ethereumjs-monorepo/packages/verkle/docs/classes/VerkleTree.html) | The tree to walk on. | | root | Uint8Array | The root key to walk on. | | poolSize? | number` | Task execution pool size to prevent OOM errors. Defaults to 500. |

Returns

Promise<void>

Defined in

util/walkController.ts:40