Depth-only commit threshold for batch execution (full sync / block import). Each batch
layer holds ~1024 blocks of trie diffs (~1 GB), so we flush after a few layers to bound
memory. The canonical head - DB_COMMIT_THRESHOLD safe-commit root never lands on a batch
layer boundary, so batch mode commits by depth instead; this is sound because full sync and
import only ever extend a single canonical chain (no competing forks to mis-commit).
Floor on the RocksDB shared block cache: 512 MiB. Below this the per-SST
index and filter blocks no longer stay resident and every trie read pays an
extra disk seek, which is worse than the memory it saves. Applied even when
it exceeds ROCKSDB_BLOCK_CACHE_MEMORY_PERCENT of a very small host, and
even when it exceeds the detected limit outright: a node given less than this
much memory cannot follow the chain anyway, so the floor is the more useful
failure mode than a cache too small to hold the filters.
Checks whether a valid (or migratable) database exists at the given path
by looking for a metadata.json file with a schema version between 1 and
STORE_SCHEMA_VERSION (inclusive).
Reads the chain ID from an existing database without performing a full
store initialization. Returns None if the database doesn’t exist or
the chain config can’t be read. Always returns None when compiled
without the rocksdb feature.