Repository navigation
Open
Labels
P2Scheduled: real but not urgentarea:storageStorage backends, nameservice, ledger lifecycle, index storage, cachesenhancementNew feature or requestperformancePerformance improvement (release notes: Performance)
Milestone
Description
Follow-up to #2018 and zonotope's review there.
Readers decide how to read by asking the store around the trait: resolve_local_path (39 call sites), resolve_cached_bytes (54), is_remote, permits_plaintext_cache, and since #2018 resolve_local_bytes. The disk cache sits outside every store and needs those answers. That is why cache_dir is threaded through 28 files and why the cache leaked local storage until #2018.
Proposed, in shippable stages:
ContentStore::getreturns a shared, read-only handle that derefs to[u8]: owned bytes,Arc<[u8]>, or an mmap.- One synchronous, non-blocking
getreturning bytes orNonereplacesresolve_local_path,resolve_cached_bytesandresolve_local_bytes. File storage returns an mmap, memory storage anArcclone. CachedContentStore<S>takes over the disk cache: coalesced fetches, the byte budget, eviction, write-through onput, and range reads served from the cache file. Only the code that assembles the store stack knows a store is remote. This removesis_remote,uses_disk_cache,needs_disk_copy,seed_disk_cache,fetch_cached_bytes*and thecache_dirthreading.- Encryption sits above the cache, so the cache holds ciphertext.
permits_plaintext_cachegoes away. Encrypted remote stores get a disk cache for the first time; today every miss re-fetches the whole object, because AES-GCM rules out range reads.
Performance constraints:
- The hot read paths must stay synchronous. File reads must not move onto the sync→async bridge.
- The remote read policy (range reads first, promotion on a leaf's second open, coalescing) moves into the wrapper unchanged.
- Small blobs keep the read-instead-of-mmap threshold.
- Changing the fetch future types can re-trigger the rustc layout-depth overflow seen in fix: index storage growth — stats sketch GC, disk cache for local storage, drop of blob/ #2018.
Out of scope: the wasm residency tier (miss register / NeedFetch).
The open annotation_hydration/scan gap from #2018 is tracked in #2030; this refactor rewrites the read path it most likely sits on, so re-measure it after stage 2.
Metadata
Metadata
Assignees
Labels
P2Scheduled: real but not urgentarea:storageStorage backends, nameservice, ledger lifecycle, index storage, cachesenhancementNew feature or requestperformancePerformance improvement (release notes: Performance)
Activity
bplatz commentedon Oct 20, 2026
From #2130:
get_local_ranged, a defaulted method onStorageRead/ContentStorethat the leaf, forward-pack and reverse-leaf openers call, andcostly_local_readsare reader-side probes of the same shape aspermits_plaintext_cache. With encryption above the cache, stage 4 should retire them too.bplatz commentedon Nov 20, 2026
Status: stages 1–3 landed on
nextin #2035 (merged 2026-10-14). Stage 4, encryption above the disk cache, remains. Encrypted remote stores stay uncached until it lands.