@ethereumjs/verkle / WalkController
WalkController is an interface to control how the tree is being traversed.
• Readonly
onNode: FoundNodeFunction
• Readonly
taskExecutor: PrioritizedTaskExecutor
• Readonly
tree: VerkleTree
▸ allChildren(node
, key?
): void
Run all children of a node. Priority of these nodes are the key length of the children.
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. |
void
▸ pushChildrenAtIndex(node
, key?
, childIndex
, priority?
): void
Push the child of an internal node to the event queue.
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. |
void
▸ 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.
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 |
void
▸ Static
newWalk(onNode
, tree
, root
, poolSize?
): Promise
<void
>
Async function to create and start a new walk over a tree.
| 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. |
Promise
<void
>