---------------
Released 2020-05-27
Breaking Changes
~~~~~~~~~~~~~~~~
- Removed trie.Trie -- use trie.HexaryTrie instead
https://github.com/ethereum/py-trie/pull/100
- Removed trie.sync (classes: SyncRequest and HexaryTrieSync)
New syncing helper tools are imminent.
https://github.com/ethereum/py-trie/pull/100
- MissingTrieNode is no longer a KeyError, paving the way for eventually raising a KeyError instead
of returning b'' when a key is not present in the trie
https://github.com/ethereum/py-trie/pull/98
- If a trie body is missing when calling HexaryTrie.root_node, the exception will be
MissingTraversalNode instead of MissingTrieNode
https://github.com/ethereum/py-trie/pull/102
- Remove support for setting the trie's raw root node directly, via
HexaryTrie.root_node = new_raw_root_node
https://github.com/ethereum/py-trie/pull/106
- Return new annotated HexaryTrieNode from HexaryTrie.root_node property
https://github.com/ethereum/py-trie/pull/106
Features
~~~~~~~~
- MissingTrieNode now includes the prefix of the key leading to the node body that was missing
from the database. This is important for other potential database layouts. The prefix may be None,
if it cannot be determined. For now, it will not be determined when setting or deleting a key.
https://github.com/ethereum/py-trie/pull/98
- New HexaryTrie.traverse(tuple_of_nibbles) returns an annotated trie node found at the
given path of nibbles, starting from the root.
https://github.com/ethereum/py-trie/pull/102
- New HexaryTrie.traverse_from(node, tuple_of_nibbles) returns an annotated trie node found
when navigating from the given node_body down through the given path of nibbles. Useful for
avoiding database reads when the parent node body is known. Otherwise, navigating down from
the root would be required every time.
https://github.com/ethereum/py-trie/pull/102
- New MissingTraversalNode exception, analogous to MissingTrieNode, but when traversing
(because key is not available, and root_hash not available during traverse_from())
https://github.com/ethereum/py-trie/pull/102
- New TraversedPartialPath exception, raised when you try to navigate to a node, but end up
part-way inside an extension node, or try to navigate into a leaf node.
https://github.com/ethereum/py-trie/pull/102
- New HexaryTrieFog to help track unexplored prefixes, when walking a trie. Serializeable to bytes.
New exceptions PerfectVisibility or FullDirectionalVisibility when no prefixes are unexplored.
New TrieFrontierCache to reduce duplicate database accesses on a full trie walk.
https://github.com/ethereum/py-trie/pull/95
Bugfixes
~~~~~~~~
- Pruning Bugfix: with duplicate values at multiple keys, pruning would sometimes incorrectly
prune out a node that was still required. This is fixed for fresh databases, and unfixable
for existing databases. (Prune is not designed for on-disk/existing DBs anyhow)
https://github.com/ethereum/py-trie/pull/93
- Avoid reading root node when unnecessary during squash_changes(). This can be important when
building a witness, if the witness is supposed to be empty. (for example, in storage tries)
https://github.com/ethereum/py-trie/pull/101
Misc
~~~~
- Type annotation cleanups & upgrades flake8/eth-utils
https://github.com/ethereum/py-trie/pull/95