Quorum-phase model and deterministic safety for Ben-Or's binary consensus #
Fischer, Lynch, and Paterson (Cslib.FLP.Consensus.ge_one_not_exists) proved that no deterministic
asynchronous consensus protocol can tolerate even a single crash fault on two or more processes.
Ben-Or ([BO83], §3, Protocol A, printed p. 28) introduced a two-stage binary consensus
protocol for 2 * t < Fintype.card P using quorums of size n - t (n = Fintype.card P) and a
Stage-2 coin flip when no concrete proposal arrives.
This module formalizes quorum-phase deterministic safety after [BO83], §3, Protocol A
(printed p. 28; compare Theorem 1(ii)–(iii) on printed p. 29): it defines the two-stage phase
transition over per-recipient n - t quorums (PhaseSchedule.Valid), connects quorum-phase runs to
phased dynamic mid-stage crashes (CrashSchedule.Valid, crashRun), proves that deterministic
safety (Stage-1 proposal uniqueness, 1-phase unanimous validity without coin use, single-phase
estimate lock-in, cross-phase uniform agreement, and input integrity) holds unconditionally for
every coin sequence, and exhibits an explicit non-terminating execution on Fin 3, t = 1 for
every static deterministic coin fallback.
Model scope (#7120): PhaseSchedule and CrashSchedule group execution by synchronous phase
boundaries over n - t Stage-1/Stage-2 sender sets, rather than modeling the primitive
message-buffer and arbitrary cross-round step-interleaving scheduler of [BO83], §2 (printed
pp. 27–28). Companion module CslibFrontier.Computability.Distributed.BenOr.Liveness proves a
pre-coin phase-scheduler termination step (probRun) toward Theorem 1(i) of [BO83] (and
for a separate common-coin variant), while termination against full §2 asynchronous schedulers
remains open in #7120.
Quorum-phase abstraction and non-halting write-once decisions #
In [BO83], §3, Protocol A (printed p. 28), messages carry their round number r and stage tag
((1, r, x_P) in step 1; (2, r, v, D) or (2, r, ?) in step 2), and each process waits for
n - t messages of the matching (stage, r) tag before advancing. Here a single phase is modeled
by a per-recipient quorum pair PhaseSchedule P (q1, q2 : P → Finset P) satisfying
PhaseSchedule.Valid t (n - t ≤ (q1 p).card and n - t ≤ (q2 p).card).
Each process maintains ProcState (est : Bool, write-once decided : Option Bool, matching §2
printed p. 27) and continues executing subsequent phases after deciding (step 4 of Protocol A,
printed p. 28) so slower processes still collect n - t messages. CrashSchedule and
crashRun_eq_run verify that phased mid-stage crashes—where processes in crashed1 r ⊆ crashed2 r
stop sending and freeze their local states—coincide on all surviving processes with run on a
valid PhaseSchedule, giving uniform agreement even across processes that crash immediately after
deciding (crashRun_agreement).
In each phase r on state st : P → ProcState with n = Fintype.card P (matching steps 1–3 of
Protocol A, [BO83], §3, printed p. 28, with 0-indexed r : ℕ):
- Stage 1 (
stage1Proposal, Protocol A steps 1–2): processjcollects reports fromq1 j. If strictly more thann / 2(majorityThreshold n = n / 2 + 1) senders inq1 jreportedb,jproposessome b((2, r, b, D)); otherwisejproposesnone((2, r, ?)). - Stage 2 (
stage2Update, Protocol A step 3): processpcollects Stage-2 proposals fromq2 p.
Main definitions #
Cslib.Distributed.BenOr.ProcState: per-process estimate and write-once decision register.Cslib.Distributed.BenOr.PhaseSchedule,Cslib.Distributed.BenOr.PhaseSchedule.Valid: per-recipient Stage-1 and Stage-2 phase quorums of size at least|P| - t.Cslib.Distributed.BenOr.majorityThreshold: strict majority thresholdn / 2 + 1.Cslib.Distributed.BenOr.reportCount,Cslib.Distributed.BenOr.stage1Proposal: Stage-1 report tally and proposal rule.Cslib.Distributed.BenOr.proposalCount,Cslib.Distributed.BenOr.stage2Update: Stage-2 proposal tally and local state update.Cslib.Distributed.BenOr.initState,Cslib.Distributed.BenOr.phaseStep,Cslib.Distributed.BenOr.run,Cslib.Distributed.BenOr.adaptiveRun: phase execution against fixed and adaptive state-based schedules.Cslib.Distributed.BenOr.IsUnanimous,Cslib.Distributed.BenOr.AllDecided,Cslib.Distributed.BenOr.EstimateLocked: unanimous-estimate, global-decision, and decision-locks-estimate predicates.Cslib.Distributed.BenOr.CrashSchedule,Cslib.Distributed.BenOr.crashRun: dynamic mid-stage crash executions with frozen post-crash states.
Main results #
Cslib.Distributed.BenOr.adaptiveRun_eq_run: an adaptive state-based scheduler produces the same trace as the fixed sequence of quorums it selects along the run.Cslib.Distributed.BenOr.stage1Proposal_unique: at most one valuebis proposed assome bin Stage 1 across the entire network, for any quorums.Cslib.Distributed.BenOr.phaseStep_lucky_coin: for any state and Stage-1/Stage-2 quorums, there exists a bitbsuch that coin assignmentfun _ => baligns every process's next estimate tob.Cslib.Distributed.BenOr.phaseStep_lock_in: when2 * t < |P|andsched.Valid t, if any process newly decidesbin Stage 2, every process sets its next estimate tobregardless of the coins.Cslib.Distributed.BenOr.run_validity: unanimous inputbcauses every process to decidebat the end of phase0, without reading any coin.Cslib.Distributed.BenOr.run_decide_next_phase: once any process has decidedbby phaser, every process has decidedbby phaser + 1.Cslib.Distributed.BenOr.run_agreement: no two processes ever decide conflicting values, in the same phase or across different phases.Cslib.Distributed.BenOr.run_exists_inp_eq_of_decided: any value decided in any phase was the initial input of at least one process.Cslib.Distributed.BenOr.crashRun_eq_run,Cslib.Distributed.BenOr.crashRun_agreement: simulation of dynamic mid-stage crash executions and uniform agreement across crashed and surviving processes.Cslib.Distributed.BenOr.exists_nonterminating_of_fixed_coin: onFin 3, t = 1, every static deterministic coin fallbackFin 3 → Booladmits an input and a valid crash-free schedule under which no process ever decides.
References #
Process states and asynchronous phase schedules #
A phase schedule is valid for fault bound t if every process receives Stage-1 and Stage-2
messages from at least |P| - t distinct senders.
Stage-1 quorum size bound.
Stage-2 quorum size bound.
A schedule valid for fault threshold t is valid for any larger threshold t' ≥ t.
Static quorum schedule in which every process hears from all non-faulty processes univ \ F.
Whenever at most t processes are faulty, honestQuorum F is a valid n - t schedule.
Threshold arithmetic #
Strict majority threshold ⌊n / 2⌋ + 1.
Stage 1 (report) and proposal uniqueness #
Stage-1 proposal computed from received reports in S: propose some b if at least
majorityThreshold |P| senders in S reported b, and none otherwise.
Symmetric characterization of when stage1Proposal emits some b.
Symmetric characterization of when stage1Proposal emits none.
Stage-1 proposal uniqueness: across the entire network, no two Stage-1 quorums S₁ and
S₂ can produce conflicting some proposals from the same state st, because two strict
majorities cannot be disjoint in P.
Stage 2 (propose) and phase execution #
Execute one two-stage phase of Ben-Or's protocol on global state st under quorum-phase
schedule sched and coin assignment coins.
Execute r phases against an adaptive state-based scheduler strat that inspects the global
state at the start of each phase before choosing that phase's quorums.
An adaptive scheduler produces the same trace as the fixed schedule sequence of quorums it chooses along the run.
Every process currently carries the same binary estimate.
Every process has decided, and all decided values coincide.
Lucky coin, unanimous progress, lock-in, and deterministic safety #
Lucky-coin alignment: for any state st and schedule sched (even without quorum size
bounds), there exists a bit b : Bool such that if every process's coin in this phase equals b,
every process ends the phase with estimate b.
From any state where all processes hold estimate b, one valid phase preserves estimate b on
every process and sets every undecided process's decision register to some b, independent of
coins.
IsUnanimous is preserved across any valid phase under arbitrary coins.
Single-phase lock-in: if process p newly decides b in Stage 2 of a valid phase (when
2 * t < |P|), then every process q adopts next estimate b in that phase, regardless of
coins.
Write-once monotonicity of decided across any number of phases.
Lock invariant: whenever any process has decided b, every process carries estimate b.
Preserved across all valid phases once 2 * t < |P|.
EstimateLocked holds vacuously in the initial state before any process has decided.
EstimateLocked is preserved across any valid phase when 2 * t < |P|.
When EstimateLocked st holds and all processes share estimate b, one valid phase leaves
every process with decided = some b.
Quorum-phase unanimous validity (quorum-phase counterpart of Theorem 1(ii), [BO83],
§3, printed p. 29): if all processes start with input b, every process decides b after phase
0 (r = 1), without depending on any coin value.
Quorum-phase next-phase global decision (quorum-phase counterpart of Theorem 1(iii),
[BO83], §3, printed p. 29): once any process p has decided b by phase r, every process
q has decided b by phase r + 1.
Cross-phase agreement: in any valid execution with 2 * t < |P| and arbitrary coins, no
two processes ever decide different values, whether in the same phase or in different phases.
Input integrity (strong binary validity): whenever any process decides b in any phase,
at least one process started with initial input b.
Dynamic mid-stage crash simulation and uniform agreement #
Phased schedule with cumulative mid-stage crashes: crashed1 r is the set of
processes that have crashed before completing Stage 1 of phase r, and crashed2 r is the set of
processes that have crashed before completing Stage 2 of phase r. Crashed processes stop sending
in subsequent stages and freeze their local state.
Cumulative processes crashed prior to completing Stage 1 of phase
r.Cumulative processes crashed prior to completing Stage 2 of phase
r.Stage-1 sender quorums for processes completing Stage 1 of phase
r.Stage-2 sender quorums for processes completing Stage 2 of phase
r.
Validity of a dynamic crash schedule for fault bound t: crashes grow monotonically with at
most t crashes in any phase, surviving processes receive at least |P| - t messages per stage,
Stage-1 quorums in phase r + 1 exclude processes already crashed in phase r, and Stage-2
quorums exclude processes crashed before completing Stage 1.
Processes crashed before Stage 1 remain crashed through Stage 2.
Processes crashed in phase
rremain crashed in phaser + 1.At most
tprocesses crash in total by Stage 2 of any phase.Surviving Stage-1 recipients collect at least
|P| - treports.Surviving Stage-2 recipients collect at least
|P| - tproposals.Stage-1 quorums in phase
r + 1exclude senders that crashed in phaser.Stage-2 quorums exclude senders that crashed before completing Stage 1.
One phase of Ben-Or's protocol with mid-stage crashes: processes in crashed1 emit no Stage-2
proposal, and processes in crashed2 freeze their local state (including any prior decision).
Execute r phases under a dynamic mid-stage crash schedule cs.
Total PhaseSchedule sequence extending cs by assigning the surviving set univ \ crashed2 r
as a dummy quorum for already-crashed processes (whose states no surviving recipient ever reads).
Extending a valid dynamic crash schedule via toSchedule yields a valid PhaseSchedule in
every phase.
Dynamic crash simulation: at phase 0 on all processes, and after phase r + 1 on every
process p ∉ cs.crashed2 r, crashRun coincides identically with run on cs.toSchedule.
Uniform agreement under dynamic crashes: even if a process decides in some phase and immediately crashes afterward, its decision agrees with the decision of every other process across all phases.
Necessity of fresh randomization (Fin 3, t = 1): for every static deterministic coin
fallback fallback : Fin 3 → Bool, there exist an input assignment inp and a valid crash-free
quorum-phase schedule sched (sched.Valid 1) such that no process ever decides in any phase
r : ℕ.