Crash-Stop Single-Decree Synod Protocol Step #
This module formalizes a crash-stop intermediate step towards Lamport's Single-Decree Synod
consensus protocol (§2 of [Lam98]; §2 of [Lam01]), and not the crash-recovery cited
results of those papers. Over separate prepare and accept quorum families (QuorumSystem) with
cross-phase intersection, we model the
four Synod phases (Phase1a/1b/2a/2b) as a ghost-free asynchronous message-passing labelled
transition system (Cslib.LTS) allowing arbitrary message reordering, duplication, packet
loss/omission, and permanent crash-stop node failures (crashed : Bool).
Step scope and model deviations: In [Lam98] (§1.3, §2.3, Appendix A2 Forget) and
[Lam01] (§2.1, §2.5), nodes may fail by stopping and later restart using persistent stable
storage (lastTried, maxBal, maxVoted) while losing volatile per-round state; here crashes are
permanent (crashed : Bool), while .prepare p r resets per-round proposer fields (proposed,
promised, maxVote). Phase 2b uses [Lam01] §2.2's mb ≤ b voting guard (allowsVote,
updating maxBal := some b) rather than [Lam98] §2.3 step (4)'s b = nextBal[q]. Section 3
Multi-Paxos state-machine / ledger replication also remains open under issue #7207. The quorum
generalization implements the cross-phase condition of [HMS17], §5 Eq. (3),
in this crash-stop kernel: prepare quorums need not intersect each other, and accept quorums need
not intersect each other. Only an earlier accept quorum and a later prepare quorum are intersected
in the agreement proof. This does not add persistent-storage recovery or dynamic reconfiguration.
The protocol state (SynodState) is completely ghost-free: proposers, acceptors, and learners store
only the operational registers read by protocol transitions, and packet drops genuinely erase
messages from the live network buffer msgs. Safety invariants (the crash-stop P2^c / B3
quorum-witness condition on Phase2a proposals and P1^a promise–vote monotonicity) are proved
inductively over a non-dropping shadow execution (traceMsgs) and projected onto all reachable
states via network monotonicity.
Main definitions #
Cslib.Distributed.Paxos.Ballot: lexicographically ordered(round, proposer)ballot numbers uniquely owned byproposer.Cslib.Distributed.Paxos.Vote:(ballot, value)pair accepted in Phase 2b and reported in Phase 1b.Cslib.Distributed.Paxos.Msg: Synod protocol messages (phase1a,phase1b,phase2a,phase2b).Cslib.Distributed.Paxos.ProposerState,Cslib.Distributed.Paxos.AcceptorState,Cslib.Distributed.Paxos.AcceptedVote,Cslib.Distributed.Paxos.LearnerState,Cslib.Distributed.Paxos.SynodState: ghost-free local and global protocol states.Cslib.Distributed.Paxos.initState: initial global configuration for proposer input assignmentinputs.Cslib.Distributed.Paxos.SynodAction,Cslib.Distributed.Paxos.synodEnabled,Cslib.Distributed.Paxos.synodStep,Cslib.Distributed.Paxos.synodLts: asynchronous crash-stop Synod transitions andCslib.LTSsemantics with reordering, duplication,.drop,.crash*, and.stutter.Cslib.Distributed.Paxos.Reachable,Cslib.Distributed.Paxos.traceMsgs: reachable states and packets emitted along an execution trace.Cslib.Distributed.Paxos.ChosenAt,Cslib.Distributed.Paxos.SynodState.LearnedAt: quorum acceptance in Phase 2b and quorum learning at a learner.
Main results #
Cslib.Distributed.Paxos.phase2a_unique_of_ballot_crashStop: crash-stop step showing at most one value is ever proposed inPhase2afor any ballotb.Cslib.Distributed.Paxos.chosenAt_implies_higher_phase2a_eq_crashStop: crash-stop step for Lamport's inductive ballot-choice invariant—once a quorum has voted(b, v), everyPhase2a(b', v')emitted in the trace withb ≤ b'satisfiesv' = v.Cslib.Distributed.Paxos.paxos_agreement_crashStop: crash-stop global learner agreement step across any two learners and any two ballots in any reachable state.Cslib.Distributed.Paxos.paxos_validity_crashStop: crash-stop nontriviality/validity step—any value learned by a learner in a reachable state equals some proposer's initial input.
References #
Proposer-owned ballots and protocol messages #
Network packets of Lamport's Single-Decree Synod protocol ([Lam98]; [Lam01]).
- phase1a {Proposer : Type u_1} {Acceptor : Type u_2} {V : Type u_3} (b : Ballot Proposer) : Msg Proposer Acceptor V
Phase 1a (
prepare): proposer requests promises for ballotb. - phase1b {Proposer : Type u_1} {Acceptor : Type u_2} {V : Type u_3} (a : Acceptor) (b : Ballot Proposer) (maxVoted : Option (Vote Proposer V)) : Msg Proposer Acceptor V
Phase 1b (
promise): acceptorapromises not to vote in ballots< b, reporting its highest-numbered prior votemaxVoted. - phase2a {Proposer : Type u_1} {Acceptor : Type u_2} {V : Type u_3} (b : Ballot Proposer) (v : V) : Msg Proposer Acceptor V
Phase 2a (
accept): proposer of ballotbproposes decree valuev. - phase2b {Proposer : Type u_1} {Acceptor : Type u_2} {V : Type u_3} (a : Acceptor) (b : Ballot Proposer) (v : V) : Msg Proposer Acceptor V
Phase 2b (
accepted): acceptoracasts its vote for(b, v).
Ghost-free node and global protocol states #
Operational local state of a proposer (zero ghost history).
- input : V
Proposer's initial client input value.
Active ballot round owned by this proposer (
nonebefore its first prepare).- proposed : Bool
Whether this proposer has already emitted
Phase2ain its currentround. - promised : Finset Acceptor
Acceptors from which this proposer has received
Phase1bfor its currentround. - crashed : Bool
Whether this proposer has crashed.
Operational local state of an acceptor (zero ghost history).
Highest ballot promised in Phase 1b or voted in Phase 2b (
noneinitially).Highest-ballot vote cast in Phase 2b (
nonebefore first vote).- crashed : Bool
Whether this acceptor has crashed.
A Phase 2b vote (acceptor, ballot, value) recorded by a learner.
- acceptor : Acceptor
Acceptor that sent
Phase2b. - ballot : Ballot Proposer
Ballot number of the vote.
- value : V
Accepted decree value.
Operational local state of a learner (zero ghost history).
- received : Finset (AcceptedVote Proposer Acceptor V)
Phase 2b votes received so far by this learner.
- learned : Option V
Write-once learned decree value (
noneuntil a quorum of matching Phase 2b votes arrives). - crashed : Bool
Whether this learner has crashed.
Ghost-free global configuration of the Single-Decree Synod protocol: live network packet set paired with local proposer, acceptor, and learner states.
Currently in-flight packets on the asynchronous network (packets may be reordered, redelivered/duplicated, or erased by
.drop).- proposers : Proposer → ProposerState Proposer Acceptor V
Local state of each proposer.
- acceptors : Acceptor → AcceptorState Proposer V
Local state of each acceptor.
- learners : Learner → LearnerState Proposer Acceptor V
Local state of each learner.
Initial global state for proposer input assignment inputs.
Transition labels of the asynchronous Synod LTS, covering all four Paxos phases plus packet
loss (.drop), crash-stop failures (.crash*), and stuttering (.stutter).
- prepare {Proposer : Type u_1} {Acceptor : Type u_2} {Learner : Type u_3} {V : Type u_4} (p : Proposer) (r : ℕ) : SynodAction Proposer Acceptor Learner V
Proposer
pinitiates Phase 1a at a fresh strictly higher roundr. - recvPhase1a {Proposer : Type u_1} {Acceptor : Type u_2} {Learner : Type u_3} {V : Type u_4} (a : Acceptor) (b : Ballot Proposer) : SynodAction Proposer Acceptor Learner V
Acceptor
aprocessesPhase1a(b)from the network. - recvPhase1b {Proposer : Type u_1} {Acceptor : Type u_2} {Learner : Type u_3} {V : Type u_4} (p : Proposer) (a : Acceptor) (b : Ballot Proposer) (mv : Option (Vote Proposer V)) : SynodAction Proposer Acceptor Learner V
Proposer
pprocessesPhase1b(a, b, mv)from the network (and emitsPhase2aupon completing a quorum of promises). - recvPhase2a {Proposer : Type u_1} {Acceptor : Type u_2} {Learner : Type u_3} {V : Type u_4} (a : Acceptor) (b : Ballot Proposer) (v : V) : SynodAction Proposer Acceptor Learner V
Acceptor
aprocessesPhase2a(b, v)from the network. - recvPhase2b {Proposer : Type u_1} {Acceptor : Type u_2} {Learner : Type u_3} {V : Type u_4} (l : Learner) (a : Acceptor) (b : Ballot Proposer) (v : V) : SynodAction Proposer Acceptor Learner V
Learner
lprocessesPhase2b(a, b, v)from the network. - drop {Proposer : Type u_1} {Acceptor : Type u_2} {Learner : Type u_3} {V : Type u_4} (m : Msg Proposer Acceptor V) : SynodAction Proposer Acceptor Learner V
Network drops packet
mfrommsgs. - crashProposer {Proposer : Type u_1} {Acceptor : Type u_2} {Learner : Type u_3} {V : Type u_4} (p : Proposer) : SynodAction Proposer Acceptor Learner V
Proposer
psuffers a crash-stop failure. - crashAcceptor {Proposer : Type u_1} {Acceptor : Type u_2} {Learner : Type u_3} {V : Type u_4} (a : Acceptor) : SynodAction Proposer Acceptor Learner V
Acceptor
asuffers a crash-stop failure. - crashLearner {Proposer : Type u_1} {Acceptor : Type u_2} {Learner : Type u_3} {V : Type u_4} (l : Learner) : SynodAction Proposer Acceptor Learner V
Learner
lsuffers a crash-stop failure. - stutter {Proposer : Type u_1} {Acceptor : Type u_2} {Learner : Type u_3} {V : Type u_4} : SynodAction Proposer Acceptor Learner V
Dummy stuttering step leaving the global state unchanged.
Combine a proposer's running highest vote with a newly reported Phase1b vote.
Whether ballot b strictly exceeds an acceptor's maxBal (the Phase 1b promise condition).
Whether ballot b is at least an acceptor's maxBal (the Phase 2b voting condition).
Guard predicate specifying when act is enabled in state s.
Instances For
Shared transition kernel parameterized by whether .drop erases from msgs.
State transition function of the asynchronous Single-Decree Synod protocol.
Asynchronous labelled transition system (Cslib.LTS) of Lamport's Single-Decree Synod
protocol.
Instances For
Reachable qs inputs s holds when s is reachable from initState inputs in synodLts qs.
Initial state initState inputs is reachable.
Transitivity of Synod reachability along multi-step transitions.
The cumulative finite set of packets emitted along execution trace xl from s₀ (ignoring
.drop erasures).
Value v is chosen at ballot b relative to packet set msgs when every acceptor in some
quorum Q ∈ qs.acceptQuorums has emitted Phase2b(a, b, v).
Learner l has learned value v at ballot b in state s when l has received
Phase2b(a, b, v) from every acceptor in some quorum Q ∈ qs.acceptQuorums.
Shadow non-dropping simulation #
Every packet currently in s.msgs along a valid trace xl belongs to traceMsgs qs s₀ xl.
Global inductive invariant over synodLtsNoDrop #
Main safety theorems #
Crash-stop helper step towards single-proposal per ballot in [Lam98] §2.1 (B1),
§2.2–§2.3 and [Lam01] §2.2, §2.5 (not the crash-recovery cited protocol): along any execution
trace of synodLts, at most one value is ever proposed in Phase2a for any given ballot b.
Crash-stop intermediate step towards the inductive ballot-choice invariant of [Lam98]
§2.1 (Lemma) and [Lam01] §2.2 (P2^b–P2^c), and not the crash-recovery cited result:
along any crash-stop synodLts execution, if an accept quorum Q ∈ qs.acceptQuorums has voted
(b, v) in Phase 2b, then every Phase2a(b', v') emitted in the trace with b ≤ b'
satisfies v' = v.
Crash-stop intermediate step towards Single-Decree Synod agreement in [Lam98] §2.1
(Theorem 1, Appendix A2) and [Lam01] §2.2 (P2), §2.3, and not the crash-recovery cited
result: in any reachable crash-stop Synod state, any two values v₁, v₂ learned by any two
learners l₁, l₂ at any two ballots b₁, b₂ satisfy v₁ = v₂.
Crash-stop Synod learner-register characterization: in any reachable crash-stop Synod state,
learner l's operational learned register holds some v if and only if l has learned v at
some ballot b.
Crash-stop intermediate step towards Single-Decree Synod nontriviality/validity in
[Lam98] §1.2 and [Lam01] §2.1, and not the crash-recovery cited result: in any
reachable crash-stop Synod state, any value v learned by any learner l equals some proposer's
initial input.