Raft as a pure function, so it can be simulated
The Raft core takes an event and returns effects; threads, timers and the network live outside it. The same class runs in production and in a seeded simulator, 10,000 scenarios in each of two suites on every CI run. It caught two real bugs in my first version: a wrong commit rule and a wrong log backoff.