Repository navigation
Crate vyrn wire
Path: crates/engine/vyrn-wire · Layer 2 (11 §1.4) · Pinned: yes (11 §1.3)
vyrn-wire parses and builds the packets and records of 01 §6.1–6.5, and defines the RxRing and TxRing traits of 06 §6.1 that every NIC backend implements. Parsing uses zerocopy layouts, so it needs no unsafe (#![forbid(unsafe_code)]). Every parse returns a Result whose error is a 01 §6.5 reason with its 04 §14 detail, and nothing panics on input bytes. Every parse refuses a nonzero reserved field or bit (VR1) instead of ignoring it, so later versions can give those bits meaning.
- 01 §6.1 (
ReqHeader,Request; checks V1 and V9 of 04 §3.1) - 01 §6.2 (
Msgand its flags; checks M2 and M3 of 04 §3.3, flags 04 §6.1) - 01 §6.3 and 04 §1 (
RespHeader,Response,MAX_RECS_PER_PKT,PROTO_RESP_MAX_BYTES) - 01 §6.4 and §14.10, 04 §7, 09 §17.2 (
Recordand its enums) - 01 §6.5, 04 §8 and §14 (
WireError,PROTO_D_*) - 04 §4.1 (
session_*), 04 §12 (PROTO_VERSION), 06 §6.1 (ring)
| Type | Role |
|---|---|
ReqHeader, Request, encode_request
|
Request packet header, a length- and count-consistent request, and its encoder |
Msg (Side, Tif, Stp, OrderFlags) |
One 16-byte request message |
RespHeader, Response, encode_response
|
Response packet header, response, encoder |
Record (Liq, OutCause, AttestLevel) |
One response record; index is 0–9 or INDEX_NONE (0xFF) |
RawRec |
The 16-byte shape shared by 01 §6.2 and §6.4 |
WireError |
Reject reason plus detail for bytes that did not parse |
RxRing, TxRing
|
One receive queue (lane or cut core) and one transmit queue (TX core) |
RxPkt, NicCounters
|
Received-frame descriptor and per-queue counters, same layouts as vyns_rx and vyns_counters in shim.h |
PROTO_VERSION |
Protocol version this crate parses and builds; carried at session open, not in the packet |
Implemented. Own version 0.1.0, released as vyrn-wire-v0.1.0; publish = false. The crate docs name no missing piece or follow-up.
Protocol version mismatch. PROTO_VERSION is 2 (src/lib.rs:59); the changelog's last entry is "Bump PROTO_VERSION to 2 for the RATE_LIMIT id move". But every profile in deploy/profiles (aws, consumer, dev, ref) still says protocol = 1. 11 §10.1 says the binary refuses to start when the config's protocol version does not match the release.
Tests: tests/vectors.rs (3 #[test]), tests/props.rs (3, proptest), and unit tests in msg.rs, record.rs, ring.rs and session.rs (7). Total: 13 #[test] functions. tests/golden/README.md says how an independent implementation checks itself against the conformance vectors.
Workspace: vyrn-types, vyrn-crypto. External: zerocopy; dev: proptest. This matches 11 §1.4 (layer 2, vyrn-wire → vyrn-crypto).
- Source: crates/engine/vyrn-wire
- Changelog: CHANGELOG.md
- Spec: Spec-01-Conventions, Spec-04-Protocol, Spec-06-Platform
- Related: Crate-vyrn-nic, Crate-vyrn-lane, Known-Gaps
Overview
Working on VYRN
Spec
- 00 Index
- 01 Conventions
- 02 Requirements
- 03 Architecture
- 04 Protocol
- 05 Engine
- 06 Platform
- 07 Replication
- 08 Epochs
- 09 Chain
- 10 Accounts, Risk, MD
- 11 Build
- 12 Commitment
- 13 Availability
- 14 Envelope
Engine crates
Other crates
- vyrn-nic
- vyrn-log
- vyrn-data
- vyrn-consensus
- vyrn-replica
- vyrn-epoch
- vyrn-chain
- vyrn-md
- vyrn-sim
- vyrn-bench
Binaries
- vyrn-seq (stub)
- vyrn-validator (stub)
- vyrn-admin
Outside Rust
Reflects main at a9f0d61.