Expand description
Cuckoo filter persistence for fast startup.
Stores filter state alongside the merkle root that was current when the filter was saved. On startup, if the current merkle root matches the saved root, the filter is immediately trusted.
§Storage
Uses the WAL SQLite database for storage (reuses existing connection).
CREATE TABLE cf_state (
filter_id TEXT PRIMARY KEY, -- "l2" or "l3"
filter_bytes BLOB NOT NULL, -- Exported filter data
merkle_root BLOB NOT NULL, -- 32-byte root hash when saved
entry_count INTEGER NOT NULL, -- Number of entries at save time
saved_at INTEGER NOT NULL -- Unix timestamp
);Structs§
- Filter
Persistence - Cuckoo filter persistence manager.
- Saved
Filter State - Saved filter state
Constants§
- L2_
FILTER_ ID - Filter IDs for persistence
- L3_
FILTER_ ID