Repository navigation
Crate vyrn sim
crates/vyrn-sim · test-only in spec 11 §1.4 ("everything above + libvyrn_vx_oracle") · no production artifact links it (11 §1.3)
11 §1.3 and §6.4 give this crate three jobs: the deterministic whole-cluster simulator (one thread, virtual time, seeded), the oracle binding, and the invariant checkers. On main (881 Rust lines) it holds the oracle binding and a scenario runner. The oracle binding loads libvyrn_vx_oracle and calls its C ABI from vx/abi/pbv.h. The scenario runner runs the hand-written scenarios of tests/golden/scenarios/*.scn against the oracle.
- 11 §5.2 (the oracle ABI and the rule that "the oracle is not trusted either": scenarios written from 05, 08 and 10)
- 01 §6.5 and §14.10 (reject and Out codes, which the scenario parser resolves by name)
- Not yet: 11 §6.4 (the whole-cluster deterministic simulator)
| Type | Role |
|---|---|
oracle::Oracle |
One oracle book in a dlopened library (pbo_new, pbo_apply, pbo_state_bytes, pbo_free) |
oracle_abi::Config |
pbo_config, mirrored with the same sizes and offsets |
oracle_abi::Account, Session
|
pbo_account, pbo_session
|
oracle_abi::Event, Record
|
pbo_event (56 bytes), pbo_record
|
oracle_abi::ABI_VERSION, E_CAP, E_EVENT, E_FULL, E_FAULT
|
ABI version and the pbo_apply error results |
scenario::run |
Runs one .scn file against the oracle library |
scenario::golden_responses |
Reads expected responses from tests/golden/vyrn_proto_vectors.out
|
Implemented (partial)
- The oracle binding and the scenario runner are implemented. tests/golden/scenarios holds 14
.scnfiles. - The crate is not yet the simulator of 11 §6.4. There is no event loop, sim network, cluster boxes or invariant checker. The crate doc's first line still says "Deterministic whole-cluster simulator, oracle binding, invariant checkers."
- The
vyrn-simbinary is a stub: src/main.rs isfn main() {}. -
tests/seeds.toml has
seeds = [], and tools/sim-swarm has an emptymain. - Tests: 2
#[test]in tests/oracle_scenarios.rs.scenarios_against_the_vx_oraclepasses with a "skipped" message whentarget/vx/libvyrn_vx_oracle.{so,dylib}is missing, unlessVYRN_REQUIRE_VX_ORACLE=1is set. No CI workflow runsvx/build.shor sets that variable.
| Crates | |
|---|---|
Code (Cargo.toml) |
vyrn-types, -crypto, -wire, -cut, -risk, -bbo, -lane, -engine, -nic, -log, -data, -consensus, -replica, -epoch, -chain, -md; commonware-runtime, libc (for dlopen) |
| 11 §1.4 | everything above, plus libvyrn_vx_oracle (Vx, C ABI) |
The declared dependencies match the graph. The oracle library is loaded at run time, not linked. No source file uses the internal crates yet.
- Code: crates/vyrn-sim
- Spec: Spec-11-Build, Spec-05-Engine, Spec-01-Conventions
- Related: Vx-Oracle-and-Client, Building-Testing-Benchmarking, 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.