[][src]Module merkletree::store

Store implementations.

Structs

DiskIter
DiskStore

The Disk-only store is used to reduce memory to the minimum at the cost of build time performance. Most of its I/O logic is in the store_copy_from_slice and store_read_range functions.

DiskStoreProducer
ExternalReader
LevelCacheStore

The LevelCacheStore is used to reduce the on-disk footprint even further to the minimum at the cost of build time performance. Each LevelCacheStore is created with a StoreConfig object which contains the number of binary tree levels above the base that are 'cached'. This implementation has hard requirements about the on disk file size based on that number of levels, so on-disk files are tied, structurally to the configuration they were built with and can only be accessed with the same number of levels.

MmapStore

Store that saves the data on disk, and accesses it using memmap.

StoreConfig
VecStore
VecStoreIter
VecStoreProducer

Enums

StoreConfigDataVersion

Constants

BUILD_CHUNK_NODES
DEFAULT_CACHED_ABOVE_BASE_LAYER_BINARY
DEFAULT_CACHED_ABOVE_BASE_LAYER_OCT
DEFAULT_CACHED_ABOVE_BASE_LAYER_QUAD
SMALL_TREE_BUILD

Tree size (number of nodes) used as threshold to decide which build algorithm to use. Small trees (below this value) use the old build algorithm, optimized for speed rather than memory, allocating as much as needed to allow multiple threads to work concurrently without interrupting each other. Large trees (above) use the new build algorithm, optimized for memory rather than speed, allocating as less as possible with multiple threads competing to get the write lock.

Traits

Store

Backing store of the merkle tree.