pub struct BlockStoreConfig {Show 24 fields
pub path: PathBuf,
pub block_cache_capacity: usize,
pub header_cache_capacity: usize,
pub cache_shards: usize,
pub warm_cache_on_open: bool,
pub warm_cache_depth: u64,
pub write_buffer_size: usize,
pub block_cache_size: usize,
pub max_open_files: i32,
pub enable_blob_db: bool,
pub compress_blocks: bool,
pub compression_level: i32,
pub use_compression_dict: bool,
pub max_decompressed_block_bytes: usize,
pub zstd_dictionary_override: Option<Vec<u8>>,
pub write_pipeline_batch_size: usize,
pub write_pipeline_flush_ms: u64,
pub write_pipeline_channel_capacity: usize,
pub sync_writes: bool,
pub readahead_size: usize,
pub canonical_height_cache_capacity: usize,
pub hash_to_height_cache_capacity: usize,
pub enable_compaction_pruning: bool,
pub min_retained_height: Option<u64>,
}Expand description
Configuration for opening or creating a crate::store::BlockStore.
Construction: Use BlockStoreConfig::default and override fields, std::default::Default::default
with struct update syntax (BlockStoreConfig { path: my_dir, ..Default::default() }), or STR-005 test_config for tiny test tunables.
Validation: crate::store::BlockStore::open should eventually enforce cache_shards is a power of two (TYP-008 implementation notes); today callers should follow that invariant.
Fields§
§path: PathBufRoot directory for the RocksDB database files (TYP-008 path).
block_cache_capacity: usizeMax blocks retained in the sharded block cache.
header_cache_capacity: usizeMax headers retained in the sharded header cache.
cache_shards: usizeShard count for block/header caches; must be a power of two when enforced (TYP-008).
warm_cache_on_open: boolWhen true, crate::store::BlockStore::open preloads recent canonical blocks (STR-004, CAC-006).
warm_cache_depth: u64Trailing heights (inclusive) to touch when warming, starting from tip (CAC-006).
write_buffer_size: usizeRocksDB memtable / write buffer budget per column family (bytes).
block_cache_size: usizeShared block cache for RocksDB (bytes).
max_open_files: i32max_open_files passed to RocksDB options.
enable_blob_db: boolWhen true, enable BlobDB-style large-value handling for block bodies (TYP-003).
compress_blocks: bool§compression_level: i32Zstd level for block compression when compress_blocks is true.
use_compression_dict: boolWhether to use a trained zstd dictionary (SER-005).
max_decompressed_block_bytes: usizeMax accepted decompressed byte length for a stored block body (SER-001).
zstd_dictionary_override: Option<Vec<u8>>Optional zstd dictionary bytes wired at open time (SER-001).
Production: leave None — crate::store::BlockStore::open loads crate::constants::META_ZSTD_DICT
from CF_METADATA when Self::use_compression_dict is true (SER-005).
Tests: set to a trained dictionary to exercise dictionary compress/decompress without persisting metadata first.
write_pipeline_batch_size: usizeMax blocks batched before a pipeline flush.
write_pipeline_flush_ms: u64Max wait before flushing a partial pipeline batch (milliseconds).
write_pipeline_channel_capacity: usizeBounded async channel capacity feeding the write pipeline (BLK-008).
sync_writes: boolWhen true, sync the WAL after each write (durability vs throughput).
readahead_size: usizeHint for sequential readahead (BLK-006).
canonical_height_cache_capacity: usizeMax entries in the canonical height→hash BTreeMap cache (CAC-004).
When the cache exceeds this size, the lowest height entry is evicted.
Set to 0 to disable the height cache entirely.
hash_to_height_cache_capacity: usizeMax entries in the hash→height reverse lookup cache (CAC-005).
Uses the same sharded LRU infrastructure as block/header caches. Higher capacity is practical because each entry is only 40 bytes (32 hash + 8 height).
enable_compaction_pruning: boolRegister compaction-time pruning when true (PRN-003).
min_retained_height: Option<u64>Optional floor height below which compaction may drop data; None disables.
Trait Implementations§
Source§impl Clone for BlockStoreConfig
impl Clone for BlockStoreConfig
Source§fn clone(&self) -> BlockStoreConfig
fn clone(&self) -> BlockStoreConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for BlockStoreConfig
impl Debug for BlockStoreConfig
Auto Trait Implementations§
impl Freeze for BlockStoreConfig
impl RefUnwindSafe for BlockStoreConfig
impl Send for BlockStoreConfig
impl Sync for BlockStoreConfig
impl Unpin for BlockStoreConfig
impl UnsafeUnpin for BlockStoreConfig
impl UnwindSafe for BlockStoreConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FmtForward for T
impl<T> FmtForward for T
Source§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self to use its Binary implementation when Debug-formatted.Source§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self to use its Display implementation when
Debug-formatted.Source§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self to use its LowerExp implementation when
Debug-formatted.Source§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self to use its LowerHex implementation when
Debug-formatted.Source§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self to use its Octal implementation when Debug-formatted.Source§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self to use its Pointer implementation when
Debug-formatted.Source§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self to use its UpperExp implementation when
Debug-formatted.Source§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self to use its UpperHex implementation when
Debug-formatted.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
Source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
Source§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
Source§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
Source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self, then passes self.as_ref() into the pipe function.Source§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self, then passes self.as_mut() into the pipe
function.Source§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self, then passes self.deref() into the pipe function.Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> Tap for T
impl<T> Tap for T
Source§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B> of a value. Read moreSource§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B> of a value. Read moreSource§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R> view of a value. Read moreSource§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R> view of a value. Read moreSource§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap() only in debug builds, and is erased in release builds.Source§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut() only in debug builds, and is erased in release
builds.Source§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref() only in debug builds, and is erased in release
builds.Source§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut() only in debug builds, and is erased in release
builds.Source§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref() only in debug builds, and is erased in release
builds.