Static block storage prototype#74
Conversation
Empirical evidence for moving blocks out of LevelDBHit a wall during full-mainnet ERA import (sigp#9273 testing) at era ~960/1741 with the leveldb backend. Sharing the numbers in case they're useful motivation for this PR — they corroborate exactly why static block storage is the right direction. The numbersAfter ~23h of import (~600 GB of chain_db on disk):
Why LevelDB is past its design point at this scaleLevelDB was designed by Google around 2011 as a small/medium key-value store (Chrome bookmarks, IndexedDB). Three concrete reasons it falls apart at our scale: 1. Single-threaded background compaction. LevelDB has exactly one background thread doing all compaction work. RocksDB (Facebook's fork) added subcompactions specifically because LevelDB couldn't handle write-heavy workloads. At 600 GB+ the queue grows faster than one thread can drain it. 2. Level sizing assumes ≤ ~100 GB. LevelDB's level pyramid: L0→L1=10 MB, L2=100 MB, L3=1 GB, L4=10 GB, L5=100 GB, L6=1 TB. With max_levels=7 the design implicitly caps near 1 TB. L6 compactions are massive: merging an L5 SST into L6 may touch hundreds of overlapping files, all serialised on the one bg thread. 3. MANIFEST/VersionEdit O(N) overhead. Every SST is tracked in a single MANIFEST file. With 303k SSTs, every version edit (after each compaction) writes to MANIFEST. Open-time recovery scans the whole edit log. The TableCache (bounded by Why static block storage helps directlyThe bytes-by-column breakdown of
The leveldb numbers above are basically the strongest argument for this PR. Happy to share the full raw logs / instrumentation data if useful. |
Description
Adds a working draft for static block storage:
StaticBlockStorewith snappy records and.offoffsetsStaticBlobStoreAPI stub for checking integration shapeAdditional Info
Draft PR for tracking the design/prototype work. Not ready for review.
Testing
cargo check -p storeTEST_FEATURES="beacon-node-leveldb,beacon-node-redb," RUSTFLAGS="-C debug-assertions=no " make lint