Repository navigation
Crate vyrn consensus
crates/vyrn-consensus · layer 4 of spec 11 §1.4 · not pinned (11 §1.3)
Simplex on Commonware. It orders blocks that vyrn-log builds and never calls the matching engine. In the words of 07, "BFT finalizes the order, not the state". The crate defines four boundary contracts: the block source, the proposal, the committee and the finality certificate. It wires them into commonware-consensus Simplex for one voter, and it detects a silent sequencer.
- 07 §6.3 (Simplex mapping,
REP_Proposal) - 07 §6.4 (the vote rule
INV-REP-4): item 1 here, items 2–5 throughBlockSource::check_body - 07 §6.5 (
REP_FinalityCert,INV-QUORUMof 01 §7) - 07 §9.1–§9.2 (silence detection, deposition count)
- 07 §13.1 and 01 §14.4 (who votes; the sequencer never votes)
| Type | Role |
|---|---|
BlockSource (trait), Verdict
|
What consensus asks the log: header, and Valid / Invalid / Pending for the rest of a block |
LogSource, Genesis
|
The BlockSource backed by a vyrn-log BlockStore, and its anchor |
Proposal, ProposalKind
|
REP_Proposal, 85 bytes: Headers or Seal
|
Committee |
The voters of REP_Membership. Refuses any seq_key among the voters |
FinalityCert, verify_finality_cert
|
The certificate, and the one offline check of it |
voter::App, voter::config, VoterConfig
|
Simplex Automaton / Relay / Reporter wiring for one voter |
voter::Finalized |
Reporter that turns every finalization into a FinalityCert
|
silence::Frames, Suspicion, Deposition
|
Frame-arrival clock, silence suspicion, and the deposition count |
Implemented (partial)
- Proposal codec, committee, certificate check, block-source split and a Simplex voter are implemented. Conformance vectors are in vectors/finality_cert.txt.
-
silence.rs: "The signedSilencemessage and its TailReport (07 §9.3) are not in this crate yet". -
proposal.rs, onProposalKind::Seal(07 §9.4): "Encoded and decoded here; this crate does not yet propose or vote for one." -
voter.rs: the Elector isRoundRobin("see the follow-up on its order in the PR"). - Tests: 24
#[test], all insrc/:tests.rs4,cert.rs4,proposal.rs3,membership.rs3,silence.rs3,voter.rs3,source.rs2,conformance.rs2.
| Crates | |
|---|---|
Code (Cargo.toml) |
vyrn-types, vyrn-crypto, vyrn-log; Commonware consensus, p2p, runtime, cryptography, codec, utils, parallel, actor; tokio
|
| 11 §1.4 |
vyrn-log, Commonware (consensus, p2p, runtime, cryptography, storage, codec) |
The internal dependencies match. 11 §1.4 lists Commonware storage, and the crate does not depend on it. It also uses three Commonware crates that §1.4 does not name: utils, parallel and actor.
- Code: crates/vyrn-consensus
- Spec: Spec-07-Replication, Spec-01-Conventions, Spec-11-Build
- Related: Crate-vyrn-log, Crate-vyrn-epoch, Crate-vyrn-replica
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.