Skip to main content

Module cache

Module cache 

Source
Expand description

The cache seam this crate consumes.

This crate does not invent a new cache abstraction — it consumes sui_cache::storage::StorageBackend exactly as sui cache serve does. A node is “cached” when its content_hash has a narinfo entry; the narinfo content is the image reference the node’s cache write produced, so a cache hit can pull the already-built image instead of rebuilding it. Real callers construct the backend via sui_cache::storage::build_backend against a sui_cache::BackendConfig (Postgres L2 + Redis L1, per sui-supercacheci); tests use MockCacheBackend, an in-memory implementation of the same trait — the identical shape the sui-store crate’s TestStore uses to prove Store’s default methods without a real database.

Structs§

MockCacheBackend
An in-memory StorageBackend for unit tests. Never touches a filesystem, Redis, or Postgres — narinfo entries live in a Mutex<BTreeMap> for the duration of the test.