# Functions
CacheMisses retrieves a global counter measuring the number of cache misses the trie had since process startup.
CacheUnloads retrieves a global counter measuring the number of cache unloads the trie did since process startup.
New creates a trie with an existing root node from db.
NewDatabase creates a new trie database to store ephemeral trie content before its written out to disk or garbage collected.*
对 db 实例的封装
*/.
NewDifferenceIterator constructs a NodeIterator that iterates over elements in b that are not in a.
NewIterator creates a new key-value iterator from a node iterator.
NewSecure creates a trie with an existing root node from a backing database and optional intermediate in-memory node pool.
NewSync creates a new trie data download scheduler.
NewUnionIterator constructs a NodeIterator that iterates over elements in the union of the provided NodeIterators.
todo 校验 Prove() 返回的 proofDb 数组 和 key 的关系
以此来得知 key 是否在该 MPT 的路径上 ?
验证proffDb中是否存在满足输入的hash,和对应key的节点,如果满足,则返回rlp解码后的该节点
todo 因为 key 对应的 value 肯定是 valueNode.
# Variables
ErrAlreadyProcessed is returned by the trie sync when it's requested to process a node it already processed previously.
ErrNotRequested is returned by the trie sync when it's requested to process a node it did not request.
# Structs
Database is an intermediate write layer between the trie data structures and the disk database.
Iterator is a key-value trie iterator that traverses a Trie.
MissingNodeError is returned by the trie functions (TryGet, TryUpdate, TryDelete) in the case where a trie node is not present in the local database.
SecureTrie wraps a trie with key hashing.
Sync is the main state trie synchronisation scheduler, which provides yet unknown trie hashes to retrieve, accepts node data associated with said hashes and reconstructs the trie step by step until all is done.
SyncResult is a simple list to return missing nodes along with their request hashes.
Trie is a Merkle Patricia Trie.
# Interfaces
DatabaseReader wraps the Get and Has method of a backing store for the trie.
NodeIterator is an iterator to traverse the trie pre-order.
# Type aliases
LeafCallback is a callback type invoked when a trie operation reaches a leaf node.