How input-output-hk/ouroboros-leios works
Major components
• Simulations:
– Haskell Simulation Engine (located in the “simulation” directory). It reads a network topology file and a YAML configuration (found under “data/simulation”) to simulate the Leios protocol. It produces log files and even has built‐in visualization capabilities.
– Rust Simulation Engine (in the “sim‐rs” directory). Like its Haskell counterpart, it also ingests topology and configuration files, but it outputs JSONL trace files that are later consumed by the visualization tool.
• Visualization & Analysis:
– Web-Based Visualization UI (in the “ui” directory). This front-end (built with TypeScript/React) loads JSONL trace files produced by the Rust simulation so that users can interactively view graphs and performance metrics.
– Analysis Tools (e.g., “delta_q” and “topology‐checker”). DeltaQ manages network quality analysis and related measurements while the topology‐checker validates the simulation’s network topologies.
• Configuration & Data:
– “data/simulation” contains common input files, configuration defaults, and schema information that are used by both simulation engines.
• Documentation & Supplementary Tools:
– The “site” directory holds the project website, providing detailed documentation, FAQs, protocol overviews, and additional explanatory content.
– Other supportive modules such as “cost-dashboard”, “crypto-benchmarks.rs”, and “conformance-testing” offer experimental and benchmark-related functionalities that enrich the overall research and R&D effort.
• Formal Specification:
– References to the Agda specification and formal treatment of the protocol (e.g., in cost-dashboard and via references to the external formal spec repository) underscore the theoretical backbone of the project.
Relationships and data flow
• Input files (e.g., YAML topology and parameter files from “data/simulation”) are fed into both simulation engines.
• The Haskell simulation engine processes these inputs and outputs log files (possibly feeding an internal “viz” mode), whereas the Rust simulation processes the same type of input but produces JSONL trace files.
• The JSONL trace files are then consumed by the UI, which provides an interactive front-end for visual analysis.
• Additional analysis components (DeltaQ and topology-checker) operate either on the simulation outputs or on the configuration/topology data, providing diagnostic or validation feedback.
• All of these components are Dockerized (as shown by the provided Dockerfile and build instructions) so that the simulation engines can be run in containerized environments. This ensures that the flow from configuration, to simulation execution, to output generation is modular and deployable.
• The website serves as a public, informational layer that outlines the protocol's specification and progress (linked from the README).
Architectural patterns and design principles
• Modularity: There is a clean separation between simulation engines (Haskell vs. Rust), visualization (UI), analysis tools (DeltaQ and topology-checker), and documentation (site). Each module has a clear purpose and external communication (via files, network mounts, or Docker volumes).
• Containerization: Docker images support both simulation environments, ensuring reproducibility and isolation.
• Config-driven execution: Simulation parameters and network topologies are externalized in YAML files that both simulation engines read, making the system highly configurable.
• Cross-language interoperability: Although implemented in different languages (Haskell, Rust, TypeScript/React, Agda for formal specification), the components interact through common file formats (e.g., JSONL trace files) and shared configuration schemas.