Practical Byzantine Fault Tolerance: Normal-Case and View-Change Multi-Slot SMR Step #
This module formalizes an ideal-authentication, checkpoint-free intermediate step toward the
Practical Byzantine Fault Tolerance (PBFT) state-machine replication protocol of
Castro and Liskov (§§4.2, 4.4, 4.5, pp. 3–7; extended journal version
[CL02]), and not the full cryptographic, garbage-collected protocol of those papers,
as part of #7506 (#3261).
Model scope and explicit abstractions #
Over a finite replica universe P, static Byzantine fault set F : Finset P (F.card ≤ f), view
numbers v : ℕ with primary schedule primary : ℕ → P, sequence slots s : ℕ, and request values
V (Option V carries some val for client requests and none for PBFT's null no-op request of
§4.4, p. 6):
- General
3 * f < |P|quorum threshold (pbftQuorumSize P f = Fintype.card P - f): [CL99] §4 assumes|P| = 3 * f + 1for simplicity, where2 * f + 1 = |P| - f. Here certificates (PreparedCert,CommittedLocal,NewView) use quorum size|P| - f, which equals2 * f + 1when|P| = 3 * f + 1and forms anf-threshold dissemination quorum system for every3 * f < Fintype.card PviaisThresholdDisseminationQuorumSystem_thresholdQuorums_sub. - Ideal sender signatures without digests or MAC vectors: messages in
st.networkcarry ideal unforgeable signer identity (PBFTMsg.signer); faulty replicasj ∈ Fmay inject arbitrary messages signed byj ∈ F(PBFTAction.byzSend), while messages signed byi ∉ Foriginate solely from honest replica transitions. Collision-resistant digestsD(m)and §5.2 symmetric MAC authenticator vectors remain open under#7506. - Unbounded log (
min-s = 0without checkpoint truncation): replicas retain their accepted proposals and prepared certificates across views without §4.3 periodicCHECKPOINTgarbage collection or[h, H]sequence-number watermarks, which remain open under#7506alongside §4.5.2 real-time exponential-backoff view-change timers and [CL02] proactive recovery.
Main definitions #
Cslib.Distributed.ByzantineQuorum.pbftQuorumSize: Byzantine quorum threshold|P| - f.Cslib.Distributed.ByzantineQuorum.SlotEntry:(view, slot, val)record for accepted proposals and local commits.Cslib.Distributed.ByzantineQuorum.PreparedCert,Cslib.Distributed.ByzantineQuorum.PreparedCert.voters,Cslib.Distributed.ByzantineQuorum.PreparedCert.ValidIn: PBFT prepared certificate (PrePreparefromprimary viewplus matching backupPrepares reachingpbftQuorumSize P f).Cslib.Distributed.ByzantineQuorum.ViewChangeMsg,Cslib.Distributed.ByzantineQuorum.SlotProposal,Cslib.Distributed.ByzantineQuorum.PBFTMsg,Cslib.Distributed.ByzantineQuorum.PBFTMsg.signer: PBFT protocol messages (prePrepare,prepare,commit,viewChange,newView) and their authenticated signers.Cslib.Distributed.ByzantineQuorum.computeSlotVal,Cslib.Distributed.ByzantineQuorum.computeOset,Cslib.Distributed.ByzantineQuorum.ViewChangeMsg.ValidIn,Cslib.Distributed.ByzantineQuorum.NewViewValidIn: deterministicNEW-VIEWOsetselection (highest-view prepared value per slot up tomax-s, ornone/nullif unprepared) and validity predicates.Cslib.Distributed.ByzantineQuorum.ReplicaState,Cslib.Distributed.ByzantineQuorum.PBFTState,Cslib.Distributed.ByzantineQuorum.PBFTAction,Cslib.Distributed.ByzantineQuorum.initPBFTState,Cslib.Distributed.ByzantineQuorum.pbftStep,Cslib.Distributed.ByzantineQuorum.PBFTReachable: ghost-free replica state, asynchronous transition function, and reachable global configurations.Cslib.Distributed.ByzantineQuorum.CommittedLocal: honest-replica local commit predicate at(view, slot, val).Cslib.Distributed.ByzantineQuorum.executeSlotLog: sequential deterministic state-machine execution over committed slot entries0, ..., k - 1.
Main results #
Cslib.Distributed.ByzantineQuorum.preparedCert_unique_idealAuth: within-view non-equivocation step (after [CL99], §4.2, p. 4)—under3 * f < Fintype.card PandF.card ≤ f, any two validPreparedCerts in a reachable state with the sameviewandslothave equalval.Cslib.Distributed.ByzantineQuorum.committedLocal_preserves_higher_prepared_idealAuth: cross-view commit-preservation step (after [CL99], §4.5.1, pp. 6–7)—if any honest replicai ∉ FachievesCommittedLocal st i v s val, then no validPreparedCertfor slotsin any viewv' ≥ vcarries a different value.Cslib.Distributed.ByzantineQuorum.pbft_commit_agreement_idealAuth: multi-slot SMR commit safety step—all honest replicasi₁, i₂ ∉ Fcommit identical values at every sequence slots, even across distinct viewsv₁andv₂.Cslib.Distributed.ByzantineQuorum.pbft_smr_state_agreement_idealAuth: deterministic state-machine replicas executing committed slots0, ..., k - 1reach identical service states.Cslib.Distributed.ByzantineQuorum.pbft_honest_primary_three_phase_liveness_idealAuth: synchronized honest-primary 3-phase liveness step (after [CL99], §§4.2, 4.5.2)—whenprimary v ∉ Fand all honest replicas are active in viewvat a fresh slots, synchronous delivery ofPrePrepare → Prepare → Commitamonguniv \ Fcommits(v, s, val)at every honest replica.Cslib.Distributed.ByzantineQuorum.exists_pbft_splitBrain_fin3:|P| ≤ 3 * fsplit-brain view-change counterexample onFin 3(f = 1,F = {2}), exhibiting a primary schedule and a reachable state in which honest replica0commitssome falseat slot0in view0while honest replica1commitssome trueat slot0in view1.
References #
Quorum size, certificates, and authenticated PBFT messages #
Full replica quorum {primary c.view} ∪ c.prepares vouching for prepared certificate c.
A VIEW-CHANGE payload sent by sender for target view carrying prepared certificates pset
from views < view ([CL99], §4.4, p. 6).
- view : ℕ
New view number
v' > 0requested bysender. - sender : P
Replica signing the
VIEW-CHANGEmessage. - pset : Finset (PreparedCert P V)
Set of prepared certificates from earlier views reported by
sender.
A slot assignment (slot, val) computed in the O component of a NEW-VIEW message
([CL99], §4.4, p. 6).
Authenticated wire messages of normal-case and view-change PBFT ([CL99], §§4.2, 4.4, pp. 4–6).
- prePrepare {P : Type u_1} {V : Type u_2} (view slot : ℕ) (val : Option V) : PBFTMsg P V
PRE-PREPARE(view, slot, val)signed byprimary view. - prepare {P : Type u_1} {V : Type u_2} (view slot : ℕ) (val : Option V) (sender : P) : PBFTMsg P V
PREPARE(view, slot, val, sender)signed by backupsender. - commit {P : Type u_1} {V : Type u_2} (view slot : ℕ) (val : Option V) (sender : P) : PBFTMsg P V
COMMIT(view, slot, val, sender)signed by replicasender. - viewChange {P : Type u_1} {V : Type u_2} (vc : ViewChangeMsg P V) : PBFTMsg P V
VIEW-CHANGEmessage signed byvc.sender. - newView {P : Type u_1} {V : Type u_2} (view : ℕ) (vset : Finset (ViewChangeMsg P V)) (oset : Finset (SlotProposal V)) : PBFTMsg P V
NEW-VIEW(view, vset, oset)signed byprimary view.
Certificate validation and deterministic NEW-VIEW Oset computation #
c is a valid prepared certificate over network log net when primary c.view sent the
matching prePrepare, primary c.view ∉ c.prepares, every q ∈ c.prepares sent a matching
prepare, and {primary c.view} ∪ c.prepares has size at least pbftQuorumSize P f.
Instances For
vc is a valid VIEW-CHANGE message on net when 0 < vc.view,
PBFTMsg.viewChange vc ∈ net, and every certificate in vc.pset is valid on net with view < vc.view.
Instances For
Select the re-proposed slot value for slot s from the union certs of prepared certificates
in Vset ([CL99], §4.4, p. 6): returns some none (null no-op) if certs contains
no certificate for slot s, some o if all maximum-view certificates for slot s agree on o,
and none only if certs contains conflicting certificates at the same maximum view.
Compute the O set of SlotProposals for NEW-VIEW from vset ([CL99], §4.4,
p. 6, with min-s = 0): empty if vset reports no prepared certificates, and otherwise covering
every slot 0 ≤ s ≤ max-s via computeSlotVal.
Validity of NEW-VIEW(v', vset, oset) over net ([CL99], §4.4, p. 6): 0 < v',
newView and all corresponding prePrepare messages in oset are on net, every vc ∈ vset is a
valid VIEW-CHANGE for v', at least pbftQuorumSize P f distinct replicas contributed to vset,
and computeOset vset = some oset.
Instances For
Ghost-free replica state and asynchronous PBFT transitions #
Local operational state of a PBFT replica ([CL99], §§4.2, 4.4).
- view : ℕ
Current active view (
0initially). - inViewChange : Bool
truewhile the replica has halted normal-case processing awaitingNEW-VIEW. - targetView : ℕ
Highest view for which this replica has initiated
VIEW-CHANGEor enteredNEW-VIEW. Accepted
(view, slot, val)pre-prepares.- preparedCerts : Finset (PreparedCert P V)
Valid
PreparedCerts assembled by this replica across views. Locally committed
(view, slot, val)entries (committed-localin §4.2, p. 5).
Effective view watermark targetView (during a view change) or view (during normal case).
Global asynchronous PBFT configuration: transmitted signed network messages and per-replica states.
Set of signed messages transmitted on the network (modeling arbitrary delay, reordering, replay, and selective link omission).
- replicas : P → ReplicaState P V
Local state of each replica; only entries for
i ∉ Frepresent honest replicas.
Initial PBFT global configuration in view 0 with empty logs and network.
Atomic asynchronous step labels of the PBFT protocol.
- propose {P : Type u_1} {V : Type u_2} (v s : ℕ) (val : Option V) : PBFTAction P V
Primary
primary vproposesvalat fresh slotsin active viewv. - acceptPrePrepare {P : Type u_1} {V : Type u_2} (i : P) (v s : ℕ) (val : Option V) : PBFTAction P V
Backup
i ≠ primary vacceptsprePrepare(v, s, val)and emitsprepare(v, s, val, i). - completePrepare {P : Type u_1} {V : Type u_2} (i : P) (c : PreparedCert P V) : PBFTAction P V
Replica
ilogs validPreparedCertcin viewc.viewand emitscommit. - completeCommit {P : Type u_1} {V : Type u_2} (i : P) (c : PreparedCert P V) (committers : Finset P) : PBFTAction P V
Replica
iobservespbftQuorumSize P fmatchingcommits for preparedcand commits. - startViewChange {P : Type u_1} {V : Type u_2} (i : P) (v' : ℕ) : PBFTAction P V
Replica
itimes out and initiatesVIEW-CHANGEforv' > effectiveView. - formNewView {P : Type u_1} {V : Type u_2} (v' : ℕ) (vset : Finset (ViewChangeMsg P V)) : PBFTAction P V
Primary
primary v'forms and broadcastsNEW-VIEW(v', vset, oset)and itsprePrepares. - enterNewView {P : Type u_1} {V : Type u_2} (i : P) (v' : ℕ) (vset : Finset (ViewChangeMsg P V)) (oset : Finset (SlotProposal V)) : PBFTAction P V
Backup
i ≠ primary v'validatesNEW-VIEW(v', vset, oset), entersv', and emitsprepares foroset. - byzSend {P : Type u_1} {V : Type u_2} (m : PBFTMsg P V) : PBFTAction P V
Faulty replica
m.signer primary ∈ Finjects signed messagemonto the network.
Computable single-step transition function of asynchronous PBFT under primary schedule
primary, fault parameter f, and static Byzantine set F (invalid actions stutter).
Inductive reachability of global PBFT states from initPBFTState P V.
- init {P : Type u_1} {V : Type u_2} [Fintype P] [DecidableEq P] [DecidableEq V] {primary : ℕ → P} {f : ℕ} {F : Finset P} : PBFTReachable primary f F (initPBFTState P V)
The initial empty-network configuration in view
0is reachable. - step {P : Type u_1} {V : Type u_2} [Fintype P] [DecidableEq P] [DecidableEq V] {primary : ℕ → P} {f : ℕ} {F : Finset P} {st : PBFTState P V} (act : PBFTAction P V) : PBFTReachable primary f F st → PBFTReachable primary f F (pbftStep primary f F st act)
Stepping a reachable configuration along any
PBFTActionyields a reachable configuration.
Fold a finite list of PBFTActions from st preserves PBFTReachable.
Monotonicity helpers and inductive protocol invariants #
Within-view non-equivocation, cross-view commit preservation, and SMR safety #
Within-view non-equivocation step toward #7506 (after Castro and Liskov, §4.2,
p. 4; ideal-authentication checkpoint-free model): under 3 * f < Fintype.card P
and F.card ≤ f, any two valid PreparedCerts in a reachable state st for the same view and
slot have equal val.
Cross-view commit-preservation step toward #7506 (after Castro and Liskov, §4.5.1,
pp. 6–7; ideal-authentication checkpoint-free model): if 3 * f < Fintype.card P, F.card ≤ f, and some honest replica i₀ ∉ F locally commits (v, s, val) in reachable state
st, then every valid PreparedCert c' on st.network at slot s in any view v' ≥ v carries
c'.val = val.
Multi-slot total-order SMR commit safety step toward #7506 (after Castro and Liskov, §4.5.1,
pp. 6–7; ideal-authentication checkpoint-free model): under 3 * f < Fintype.card P and F.card ≤ f, any two honest replicas i₁, i₂ ∉ F that locally commit (v₁, s, val₁) and (v₂, s, val₂) at sequence slot s (even in distinct views) commit val₁ = val₂.
Sequential execution of deterministic state-machine commands smStep : S → V → S across slots
0, ..., k - 1 (none = PBFT null no-op leaving the service state unchanged).
Deterministic state-machine replication state-agreement step toward #7506 (after
Castro and Liskov, §§3, 4.5.1, pp. 2–3, 6–7; ideal-authentication
checkpoint-free model): if two honest replicas i₁, i₂ ∉ F have committed views
views₁, views₂ : ℕ → ℕ and slot commands cmds₁, cmds₂ across all slots < k in reachable state
st (3 * f < Fintype.card P, F.card ≤ f), then executing slots 0, ..., k - 1 from smInit
yields identical service states at i₁ and i₂.
Synchronized honest-primary 3-phase liveness #
Synchronized honest-primary 3-phase liveness step toward #7506 (after Castro and Liskov,
§§4.2, 4.5.2, pp. 4–5, 7; ideal-authentication checkpoint-free model): from any
reachable configuration st (F.card ≤ f) in which primary v ∉ F and every honest replica i ∉ F is active in view v (view = v, inViewChange = false) with fresh slot s, there exists a
finite 3-phase normal-case schedule reaching a configuration st' in which every honest
replica i ∉ F has locally committed (v, s, val).
Sharpness of 3 * f < Fintype.card P for PBFT view-change safety (#7506): on Fin 3 with
f = 1 (Fintype.card (Fin 3) = 3 * f) and static Byzantine set F = {2} (F.card = 1 ≤ f),
there exist a primary schedule primary and a reachable PBFT state in which honest replicas 0 ∉ F
and 1 ∉ F locally commit conflicting client requests some false ≠ some true at sequence slot
0.