[Paper Review] Twins: BFT Systems Made Robust
Twins introduces a novel, scalable framework for systematically generating Byzantine fault attacks in BFT systems by deploying twin replicas of honest nodes with identical identities and credentials. By simulating equivocation, double voting, and state forgetting, Twins exposes safety violations within minutes—demonstrated by detecting deliberately injected bugs in DiemBFT at scale, executing 44 million scenarios daily.
This paper presents Twins, an automated unit test generator of Byzantine attacks. Twins implements three types of Byzantine behaviors: (i) leader equivocation, (ii) double voting, and (iii) losing internal state such as forgetting 'locks' guarding voted values. To emulate interesting attacks by a Byzantine node, it instantiates twin copies of the node instead of one, giving both twins the same identities and network credentials. To the rest of the system, the twins appear indistinguishable from a single node behaving in a 'questionable' manner. Twins can systematically generate Byzantine attack scenarios at scale, execute them in a controlled manner, and examine their behavior. Twins scenarios iterate over protocol rounds and vary the communication patterns among nodes. Twins runs in a production setting within DiemBFT where it can execute 44M Twins-generated scenarios daily. Whereas the system at hand did not manifest errors, subtle safety bugs that were deliberately injected for the purpose of validating the implementation of Twins itself were exposed within minutes. Twins can prevent developers from regressing correctness when updating the codebase, introducing new features, or performing routine maintenance tasks. Twins only requires a thin wrapper over DiemBFT, we thus envision other systems using it. Building on this idea, one new attack and several known attacks against other BFT protocols were materialized as Twins scenarios. In all cases, the target protocols break within fewer than a dozen protocol rounds, hence it is realistic for the Twins approach to expose the problems.
Motivation & Objective
- To address the challenge of systematically testing Byzantine Fault Tolerance (BFT) protocols under realistic, complex attacks that are difficult to manually construct.
- To overcome the limitations of random fault injection (e.g., Chaos Monkey) and formal verification (e.g., model checking), which suffer from lack of coverage or state explosion.
- To provide a practical, production-ready validation method that detects subtle safety bugs early in development, even during routine maintenance.
- To enable automated, repeatable, and comprehensive testing of BFT systems by leveraging twin replicas to emulate Byzantine behavior without modifying the original protocol code.
Proposed method
- Deploying multiple autonomous, identical copies (twins) of a single node, each with the same cryptographic identity and network credentials, to simulate Byzantine behavior.
- Using twins to generate attacks such as leader equivocation, double voting, and forgetting voted values—behaviors indistinguishable from those of a single malicious node.
- Systematically iterating over protocol rounds and varying communication patterns between twins and other nodes to explore diverse attack surfaces.
- Integrating Twins as a thin wrapper over DiemBFT, enabling automated execution of millions of test scenarios per day in a production environment.
- Leveraging existing correct protocol logic to generate faulty behaviors, avoiding the need to manually code Byzantine semantics.
- Validating the framework by injecting known and novel safety bugs into DiemBFT, which were detected within minutes by Twins.
Experimental results
Research questions
- RQ1Can a systematic, automated approach detect subtle safety bugs in BFT consensus protocols that are difficult to find through manual testing or random fault injection?
- RQ2To what extent can twin replicas of honest nodes emulate complex Byzantine behaviors such as equivocation and state forgetting without modifying the protocol code?
- RQ3Can the Twins framework be scaled to execute millions of test scenarios daily in a real-world BFT system like DiemBFT while maintaining low false positive rates?
- RQ4Does the Twins approach cover a broad class of Byzantine attacks, particularly those relying on knowledge of protocol state and causal dependencies?
- RQ5Can Twins be extended to validate ancillary components of BFT systems, such as reconfiguration and smart contract execution, beyond the core consensus protocol?
Key findings
- Twins successfully detected deliberately injected safety bugs in DiemBFT within minutes, demonstrating high sensitivity to logical flaws.
- The framework executed 44 million Twins-generated scenarios daily in a production setting, proving scalability and practicality.
- All known and novel attacks on BFT protocols materialized as Twins scenarios caused protocol failure within fewer than a dozen protocol rounds.
- Twins uncovered subtle safety violations that were not exposed by traditional testing or random fault injection, highlighting its superior coverage.
- The approach avoids state explosion by modeling only correct executions and using twin replicas to generate faulty behaviors, making it more efficient than formal verification.
- The framework is extensible and has been used to validate not only core consensus but also ancillary components like reconfiguration and smart contract execution in DiemBFT.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.