Verifying formal models of Raft implementations
Antithesis combined AI, TLA+, Lean, and trace validation to formally prove safety properties for production Raft libraries from etcd and HashiCorp, uncovering several bugs.
read it Essential reading for engineers interested in bridging the gap between formal specifications and production distributed systems code using AI and fuzzing.
summary
Antithesis used AI agents to infer TLA+ models from production Raft libraries and verified core safety properties using model checking and theorem provers like Lean. To bridge the gap between abstract models and actual code, they employed an iterative loop combining trace validation with deterministic simulation testing and fault injection. This process successfully proved safety invariants and exposed 7 patches across both implementations, including new and previously known bugs. The project demonstrates how testing and formal verification can amplify each other to increase system robustness.
key points
- The team used Claude Fable 5.2 to automatically infer TLA+ models from Go implementations, translating them to Veil/Lean for interactive theorem proving.
- Trace validation connected the abstract models to real execution by checking structured log events emitted during fault-injection testing in Antithesis.
- The process cost less than $1,200 in LLM tokens and 2,000 Antithesis compute-hours per library, uncovering 7 patches across etcd-raft and HashiCorp Raft.
who should read it
Distributed systems engineers, researchers in formal verification, and developers working on consensus protocols.
discussion warm
Incredible work! I’m sad to see my face on one of the open HashiCorp Raft issues. I’m at Vercel now, but Antithesis was fantastic to work with on that one when I was still at HashiCorp/IBM. Antithesis graciously offered to walk us through the issue on a call. Sadly HashiCorp/IBM had long since stopped devoting resources to their raft implementation despite it being core to 3 of their products. It works quite well even in the face of an ever-growing list of open issues, and the folks who have contributed to it should take a lot of pride in what they’ve accomplished. (My contributions are …
A former HashiCorp maintainer provides rare context on the lack of resources devoted to maintaining the HashiCorp Raft library.
Generated by an LLM from the article and thread. Check the sources before relying on it.