Repository navigation
Crate vyrn types
Path: crates/engine/vyrn-types · Layer 0 (11 §1.4) · Pinned: yes (11 §1.3)
vyrn-types holds the shared vocabulary of every other crate: the newtypes of 01 §3, the constants of 01 §5, the reject and step codes of 01 §6.5 and §14.10, and the record structs of 01 §6.6. Its only logic is checked arithmetic on Qty, Tick and notional (01 §11.4). It has no dependencies, and it is #![no_std] and #![forbid(unsafe_code)]. The constants are budgets unless 01 says otherwise; none of them is a measurement.
- 01 §3: newtypes (
Tick,Qty,AccountId,SessionId,LaneId,LaneSeq,StepId,Handle,Epoch,Height,Nanos,BookId,PktHash,Tag,Hash) - 01 §5: constants as
pub const(for exampleLAT_MAX_NS,N_LANES_REF= 49 as 42 dedicated + 7 pooled per 01 §14.15,CACHE_LINE) - 01 §6.5 and §14.10:
RejectReasonandStepKindcodes - 01 §6.6: the record structs
- 01 §11.4: checked arithmetic
| Type | Role |
|---|---|
Tick, Qty
|
Price index in the book's tick ladder (tick 0 is "no bid") and quantity in lots, with checked arithmetic |
Handle |
Lane-local order handle: bits 0–23 slot, bits 24–31 generation |
LaneSeq, StepId
|
Per-lane sequence of applied ops and per-book sequence of BBO-core steps; both start at 1 each epoch |
Epoch |
Epoch number; low16() gives the epoch16 the wire carries |
RejectReason, StepKind
|
The Reject.reason codes and the BBO step kinds |
HomeCode, Mode
|
Home region and BASE/CHAIN mode |
PacketRecord, StepRecord<N>
|
Order-stream records of 01 §6.6 |
BlockHeader, HandoffRecord, AcctTake
|
Block header, epoch handoff record and pooled-lane token record |
Dense, DenseId
|
Dense arrays indexed by an id's slot |
Implemented. Own version 0.1.0, released as vyrn-types-v0.1.0; publish = false. The crate notes one code that is reserved but not yet assigned: "25 is reserved for RESEND_RECOVERY (03 Request 10), not yet in 01" (src/codes.rs:39).
Tests: the crate has no tests/ directory. Unit tests sit in src/lib.rs, src/codes.rs and src/dense.rs: 10 #[test] functions in all.
No workspace crates and no external crates. This matches 11 §1.4 (layer 0) and 11 §1.3 ("No dependencies").
- Source: crates/engine/vyrn-types
- Changelog: CHANGELOG.md
- Spec: Spec-01-Conventions, Spec-11-Build
- Related: Architecture, Crate-vyrn-crypto, Crate-vyrn-wire
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.