Documentation

CslibFrontier.Computability.Distributed.ByzantineQuorum.QuorumSystems

Threshold Byzantine Quorum Systems and Masking-Register Safety Step #

This module formalizes uniform b-threshold Byzantine quorum systems and single-latest-write unauthenticated masking-quorum register safety as a step toward #7506 (#3261), after Malkhi and Reiter (Distributed Computing 11(4):203–213, 1998; preliminary version in STOC 1997, pp. 569–578), rather than the general non-uniform fail-prone system characterizations of that paper.

In [MR98] §3.1 (p. 204), a quorum system over U is non-empty and pairwise intersecting, while a fail-prone system B ⊆ 2^U is non-empty and subset-incomparable (∀ B₁ B₂ ∈ B, B₁ ⊆ B₂ → B₁ = B₂). Here QuorumSystem P carries an unbundled finite family quorums : Finset (Finset P) (deriving nonemptiness and pairwise intersection from IsThresholdDisseminationQuorumSystem), IsAvailableFor qs B requires every F ∈ B to miss some quorum (∃ Q ∈ qs.quorums, Disjoint Q F), and thresholdAdversary P b = {F | F.card ≤ b} downward-closes {F | F.card = b}:

Finally, we formalize a single-latest-write step for the unauthenticated timestamped register protocol of §§3.2 and 4 (pp. 205–206): correct servers update their stored TimestampedVal whenever a strictly newer timestamp arrives (applyWrites), faulty servers u ∈ F (|F| ≤ b) return arbitrary forged (ts, val) pairs without cryptographic signatures, and a client reading from any masking quorum Q_r filters to entries supported by at least b + 1 servers in Q_r (maskingCandidates) and selects the unique maximum surviving timestamp (maskingRead). General fail-prone systems B (Theorems 4.3 and 5.4; Corollaries 4.4 and 5.5), weak-inequality opaque quorums (Definition 5.9, Example 5.11, Theorem 5.12), load lower bounds (§3.3 Definition 3.1, §4 Theorem 4.5, §5.2 Theorem 5.14), and §6 faulty-client Echo/Ready updates remain open under #7506.

Main definitions #

Main results #

References #

Quorum systems and fail-prone availability #

A candidate quorum system over server universe P, represented by a finite family of server subsets ([MR98], §3.1, p. 204).

  • quorums : Finset (Finset P)

    Finite family of quorum subsets of P.

Availability against a fail-prone adversary structure B ([MR98], Definitions 4.1, 5.1, and 5.9, pp. 206–209): for every fault set F ∈ B, at least one quorum contains no faulty server.

The uniform b-threshold adversary consisting of all subsets of P of size at most b.

Threshold dissemination, masking, and strong-opaque quorum systems #

Uniform b-threshold specialization of dissemination quorum systems (#7506; after [MR98], Definition 5.1, §5.1, p. 208, specialized to thresholdAdversary P b): available against up to b faulty servers, and every pair of quorums intersects outside any faulty set of size at most b.

Uniform b-threshold specialization of masking quorum systems (#7506; after [MR98], Definition 4.1, §4, pp. 205–206, specialized to thresholdAdversary P b): available against up to b faulty servers, and for any two quorums Q₁, Q₂ and fault sets F₁, F₂ of size at most b, (Q₁ ∩ Q₂) \ F₁ strictly outnumbers F₂ ∩ Q₂.

Uniform b-threshold strong-inequality opaque quorum system (#7506; formalizing the strict > variant of O-Consistency1 noted in [MR98], §5.2, p. 209 immediately below Definition 5.9, specialized to thresholdAdversary P b): available against up to b faulty servers, and for any two quorums Q₁, Q₂ and fault sets F₁, F₂ of size at most b, correct up-to-date servers (Q₁ ∩ Q₂) \ F₁ strictly outnumber out-of-date correct servers (Q₂ \ Q₁) \ F₂ plus faulty servers Q₂ ∩ F₂.

Every b-threshold strong-opaque quorum system is a b-threshold masking quorum system.

Every b-threshold masking quorum system is a b-threshold dissemination quorum system.

Every b-threshold dissemination quorum system has at least one quorum.

Any two quorums in a b-threshold dissemination quorum system intersect.

Exact cardinality characterization of b-threshold dissemination quorum systems: availability against |F| ≤ b together with pairwise intersection of size at least b + 1.

Exact cardinality characterization of b-threshold masking quorum systems: availability against |F| ≤ b together with pairwise intersection of size at least 2 * b + 1.

Exact cardinality characterization of b-threshold strong-opaque quorum systems: availability against |F| ≤ b together with (Q₂ \ Q₁).card + 2 * b < (Q₁ ∩ Q₂).card for all pairs of quorums.

Threshold quorum constructions and exact iff resilience characterizations #

Quorum system over a finite server set P consisting of all subsets of cardinality at least k.

Canonical b-dissemination threshold quorum system of minimum quorum size ⌈(|P| + b + 1) / 2⌉ = (|P| + b + 2) / 2 ([MR98], Example 5.6, p. 208).

Canonical b-masking threshold quorum system of minimum quorum size ⌈(|P| + 2 * b + 1) / 2⌉ = (|P| + 2 * b + 2) / 2 ([MR98], Example 4.6, p. 207).

Canonical b-threshold strong-opaque quorum system of minimum quorum size ⌈(2 * |P| + 2 * b + 1) / 3⌉ = (2 * |P| + 2 * b + 3) / 3 (#7506; strict-inequality adaptation of [MR98], Example 5.11 and §5.2 p. 209).

Maximal-resilience (|P| - b)-cardinality threshold step toward #7506: when 3 * b < Fintype.card P, thresholdQuorums P (Fintype.card P - b) forms a b-threshold dissemination quorum system (recovering 2 * b + 1 when |P| = 3 * b + 1).

Strong-opaque threshold construction step toward #7506 (strict-inequality adaptation after Malkhi and Reiter, §5.2, p. 209 and Example 5.11, p. 210): when 5 * b < Fintype.card P, strongOpaqueThresholdQuorums P b is a b-threshold strong-opaque quorum system.

Uniform b-threshold dissemination existence step toward #7506 (specializing Malkhi and Reiter, Corollary 5.5, §5.1, p. 208 to thresholdAdversary P b; general fail-prone systems B of Theorem 5.4 and Corollary 5.5 remain open under #7506): over a nonempty finite server universe P, a b-threshold dissemination quorum system exists if and only if 3 * b < Fintype.card P.

Uniform b-threshold masking existence step toward #7506 (specializing Malkhi and Reiter, Corollary 4.4, §4, p. 206 to thresholdAdversary P b; general fail-prone systems B of Theorem 4.3 and Corollary 4.4 remain open under #7506): over a nonempty finite server universe P, a b-threshold masking quorum system exists if and only if 4 * b < Fintype.card P.

Uniform b-threshold strong-opaque existence step toward #7506 (formalizing the strict > variant of O-Consistency1 noted in Malkhi and Reiter, §5.2, p. 209; contrasting with Definition 5.9, Example 5.11, and Theorem 5.12's weak-inequality ≥ opaque quorum systems whose exact bound is 5 * b ≤ |P| for b > 0, which remain open under #7506): over a nonempty finite server universe P, a b-threshold strong-opaque quorum system exists if and only if 5 * b < Fintype.card P.

Unauthenticated masking-quorum register read-after-write safety #

structure Cslib.Distributed.ByzantineQuorum.TimestampedVal (T : Type u_1) (V : Type u_2) :
Type (max u_1 u_2)

A timestamped register entry (ts, val) stored by a server or returned to a reader in the unauthenticated masking-quorum register protocol ([MR98], §3.2, p. 205).

  • ts : T

    Write timestamp ordered in T.

  • val : V

    Register value written at ts.

theorem Cslib.Distributed.ByzantineQuorum.TimestampedVal.ext {T : Type u_1} {V : Type u_2} {x y : TimestampedVal T V} (ts : x.ts = y.ts) (val : x.val = y.val) :
x = y
def Cslib.Distributed.ByzantineQuorum.instDecidableEqTimestampedVal.decEq {T✝ : Type u_1} {V✝ : Type u_2} [DecidableEq T✝] [DecidableEq V✝] (x✝ x✝¹ : TimestampedVal T✝ V✝) :
Decidable (x✝ = x✝¹)
@[instance_reducible]

Server-side update rule of [MR98] §3.2 (p. 205): replace the stored entry only when the incoming write carries a strictly larger timestamp.

Local register entry at a correct server after starting from init and applying delivered writes in arbitrary asynchronous arrival order.

def Cslib.Distributed.ByzantineQuorum.maskingCandidates {P : Type u_1} {T : Type u_2} {V : Type u_3} [DecidableEq T] [DecidableEq V] (b : ℕ) (Q_r : Finset P) (resp : P → TimestampedVal T V) :

Candidate (ts, val) entries returned by at least b + 1 servers in read quorum Q_r ([MR98], §4, p. 206, specialized to thresholdAdversary P b).

@[simp]
theorem Cslib.Distributed.ByzantineQuorum.mem_maskingCandidates_iff {P : Type u_1} {T : Type u_2} {V : Type u_3} [DecidableEq T] [DecidableEq V] {b : ℕ} {Q_r : Finset P} {resp : P → TimestampedVal T V} {e : TimestampedVal T V} :
e ∈ maskingCandidates b Q_r resp ↔ b + 1 ≤ {u ∈ Q_r | resp u = e}.card
theorem Cslib.Distributed.ByzantineQuorum.maskingCandidates_sound {P : Type u_1} {T : Type u_2} {V : Type u_3} [DecidableEq T] [DecidableEq V] {b : ℕ} {F Q_r : Finset P} (hF : F.card ≤ b) {resp : P → TimestampedVal T V} {e : TimestampedVal T V} (he : e ∈ maskingCandidates b Q_r resp) :
∃ u ∈ Q_r, u ∉ F ∧ resp u = e

Soundness of (b + 1)-multiplicity filtering without signatures: when F.card ≤ b, every entry in maskingCandidates b Q_r resp was returned by at least one correct server u ∈ Q_r \ F.

def Cslib.Distributed.ByzantineQuorum.maskingRead {P : Type u_1} {T : Type u_2} {V : Type u_3} [LinearOrder T] [DecidableEq V] (b : ℕ) (Q_r : Finset P) (resp : P → TimestampedVal T V) :

Computable unauthenticated client read function ([MR98], §4, p. 206): filter responses on Q_r to maskingCandidates b Q_r resp and return some e.val when a unique surviving candidate e attains the maximum timestamp across all surviving candidates.

theorem Cslib.Distributed.ByzantineQuorum.threshold_masking_register_max_ts_eq {P : Type u_1} {T : Type u_2} {V : Type u_3} [DecidableEq P] [LinearOrder T] [DecidableEq V] {qs : QuorumSystem P} {b : ℕ} (hqs : qs.IsThresholdMaskingQuorumSystem b) {F Q_w Q_r : Finset P} (hF : F.card ≤ b) (hQw : Q_w ∈ qs.quorums) (hQr : Q_r ∈ qs.quorums) {init latest : TimestampedVal T V} {delivered : P → List (TimestampedVal T V)} (hinit : init.ts < latest.ts) (hcompleted : ∀ u ∈ Q_w, u ∉ F → latest ∈ delivered u) (hbound : ∀ u ∉ F, ∀ e ∈ delivered u, e = latest ∨ e.ts < latest.ts) {resp : P → TimestampedVal T V} (hresp : ∀ u ∉ F, resp u = applyWrites init (delivered u)) :
latest ∈ maskingCandidates b Q_r resp ∧ ∀ e ∈ maskingCandidates b Q_r resp, (∀ e' ∈ maskingCandidates b Q_r resp, e'.ts ≤ e.ts) → e = latest

Unauthenticated b-threshold single-latest-write masking-register step toward #7506 (after Malkhi and Reiter, §§3.2, 4, Lemma 4.2, pp. 205–206): suppose qs is a b-threshold masking quorum system, F.card ≤ b, write latest (init.ts < latest.ts) has been delivered to every correct server in write quorum Q_w ∈ qs.quorums, every other write delivered to any correct server has timestamp < latest.ts, and resp agrees with each correct server's local state applyWrites init (delivered u) outside F (while faulty servers in F return arbitrary forged pairs). Then in any read quorum Q_r ∈ qs.quorums:

  1. latest ∈ maskingCandidates b Q_r resp, and
  2. any e ∈ maskingCandidates b Q_r resp whose timestamp is at least as large as every candidate in maskingCandidates b Q_r resp satisfies e = latest (hence e.val = latest.val).
theorem Cslib.Distributed.ByzantineQuorum.threshold_maskingRead_eq_some_latest_write {P : Type u_1} {T : Type u_2} {V : Type u_3} [DecidableEq P] [LinearOrder T] [DecidableEq V] {qs : QuorumSystem P} {b : ℕ} (hqs : qs.IsThresholdMaskingQuorumSystem b) {F Q_w Q_r : Finset P} (hF : F.card ≤ b) (hQw : Q_w ∈ qs.quorums) (hQr : Q_r ∈ qs.quorums) {init latest : TimestampedVal T V} {delivered : P → List (TimestampedVal T V)} (hinit : init.ts < latest.ts) (hcompleted : ∀ u ∈ Q_w, u ∉ F → latest ∈ delivered u) (hbound : ∀ u ∉ F, ∀ e ∈ delivered u, e = latest ∨ e.ts < latest.ts) {resp : P → TimestampedVal T V} (hresp : ∀ u ∉ F, resp u = applyWrites init (delivered u)) :
maskingRead b Q_r resp = some latest.val

Computable b-threshold single-latest-write masking-read step toward #7506 (after Malkhi and Reiter, §§3.2, 4, Lemma 4.2, pp. 205–206): under the hypotheses of threshold_masking_register_max_ts_eq, maskingRead b Q_r resp = some latest.val for every read quorum Q_r ∈ qs.quorums and arbitrary Byzantine responses on F.