Skip to content

Commit

Permalink
fix outdated docs
Browse files Browse the repository at this point in the history
Since cosmos#676, nodes are indexed by an integer nonce instead of its hash
  • Loading branch information
larry0x authored May 11, 2023
1 parent 747bc12 commit 532283f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ The IAVL tree is a versioned, snapshottable (immutable) AVL+ tree for persistent

The purpose of this data structure is to provide persistent storage for key-value pairs (say to store account balances) such that a deterministic merkle root hash can be computed. The tree is balanced using a variant of the [AVL algorithm](http://en.wikipedia.org/wiki/AVL_tree) so all operations are O(log(n)).

Nodes of this tree are immutable and indexed by their hash. Thus any node serves as an immutable snapshot which lets us stage uncommitted transactions from the mempool cheaply, and we can instantly roll back to the last committed state to process transactions of a newly committed block (which may not be the same set of transactions as those from the mempool).
Nodes of this tree are immutable and indexed by an integer nonce. Thus any node serves as an immutable snapshot which lets us stage uncommitted transactions from the mempool cheaply, and we can instantly roll back to the last committed state to process transactions of a newly committed block (which may not be the same set of transactions as those from the mempool).

In an AVL tree, the heights of the two child subtrees of any node differ by at most one. Whenever this condition is violated upon an update, the tree is rebalanced by creating O(log(n)) new nodes that point to unmodified nodes of the old tree. In the original AVL algorithm, inner nodes can also hold key-value pairs. The AVL+ algorithm (note the plus) modifies the AVL algorithm to keep all values on leaf nodes, while only using branch-nodes to store keys. This simplifies the algorithm while keeping the merkle hash trail short.

Expand Down Expand Up @@ -39,4 +39,4 @@ In Ethereum, the analog is [Patricia tries](http://en.wikipedia.org/wiki/Radix_t
7. [Export/import docs](./tree/export_import.md)
- Explains the overall export/import functionality
- Explains the `ExportNode` format for exported nodes
- Explains the algorithms for exporting and importing nodes
- Explains the algorithms for exporting and importing nodes

0 comments on commit 532283f

Please sign in to comment.