Reaching Agreement in the Presence of Faults 1: With n ≥ 3m + 1 Processors, the Recursive Majority Procedure on (m + 1)-Level Scenarios Assures Interactive Consistency for m FaultsResearch Paper
Motivation
A fault-tolerant system often replicates a computation on several processors and needs the nonfaulty ones to act on the same data, even though some processors may fail in arbitrary ways: send wrong values, send different values to different recipients, or lie about what they were told. Pease, Shostak and Lamport posed the question in 1980, motivated by the SIFT fault-tolerant aircraft-control computer under development at SRI (Wensley et al. 1978), where it arises in clock synchronization among other places: processors, at most of them faulty, communicate by two-party messages whose sender is always identifiable, and each holds a private value. Can the nonfaulty processors all compute the same vector of values, one entry per processor, whose entry for every nonfaulty processor is that processor's true value? The paper (J. ACM 27 (1980) 228–234) calls this interactive consistency and settles it: possible if and only if when messages can be forged in relay, and possible for every when they cannot. The same problem, under the name Byzantine generals, became the standard model of arbitrary ("Byzantine") failures in distributed computing (Lamport, Shostak & Pease 1982); the bound underlies the quorum sizes of later replication protocols.
This mission covers the positive half of the paper's characterization: Section 3's recursive procedure, which achieves interactive consistency with processors in rounds of message exchange.
Setting
Let be a finite set of processors and a set of values. A string over a set is a finite sequence of elements of , repetitions allowed. For a -level scenario is a map from the nonempty strings over of length at most to . The value is 's private value ; for , is the value tells that told … that told is 's private value. A -level scenario records the outcome of rounds of message exchange.
Faults are modeled by a set of nonfaulty processors, unknown to the processors. Nonfaulty processors relay truthfully, so is consistent with when
Faulty processors are otherwise unconstrained. A processor sees only its view , the restriction of to strings beginning with .
The procedure (p. 230). Processor computes the entry for processor as follows, with and the current processor count and fault bound:
- If some with and some satisfy for every string over of length , record .
- Otherwise apply the procedure for , to the processor set and the view , obtaining a vector of entries. If at least of them agree, record the common value; otherwise record NIL.
In Lean this is InteractiveConsistency.OralAlgorithm.record m P τ q with τ = fun w => σ (p :: w), values in Option V with none for NIL.
Formalization targets
Goal: the procedure assures interactive consistency
For , for every with and every -level scenario consistent with ,
This is procedure_assures_ic. It is the paper's claim about this procedure, not an existence statement.
Milestones, in the order the paper's proof uses them
- Nonfaulty (p. 231): for , step (1) succeeds and records .
- Two step-(1) quorums agree (p. 231): if find quorums with values , then .
- The subscenario (p. 230): for faulty , is an -level scenario on consistent with , and .
- The claim (p. 231): if satisfy step (1) for and , then has at least members and satisfy step (1) of the recursive call for every .
Significance
The theorem is the upper bound in the tight characterization of when interactive consistency is achievable with unauthenticated messages; the matching impossibility (the paper's Section 4 THEOREM) shows that no procedure, with any number of rounds, does better. The procedure is the ancestor of the "oral messages" algorithm of the Byzantine generals paper, and its quorum arithmetic (, intersections of two quorums containing a nonfaulty member) recurs throughout Byzantine fault-tolerant replication.
The result is proved in the paper, in a half-page induction. What this mission adds is a machine-checked proof against an explicit model of scenarios, views and consistency with a bounded number of rounds. Machine-checked proofs exist for the related algorithm of the later Byzantine generals paper in other proof systems; this procedure, with its quorum-based step (1), has to our knowledge not been formalized in Lean, and nothing on message-passing agreement exists on this platform.
Difficulty
Each step of the paper's proof is short, but the bookkeeping is where an argument breaks. The recursion changes three things at once: the processor set loses , the fault bound drops by one, and the scenario becomes of one level less. The induction hypothesis must therefore be stated for every finite processor set and every scenario, and applied to a subscenario whose consistency is inherited only for strings of the right length. The mixed case, where one nonfaulty processor exits at step (1) and another recurses, is the delicate one: the two processors' computations take different branches, and since is faulty nothing forces either value to be 's private value. The thresholds are exact: in step (1) and agreeing entries in step (2), both in the current and ; off-by-one changes in either break the case analysis. Finally, step (2)'s majority value must be shown unique, so that two processors with the same vector record the same value.
Formalization scope
Processors form a Finset α with decidable equality; strings are List α, read left to right (the receiver first, the originator last), so is σ (p :: (w ++ [q])). A scenario is a total function List α → V; consistency with (ConsistentUpTo P N (m + 1) σ) constrains it only on strings over of length at most , the domain of an -level scenario and all the procedure reads. The procedure receives only the view fun w => σ (p :: w), never or . The fault hypothesis is P.card ≤ N.card + m; is included.
Explicit readings of the paper's prose: "size " is P.card + m < 2 * Q.card; is natural-number division; "strings over of length " includes the empty string and allows repetitions; the step-(2) vector is indexed by P.erase q and includes 's own entry; the recorded value in step (1) is (the empty string forces it); when several values reach the step-(2) threshold one is chosen deterministically from the vector (under the goal's hypotheses at most one does); for a failing step (1) records NIL (never reached under the hypotheses). Two printed slips are corrected in the Lean: "records and " (for "for ") and "" (for ).
Trivializing formalizations are ruled out: the procedure never sees itself (with it, recording would be trivial), consistency constrains only relays by nonfaulty processors, and ranges over every subset of size at least .
The development needs only finite sets and lists; no library beyond Mathlib is required. The quorum-intersection lemmas and the subscenario construction are reusable for other oral-message protocols. Contributions welcome: proofs of the four milestones, the goal by induction on , and a computable version of the procedure for concrete instances. This is mission 1 of a series of three on this paper; mission 2 formalizes the impossibility THEOREM for (Section 4), and mission 3 the authenticated-message procedure for every (Section 5).
Selected references
- M. Pease, R. Shostak, L. Lamport, Reaching agreement in the presence of faults, Journal of the ACM 27(2), 1980, 228–234. https://doi.org/10.1145/322186.322188
- L. Lamport, R. Shostak, M. Pease, The Byzantine generals problem, ACM Transactions on Programming Languages and Systems 4(3), 1982, 382–401. https://doi.org/10.1145/357172.357176
- J. H. Wensley et al., SIFT: Design and analysis of a fault-tolerant computer for aircraft control, Proceedings of the IEEE 66(10), 1978, 1240–1255. https://doi.org/10.1109/PROC.1978.11114