NewsCrawler.org

Formally verifying etcd and HashiCorp Raft implementations with AI and TLA+

Verifying formal models of Raft implementations | Antithesis
Image: Reddit

The Antithesis team describes how it used AI, formal methods and its own testing platform to model two production Raft[1] libraries, one from etcd and one from HashiCorp. Both libraries implement the same protocol, but they take different approaches. The team wrote TLA+[2] models with trace validation[3], then repeated model checking, testing and proof attempts, fixing bugs and refining the model until the proofs held and every test run matched the model.

The model covers pre-votes, snapshots and leadership transfers. For etcd-raft only, it also covers read indexes, async storage writes and membership changes. The final proofs establish Election Safety, Leader Completeness and State-Machine Safety. The authors say that, after the fixes, the designs give the same guarantees as the Raft paper for the features they modeled, and they have published the artifacts for open review.

Claude Fable 5.2 inferred the TLA+ models from the code, but people chose which features to include and changed one of the generated safety properties. The Antithesis plugin set up test clusters with fault injection and assertions. A trace validation kit flagged any run whose logs did not match a path in the model. The TLC[4] model checker checked the invariants on small bounded instances with over 1.6 million states.

Read the original antithesis.comDiscussion

Sources

Published: First seen: Читать по-русски

Open as a page