Repository navigation
Crate vyrn log
Path: crates/vyrn-log · Layer 2 (11 §1.4) · Pinned: no (11 §1.3)
vyrn-log is the VYRN log: order-stream encoding with LEB128 deltas, block assembly, the hash chain, block storage, and the readers replay uses. Its byte formats are a contract that every client, the Vx client included, reproduces bit for bit; each module documents its format before its code. Decoding is strict: a decoder accepts exactly the bytes the encoder produces from the same state. Every rejection is a sequencer fault (RepErr), and nothing panics on input bytes.
- 07 §2, §3, §6.1, §8 (order stream, frames, blocks, storage)
- 07 §3.8 (step kind payloads), §3.12 (decoder errors stop the vote), §15 (
REP_E_*codes) - 01 §6.6 (
StepRecord), 01 §10 (stream-A on core 4, stream-B on core 7, per 11 §1.3)
| Type | Role |
|---|---|
StreamEncoder, StreamDecoder
|
Frame one substream (stream core); decode it in frame_seq order (replica). Both fail closed |
Frame, FrameHeader, FrameKind
|
A frame and its 24-byte header |
Layout |
Which lanes each substream carries |
StepMerger, MergedStep
|
Join substream A's and B's step halves into whole StepRecords |
BlockAssembler, header_hash, check_link
|
Build unsigned 190-byte headers from closed half-blocks; chain rules |
BlockStore, MemStore, FileStore
|
Block storage trait; in-memory store; one file per drive, block h on drive h mod drives
|
LogReader |
Reads stored blocks in height order, checking order_root and the link |
TenureStart, BlockMark
|
Stream records that start a tenure and mark a block |
RepErr, StoreError
|
Decoder/stream errors; storage errors |
Implemented. Version 0.1.0 from the workspace; publish = false. The crate docs name no missing piece or follow-up. One error is out of its scope by design: "REP_E_HASHLAG is time-based and raised by the replica, not by this decoder." seq_sig and certificates are the caller's to check. The crate is #![forbid(unsafe_code)].
Tests: tests/golden.rs (9 #[test]), tests/store.rs (12), tests/props.rs (3, proptest), and unit tests in src/leb.rs and src/merge.rs (4). Total: 28 #[test] functions. Golden vectors for independent implementations: tests/golden/vyrn_log_vectors.py and .out.
Workspace: vyrn-types, vyrn-crypto. External: thiserror; dev: proptest. This matches 11 §1.4 (layer 2, vyrn-log → vyrn-crypto).
- Source: crates/vyrn-log
- Spec: Spec-07-Replication, Spec-01-Conventions, Spec-11-Build
- Related: Crate-vyrn-consensus, Crate-vyrn-replica, Crate-vyrn-data
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.