Skip to main content

Module persistence

Module persistence 

Source
Expand description

Memory-first persistence of network-learned state. The engine’s tables are the truth; a host flushes sealed snapshots of them to a PersistedStore and seeds the tables from it at the next boot; destination identities deliberately retain RNS’s historical known_destinations filename and their existing Prns region tag. Config-derived state (held identities, registered destinations, group keys) is never snapshotted — the identity vault and the host recipe re-supply it at boot.

Modules§

envelope
The sealed frame every snapshot travels in: magic, version, region tag, payload length, payload, CRC-32. A load is untrusted input, so truncation, cross-region mixups, and bit rot each refuse by name before any payload parse.
reticulum_directory

Structs§

FileStore
PersistedDestinationIdentityRows
PersistedRouteRows
Yields rows in stored order; the first malformed row poisons the iterator, and payload bytes past the declared row count are refused rather than ignored.
PersistedSelfRatchets
Fixed-size secrets let the whole payload validate at open, so the secret iterator is infallible.
PersistedTunnelRows
Fixed-size rows let the whole payload validate at open, so iteration is infallible: a truncated row and bytes past the declared count are both refused before the first row is yielded.
SnapshotFingerprint
The checksum a sealed snapshot already carries, reborrowed as its change fingerprint: two seals of identical payloads carry identical fingerprints, so a flusher can skip rewriting a region whose fingerprint matches its last flush — no second hash pass. A changed payload whose CRC-32 collides with the previous one (odds 2^-32 per flush) skips one write; the next real change heals it.

Enums§

DestinationIdentitiesSnapshotWriteError
FileStoreError
Removal
RoutingTableSnapshotWriteError
SnapshotOpenError
SnapshotReadError
SnapshotRegion
SelfRatchets blobs carry secrets, so they ride the identity vault rather than a PersistedStore — the region tag still seals them against cross-region mixups.
SnapshotSealError

Constants§

SNAPSHOT_OVERHEAD_LEN
TIMEBASE_SNAPSHOT_LEN
TUNNEL_ROW_WIRE_LEN

Traits§

PersistedStore
Where snapshots sleep between boots. The engine’s tables stay the truth: a host flushes sealed snapshots here and reads them back at the next boot to seed the tables.

Functions§

destination_identities_snapshot_len
maximum_persisted_route_row_wire_len
maximum_route_upsert_payload_len
open_snapshot
persisted_destination_identity_wire_len
persisted_route_row_wire_len
read_destination_identities_snapshot
read_routing_table_snapshot
read_self_ratchets_snapshot
read_timebase_snapshot
read_tunnels_snapshot
routing_table_snapshot_len
seal_snapshot
seal_snapshot_in_place
Seals a payload the caller already wrote at out[SNAPSHOT_HEADER_LEN..SNAPSHOT_HEADER_LEN + payload_len], sparing a large payload the staging copy seal_snapshot takes.
self_ratchets_snapshot_len
snapshot_fingerprint
tunnels_snapshot_len
write_destination_identities_snapshot
write_routing_table_snapshot
write_self_ratchets_snapshot
write_timebase_snapshot
write_tunnels_snapshot