8 ms·
Paxos automatically determined safe and secure
- deleted 5y ago[deleted]
- threatofrain 5y agoTowards an Automatic Proof of Lamport's Paxos (2021) https://arxiv.org/pdf/2108.08796.pdf https://arxiv.org/pdf/2108.08796.pdf
- 0xbadcafebee 5y agoWhen people talk about security vulnerabilities, they focus on the most glaring holes. "Memory safety!!!!!" etc. Meanwhile, cyber criminals merrily go about their day hijacking massive computer systems without even using a memory safety vuln. Because the criminals don't give a crap what kind of holes there are - they any kind will do. When people talk about distributed consensus algorithms, they're similarly missing the important point. A useful algorithm isn't the end-all be-all of the system. What's important is that the entire system be operated to a high degree of reliability in a way that meets the needs of a specific application. Paxos or not, if your implementation keeps falling over for reasons other than consensus, or you don't build in the tools to properly deal with the knock-on effects of consensus issues, etc, then the whole thing is going to blow up anyway. No algorithm on its own will make a better system. You need all the other parts of the system to be just as awesome, or it falls apart just the same.
- tester756 5y agohttps://xkcd.com/538/ https://xkcd.com/538/
- jiggawatts 5y agoThis reminds me of a recent project where I was doing some maintenance work on a system where one component was using ZooKeeper, which uses a distributed consensus algorithm similar to Paxos. Guess which component was the only one that failed to come back up after a simple reboot? Turns out that ZooKeeper has default "boot" timeouts that are too short for typical JVM startup times on some hosting platforms, so it just throws up its hands and never tries again after the first attempt. I want to know who was the person that sat down, cracked his knuckles, and then want about writing the code to deliberately add a failure mode to what is otherwise a very failure-tolerant algorithm.
- lmm 5y agoZooKeeper is consistent at all costs and often sacrifices availability for it, by design.
- jiggawatts 5y agoThis superficially sounds like a good design choice, but makes no sense whatsoever if you stop and think about it for a minute. Clustering systems like ZooKeeper are pointless for scenarios where things never fail. They serve no purpose in a system that is infallible, unchanging, and perfect. They're intended for handling failures and other changes.[1] Power outages happen. Temporary but total network outages happen, sometimes across even multi-region deployments. Cluster-wide reboots may need to occur occasionally. Startup might be slow due to a storm of other systems also starting and slowing down everything. These scenarios have to be handled. It's not optional for any system design for failure scenarios. VMware handled it fine. Windows Failover Clustering handled it fine. SQL Server AlwaysOn Availability Groups handled it fine. Kubernetes was back up and running before anything else. ZooKeeper didn't. It just sat there. No nodes were down. No services had crashed. It wasn't out of disk space. No data was corrupted. No "inconsistency" of any kind had occurred. It just decided not to start. Because it was, what? Too impatient? It saw that 60 seconds had elapsed, and apparently 61 seconds is just too long to wait, so no cluster! No! Too slow! Boot faster next time! What if this occurs at 1am on a system without 24/7, round-the-clock support? ZooKeeper will go down, and stay down. In this case this was a planned outage, so I had to stay up until 3:30 am troubleshooting why ZooKeeper wouldn't act like any other cluster I had ever dealt with. Fun. [1] I got this lesson taught to me by a CommVault backup product designer. He explained that "backup products" aren't. They're recovery products, and their only purpose is to be used in a disaster. If they can't handle a disaster, they're worse than worthless, they give a false sense of confidence! CommVault was designed by people that had operated forward IT bases for the military in the Yugoslav civil war. They had to recover systems from data centres that were literally smoking craters in the ground. ZooKeeper struggles with planned reboots. It's not even vaguely in the same league of trustworthiness.
- polskibus 5y ago
- lamontcg 5y agoIts important to have a distributed consensus protocol like Paxos, which has been validated, as a lego block in building any larger system. We need a lot more of those well engineered, proven, validated lego blocks. Memory safety is a cross cutting concern which makes all those lego blocks much safer. We are about 30 years behind the curve and have a lot of ground to make up. That doesn't make these efforts useless, that just means that we need 10 times the effort.
- drivebycomment 5y agoWhat a strawman. The article doesn't claim or imply that Paxos on its own will make a better system. You can't build secure systems without having solid building blocks and primitives. Just like proving encryption algorithms and cryptographic have functions have certain properties is important and essential, proving properties about Paxos is important and useful.
- johnisgood 5y agoSpeaking of proving encryption algorithms and such: https://github.com/Componolit/libsparkcrypto https://github.com/Componolit/libsparkcrypto Ada/SPARK! They added ECDSA, ECGDSA, too. :)
- jt_thurs_82 5y ago> the most foundational distributed computing protocols—known as Paxos—meets its specifications. > Paxos is one of the most important examples of the category >“Most—if not all—consensus algorithms fundamentally derive concepts from Paxos,” Goel said. A lot of burying the lede here, trying to imply Paxos powers many more applications than it actually does. While Paxos is in decent widespread use, and influential, I find some of the verbiage here lying by omission.
- Jweb_Guru 5y agoThat seems pretty accurate, TBH. Correct distributed consensus is almost exclusively done via some flavor of Paxos. As for the actual research, it probably needs much closer reading, but if they can automatically infer nontrivial inductive invariants that's huge for automatic verification, since this is the usual stumbling block for those kinds of tools.
- m0zg 5y agoMost people have never dealt with large resilient systems, and do not understand what "distributed consensus" even means, and what it enables. Hence the derisive comments on this important result.
- ncmncm 5y agoAs I understand it, Raft is much more commonly relied upon than Paxos. Raft uses concepts from Paxos, but is not Paxos. So, a proof about Paxos is not a proof about Raft.
- Jweb_Guru 5y agoRaft is more or less a Paxos variant with good marketing. Sure, the proof for vanilla Paxos won't directly apply, but it's not inaccurate to say that it derives heavily from Paxos, which is all the quote above was saying. See https://emptysqua.re/blog/paxos-vs-raft/ https://emptysqua.re/blog/paxos-vs-raft/.
- 5y ago
- throw10920 5y agoAssuming it's possible for most proofs to become automatically generated (which I don't think is a given), then it seems like verification work will shift from manually writing proofs into writing the specification from which proofs will automatically be generated - in which case, verification engineers will be able to look forward to an exciting future of figuring out how to tell the computer what is meant by "is". Or doing system implementation directly - it doesn't seem like automated program synthesis is going anywhere fast... (I jest, while still growing to be more of a fan of type systems, borrow checkers, and formal proofs)
- johnbender 5y agoMore likely we’re looking at codesign/correct-by-construction for fully general purpose verification. In many cases it’s possibly to refine a state machine based specification to an imperative implementation (and thereby carry safety properties down to the implementation) but at present the implementation usually looks like the state machine (thus codesign)
- ncmncm 5y agoA proof about a state machine is more useful than a proof about a program, or an automatically generated program. Proving that a program correctly implements a state machine is a much simpler exercise than teaching a proof system about your programming language.
- Jweb_Guru 5y ago> A proof about a state machine is more useful than a proof about a program, or an automatically generated program. Easier maybe, but more useful? I disagree. Just because it's difficult to prove things about real programs doesn't change the fact that a formally verified program has really important advantages--like being able to actually run it, and knowing the executing code actually fulfills the spec rather than relying on a human translation layer.
- 5y ago
- scrubs 5y agoThis is what I come to HN for. Thanks for the post.
- lowbloodsugar 5y agoI thought that Lamport already did that with TLA+? What is new about this one?
- MatteoFrigo 5y agoTLA+ is a specification language. Its goal is to say exactly what the algorithm is, because an informal description in English or even pseudo-code is usually too ambiguous and not amenable to mechanical proofs. TLA+ by itself does not prove anything. You can write incorrect algorithms in TLA+, in the same way that you can write incorrect C programs. Once you have a TLA+ specification, lazy people like me run the specification through a tool called TLC that exhaustively explores all possible behaviors of the algorithm in a finite search space. For example, the specification may say that a property is valid for all N, but TLC checks it for N=1, 2, and 3. This step is not a "proof" (it's more like a test suite), but people like me say "good enough" and ship at this point. Lamport and colleagues have a tool called TLAPS where you can write a proof yourself (e.g., valid for all N), and the tool checks that the proof proves what it claims to prove. The next step, which is what this paper is all about, is to derive the proof automatically.
- sethammons 5y ago> The tool the researchers designed for this proof is called IC3PO, a model checking system that looks through every state a program can enter and determines whether it matches a description of safe behavior. If the protocol is correct, IC3PO produces what’s termed an inductive invariant—a proof by induction that the property holds in all cases. If instead a bug is found in the protocol, it will produce a counter-example and execution trace, showing step by step how the bug manifests. That's really cool.
- thrtythreeforty 5y agoYou can also find this in hardware test benches - Symbiyosys (FOSS) and JasperGold (very proprietary) can prove via induction that assertions about your system on chip hold true for all time.
- ummonk 5y agoHas anyone done the same for raft consensus?
- johnbender 5y agoRaft has been manually verified which was the hurdle here that makes the result interesting: https://github.com/uwplse/verdi-raft https://github.com/uwplse/verdi-raft
- _r2gl 5y agoThe conclusion in the paper states it's left as future work. "Future work also includes automatically inferring inductive proofs for other distributed protocols, such as Byzantine Paxos [15], Raft [90], etc., and exploring the verification of consensus algorithms in blockchain applications. " https://arxiv.org/pdf/2108.08796.pdf https://arxiv.org/pdf/2108.08796.pdf
- baby 5y agoor for byzantine-fault tolerant consensus like hotstuff?
- meetups323 5y ago> The inductive invariant IC3PO produced for Paxos in under an hour identically matches the human-written one previously derived with significant manual effort using a technique called interactive theorem proving. On top of speeding the process up, it also produces a proof with very succinct and digestible documentation. Is there anything actually different between "interactive theorem proving" in a sufficiently advanced language (say Coq) and what they've done here? Honest question, I had to drop out of my college Coq class on account of a broken leg (and lack of willpower).
- johnbender 5y agoIn Coq the user generally writes meta programs to generate proofs as programs at varying levels of automation (Ltac scripts). Here they used IC3 to automatically produce proof that their state based model of paxos satisfies the invariant. In principle one could build an automated proof system for a state machine-esque formalism written in Coq using Ltac but that would be a nightmare in practice.
- generationP 5y agoWondering where the word "secure" in the title is coming from. These are purely safety results; the setting doesn't even allow for Byzantine failures.
- _vvhw 5y ago“Paxos is one of the first and most celebrated ideas that laid the foundation for how different things come to an agreement asynchronously” “Most—if not all—consensus algorithms fundamentally derive concepts from Paxos” It's not well known (even in the field of distributed systems) that in fact Viewstamped Replication pioneered the field of consensus in 1988, a year before Paxos, with an intuitive algorithm essentially identical to Raft, so that Raft is more within the family and tradition of Viewstamped Replication (as is Multi-Paxos state machine replication) than the other way round. Viewstamped Replication is significantly easier to implement correctly in the presence of real world storage faults, which formal proofs often do not take into account in their fault model. For example, Paxos and Raft proofs typically assume only pristine stable storage, and the correctness unfortunately rapidly breaks down when physical disks are used, since these may misdirect reads and writes. UW-Madison have done some excellent research in this area in particular, the intersection of consensus protocol correctness and storage faults, and I would recommend reading "Protocol-Aware Recovery for Consensus-Based Storage" if you'd like to dive into some of this: https://www.usenix.org/conference/fast18/presentation/alagappan https://www.usenix.org/conference/fast18/presentation/alagap... Aleksey Charapko's DistSys Reading Group also recently covered Viewstamped Replication as a foundational paper, focusing on the crystal clear 2012 revision by Barbara Liskov and James Cowling, which I was able to present, covering some of our experience implementing the protocol for TigerBeetle, a distributed database with a strict storage fault model: http://charap.co/reading-group-viewstamped-replication-revisited/ http://charap.co/reading-group-viewstamped-replication-revis...
- hawk_ 5y ago> correctness unfortunately rapidly breaks down when physical disks are used, since these may misdirect reads and writes. Isn't the whole point of consensus to get around discrepancies due to faults in individual devices. With high enough quorum in Raft for example you can lower the probability of dataloss to an arbitrarily low point to not matter at all in practice.
- _vvhw 5y ago"Isn't the whole point of consensus to get around discrepancies due to faults in individual devices" Yes, but only with respect to the fault models actually adopted, proven, implemented and tested. Again, most formal proofs, papers and implementations are not actually incorporating any kind of a storage fault model, yet this is essential for correctness in a production deployment. If you look closely at Paxos and RAFT, they only attempt correctness for the network fault model {packets may be reordered/lost/delayed/replayed/redirected} and process fault model {crash failure}, nothing else. For example, there's no mention of what to do if your disk forgets some writes either because of a misdirected write, or because of a latent sector error, or because of corruption in the middle of the committed consensus log. Unfortunately, simply increasing quorum will also not actually lower the probability of data loss. In fact, there are trivial cases where even a single local disk sector failure on one replica can cause an entire Paxos or RAFT cluster to experience global cluster data loss. Protocol-Aware Recovery for Consensus-Based Storage from UW-Madison goes into this in detail, showing where well-known distributed systems are not correct, and also showing how this can be fixed. It won best paper at FAST '18 but is still catching on in industry. We implemented Protocol-Aware Recovery for TigerBeetle [1], and use deterministic simulation testing to inject all kinds of storage faults on all replicas in a cluster, even as high as 20% simultaneously on all 5 replicas, including the leader. It was pretty magical for us to watch TigerBeetle just keep on running the first time, with high availability and no loss of data, despite radioactively high levels of corruption across the cluster. [1] https://www.tigerbeetle.com https://www.tigerbeetle.com
- dgan 5y agoCould this be done in Isabelle? Isabelle has the ability to prove inductive statements. (Disclaimer : i am a noob reading Concrete Semantics right now)
- johnisgood 5y agohttps://github.com/Componolit/libsparkcrypto/blob/componolit/src/theories/Mod_Simp.thy https://github.com/Componolit/libsparkcrypto/blob/componolit... It makes my head spin!
- aman-goel 5y agoHere is a link to a YouTube video on this work- https://youtu.be/nPwlj6w6EXU https://youtu.be/nPwlj6w6EXU The tool IC3PO is open source on GitHub- https://github.com/aman-goel/ic3po https://github.com/aman-goel/ic3po