Byzantine fault injection for distributed protocols in Rust, built as a plugin for MadSim. MadSim gives you deterministic simulation with crash faults. Basanos adds the Byzantine part: adversary placement (which nodes are faulty), behavior (equivocation, omission, delay, selective forwarding, flooding, payload corruption), and network topology, each configured independently. The same seed reproduces the same trace, bit for bit.
This repository is the project's home: it starts from the version evaluated in our SRDS 2026 tool paper, "Extending MadSim for Deterministic Byzantine Simulation", and moves forward from there. The project was published as MadSim-Byz and renamed to Basanos afterwards to support its continued extension; the crate keeps the original name for now. The exact version the paper evaluates is tag v1.0.1, archived at 10.5281/zenodo.21347937. The examples/ directory holds the paper's four case studies against unmodified third-party crates: Bracha reliable broadcast, binary agreement, AlephBFT, and VRF-PBFT. data/ has the CSVs behind the paper's figures, and scripts/ regenerates the plots.
use madsim_byz::adversary::{PlacementSpec, Placement};
use madsim_byz::behavior::{Behavior, BehaviorPlan};
use madsim_byz::node::NodeRole;
use madsim_byz::runtime::ByzantineSim;
let rt = madsim::runtime::Runtime::with_seed_and_config(42, Default::default());
rt.add_simulator::<ByzantineSim>();
rt.block_on(async {
let byz = madsim::plugin::simulator::<ByzantineSim>();
// 20 nodes, 5 Byzantine clustered around node 10
let adv = PlacementSpec::new(5, Placement::Clustered { center: 10 });
let roles = adv.assign_roles(20);
// Byzantine nodes: 30% message omission plus 50ms delay
let mut plan = BehaviorPlan::new(Behavior::Honest);
for (i, role) in roles.iter().enumerate() {
byz.register_node(i, *role);
if *role == NodeRole::Byzantine {
plan.assign(i, Behavior::Composite(vec![
Behavior::Omission { drop_rate: 0.3 },
Behavior::Delay { extra_ms: 50.0 },
]));
}
}
byz.set_plan(plan);
// Spawn protocol tasks on MadSim nodes; before each send the protocol calls
// let decision = byz.decide(my_idx, dst_idx, current_time_ms);
// if !decision.deliver { return; }
});Run a case study:
cargo run --example bracha_broadcast@inproceedings{dantas2026madsimbyz,
author = {Dantas, Abel and Baquero, Carlos},
title = {Extending {MadSim} for Deterministic {Byzantine} Simulation},
booktitle = {45th IEEE International Symposium on Reliable Distributed Systems (SRDS)},
year = {2026},
note = {Tool paper},
}Releases are archived at Zenodo under the concept DOI 10.5281/zenodo.21324885, which resolves to the latest version; each release also carries its own version DOI.
Basanos is developed as a research instrument, and this repository is its permanent home: capabilities from follow-up publications land here as they are published. Star or watch the repo to follow.
MIT.