Last updated
Last updated
An in the MPT is designed to represent a shared path segment within the trie. Unlike the Leaf Node, it does not store actual data values. Instead, it serves to optimize and reduce the depth of the trie by consolidating shared paths.
Path Consolidator: An Extension Node is essentially a pathway shortener. By capturing shared segments of keys in the trie, it reduces the depth and complexity of the tree structure.
Single Child: Unlike Leaf Nodes, an Extension Node points to one child node, which could either be another Extension Node, a Leaf Node, or a branching node.
To depict the Extension Node in Go, we've structured it as:
Path
: Captures the shared segment of the path, represented as nibbles
Node
: Holds a reference to its single child node
Dirty
: A boolean flag indicating if modifications have been made to the node since the last commit