Accurate Protocol Simulation
Implementation fidelity
This demo accurately simulates the UltraDAG consensus implementation in Rust.
Finality uses O(1) incremental descendant tracking (same as dag.rs).
Validators skip rounds that fail the 2f+1 gate (same as validator.rs).
Production fires optimistically at quorum before the timer (same as tokio::select! in validator.rs).
Key Protocol Properties:
- Incremental Descendant Tracking: When vertex V is inserted, all ancestors of V gain V's validator in their
descendant_validators set via upward BFS with early termination. Finality check is O(1) — just read the precomputed count.
- 2f+1 Gate: Before producing round r, each validator checks that ⌈2n/3⌉ distinct validators produced vertices in round r−1. If not, the round is skipped (shown as SKIP in the demo). After 3 consecutive skips, stall recovery fires unconditionally.
- Optimistic Responsiveness: As soon as quorum vertices from round r−1 arrive, the validator produces immediately — no need to wait for the full timer. The timer is a fallback for slow networks.
- Byzantine Fault Tolerance: Up to f = ⌊(n−1)/3⌋ Byzantine validators tolerated. Equivocators (two vertices same round) are permanently banned — no unban path exists.
- Parent Finality Guarantee: A vertex can only finalize after all its parents are finalized. Finality cascades forward through children.