checks whether cache has any value stored for given cache key
returns value for the key and exact blockHeight
returns latest value stored for given key
returns cached value for the highest available in cache block that is not higher than blockHeight
.
puts new value in cache under given {@link BlockHeightKey.key} and BlockHeightKey.blockHeight.
Generated using TypeDoc
An implementation of BlockHeightSwCache that stores its data in BSON files. Data is flushed to disk every 10 new cache entries.
Main use-case is the per block height state cache for contracts.
A separate file is created for each block height - otherwise it was common to hit 16 megabytes file size limit for bson files.
At time of writing, completely cached state for all contracts, at all block heights, was taking ~2.5GB of disk space :-).
The files are organised in the following structure: --/basePath --/txId_1 --1.cache.bson --2.cache.bson ... --748832.cache.bson --/txId_2 --1.cache.bson --323332.cache.bson ...etc.
Note: this is not performance-optimized for reading LARGE amount of contracts ;-)