I'm fascinated by consensus algorithms and would love to implement one myself to synchronize unreliable systems (e.g. a network of independent sensors with a common database running on ESP8266 modules). I didn't study CS, so I didn't absorb all the underlying theory with my breastmilk. So big questions remain unanswered so far.<p>How exactly do I know that the algorithm is correct? (Proof, of course, but how?)<p>How do I know that my implementation is correct? (Unit test, of course, but how? How do I simulate/test asynchronous systems with failing communication? How do I catch all possible edge cases?)<p>Is there an comparative overview of consensus algorithms detailing pros and cons? (A few days ago there was a post about Paxos/Raft having abmysal worst-case performance.)