Documentation

CslibFrontier.Computability.Distributed.PartialSynchrony.Basic

Partial synchrony and unconditional pre-GST quorum-locking safety #

Deterministic fault-tolerant consensus in the basic round model of partial synchrony introduced by Dwork, Lynch and Stockmeyer, §3.1 (which captures synchronous processors with communication bound Δ holding from an unknown Global Stabilization Time GST onward via §4.1).

Model #

A PartialSyncProtocol P V State Msg specifies deterministic round-based execution over processes P with initial inputs in V, outgoing messages send, state transitions update taking per-sender Option Msg deliveries, and optional write-once decisions output : P → State → Option V.

Before GST, an adversarial network schedule deliver : ℕ → P → P → Bool may drop any subset of point-to-point messages in any round, modeling arbitrary message loss and timeouts prior to stabilization. IsGST deliver F gst asserts that from round gst onward, every message between correct processes (∉ F) is delivered in its round. Two fault regimes share the same protocol interface:

Crucially, as emphasized in Dwork, Lynch and Stockmeyer, §1.2, p. 290, the safety properties (irrevocability, agreement, and validity) hold unconditionally for every deliver schedule—even if GST never arrives (GST = ∞)—while post-GST liveness is established in CslibFrontier.Computability.Distributed.PartialSynchrony.Liveness.

Streamlined view-based quorum-locking protocols vs. [DLS88] §3.2 #

In Dwork, Lynch and Stockmeyer, §§3.2.1–3.2.3, Algorithms 1–3 alternate trying phases with explicit lock-release phases and piggyback monotone PROPER sets on every message, using a continuous Srikanth–Toueg echo broadcast across all subsequent rounds in the unauthenticated Byzantine case (Algorithm 3, Figure 1, p. 301). Here we formalize two original three- and six-subround rotating-coordinator view-based quorum-locking protocols over an arbitrary [DecidableEq V] domain:

Main definitions #

Main results #

References #

Partial-synchrony basic round model #

structure Cslib.Distributed.PartialSynchrony.PartialSyncProtocol (P : Type u_1) (V : Type u_2) (State : Type u_3) (Msg : Type u_4) :
Type (max (max (max u_1 u_2) u_3) u_4)

A deterministic consensus protocol in the basic round model of partial synchrony Dwork, Lynch and Stockmeyer, §3.1.

Process i starts in init i (x i). In round r + 1, each correct process j attempts to send send r j s i to i; i receives Option Msg per sender (none when omitted by the network or sender) and transitions via update r i s recv. output i s is some v once i has decided v and none while undecided.

  • init : P → V → State

    Initial local state of process i on input value v.

  • send : ℕ → P → State → P → Msg

    Message sent by process i in state s to recipient j during round r + 1.

  • update : ℕ → P → State → (P → Option Msg) → State

    Next local state of i after round r + 1 given received P → Option Msg.

  • output : P → State → Option V

    Decision value read from local state (none while undecided).

def Cslib.Distributed.PartialSynchrony.IsGST {P : Type u_1} (deliver : ℕ → P → P → Bool) (F : Finset P) (gst : ℕ) :

Global Stabilization Time condition Dwork, Lynch and Stockmeyer, §3.1, p. 295: from round gst onward, every message sent by a correct process j ∉ F to a correct process i ∉ F is delivered (deliver r j i = true). Prior to gst, deliver is unconstrained.

def Cslib.Distributed.PartialSynchrony.PartialSyncProtocol.byzantineState {P : Type u_1} {V : Type u_2} {S : Type u_3} {M : Type u_4} [DecidableEq P] (π : PartialSyncProtocol P V S M) (F : Finset P) (deliver : ℕ → P → P → Bool) (adv : ℕ → P → P → Option M) (x : P → V) :
ℕ → P → S

State of process i after r rounds under unauthenticated Byzantine faults F with network delivery schedule deliver, faulty-sender table adv, and initial inputs x.

def Cslib.Distributed.PartialSynchrony.PartialSyncProtocol.byzantineDecision {P : Type u_1} {V : Type u_2} {S : Type u_3} {M : Type u_4} [DecidableEq P] (π : PartialSyncProtocol P V S M) (F : Finset P) (deliver : ℕ → P → P → Bool) (adv : ℕ → P → P → Option M) (x : P → V) (r : ℕ) (i : P) :

Optional decision of process i after r rounds in a Byzantine partial-synchrony run.

def Cslib.Distributed.PartialSynchrony.PartialSyncProtocol.omissionState {P : Type u_1} {V : Type u_2} {S : Type u_3} {M : Type u_4} (π : PartialSyncProtocol P V S M) (deliver : ℕ → P → P → Bool) (x : P → V) :
ℕ → P → S

State of process i after r rounds under crash/omission schedule deliver and inputs x Dwork, Lynch and Stockmeyer, §§2.2, 3.1. Every process executes the protocol transition function; omitted links deliver none.

def Cslib.Distributed.PartialSynchrony.PartialSyncProtocol.omissionDecision {P : Type u_1} {V : Type u_2} {S : Type u_3} {M : Type u_4} (π : PartialSyncProtocol P V S M) (deliver : ℕ → P → P → Bool) (x : P → V) (r : ℕ) (i : P) :

Optional decision of process i after r rounds in an omission/crash partial-synchrony run.

def Cslib.Distributed.PartialSynchrony.PartialSyncProtocol.omissionAdv {P : Type u_1} {V : Type u_2} {S : Type u_3} {M : Type u_4} (π : PartialSyncProtocol P V S M) (deliver : ℕ → P → P → Bool) (x : P → V) :
ℕ → P → P → Option M

Replays the messages of an omission run deliver for F inside a Byzantine run.

theorem Cslib.Distributed.PartialSynchrony.PartialSyncProtocol.omissionState_eq_byzantineState {P : Type u_1} {V : Type u_2} {S : Type u_3} {M : Type u_4} [DecidableEq P] (π : PartialSyncProtocol P V S M) (F : Finset P) (deliver : ℕ → P → P → Bool) (x : P → V) (r : ℕ) (i : P) :
π.omissionState deliver x r i = π.byzantineState F deliver (π.omissionAdv deliver x) x r i

Every omission/crash run coincides with the Byzantine run against omissionAdv.

π solves consensus against at most t unauthenticated Byzantine faults under partial synchrony Dwork, Lynch and Stockmeyer, §§1.2, 2.4: safety (irrevocability, agreement, and validity when all correct inputs equal v) holds unconditionally across all schedules deliver, and every correct process eventually decides once IsGST deliver F gst holds.

  • irrevocable (F : Finset P) : F.card ≤ t → ∀ (deliver : ℕ → P → P → Bool) (adv : ℕ → P → P → Option M) (x : P → V) (r₁ r₂ : ℕ), r₁ ≤ r₂ → ∀ i ∉ F, ∀ (v : V), π.byzantineDecision F deliver adv x r₁ i = some v → π.byzantineDecision F deliver adv x r₂ i = some v

    Decisions of correct processes are write-once.

  • agreement (F : Finset P) : F.card ≤ t → ∀ (deliver : ℕ → P → P → Bool) (adv : ℕ → P → P → Option M) (x : P → V) (r₁ r₂ : ℕ), ∀ i ∉ F, ∀ j ∉ F, ∀ (v₁ v₂ : V), π.byzantineDecision F deliver adv x r₁ i = some v₁ → π.byzantineDecision F deliver adv x r₂ j = some v₂ → v₁ = v₂

    Unconditional agreement: no two correct processes ever decide distinct values, even without GST.

  • validity (F : Finset P) : F.card ≤ t → ∀ (deliver : ℕ → P → P → Bool) (adv : ℕ → P → P → Option M) (x : P → V) (v : V), (∀ i ∉ F, x i = v) → ∀ (r : ℕ), ∀ i ∉ F, ∀ (w : V), π.byzantineDecision F deliver adv x r i = some w → w = v

    Unconditional strong validity: if all correct processes start with v, no correct process ever decides any value other than v.

  • termination (F : Finset P) : F.card ≤ t → ∀ (deliver : ℕ → P → P → Bool) (gst : ℕ) (adv : ℕ → P → P → Option M) (x : P → V), IsGST deliver F gst → ∀ i ∉ F, ∃ (r : ℕ), (π.byzantineDecision F deliver adv x r i).isSome = true

    Post-GST termination: if IsGST deliver F gst holds, every correct process decides.

π solves consensus against at most t crash/omission faults under partial synchrony Dwork, Lynch and Stockmeyer, §§2.4, 3.2.1. Strong unanimity assumes ∀ i, x i = v because an omission-faulty process that omits no messages behaves identically to a correct process.

  • irrevocable (deliver : ℕ → P → P → Bool) (x : P → V) (r₁ r₂ : ℕ) : r₁ ≤ r₂ → ∀ (i : P) (v : V), π.omissionDecision deliver x r₁ i = some v → π.omissionDecision deliver x r₂ i = some v

    Decisions are write-once.

  • agreement (F : Finset P) : F.card ≤ t → ∀ (deliver : ℕ → P → P → Bool) (x : P → V) (r₁ r₂ : ℕ), ∀ i ∉ F, ∀ j ∉ F, ∀ (v₁ v₂ : V), π.omissionDecision deliver x r₁ i = some v₁ → π.omissionDecision deliver x r₂ j = some v₂ → v₁ = v₂

    Unconditional agreement across correct processes and rounds, even without GST.

  • validity (deliver : ℕ → P → P → Bool) (x : P → V) (v : V) : (∀ (i : P), x i = v) → ∀ (r : ℕ) (i : P) (w : V), π.omissionDecision deliver x r i = some w → w = v

    Unconditional strong unanimity: if all initial values equal v, only v can be decided.

  • termination (F : Finset P) : F.card ≤ t → ∀ (deliver : ℕ → P → P → Bool) (gst : ℕ) (x : P → V), IsGST deliver F gst → ∀ i ∉ F, ∃ (r : ℕ), (π.omissionDecision deliver x r i).isSome = true

    Post-GST termination: once IsGST deliver F gst holds, every correct process decides.

Any protocol solving unauthenticated Byzantine partial-synchrony consensus against t faults also solves omission/crash partial-synchrony consensus against t faults.

Zero-communication protocol in which every process immediately decides its own initial input.

On at most one process, ownInputProtocol solves Byzantine partial-synchrony consensus for every fault bound t.

Quorum intersection and list-based quorum counting #

theorem Cslib.Distributed.PartialSynchrony.quorum_inter_notMem {P : Type u_1} [Fintype P] [DecidableEq P] {F S₁ S₂ : Finset P} (h : Fintype.card P + F.card < S₁.card + S₂.card) :
∃ p ∈ S₁ ∩ S₂, p ∉ F

Two finite sets of processes S₁, S₂ whose cardinalities sum to strictly more than Fintype.card P + F.card intersect in at least one process outside F.

theorem Cslib.Distributed.PartialSynchrony.length_filter_dedup_eq_card {P : Type u_1} [Fintype P] [DecidableEq P] {procs : List P} (hprocs : ∀ (x : P), x ∈ procs) (p : P → Bool) :
(List.filter p procs.dedup).length = {x : P | p x = true}.card

Counting elements of procs.dedup satisfying p agrees with (Finset.univ.filter p).card whenever procs enumerates every P.

theorem Cslib.Distributed.PartialSynchrony.dedup_length_eq_card {P : Type u_1} [Fintype P] [DecidableEq P] {procs : List P} (hprocs : ∀ (p : P), p ∈ procs) :

When procs enumerates P, procs.dedup.length = Fintype.card P.

def Cslib.Distributed.PartialSynchrony.countVal {P : Type u_1} {V : Type u_2} [DecidableEq P] [DecidableEq V] (procs : List P) (f : P → Option V) (v : V) :

Multiplicity of some v across procs.dedup in f : P → Option V.

def Cslib.Distributed.PartialSynchrony.findQuorumVal {P : Type u_1} {V : Type u_2} [DecidableEq P] [DecidableEq V] (procs : List P) (q : ℕ) (f : P → Option V) :

Returns a value v carried by at least q distinct senders in procs.dedup, if any.

theorem Cslib.Distributed.PartialSynchrony.countVal_eq_card {P : Type u_1} {V : Type u_2} [Fintype P] [DecidableEq P] [DecidableEq V] {procs : List P} (hprocs : ∀ (x : P), x ∈ procs) (f : P → Option V) (v : V) :
countVal procs f v = {j : P | f j = some v}.card
theorem Cslib.Distributed.PartialSynchrony.findQuorumVal_eq_some_iff {P : Type u_1} {V : Type u_2} [Fintype P] [DecidableEq P] [DecidableEq V] {procs : List P} (hprocs : ∀ (x : P), x ∈ procs) {q : ℕ} (hq : Fintype.card P < 2 * q) (f : P → Option V) (v : V) :
findQuorumVal procs q f = some v ↔ q ≤ {j : P | f j = some v}.card

When Fintype.card P < 2 * q, at most one value can have q senders, so findQuorumVal returns some v if and only if at least q senders carry some v.

theorem Cslib.Distributed.PartialSynchrony.prevoteQuorum_unique {P : Type u_1} {V : Type u_2} [Fintype P] [DecidableEq V] {F : Finset P} {t : ℕ} (hn : 3 * t < Fintype.card P) (hF : F.card ≤ t) {honestEcho m₁ m₂ : P → Option V} (h₁_honest : ∀ h ∉ F, ∀ (w : V), m₁ h = some w → honestEcho h = some w) (h₂_honest : ∀ h ∉ F, ∀ (w : V), m₂ h = some w → honestEcho h = some w) {v₁ v₂ : V} (hq₁ : Fintype.card P - t ≤ {j : P | m₁ j = some v₁}.card) (hq₂ : Fintype.card P - t ≤ {j : P | m₂ j = some v₂}.card) :
v₁ = v₂

Within-view (n - t) echo/prevote quorum uniqueness: when 3 * t < Fintype.card P and F.card ≤ t, if every correct process h ∉ F sends at most one echo value honestEcho h in view v, at most one value val can gather n - t echoes across any two recipients' views m₁, m₂ (even if faulty senders equivocate across recipients).

Shared domain structures for view-based quorum locking #

A view-stamped lock or Stage-2 vote (view, val).

  • view : ℕ

    View index in which the vote or lock was formed.

  • val : V

    Value voted or locked in view.

Summary of initial-value properness computed in Subround 0 of a view.

  • allProper : Bool

    Set to true when at least 2t + 1 initial values were received with at least t + 1 entries distinct from every received value, certifying all of V proper.

  • freqVals : List V

    Initial values received from at least t + 1 distinct senders.

A coordinator proposal in view v, carrying a proposed value and an optional justifying lock view certView (none for a fresh unlocked proposal, some u for a certified lock at u < v).

  • val : V

    Proposed consensus value.

  • certView : Option ℕ

    Justifying certificate view (none when unlocked).

Selects an entry of maximum view from a list of ViewLocks, if nonempty.

theorem Cslib.Distributed.PartialSynchrony.pickMaxLock_mem {V : Type u_1} {lks : List (ViewLock V)} {best : ViewLock V} (h : pickMaxLock lks = some best) :
best ∈ lks
theorem Cslib.Distributed.PartialSynchrony.pickMaxLock_le {V : Type u_1} {lks : List (ViewLock V)} {best : ViewLock V} (h : pickMaxLock lks = some best) (lk : ViewLock V) :
lk ∈ lks → lk.view ≤ best.view

Unauthenticated Byzantine 6-subround view-locking protocol (3 * t < Fintype.card P) #

Messages exchanged by byzQuorumProtocol across the 6 subrounds of each view v.

  • rawStatus {V : Type u_1} (initVal : V) (votedViews : List (ViewLock V)) : ByzViewMsg V

    Subround 0: initial value and history of Stage-2 ViewLock votes emitted by the sender.

  • certStatus {V : Type u_1} (proper : ProperReport V) (certPairs : List (ViewLock V)) : ByzViewMsg V

    Subround 1: amplified properness report and (t + 1)-witnessed past ViewLock votes.

  • propose {V : Type u_1} (view : ℕ) (prop : Proposal V) : ByzViewMsg V

    Subround 2: coordinator proposal for view v.

  • echo {V : Type u_1} (view : ℕ) (val : V) : ByzViewMsg V

    Subround 3: Stage-1 echo/prevote for (view, val).

  • vote {V : Type u_1} (view : ℕ) (val : V) : ByzViewMsg V

    Subround 4: Stage-2 vote for (view, val) (emitted after n - t echoes).

  • commit {V : Type u_1} (view : ℕ) (val : V) : ByzViewMsg V

    Subround 5: Stage-3 commit for (view, val) (emitted after n - t votes, upon locking).

  • idle {V : Type u_1} : ByzViewMsg V

    Placeholder sent by non-leaders in Subround 2 or silent voters in Subrounds 3–5.

Local state of a process running byzQuorumProtocol.

  • input : V

    Process's initial input value.

  • locked : Option (ViewLock V)

    Highest (view, val) lock acquired after n - t Stage-2 votes (none initially).

  • decided : Option V

    Write-once consensus decision (none until n - t Stage-3 commits are observed).

  • votedViews : List (ViewLock V)

    Append-only record of (view, val) Stage-2 votes emitted by this process.

  • properReport : ProperReport V

    Subround 0 → 1 properness summary.

  • certPairs : List (ViewLock V)

    Subround 0 → 1 (t + 1)-witnessed past vote pairs.

  • properSnapshot : List (ProperReport V)

    Subround 1 → 2 received properness reports for voter check.

  • voterCerts : List (ViewLock V)

    Subround 1 → 2 (t + 1)-amplified view certificates accepted by a voter.

  • leaderProposal : Option (Proposal V)

    Subround 1 → 2 proposal prepared if this process is the view coordinator.

  • myEcho : Option V

    Subround 2 → 3 Stage-1 echo value, if accepted.

  • myVote : Option V

    Subround 3 → 4 Stage-2 vote value, if n - t echoes were observed.

  • myCommit : Option V

    Subround 4 → 5 Stage-3 commit value, if n - t votes were observed.

Initial local state of byzQuorumProtocol on input v.

Extracts the initial value from a Subround-0 .rawStatus message.

Extracts the votedViews list from a Subround-0 .rawStatus message.

def Cslib.Distributed.PartialSynchrony.rawVoteCount {P : Type u_1} {V : Type u_2} [DecidableEq P] [DecidableEq V] (procs : List P) (v : ℕ) (m : P → Option (ByzViewMsg V)) (lk : ViewLock V) :

Number of distinct senders in procs.dedup reporting lk in Subround 0 for lk.view < v.

Subround 0 properness computation from received .rawStatus messages.

def Cslib.Distributed.PartialSynchrony.computeCertPairs {P : Type u_1} {V : Type u_2} [DecidableEq P] [DecidableEq V] (procs : List P) (t v : ℕ) (m : P → Option (ByzViewMsg V)) :

Subround 0 (t + 1)-witnessed ViewLock pairs for view v.

Extracts (proper, certPairs) from a Subround-1 .certStatus message.

def Cslib.Distributed.PartialSynchrony.certSupportCount {P : Type u_1} {V : Type u_2} [DecidableEq P] [DecidableEq V] (procs : List P) (v : ℕ) (m : P → Option (ByzViewMsg V)) (lk : ViewLock V) :

Count of distinct senders in procs.dedup whose .certStatus carries lk (lk.view < v).

Number of ProperReport entries in snaps vouching for w.

theorem Cslib.Distributed.PartialSynchrony.filterMap_fst_filter_length {P : Type u_1} {V : Type u_2} (l : List P) (f : P → Option (ProperReport V × List (ViewLock V))) (pred : ProperReport V → Bool) :
(List.filter pred (List.filterMap (fun (j : P) => Option.map Prod.fst (f j)) l)).length = (List.filter (fun (j : P) => match f j with | some (rep, snd) => pred rep | none => false) l).length

Length of a filtered filterMap of Prod.fst over (ProperReport, certPairs) pairs.

Whether prop : Proposal V is acceptable to a voter holding state st.

def Cslib.Distributed.PartialSynchrony.byzSend {P : Type u_1} {V : Type u_2} [DecidableEq P] (leader : ℕ → P) (r : ℕ) (i : P) (st : ByzViewState V) :

Outgoing message of byzQuorumProtocol in round r (v = r / 6, subround r % 6).

Extracts a view-v .echo payload.

Extracts a view-v .vote payload.

Extracts a view-v .commit payload.

def Cslib.Distributed.PartialSynchrony.byzUpdate {P : Type u_1} {V : Type u_2} [DecidableEq P] [DecidableEq V] (procs : List P) (leader : ℕ → P) (t r : ℕ) (st : ByzViewState V) (m : P → Option (ByzViewMsg V)) :

Local state transition of byzQuorumProtocol at the end of round r.

def Cslib.Distributed.PartialSynchrony.byzQuorumProtocol (P : Type u_1) (V : Type u_2) [DecidableEq P] [DecidableEq V] (procs : List P) (leader : ℕ → P) (t : ℕ) :

Original six-subround rotating-coordinator unauthenticated Byzantine quorum-locking consensus protocol (3 * t < Fintype.card P) for the basic round model of Dwork, Lynch and Stockmeyer, §3.1 (replacing Algorithm 3's alternating trying/lock-release phases, monotone PROPER-set piggybacking, and continuous Srikanth–Toueg broadcast in §3.2.3 with a two-round t + 1 / n - t status and input-properness relay plus echo, vote/lock, and commit quorums). procs enumerates P (∀ p : P, p ∈ procs) so quorum thresholds and candidate selection are computable without [Fintype V] or Classical.choice.

Unconditional pre-GST safety of byzQuorumProtocol #

def Cslib.Distributed.PartialSynchrony.byzIncoming {P : Type u_1} {V : Type u_2} [DecidableEq P] [DecidableEq V] (procs : List P) (leader : ℕ → P) (t : ℕ) (F : Finset P) (deliver : ℕ → P → P → Bool) (adv : ℕ → P → P → Option (ByzViewMsg V)) (x : P → V) (r : ℕ) (i j : P) :

Incoming message function for recipient i in round r of a byzQuorumProtocol run.

theorem Cslib.Distributed.PartialSynchrony.byzQuorum_state_succ {P : Type u_1} {V : Type u_2} [DecidableEq P] [DecidableEq V] {procs : List P} (leader : ℕ → P) {t : ℕ} (F : Finset P) (deliver : ℕ → P → P → Bool) (adv : ℕ → P → P → Option (ByzViewMsg V)) (x : P → V) (r : ℕ) (i : P) :
(byzQuorumProtocol P V procs leader t).byzantineState F deliver adv x (r + 1) i = byzUpdate procs leader t r ((byzQuorumProtocol P V procs leader t).byzantineState F deliver adv x r i) (byzIncoming procs leader t F deliver adv x r i)

One-step unfolding equation for byzQuorumProtocol's byzantineState.

theorem Cslib.Distributed.PartialSynchrony.byzState_input_eq {P : Type u_1} {V : Type u_2} [DecidableEq P] [DecidableEq V] {procs : List P} (leader : ℕ → P) {t : ℕ} (F : Finset P) (deliver : ℕ → P → P → Bool) (adv : ℕ → P → P → Option (ByzViewMsg V)) (x : P → V) (r : ℕ) (i : P) :
((byzQuorumProtocol P V procs leader t).byzantineState F deliver adv x r i).input = x i

input is invariant across all rounds of byzQuorumProtocol.

theorem Cslib.Distributed.PartialSynchrony.byzQuorum_irrevocable {P : Type u_1} {V : Type u_2} [DecidableEq P] [DecidableEq V] {procs : List P} (leader : ℕ → P) {t : ℕ} (F : Finset P) (deliver : ℕ → P → P → Bool) (adv : ℕ → P → P → Option (ByzViewMsg V)) (x : P → V) {r₁ r₂ : ℕ} (hr : r₁ ≤ r₂) (i : P) (val : V) (hdec : (byzQuorumProtocol P V procs leader t).byzantineDecision F deliver adv x r₁ i = some val) :
(byzQuorumProtocol P V procs leader t).byzantineDecision F deliver adv x r₂ i = some val

Decisions of byzQuorumProtocol are write-once across all rounds.

theorem Cslib.Distributed.PartialSynchrony.byzState_locked_unchanged_of_ne_four {P : Type u_1} {V : Type u_2} [DecidableEq P] [DecidableEq V] {procs : List P} (leader : ℕ → P) {t : ℕ} (F : Finset P) (deliver : ℕ → P → P → Bool) (adv : ℕ → P → P → Option (ByzViewMsg V)) (x : P → V) (r : ℕ) (h : r % 6 ≠ 4) (i : P) :
((byzQuorumProtocol P V procs leader t).byzantineState F deliver adv x (r + 1) i).locked = ((byzQuorumProtocol P V procs leader t).byzantineState F deliver adv x r i).locked
theorem Cslib.Distributed.PartialSynchrony.voterCerts_sound {P : Type u_1} {V : Type u_2} [DecidableEq P] [DecidableEq V] {procs : List P} (leader : ℕ → P) {t : ℕ} {F : Finset P} {deliver : ℕ → P → P → Bool} {adv : ℕ → P → P → Option (ByzViewMsg V)} {x : P → V} (hF : F.card ≤ t) (v : ℕ) (i : P) {lk : ViewLock V} (hlk : lk ∈ ((byzQuorumProtocol P V procs leader t).byzantineState F deliver adv x (6 * v + 2) i).voterCerts) :
lk.view < v ∧ ∃ h ∉ F, lk ∈ ((byzQuorumProtocol P V procs leader t).byzantineState F deliver adv x (6 * v) h).votedViews

Unforgeability of unauthenticated view certificates (voterCerts_sound): if lk is in voterCerts at the end of Subround 1 of view v (6 * v + 2), then lk.view < v and some correct process h ∉ F held lk ∈ votedViews at round 6 * v.

theorem Cslib.Distributed.PartialSynchrony.byzState_locked_witness {P : Type u_1} {V : Type u_2} [DecidableEq P] [DecidableEq V] {procs : List P} (leader : ℕ → P) {t : ℕ} [Fintype P] {F : Finset P} {deliver : ℕ → P → P → Bool} {adv : ℕ → P → P → Option (ByzViewMsg V)} {x : P → V} (hprocs : ∀ (p : P), p ∈ procs) (hn : 3 * t < Fintype.card P) (hF : F.card ≤ t) (r : ℕ) (i : P) {lk : ViewLock V} :
((byzQuorumProtocol P V procs leader t).byzantineState F deliver adv x r i).locked = some lk → 6 * lk.view + 4 < r ∧ Fintype.card P - 2 * t ≤ {h ∈ Finset.univ \ F | lk ∈ ((byzQuorumProtocol P V procs leader t).byzantineState F deliver adv x r h).votedViews}.card

Every lock locked = some lk held at round r satisfies 6 * lk.view + 4 < r and is backed by at least n - 2 * t correct processes h ∉ F holding lk ∈ votedViews at round r.

theorem Cslib.Distributed.PartialSynchrony.byzQuorum_lock_preservation {P : Type u_1} {V : Type u_2} [DecidableEq P] [DecidableEq V] {procs : List P} (leader : ℕ → P) {t : ℕ} [Fintype P] {F : Finset P} {deliver : ℕ → P → P → Bool} {adv : ℕ → P → P → Option (ByzViewMsg V)} {x : P → V} (hprocs : ∀ (p : P), p ∈ procs) (hn : 3 * t < Fintype.card P) (hF : F.card ≤ t) {v₀ : ℕ} {val₀ : V} {L₀ : Finset P} (hL₀_sub : L₀ ⊆ Finset.univ \ F) (hL₀_card : Fintype.card P - 2 * t ≤ L₀.card) (hL₀_lock : ∀ q ∈ L₀, ((byzQuorumProtocol P V procs leader t).byzantineState F deliver adv x (6 * (v₀ + 1)) q).locked = some { view := v₀, val := val₀ }) (d : ℕ) :
(∀ (r : ℕ) (p : P) (val : V), { view := v₀ + d, val := val } ∈ ((byzQuorumProtocol P V procs leader t).byzantineState F deliver adv x r p).votedViews → val = val₀) ∧ ∀ q ∈ L₀, ∃ (u_q : ℕ), v₀ ≤ u_q ∧ ((byzQuorumProtocol P V procs leader t).byzantineState F deliver adv x (6 * (v₀ + d + 1)) q).locked = some { view := u_q, val := val₀ }

Cross-view lock preservation (byzQuorum_lock_preservation): suppose 3 * t < Fintype.card P, F.card ≤ t, and a set L₀ ⊆ Finset.univ \ F of at least n - 2 * t correct processes holds locked = some ⟨v₀, val₀⟩ at the end of view v₀ (6 * (v₀ + 1)). Then across all views v ≥ v₀ and all rounds r:

  1. Every Stage-2 vote ⟨v, val⟩ ∈ votedViews with v₀ ≤ v has val = val₀.
  2. At the end of every view v ≥ v₀ (6 * (v + 1)), every q ∈ L₀ holds locked = some lk with v₀ ≤ lk.view and lk.val = val₀.
theorem Cslib.Distributed.PartialSynchrony.byzQuorum_agreement {P : Type u_1} {V : Type u_2} [DecidableEq P] [DecidableEq V] {procs : List P} (leader : ℕ → P) {t : ℕ} [Fintype P] {F : Finset P} (hprocs : ∀ (p : P), p ∈ procs) (hn : 3 * t < Fintype.card P) (hF : F.card ≤ t) (deliver : ℕ → P → P → Bool) (adv : ℕ → P → P → Option (ByzViewMsg V)) (x : P → V) {r₁ r₂ : ℕ} {i j : P} {v₁ v₂ : V} (h₁ : (byzQuorumProtocol P V procs leader t).byzantineDecision F deliver adv x r₁ i = some v₁) (h₂ : (byzQuorumProtocol P V procs leader t).byzantineDecision F deliver adv x r₂ j = some v₂) :
v₁ = v₂

Unconditional pre-GST global agreement (byzQuorum_agreement): for 3 * t < Fintype.card P and F.card ≤ t, no two processes ever decide distinct values in byzQuorumProtocol (even under arbitrary pre-GST message loss and without GST ever holding).

theorem Cslib.Distributed.PartialSynchrony.byzQuorum_validity {P : Type u_1} {V : Type u_2} [DecidableEq P] [DecidableEq V] {procs : List P} (leader : ℕ → P) {t : ℕ} [Fintype P] {F : Finset P} (hprocs : ∀ (p : P), p ∈ procs) (hn : 3 * t < Fintype.card P) (hF : F.card ≤ t) (deliver : ℕ → P → P → Bool) (adv : ℕ → P → P → Option (ByzViewMsg V)) {x : P → V} {val₀ : V} (hx : ∀ h ∉ F, x h = val₀) (r : ℕ) (i : P) {w : V} :
(byzQuorumProtocol P V procs leader t).byzantineDecision F deliver adv x r i = some w → w = val₀

Unconditional strong validity (byzQuorum_validity): when 3 * t < Fintype.card P, F.card ≤ t, and every correct process starts with val₀ (∀ h ∉ F, x h = val₀), no process ever decides any value w ≠ val₀ in byzQuorumProtocol (even without GST).

Crash/omission 3-subround view-locking protocol (2 * t < Fintype.card P) #

Messages exchanged by omissionQuorumProtocol across the 3 subrounds of each view v.

Local state of a process running omissionQuorumProtocol.

  • input : V

    Process's initial input value.

  • locked : Option (ViewLock V)

    Highest (view, val) lock acquired upon accepting a proposal (none initially).

  • decided : Option V

    Write-once consensus decision (none until n - t acknowledgments are observed).

  • leaderProposal : Option (Proposal V)

    Subround 0 → 1 proposal prepared if this process is the view coordinator.

  • myAck : Option V

    Subround 1 → 2 acknowledgment value, if a proposal was accepted in Subround 1.

def Cslib.Distributed.PartialSynchrony.omissionSend {P : Type u_1} {V : Type u_2} [DecidableEq P] (leader : ℕ → P) (r : ℕ) (i : P) (st : OmissionViewState V) :

Outgoing message of omissionQuorumProtocol in round r (v = r / 3, subround r % 3).

Whether an omission-protocol voter in state st accepts prop in view v (v' = v).

Extracts a view-v .ack payload.

Whether a received OmissionViewMsg is a Subround-0 .status message.

Extracts the optional ViewLock from a Subround-0 .status message.

def Cslib.Distributed.PartialSynchrony.omissionUpdate {P : Type u_1} {V : Type u_2} [DecidableEq P] [DecidableEq V] (procs : List P) (leader : ℕ → P) (t r : ℕ) (st : OmissionViewState V) (m : P → Option (OmissionViewMsg V)) :

Local state transition of omissionQuorumProtocol at the end of round r.

Original three-subround rotating-coordinator crash/omission quorum-locking consensus protocol (2 * t < Fintype.card P) for the basic round model of Dwork, Lynch and Stockmeyer, §3.1 (replacing Algorithm 1's alternating trying/lock-release phases and monotone PROPER-set piggybacking in §3.2.1 with single-lock status reporting, proposal/locking, and n - t acknowledgments).

Unconditional pre-GST safety of omissionQuorumProtocol #

def Cslib.Distributed.PartialSynchrony.omissionIncoming {P : Type u_1} {V : Type u_2} [DecidableEq P] [DecidableEq V] (procs : List P) (leader : ℕ → P) (t : ℕ) (deliver : ℕ → P → P → Bool) (x : P → V) (r : ℕ) (i j : P) :

Incoming message function for recipient i in round r of an omissionQuorumProtocol run.

theorem Cslib.Distributed.PartialSynchrony.omissionQuorum_state_succ {P : Type u_1} {V : Type u_2} [DecidableEq P] [DecidableEq V] {procs : List P} (leader : ℕ → P) {t : ℕ} (deliver : ℕ → P → P → Bool) (x : P → V) (r : ℕ) (i : P) :
(omissionQuorumProtocol P V procs leader t).omissionState deliver x (r + 1) i = omissionUpdate procs leader t r ((omissionQuorumProtocol P V procs leader t).omissionState deliver x r i) (omissionIncoming procs leader t deliver x r i)

One-step unfolding equation for omissionQuorumProtocol's omissionState.

theorem Cslib.Distributed.PartialSynchrony.omission_irrevocable {P : Type u_1} {V : Type u_2} [DecidableEq P] [DecidableEq V] {procs : List P} (leader : ℕ → P) {t : ℕ} (deliver : ℕ → P → P → Bool) (x : P → V) {r₁ r₂ : ℕ} (hr : r₁ ≤ r₂) (i : P) (val : V) (hdec : (omissionQuorumProtocol P V procs leader t).omissionDecision deliver x r₁ i = some val) :
(omissionQuorumProtocol P V procs leader t).omissionDecision deliver x r₂ i = some val

Decisions of omissionQuorumProtocol are write-once across all rounds.

theorem Cslib.Distributed.PartialSynchrony.omission_locked_unchanged_of_ne_one {P : Type u_1} {V : Type u_2} [DecidableEq P] [DecidableEq V] {procs : List P} (leader : ℕ → P) {t : ℕ} (deliver : ℕ → P → P → Bool) (x : P → V) (r : ℕ) (h : r % 3 ≠ 1) (i : P) :
((omissionQuorumProtocol P V procs leader t).omissionState deliver x (r + 1) i).locked = ((omissionQuorumProtocol P V procs leader t).omissionState deliver x r i).locked
theorem Cslib.Distributed.PartialSynchrony.omission_agreement {P : Type u_1} {V : Type u_2} [DecidableEq P] [DecidableEq V] {procs : List P} (leader : ℕ → P) {t : ℕ} [Fintype P] (hprocs : ∀ (p : P), p ∈ procs) (hn : 2 * t < Fintype.card P) (deliver : ℕ → P → P → Bool) (x : P → V) {r₁ r₂ : ℕ} {i j : P} {v₁ v₂ : V} (h₁ : (omissionQuorumProtocol P V procs leader t).omissionDecision deliver x r₁ i = some v₁) (h₂ : (omissionQuorumProtocol P V procs leader t).omissionDecision deliver x r₂ j = some v₂) :
v₁ = v₂

Unconditional pre-GST agreement for omissionQuorumProtocol (omission_agreement): when 2 * t < Fintype.card P, no two processes ever decide distinct values (even without GST).

theorem Cslib.Distributed.PartialSynchrony.omission_validity {P : Type u_1} {V : Type u_2} [DecidableEq P] [DecidableEq V] {procs : List P} (leader : ℕ → P) {t : ℕ} [Fintype P] (hprocs : ∀ (p : P), p ∈ procs) (hn : 2 * t < Fintype.card P) (deliver : ℕ → P → P → Bool) {x : P → V} {val₀ : V} (hx : ∀ (p : P), x p = val₀) (r : ℕ) (i : P) {w : V} :
(omissionQuorumProtocol P V procs leader t).omissionDecision deliver x r i = some w → w = val₀

Unconditional strong unanimity for omissionQuorumProtocol (omission_validity): when 2 * t < Fintype.card P and all initial inputs equal val₀ (∀ i, x i = val₀), no process ever decides any value other than val₀ (even without GST).