Skip to content

Crate vyrn data

Amp edited this page Nov 18, 2026 · 1 revision

vyrn-data

crates/vyrn-data · layer 4 of spec 11 §1.4 · not pinned (11 §1.3)

Purpose

The data tier. A client sends a second copy of each request packet to a data box. The box checks it, stores it by (session, pkt_seq) and PktHash, fans it out to every replica and the warm standby, and answers fetches for missing payloads. It answers from its RAM ring, and also from logged blocks that it reads through vyrn_log::BlockStore.

Spec sections it implements

  • 07 §5 (the data tier): §5.2 ingest, §5.3 data frame, §5.5 fetch
  • 01 §6.1 (the request packet), 04 D2/D3 and §2.4 (resends and client equivocation)
  • 07 §8.2 (the block record whose payloads a BLOCK fetch serves)
  • 11 §1.3 (the crate's job), 11 §1.4 (layer 4)

Main public types

Type Role
DataNode One data box over generic RxRing/TxRing and a BlockStore: ingest, fan-out, heartbeats, fetches
NodeConfig, Counters Box configuration and its counters (such as fetch_bad)
DataHome, HomeConfig Ingest for one data home: parse, MAC, dedupe, hash, store
Mode BASE checks tag_seq under K_seq, CHAIN checks tag_com under K_com
Reject, Event Ingest reject reasons, and events for the control core (BadMac, CopyConflict)
Packet, Ingested A stored packet and the result of one ingest
ring::Ring The RAM ring indexed by (session, pkt_seq)
dedupe::Dedupe The hi mark plus a 256-bit window per session
frame::FrameBuf, frame::DataHdr, frame::Fetch DATA / DATA_HB / FETCH_RESP frames and the KEY / RANGE / BLOCK fetch messages

Status on main (a9f0d61)

Implemented (partial)

  • The library implements ingest, the frame format, the fetch formats and a node that runs end to end over vyrn-nic's sim backend.
  • The crate doc marks several choices as gap, where 07 is silent. Examples: the fetch byte layout, MAX_VARIANTS, and a ring that evicts by slot count rather than by REP_DATA_RING_S.
  • The crate doc names one follow-up: "07 §5.2 step 5's fixed open-addressed table is a follow-up". The indexes are BTreeMaps, which allocate as sessions arrive.
  • The vyrn-data binary is a stub: src/main.rs is fn main() {}.
  • Cargo.toml declares commonware-p2p and tokio, but no file under src/ uses them.
  • Tests: 10 #[test]. tests/node.rs has 5, tests/golden.rs has 3 (against tests/golden/vyrn_data_vectors.out), and src/ring.rs and src/dedupe.rs have 1 each.

Depends on

Crates
Code (Cargo.toml) vyrn-types, vyrn-crypto, vyrn-wire, vyrn-log, vyrn-nic
11 §1.4 vyrn-log, vyrn-nic (and the layers below them)

These match. 11 §1.3 says the vyrn-data binary links vyrn-data, vyrn-nic and vyrn-log, but its main does nothing yet.

Links

Clone this wiki locally