Documentation

CslibFrontier.Computability.Distributed.AsyncByzantine.Basic

Asynchronous authenticated Byzantine message passing and reliable broadcast #

This module models deterministic asynchronous point-to-point message passing with static Byzantine faults and authenticated sender channels, following [Bra87] and [BT85]. It is the asynchronous Byzantine counterpart to Cslib.FLP (asynchronous crash faults) and Cslib.Distributed.Byzantine (synchronous Byzantine agreement).

A message on the network is an Envelope P M carrying its sender src, recipient dest, and payload body. Given a distinguished broadcaster dealer : P, a Protocol P S M V dealer assigns:

For a static set F : Finset P of faulty processes, s.msgs : Multiset (Envelope P M) holds all in-flight messages sent by correct processes (e.src ∉ F). The labelled transition system π.lts F allows three kinds of actions (Action P M):

Every process's delivery field out : Option V is write-once: once a correct process decides some v, later transitions leave out unchanged (procDecided_stable). Because point-to-point channels are authenticated, no Byzantine action can forge a message whose src ∉ F (Reachable.msgs_src_notMem).

An infinite execution is fair (Fair F ss xs) if every authentic in-flight message addressed to a correct process is eventually delivered. Protocol.exists_fair_omegaExecution shows every global state extends to a fair Byzantine-free infinite execution by draining the pending authentic multiset round-by-round via Cslib.LTS.OmegaExecution.flatten_mTr.

Protocol.SolvesReliableBroadcast t specifies single-sender Byzantine reliable broadcast (consistency/agreement, honest-sender integrity/no-spurious-delivery, validity, and totality) against at most t faulty processes. directProtocol witnesses both the fault-free case (t = 0) and every process set of size at most 2.

Main definitions #

Main results #

References #

structure Cslib.Distributed.AsyncByzantine.Envelope (P : Type u_1) (M : Type u_2) :
Type (max u_1 u_2)

An authenticated message envelope in transit from src to dest carrying payload body.

  • src : P

    Sender process identity, authenticated by the point-to-point channel.

  • dest : P

    Destination process identity.

  • body : M

    Message payload.

theorem Cslib.Distributed.AsyncByzantine.Envelope.ext {P : Type u_1} {M : Type u_2} {x y : Envelope P M} (src : x.src = y.src) (dest : x.dest = y.dest) (body : x.body = y.body) :
x = y
theorem Cslib.Distributed.AsyncByzantine.Envelope.ext_iff {P : Type u_1} {M : Type u_2} {x y : Envelope P M} :
x = y ↔ x.src = y.src ∧ x.dest = y.dest ∧ x.body = y.body
def Cslib.Distributed.AsyncByzantine.instDecidableEqEnvelope.decEq {P✝ : Type u_1} {M✝ : Type u_2} [DecidableEq P✝] [DecidableEq M✝] (x✝ x✝¹ : Envelope P✝ M✝) :
Decidable (x✝ = x✝¹)
@[instance_reducible]
def Cslib.Distributed.AsyncByzantine.tagSender {P : Type u_1} {M : Type u_2} (src : P) (destBody : P × M) :

Tag a (dest, body) pair emitted by sender src as an Envelope.

@[simp]
theorem Cslib.Distributed.AsyncByzantine.tagSender_src {P : Type u_1} {M : Type u_2} (src : P) (destBody : P × M) :
(tagSender src destBody).src = src
@[simp]
theorem Cslib.Distributed.AsyncByzantine.tagSender_dest {P : Type u_1} {M : Type u_2} (src : P) (destBody : P × M) :
(tagSender src destBody).dest = destBody.1
@[simp]
theorem Cslib.Distributed.AsyncByzantine.tagSender_body {P : Type u_1} {M : Type u_2} (src : P) (destBody : P × M) :
(tagSender src destBody).body = destBody.2
def Cslib.Distributed.AsyncByzantine.broadcastAll (P : Type u_1) {M : Type u_2} [Fintype P] (m : M) :
Multiset (P × M)

Broadcast payload m to every process q : P (including the sender itself).

theorem Cslib.Distributed.AsyncByzantine.mem_broadcastAll_tag {P : Type u_1} {M : Type u_2} [Fintype P] (src q : P) (m : M) :
{ src := src, dest := q, body := m } ∈ Multiset.map (tagSender src) (broadcastAll P m)
structure Cslib.Distributed.AsyncByzantine.ProcState (S : Type u_1) (V : Type u_2) :
Type (max u_1 u_2)

Local state of a process paired with its write-once delivery register out.

  • state : S

    Internal local state.

  • out : Option V

    Delivered output value (none if no value has been delivered yet).

theorem Cslib.Distributed.AsyncByzantine.ProcState.ext {S : Type u_1} {V : Type u_2} {x y : ProcState S V} (state : x.state = y.state) (out : x.out = y.out) :
x = y
def Cslib.Distributed.AsyncByzantine.instDecidableEqProcState.decEq {S✝ : Type u_1} {V✝ : Type u_2} [DecidableEq S✝] [DecidableEq V✝] (x✝ x✝¹ : ProcState S✝ V✝) :
Decidable (x✝ = x✝¹)
@[instance_reducible]
structure Cslib.Distributed.AsyncByzantine.State (P : Type u_1) (S : Type u_2) (M : Type u_3) (V : Type u_4) :
Type (max (max (max u_1 u_2) u_3) u_4)

Global configuration of an asynchronous authenticated Byzantine network.

  • msgs : Multiset (Envelope P M)

    Multiset of authentic in-flight messages (src ∉ F). Messages are unordered.

  • proc : P → ProcState S V

    Local state of every process. Only entries for p ∉ F represent correct processes.

theorem Cslib.Distributed.AsyncByzantine.State.ext {P : Type u_1} {S : Type u_2} {M : Type u_3} {V : Type u_4} {x y : State P S M V} (msgs : x.msgs = y.msgs) (proc : x.proc = y.proc) :
x = y
theorem Cslib.Distributed.AsyncByzantine.State.ext_iff {P : Type u_1} {S : Type u_2} {M : Type u_3} {V : Type u_4} {x y : State P S M V} :
x = y ↔ x.msgs = y.msgs ∧ x.proc = y.proc
@[reducible, inline]
abbrev Cslib.Distributed.AsyncByzantine.State.ProcDecided {P : Type u_1} {S : Type u_2} {M : Type u_3} {V : Type u_4} (s : State P S M V) (p : P) (v : V) :

Process p has delivered value v in global state s.

inductive Cslib.Distributed.AsyncByzantine.Action (P : Type u_1) (M : Type u_2) :
Type (max u_1 u_2)

Transition label for the asynchronous Byzantine LTS.

  • deliver {P : Type u_1} {M : Type u_2} (e : Envelope P M) : Action P M

    Deliver an authentic in-flight envelope e to its correct recipient e.dest.

  • byzRecv {P : Type u_1} {M : Type u_2} (src dest : P) (body : M) : Action P M

    Deliver an arbitrary message body sent by a faulty process src ∈ F to a correct recipient dest ∉ F.

  • stutter {P : Type u_1} {M : Type u_2} : Action P M

    Stuttering step leaving the global state unchanged.

def Cslib.Distributed.AsyncByzantine.instDecidableEqAction.decEq {P✝ : Type u_1} {M✝ : Type u_2} [DecidableEq P✝] [DecidableEq M✝] (x✝ x✝¹ : Action P✝ M✝) :
Decidable (x✝ = x✝¹)
@[instance_reducible]
instance Cslib.Distributed.AsyncByzantine.instDecidableEqAction {P✝ : Type u_1} {M✝ : Type u_2} [DecidableEq P✝] [DecidableEq M✝] :
DecidableEq (Action P✝ M✝)

Boolean predicate checking whether an action is an authentic delivery .deliver _.

a.IsHonest holds when a is not a Byzantine message injection.

@[simp]
theorem Cslib.Distributed.AsyncByzantine.Action.not_isHonest_byzRecv {P : Type u_1} {M : Type u_2} (src dest : P) (body : M) :
¬(byzRecv src dest body).IsHonest
structure Cslib.Distributed.AsyncByzantine.Protocol (P : Type u_1) (S : Type u_2) (M : Type u_3) (V : Type u_4) (dealer : P) :
Type (max (max (max u_1 u_2) u_3) u_4)

A deterministic asynchronous authenticated message-passing protocol with a distinguished broadcaster dealer : P.

Non-dealer initial states and messages cannot depend on the broadcaster's input Option V. When a correct process p in local state st receives body from src, it moves to internal state next p st src body, sends outgoing messages send p st src body, and optionally delivers out p st src body if it has not already delivered a value.

  • init : P → S

    Initial internal state of a non-dealer process p ≠ dealer.

  • initDealer : Option V → S

    Initial internal state of dealer given input : Option V.

  • initMsgs : P → Multiset (P × M)

    Initial messages emitted by a non-dealer process p ≠ dealer.

  • initDealerMsgs : Option V → Multiset (P × M)

    Initial messages emitted by dealer given input : Option V.

  • next : P → ProcState S V → P → M → S

    State update when process dest receives body from src.

  • send : P → ProcState S V → P → M → Multiset (P × M)

    Outgoing messages (q, m) emitted when process dest receives body from src.

  • out : P → ProcState S V → P → M → Option V

    Value delivered (some v) when process dest receives body from src. Write-once semantics are enforced by recvCore.

def Cslib.Distributed.AsyncByzantine.Protocol.initState {P : Type u_1} {S : Type u_2} {M : Type u_3} {V : Type u_4} {dealer : P} [DecidableEq P] (π : Protocol P S M V dealer) (input : Option V) (p : P) :
S

Initial internal state of process p given dealer input input.

def Cslib.Distributed.AsyncByzantine.Protocol.initSend {P : Type u_1} {S : Type u_2} {M : Type u_3} {V : Type u_4} {dealer : P} [DecidableEq P] (π : Protocol P S M V dealer) (input : Option V) (p : P) :
Multiset (P × M)

Initial outgoing (dest, body) multiset emitted by process p given dealer input input.

def Cslib.Distributed.AsyncByzantine.Protocol.start {P : Type u_1} {S : Type u_2} {M : Type u_3} {V : Type u_4} {dealer : P} [DecidableEq P] (π : Protocol P S M V dealer) [Fintype P] (F : Finset P) (input : Option V) :
State P S M V

The initial global state for a static faulty set F and dealer input input : Option V. Only correct processes (p ∉ F) contribute authentic messages to the initial network multiset; faulty processes inject messages arbitrarily via Action.byzRecv.

def Cslib.Distributed.AsyncByzantine.Protocol.updateProc {P : Type u_1} {S : Type u_2} {M : Type u_3} {V : Type u_4} {dealer : P} (π : Protocol P S M V dealer) (dest src : P) (body : M) (st : ProcState S V) :

Local state update shared by authentic and Byzantine message deliveries; once out becomes some v, it never changes.

def Cslib.Distributed.AsyncByzantine.Protocol.recvCore {P : Type u_1} {S : Type u_2} {M : Type u_3} {V : Type u_4} {dealer : P} [DecidableEq P] (π : Protocol P S M V dealer) (src dest : P) (body : M) (msgsBase : Multiset (Envelope P M)) (s : State P S M V) :
State P S M V

Core global transition shared by authentic delivery (recvHonest) and Byzantine injection (recvByz), differing only in whether an envelope is erased from s.msgs.

def Cslib.Distributed.AsyncByzantine.Protocol.recvHonest {P : Type u_1} {S : Type u_2} {M : Type u_3} {V : Type u_4} {dealer : P} [DecidableEq P] [DecidableEq M] (π : Protocol P S M V dealer) (e : Envelope P M) (s : State P S M V) :
State P S M V

State resulting from delivering authentic in-flight envelope e to e.dest.

def Cslib.Distributed.AsyncByzantine.Protocol.recvByz {P : Type u_1} {S : Type u_2} {M : Type u_3} {V : Type u_4} {dealer : P} [DecidableEq P] (π : Protocol P S M V dealer) (src dest : P) (body : M) (s : State P S M V) :
State P S M V

State resulting from delivering an adversary-injected message (src, body) to dest.

def Cslib.Distributed.AsyncByzantine.Protocol.lts {P : Type u_1} {S : Type u_2} {M : Type u_3} {V : Type u_4} {dealer : P} [DecidableEq P] [DecidableEq M] (π : Protocol P S M V dealer) (F : Finset P) :
LTS (State P S M V) (Action P M)

Labelled transition system of π for a fixed static set F of Byzantine processes.

def Cslib.Distributed.AsyncByzantine.Protocol.Reachable {P : Type u_1} {S : Type u_2} {M : Type u_3} {V : Type u_4} {dealer : P} [DecidableEq P] [DecidableEq M] (π : Protocol P S M V dealer) [Fintype P] (F : Finset P) (input : Option V) (s : State P S M V) :

π.Reachable F input s means s is reachable from π.start F input under π.lts F.

Basic transition lemmas #

theorem Cslib.Distributed.AsyncByzantine.Protocol.reachable_start {P : Type u_1} {S : Type u_2} {M : Type u_3} {V : Type u_4} {dealer : P} [DecidableEq P] [DecidableEq M] (π : Protocol P S M V dealer) [Fintype P] (F : Finset P) (input : Option V) :
π.Reachable F input (π.start F input)
theorem Cslib.Distributed.AsyncByzantine.Protocol.Reachable.trans {P : Type u_1} {S : Type u_2} {M : Type u_3} {V : Type u_4} {dealer : P} [DecidableEq P] [DecidableEq M] [Fintype P] {π : Protocol P S M V dealer} {F : Finset P} {input : Option V} {s s' : State P S M V} (hs : π.Reachable F input s) (hreach : (π.lts F).CanReach s s') :
π.Reachable F input s'
theorem Cslib.Distributed.AsyncByzantine.Protocol.updateProc_out_eq_some {P : Type u_1} {S : Type u_2} {M : Type u_3} {V : Type u_4} {dealer : P} (π : Protocol P S M V dealer) {src dest : P} {body : M} {st : ProcState S V} {v : V} (hv : st.out = some v) :
(π.updateProc dest src body st).out = some v
theorem Cslib.Distributed.AsyncByzantine.Protocol.procDecided_stable {P : Type u_1} {S : Type u_2} {M : Type u_3} {V : Type u_4} {dealer : P} [DecidableEq P] [DecidableEq M] (π : Protocol P S M V dealer) {F : Finset P} {s s' : State P S M V} {p : P} {v : V} (hd : s.ProcDecided p v) (hreach : (π.lts F).CanReach s s') :

Once a process delivers v, its delivery register remains some v in every later state.

theorem Cslib.Distributed.AsyncByzantine.Protocol.omega_procDecided_stable {P : Type u_1} {S : Type u_2} {M : Type u_3} {V : Type u_4} {dealer : P} [DecidableEq P] [DecidableEq M] (π : Protocol P S M V dealer) {F : Finset P} {ss : ωSequence (State P S M V)} {xs : ωSequence (Action P M)} (he : (π.lts F).OmegaExecution ss xs) {k j : ℕ} (hkj : k ≤ j) {p : P} {v : V} (hd : (ss k).ProcDecided p v) :
(ss j).ProcDecided p v
theorem Cslib.Distributed.AsyncByzantine.Protocol.start_msgs_src_notMem {P : Type u_1} {S : Type u_2} {M : Type u_3} {V : Type u_4} {dealer : P} [DecidableEq P] (π : Protocol P S M V dealer) [Fintype P] (F : Finset P) (input : Option V) {e : Envelope P M} (he : e ∈ (π.start F input).msgs) :
e.src ∉ F

Every envelope present in the initial multiset of π.start F input originates from a correct process.

theorem Cslib.Distributed.AsyncByzantine.Protocol.Reachable.msgs_src_notMem {P : Type u_1} {S : Type u_2} {M : Type u_3} {V : Type u_4} {dealer : P} [DecidableEq P] [DecidableEq M] [Fintype P] {π : Protocol P S M V dealer} {F : Finset P} {input : Option V} {s : State P S M V} (hr : π.Reachable F input s) {e : Envelope P M} (he : e ∈ s.msgs) :
e.src ∉ F

In any reachable global state, every envelope in s.msgs originates from a correct process.

theorem Cslib.Distributed.AsyncByzantine.Protocol.tr_notDelivered_mem {P : Type u_1} {S : Type u_2} {M : Type u_3} {V : Type u_4} {dealer : P} [DecidableEq P] [DecidableEq M] (π : Protocol P S M V dealer) {F : Finset P} {s s' : State P S M V} {a : Action P M} {e : Envelope P M} (he : e ∈ s.msgs) (ha : a ≠ Action.deliver e) (htr : (π.lts F).Tr s a s') :
e ∈ s'.msgs

An in-flight message e stays in msgs across any transition other than .deliver e.

theorem Cslib.Distributed.AsyncByzantine.Protocol.mTr_notDelivered_mem {P : Type u_1} {S : Type u_2} {M : Type u_3} {V : Type u_4} {dealer : P} [DecidableEq P] [DecidableEq M] (π : Protocol P S M V dealer) {F : Finset P} {s t : State P S M V} {xl : List (Action P M)} {e : Envelope P M} (h : (π.lts F).MTr s xl t) (he : e ∈ s.msgs) (hnot : Action.deliver e ∉ xl) :
e ∈ t.msgs

An in-flight message e stays in msgs across any finite trace not containing .deliver e.

theorem Cslib.Distributed.AsyncByzantine.Protocol.omega_notDelivered_mem {P : Type u_1} {S : Type u_2} {M : Type u_3} {V : Type u_4} {dealer : P} [DecidableEq P] [DecidableEq M] (π : Protocol P S M V dealer) {F : Finset P} {ss : ωSequence (State P S M V)} {xs : ωSequence (Action P M)} (hexec : (π.lts F).OmegaExecution ss xs) {k : ℕ} {e : Envelope P M} (he : e ∈ (ss k).msgs) (hnot : ∀ (j : ℕ), k ≤ j → xs j ≠ Action.deliver e) (j : ℕ) :
k ≤ j → e ∈ (ss j).msgs

An in-flight message e stays in msgs across an infinite execution as long as .deliver e never occurs.

def Cslib.Distributed.AsyncByzantine.Protocol.Fair {P : Type u_1} {S : Type u_2} {M : Type u_3} {V : Type u_4} (F : Finset P) (ss : ωSequence (State P S M V)) (xs : ωSequence (Action P M)) :

Fairness: every authentic in-flight envelope addressed to a correct process is eventually delivered.

def Cslib.Distributed.AsyncByzantine.Protocol.AdmissibleRun {P : Type u_1} {S : Type u_2} {M : Type u_3} {V : Type u_4} {dealer : P} [DecidableEq P] [DecidableEq M] (π : Protocol P S M V dealer) [Fintype P] (F : Finset P) (input : Option V) (ss : ωSequence (State P S M V)) (xs : ωSequence (Action P M)) :

An admissible infinite execution of π for static faulty set F and dealer input input.

theorem Cslib.Distributed.AsyncByzantine.Protocol.admissibleRun_reachable {P : Type u_1} {S : Type u_2} {M : Type u_3} {V : Type u_4} {dealer : P} [DecidableEq P] [DecidableEq M] (π : Protocol P S M V dealer) [Fintype P] {F : Finset P} {input : Option V} {ss : ωSequence (State P S M V)} {xs : ωSequence (Action P M)} (ha : π.AdmissibleRun F input ss xs) (k : ℕ) :
π.Reachable F input (ss k)

Every state appearing in an admissible infinite execution is reachable from π.start F input.

Fair Byzantine-free scheduler #

theorem Cslib.Distributed.AsyncByzantine.Protocol.exists_fair_omegaExecution {P : Type u_1} {S : Type u_2} {M : Type u_3} {V : Type u_4} {dealer : P} [DecidableEq P] [DecidableEq M] (π : Protocol P S M V dealer) (F : Finset P) (s₀ : State P S M V) :
∃ (ss : ωSequence (State P S M V)) (xs : ωSequence (Action P M)), ss 0 = s₀ ∧ (π.lts F).OmegaExecution ss xs ∧ Fair F ss xs ∧ ∀ (k : ℕ), (xs k).IsHonest

Every global state s₀ extends to a fair, Byzantine-free infinite execution of π.lts F. All actions in the extension are either authentic deliveries .deliver e or .stutter.

theorem Cslib.Distributed.AsyncByzantine.Protocol.exists_honest_admissibleRun {P : Type u_1} {S : Type u_2} {M : Type u_3} {V : Type u_4} {dealer : P} [DecidableEq P] [DecidableEq M] (π : Protocol P S M V dealer) [Fintype P] (F : Finset P) (input : Option V) :
∃ (ss : ωSequence (State P S M V)) (xs : ωSequence (Action P M)), π.AdmissibleRun F input ss xs ∧ ∀ (k : ℕ), (xs k).IsHonest

Every initial state admits a fair, Byzantine-free infinite execution.

theorem Cslib.Distributed.AsyncByzantine.Protocol.Reachable.exists_admissibleRun {P : Type u_1} {S : Type u_2} {M : Type u_3} {V : Type u_4} {dealer : P} [DecidableEq P] [DecidableEq M] [Fintype P] {π : Protocol P S M V dealer} {F : Finset P} {input : Option V} {s : State P S M V} (hr : π.Reachable F input s) :
∃ (ss : ωSequence (State P S M V)) (xs : ωSequence (Action P M)) (k : ℕ), π.AdmissibleRun F input ss xs ∧ ss k = s ∧ ∀ (j : ℕ), k ≤ j → (xs j).IsHonest

Every reachable state occurs in some admissible infinite execution whose suffix from k onward is Byzantine-free.

Authentic message-complexity accounting #

def Cslib.Distributed.AsyncByzantine.Protocol.traceSent {P : Type u_1} {S : Type u_2} {M : Type u_3} {V : Type u_4} {dealer : P} [DecidableEq P] [DecidableEq M] (π : Protocol P S M V dealer) (s : State P S M V) :
List (Action P M) → ℕ

Total authentic envelopes emitted by correct processes along a finite trace xl starting at state s (excluding messages already present in s.msgs).

def Cslib.Distributed.AsyncByzantine.Protocol.sentInTrace {P : Type u_1} {S : Type u_2} {M : Type u_3} {V : Type u_4} {dealer : P} [DecidableEq P] [DecidableEq M] (π : Protocol P S M V dealer) [Fintype P] (F : Finset P) (input : Option V) (xl : List (Action P M)) :

Total authentic envelopes emitted by correct processes from the initial state through a finite trace xl (initial messages in (π.start F input).msgs plus π.traceSent).

theorem Cslib.Distributed.AsyncByzantine.Protocol.card_msgs_add_traceSent {P : Type u_1} {S : Type u_2} {M : Type u_3} {V : Type u_4} {dealer : P} [DecidableEq P] [DecidableEq M] (π : Protocol P S M V dealer) {F : Finset P} {s₀ s₁ : State P S M V} {xl : List (Action P M)} (hmtr : (π.lts F).MTr s₀ xl s₁) :

Exact message-conservation identity: along any valid finite execution trace xl from s₀ to s₁, the initial in-flight envelopes plus newly emitted authentic envelopes equal the final in-flight envelopes plus the authentic deliveries performed along xl.

Reliable broadcast specification #

structure Cslib.Distributed.AsyncByzantine.Protocol.SolvesReliableBroadcast {P : Type u_1} {S : Type u_2} {M : Type u_3} {V : Type u_4} {dealer : P} [DecidableEq P] [DecidableEq M] (π : Protocol P S M V dealer) [Fintype P] (t : ℕ) :

π.SolvesReliableBroadcast t means π implements single-sender asynchronous Byzantine reliable broadcast from dealer tolerating up to t static Byzantine faults ([Bra87]; [BT85]):

  • consistency (agreement): no two correct processes ever deliver different values, even if the dealer is faulty;
  • noSpurious (honest-sender integrity): if the dealer is correct with input input : Option V, any value v delivered by a correct process must satisfy input = some v (in particular, if input = none the dealer never broadcasts and no correct process ever delivers);
  • validity: if the dealer is correct with input some v, every correct process eventually delivers v in every fair execution;
  • totality: in every fair execution (even if the dealer is faulty), if some correct process delivers v, then every correct process eventually delivers v.

No-duplication (at most one delivery per process) holds structurally from write-once ProcState.out (procDecided_stable).

  • consistency (F : Finset P) : F.card ≤ t → ∀ (input : Option V) (s : State P S M V), π.Reachable F input s → ∀ i ∉ F, ∀ j ∉ F, ∀ (v₁ v₂ : V), s.ProcDecided i v₁ → s.ProcDecided j v₂ → v₁ = v₂

    Consistency (agreement): no two correct processes deliver different values in any reachable state.

  • noSpurious (F : Finset P) : F.card ≤ t → dealer ∉ F → ∀ (input : Option V) (s : State P S M V), π.Reachable F input s → ∀ i ∉ F, ∀ (v : V), s.ProcDecided i v → input = some v

    Integrity (no spurious delivery): if dealer is correct with input input, any value v delivered by a correct process matches input = some v.

  • validity (F : Finset P) : F.card ≤ t → dealer ∉ F → ∀ (v : V) (ss : ωSequence (State P S M V)) (xs : ωSequence (Action P M)), π.AdmissibleRun F (some v) ss xs → ∀ i ∉ F, ∃ (k : ℕ), (ss k).ProcDecided i v

    Validity (liveness for an honest dealer): if dealer is correct with input some v, every correct process eventually delivers v in every admissible execution.

  • totality (F : Finset P) : F.card ≤ t → ∀ (input : Option V) (ss : ωSequence (State P S M V)) (xs : ωSequence (Action P M)), π.AdmissibleRun F input ss xs → ∀ i ∉ F, ∀ (k : ℕ) (v : V), (ss k).ProcDecided i v → ∀ j ∉ F, ∃ (k' : ℕ), (ss k').ProcDecided j v

    Totality (liveness for a possibly faulty dealer): if any correct process delivers v in an admissible execution, then every correct process eventually delivers v.

theorem Cslib.Distributed.AsyncByzantine.Protocol.SolvesReliableBroadcast.mono {P : Type u_1} {S : Type u_2} {M : Type u_3} {V : Type u_4} {dealer : P} [DecidableEq P] [DecidableEq M] [Fintype P] {π : Protocol P S M V dealer} {t t' : ℕ} (h : π.SolvesReliableBroadcast t) (ht : t' ≤ t) :

Tolerating t faults implies tolerating at most t' ≤ t faults.

theorem Cslib.Distributed.AsyncByzantine.Protocol.consistency_iff_admissible {P : Type u_1} {S : Type u_2} {M : Type u_3} {V : Type u_4} {dealer : P} [DecidableEq P] [DecidableEq M] (π : Protocol P S M V dealer) [Fintype P] (t : ℕ) :
(∀ (F : Finset P), F.card ≤ t → ∀ (input : Option V) (s : State P S M V), π.Reachable F input s → ∀ i ∉ F, ∀ j ∉ F, ∀ (v₁ v₂ : V), s.ProcDecided i v₁ → s.ProcDecided j v₂ → v₁ = v₂) ↔ ∀ (F : Finset P), F.card ≤ t → ∀ (input : Option V) (ss : ωSequence (State P S M V)) (xs : ωSequence (Action P M)), π.AdmissibleRun F input ss xs → ∀ i ∉ F, ∀ j ∉ F, ∀ (k₁ k₂ : ℕ) (v₁ v₂ : V), (ss k₁).ProcDecided i v₁ → (ss k₂).ProcDecided j v₂ → v₁ = v₂

Consistency across admissible infinite executions is equivalent to consistency across all reachable finite states, because every reachable state extends to a fair infinite execution.

theorem Cslib.Distributed.AsyncByzantine.Protocol.SolvesReliableBroadcast.consistency_admissible {P : Type u_1} {S : Type u_2} {M : Type u_3} {V : Type u_4} {dealer : P} [DecidableEq P] [DecidableEq M] [Fintype P] {π : Protocol P S M V dealer} {t : ℕ} (h : π.SolvesReliableBroadcast t) {F : Finset P} (hF : F.card ≤ t) {input : Option V} {ss : ωSequence (State P S M V)} {xs : ωSequence (Action P M)} (ha : π.AdmissibleRun F input ss xs) {i j : P} (hi : i ∉ F) (hj : j ∉ F) {k₁ k₂ : ℕ} {v₁ v₂ : V} (h₁ : (ss k₁).ProcDecided i v₁) (h₂ : (ss k₂).ProcDecided j v₂) :
v₁ = v₂

Consistent broadcast fails across any run whose processes have already split.

Trivial direct broadcast (t = 0 or n ≤ 2) #

def Cslib.Distributed.AsyncByzantine.directProtocol (P : Type u_1) (V : Type u_2) [Fintype P] [DecidableEq P] (dealer : P) :

The direct single-hop broadcast protocol: dealer sends its value v to every process (including itself), and each process delivers the first message it receives directly from dealer. This solves reliable broadcast when t = 0 (on any process set) and against any number of Byzantine faults when Fintype.card P ≤ 2.

Without faults (t = 0), directProtocol solves reliable broadcast on every finite P.

On at most two processes (Fintype.card P ≤ 2), directProtocol solves reliable broadcast against any fault bound t: if dealer is faulty, at most one correct process remains, so both consistency and totality are trivial.