# Functions
GenerateAccountTrieRoot takes an account iterator and reproduces the root hash.
GenerateStorageTrieRoot takes a storage iterator and reproduces the root hash.
New attempts to load an already existing snapshot from a persistent key-value store (with a number of memory layers from a journal), ensuring that the head of the snapshot matches the expected one.
VerifyState takes the whole snapshot tree as the input, traverses all the accounts as well as the corresponding storages and compares the re-computed hash with the original one(state root and the storage root).
# Variables
ErrNotConstructed is returned if the callers want to iterate the snapshot while the generation is not finished yet.
ErrNotCoveredYet is returned from data accessors if the underlying snapshot is being generated currently and the requested data item is not yet in the range of accounts covered.
ErrSnapshotStale is returned from data accessors if the underlying snapshot layer had been invalidated due to the chain progressing forward far enough to not maintain the layer's original state.
# Interfaces
AccountIterator is a iterator to step over all the accounts in a snapshot, which may or may not be composed of multiple layers.
Iterator is a iterator to step over all the accounts or the specific storage in a snapshot which may or may not be composed of multiple layers.
Snapshot represents the functionality supported by a snapshot storage layer.
StorageIterator is a iterator to step over the specific storage in a snapshot, which may or may not be composed of multiple layers.