Specifications and algorithms, mostly from

Christian Cachin, Rachid Guerraoui, Luís Rodrigues
Introduction to Reliable and Secure Distributed Programming
Springer, Berlin, Heidelberg, 2011
ISBN 978-3-642-15259-7
doi:10.1007/978-3-642-15260-3

Perfect failure detector

Events

P.Crash(p)indication

Detects that process p has crashed.

Properties

1
Strong completeness liveness

Eventually, every process that crashes is permanently detected by every correct process.

2
Strong accuracy safety

If a process p is detected by any process, then p has crashed.

Exclude on Timeout

implements PerfectFailureDetector as P
assumes round-trip delay < Δ
on P.Init
alive := Π
detected := ∅
start_timer(Δ)
on Timeout
for p ∈ Π
if p ∉ alive and p ∉ detected
detected := detected ∪ {p}
trigger P.Crash(p)
trigger pl.Send(p, HEARTBEAT_REQUEST)
alive := ∅
start_timer(Δ)
on pl.Deliver(q, HEARTBEAT_REQUEST)
trigger pl.Send(q, HEARTBEAT_REPLY)
on pl.Deliver(p, HEARTBEAT_REPLY)
alive := alive ∪ {p}

Leader election

Events

le.Leader(p)indication

Indicates that process p is elected as leader.

Properties

1
Eventual detection liveness

Either there is no correct process, or some correct process is eventually elected as the leader.

2
Accuracy safety

If a process is leader, then all previously elected leaders have crashed.

Monarchical Leader Election

implements LeaderElection as le
on le.Init
suspected := ∅
leader := ⊥
on P.Crash(p)
suspected := suspected ∪ {p}
when leader ≠ maxrank(Π ∖ suspected)
leader := maxrank(Π ∖ suspected)
trigger le.Leader(leader)

Eventually perfect failure detector

Events

◇P.Suspect(p)indication

Notifies that process p is suspected to have crashed.

◇P.Restore(p)indication

Notifies that process p is not suspected anymore.

Properties

1
Strong completeness liveness

Eventually, every process that crashes is permanently suspected by every correct process.

2
Eventual strong accuracy liveness

Eventually, no correct process is suspected by any correct process.

Increasing Timeout

assumes partial synchrony
on ◇P.Init
alive := Π
suspected := ∅
delay := Δ
start_timer(delay)
on Timeout
if alive ∩ suspected ≠ ∅
delay := delay + Δ
for p ∈ Π
if p ∉ alive and p ∉ suspected
suspected := suspected ∪ {p}
trigger ◇P.Suspect(p)
else if p ∈ alive and p ∈ suspected
suspected := suspected ∖ {p}
trigger ◇P.Restore(p)
trigger pl.Send(p, HEARTBEAT_REQUEST)
alive := ∅
start_timer(delay)
on pl.Deliver(q, HEARTBEAT_REQUEST)
trigger pl.Send(q, HEARTBEAT_REPLY)
on pl.Deliver(p, HEARTBEAT_REPLY)
alive := alive ∪ {p}

Eventual leader detector

Events

Ω.Trust(p)indication

Indicates that process p is trusted to be leader.

Properties

1
Eventual accuracy liveness

There is a time after which every correct process trusts some correct process.

2
Eventual agreement liveness

There is a time after which no two correct processes trust different correct processes.

Monarchical Eventual Leader Detection

implements EventualLeaderDetector as Ω
on Ω.Init
suspected := ∅
leader := ⊥
on ◇P.Suspect(p)
suspected := suspected ∪ {p}
on ◇P.Restore(p)
suspected := suspected ∖ {p}
when leader ≠ maxrank(Π ∖ suspected)
leader := maxrank(Π ∖ suspected)
trigger Ω.Trust(leader)

Elect Lower Epoch

implements EventualLeaderDetector as Ω
assumes partial synchrony
on Ω.Init
epoch := 0
store(epoch)
candidates := ∅
trigger Ω.Recovery// recovery procedure completes the initialization
on Ω.Recovery
leader := maxrank(Π)
trigger Ω.Trust(leader)
delay := Δ
retrieve(epoch)
epoch := epoch + 1
store(epoch)
for p ∈ Π
trigger fll.Send(p, HEARTBEAT(epoch))
candidates := ∅
start_timer(delay)
on Timeout
new_leader := select(candidates)
if new_leader ≠ leader
delay := delay + Δ
leader := new_leader
trigger Ω.Trust(leader)
for p ∈ Π
trigger fll.Send(p, HEARTBEAT(epoch))
candidates := ∅
start_timer(delay)
on fll.Deliver(q, HEARTBEAT(ep))
if exists (s, e) ∈ candidates : s = q and e < ep
candidates := candidates ∖ {(q, e)}
candidates := candidates ∪ {(q, ep)}

Byzantine eventual leader detector

Events

bld.Trust(p)indication

Indicates that process p is trusted to be leader.

bld.Complain(p)request

Receives a complaint about process p.

Properties

1
Eventual succession liveness

If more than f correct processes that trust some process p complain about p, then every correct process eventually trusts a different process than p.

2
Putsch resistance safety

A correct process does not trust a new leader unless at least one correct process has complained against the previous leader.

3
Eventual agreement liveness

There is a time after which no two correct processes trust different processes.

Rotating Byzantine Leader Detection

implements ByzantineLeaderDetector as bld
assumes N > 3f
on bld.Init
round := 1
complain_list := [⊥]N
complained := false
trigger bld.Trust(leader(round))
on bld.Complain(p) where p = leader(round) and not complained
complained := true
for q ∈ Π
trigger al.Send(q, COMPLAINT(round))
on al.Deliver(p, COMPLAINT(r)) where r = round and complain_list[p] = ⊥
complain_list[p] := COMPLAINT
if #complain_list > f and not complained
complained := true
for q ∈ Π
trigger al.Send(q, COMPLAINT(round))
else if #complain_list > 2f
round := round + 1
complain_list := [⊥]N
complained := false
trigger bld.Trust(leader(round))

Best-effort broadcast

Events

beb.Broadcast(m)request

Broadcasts a message m to all processes.

beb.Deliver(p, m)indication

Delivers a message m broadcast by process p.

Properties

1
Validity liveness

If a correct process broadcasts a message m, then every correct process eventually delivers m.

2
No duplication safety

No message is delivered more than once.

3
No creation safety

If a process delivers a message m with sender s, then m was previously broadcast by process s.

Basic Broadcast

implements BestEffortBroadcast as beb
on beb.Broadcast(m)
for q ∈ Π
trigger pl.Send(q, m)
on pl.Deliver(p, m)
trigger beb.Deliver(p, m)

Reliable broadcast

Events

rb.Broadcast(m)request

Broadcasts a message m to all processes.

rb.Deliver(p, m)indication

Delivers a message m broadcast by process p.

Properties

1
Validity liveness

If a correct process p broadcasts a message m, then p eventually delivers m.

2
No duplication safety

No message is delivered more than once.

3
No creation safety

If a process delivers a message m with sender s, then m was previously broadcast by process s.

4
Agreement liveness

If a message m is delivered by some correct process, then m is eventually delivered by every correct process.

Lazy Reliable Broadcast

implements ReliableBroadcast as rb
on rb.Init
correct := Π
from := [∅]N
on rb.Broadcast(m)
trigger beb.Broadcast(DATA(self, m))
on beb.Deliver(p, DATA(s, m))
if m ∉ from[s]
trigger rb.Deliver(s, m)
from[s] := from[s] ∪ {m}
if s ∉ correct
trigger beb.Broadcast(DATA(s, m))
on P.Crash(p)
correct := correct ∖ {p}
for m ∈ from[p]
trigger beb.Broadcast(DATA(p, m))

Eager Reliable Broadcast

implements ReliableBroadcast as rb
on rb.Init
delivered := ∅
on rb.Broadcast(m)
trigger beb.Broadcast(DATA(self, m))
on beb.Deliver(p, DATA(s, m))
if m ∉ delivered
delivered := delivered ∪ {m}
trigger rb.Deliver(s, m)
trigger beb.Broadcast(DATA(s, m))

Uniform reliable broadcast

Events

urb.Broadcast(m)request

Broadcasts a message m to all processes.

urb.Deliver(p, m)indication

Delivers a message m broadcast by process p.

Properties

1
Validity liveness

If a correct process p broadcasts a message m, then p eventually delivers m.

2
No duplication safety

No message is delivered more than once.

3
No creation safety

If a process delivers a message m with sender s, then m was previously broadcast by process s.

4
Uniform agreement liveness

If a message m is delivered by some process (whether correct or faulty), then m is eventually delivered by every correct process.

All-Ack Uniform Reliable Broadcast

implements UniformReliableBroadcast as urb
on urb.Init
delivered := ∅
pending := ∅
correct := Π
ack[m] := ∅ for all m
on urb.Broadcast(m)
pending := pending ∪ {(self, m)}
trigger beb.Broadcast(DATA(self, m))
on beb.Deliver(p, DATA(s, m))
ack[m] := ack[m] ∪ {p}
if (s, m) ∉ pending
pending := pending ∪ {(s, m)}
trigger beb.Broadcast(DATA(s, m))
on P.Crash(p)
correct := correct ∖ {p}
function can_deliver(m)
return correct ⊆ ack[m]
when exists (s, m) ∈ pending : can_deliver(m) and m ∉ delivered
delivered := delivered ∪ {m}
trigger urb.Deliver(s, m)

Majority-Ack Uniform Reliable Broadcast

implements UniformReliableBroadcast as urb
assumes N > 2f
on urb.Init
delivered := ∅
pending := ∅
ack[m] := ∅ for all m
on urb.Broadcast(m)
pending := pending ∪ {(self, m)}
trigger beb.Broadcast(DATA(self, m))
on beb.Deliver(p, DATA(s, m))
ack[m] := ack[m] ∪ {p}
if (s, m) ∉ pending
pending := pending ∪ {(s, m)}
trigger beb.Broadcast(DATA(s, m))
function can_deliver(m)
return #ack[m] > N/2
when exists (s, m) ∈ pending : can_deliver(m) and m ∉ delivered
delivered := delivered ∪ {m}
trigger urb.Deliver(s, m)

Ideal Uniform Reliable Broadcast

implements UniformReliableBroadcast as urb
uses IdealPerfectPointToPointLinks as idealpl
on urb.Init
delivered := ∅
on urb.Broadcast(m)
trigger idealpl.Send(self, DATA(self, m))
on idealpl.Deliver(p, DATA(s, m))
if m ∉ delivered
delivered := delivered ∪ {m}
for q ∈ Π
trigger idealpl.Send(q, DATA(s, m))
trigger urb.Deliver(s, m)

Stubborn best-effort broadcast

Events

sbeb.Broadcast(m)request

Broadcasts a message m to all processes.

sbeb.Deliver(p, m)indication

Delivers a message m broadcast by process p.

Properties

1
Best-effort validity liveness

If a process that never crashes broadcasts a message m, then every correct process delivers m an infinite number of times.

2
No creation safety

If a process delivers a message m with sender s, then m was previously broadcast by process s.

Basic Stubborn Broadcast

implements StubbornBestEffortBroadcast as sbeb
on sbeb.Recovery
// do nothing
on sbeb.Broadcast(m)
for q ∈ Π
trigger sl.Send(q, m)
on sl.Deliver(p, m)
trigger sbeb.Deliver(p, m)

Logged best-effort broadcast

Events

lbeb.Broadcast(m)request

Broadcasts a message m to all processes.

lbeb.Deliver(delivered)indication

Notifies the upper layer of potential updates to variable delivered in stable storage. A message m with sender s is log-delivered once (s, m) is in delivered.

Properties

1
Validity liveness

If a process that never crashes broadcasts a message m, then every correct process eventually log-delivers m.

2
No duplication safety

No message is log-delivered more than once.

3
No creation safety

If a process log-delivers a message m with sender s, then m was previously broadcast by process s.

Logged Basic Broadcast

implements LoggedBestEffortBroadcast as lbeb
on lbeb.Init
delivered := ∅
store(delivered)
on lbeb.Recovery
retrieve(delivered)
trigger lbeb.Deliver(delivered)
on lbeb.Broadcast(m)
for q ∈ Π
trigger sl.Send(q, m)
on sl.Deliver(p, m)
if (p, m) ∉ delivered
delivered := delivered ∪ {(p, m)}
store(delivered)
trigger lbeb.Deliver(delivered)

Logged reliable broadcast

Events

lrb.Broadcast(m)request

Broadcasts a message m to all processes.

lrb.Deliver(delivered)indication

Notifies the upper layer of potential updates to variable delivered in stable storage. A message m with sender s is log-delivered once (s, m) is in delivered.

Properties

1
Validity liveness

If a process that never crashes broadcasts a message m, then every correct process eventually log-delivers m.

2
No duplication safety

No message is log-delivered more than once.

3
No creation safety

If a process log-delivers a message m with sender s, then m was previously broadcast by process s.

4
Agreement liveness

If a message m is log-delivered by some correct process, then m is eventually log-delivered by every correct process.

Logged Eager Reliable Broadcast

implements LoggedReliableBroadcast as lrb
on lrb.Init
delivered := ∅
store(delivered)
on lrb.Recovery
retrieve(delivered)
trigger lrb.Deliver(delivered)
for (s, m) ∈ delivered
trigger sbeb.Broadcast(DATA(s, m))
on lrb.Broadcast(m)
trigger sbeb.Broadcast(DATA(self, m))
on sbeb.Deliver(p, DATA(s, m))
if (s, m) ∉ delivered
delivered := delivered ∪ {(s, m)}
store(delivered)
trigger lrb.Deliver(delivered)
trigger sbeb.Broadcast(DATA(s, m))

Logged uniform reliable broadcast

Events

lurb.Broadcast(m)request

Broadcasts a message m to all processes.

lurb.Deliver(delivered)indication

Notifies the upper layer of potential updates to variable delivered in stable storage. A message m with sender s is log-delivered once (s, m) is in delivered.

Properties

1
Validity liveness

If a process that never crashes broadcasts a message m, then every correct process eventually log-delivers m.

2
No duplication safety

No message is log-delivered more than once.

3
No creation safety

If a process log-delivers a message m with sender s, then m was previously broadcast by process s.

4
Uniform agreement liveness

If a message m is log-delivered by some process (whether correct or faulty), then m is eventually log-delivered by every correct process.

Logged Majority-Ack Uniform Reliable Broadcast

assumes N > 2f
on lurb.Init
delivered := ∅
pending := ∅
ack[m] := ∅ for all m
store(pending, delivered)
on lurb.Recovery
retrieve(pending, delivered)
trigger lurb.Deliver(delivered)
for (s, m) ∈ pending
trigger sbeb.Broadcast(DATA(s, m))
on lurb.Broadcast(m)
pending := pending ∪ {(self, m)}
store(pending)
trigger sbeb.Broadcast(DATA(self, m))
on sbeb.Deliver(p, DATA(s, m))
if (s, m) ∉ pending
pending := pending ∪ {(s, m)}
store(pending)
trigger sbeb.Broadcast(DATA(s, m))
if p ∉ ack[m]
ack[m] := ack[m] ∪ {p}
if #ack[m] > N/2 and (s, m) ∉ delivered
delivered := delivered ∪ {(s, m)}
store(delivered)
trigger lurb.Deliver(delivered)

Probabilistic broadcast

Events

pb.Broadcast(m)request

Broadcasts a message m to all processes.

pb.Deliver(p, m)indication

Delivers a message m broadcast by process p.

Properties

1
Probabilistic validity liveness

There is a positive value ε such that when a correct process broadcasts a message m, the probability that every correct process eventually delivers m is at least 1 − ε.

2
No duplication safety

No message is delivered more than once.

3
No creation safety

If a process delivers a message m with sender s, then m was previously broadcast by process s.

Eager Probabilistic Broadcast

implements ProbabilisticBroadcast as pb
on pb.Init
delivered := ∅
procedure gossip(msg)
for t ∈ pick_targets(k)
trigger fll.Send(t, msg)
on pb.Broadcast(m)
delivered := delivered ∪ {m}
trigger pb.Deliver(self, m)
gossip(GOSSIP(self, m, R))
on fll.Deliver(p, GOSSIP(s, m, r))
if m ∉ delivered
delivered := delivered ∪ {m}
trigger pb.Deliver(s, m)
if r > 1
gossip(GOSSIP(s, m, r − 1))

Lazy Probabilistic Broadcast

implements ProbabilisticBroadcast as pb
uses ProbabilisticBroadcast as upb// an unreliable implementation
on pb.Init
next := [1]N
lsn := 0
pending := ∅
stored := ∅
procedure gossip(msg)
for t ∈ pick_targets(k)
trigger fll.Send(t, msg)
on pb.Broadcast(m)
lsn := lsn + 1
trigger upb.Broadcast(DATA(self, m, lsn))
on upb.Deliver(p, DATA(s, m, sn))
if random([0, 1]) > α
stored := stored ∪ {DATA(s, m, sn)}
if sn = next[s]
next[s] := next[s] + 1
trigger pb.Deliver(s, m)
else if sn > next[s]
pending := pending ∪ {DATA(s, m, sn)}
for missing ∈ [next[s], …, sn − 1]
if not exists m' : DATA(s, m', missing) ∈ pending
gossip(REQUEST(self, s, missing, R − 1))
start_timer(Δ, s, sn)
on fll.Deliver(p, REQUEST(q, s, sn, r))
if exists m : DATA(s, m, sn) ∈ stored
trigger fll.Send(q, DATA(s, m, sn))
else if r > 0
gossip(REQUEST(q, s, sn, r − 1))
on fll.Deliver(p, DATA(s, m, sn))
pending := pending ∪ {DATA(s, m, sn)}
when exists DATA(s, x, sn) ∈ pending : sn = next[s]
next[s] := next[s] + 1
pending := pending ∖ {DATA(s, x, sn)}
trigger pb.Deliver(s, x)
on Timeout(s, sn)
if sn > next[s]
next[s] := sn

FIFO-order reliable broadcast

Events

frb.Broadcast(m)request

Broadcasts a message m to all processes.

frb.Deliver(p, m)indication

Delivers a message m broadcast by process p.

Properties

1
Validity liveness

If a correct process p broadcasts a message m, then p eventually delivers m.

2
No duplication safety

No message is delivered more than once.

3
No creation safety

If a process delivers a message m with sender s, then m was previously broadcast by process s.

4
Agreement liveness

If a message m is delivered by some correct process, then m is eventually delivered by every correct process.

5
FIFO delivery safety

If some process broadcasts message m1 before it broadcasts message m2, then no correct process delivers m2 unless it has already delivered m1.

Broadcast with Sequence Number

implements FIFOReliableBroadcast as frb
on frb.Init
lsn := 0
pending := ∅
next := [1]N
on frb.Broadcast(m)
lsn := lsn + 1
trigger rb.Broadcast(DATA(self, m, lsn))
on rb.Deliver(p, DATA(s, m, sn))
pending := pending ∪ {(s, m, sn)}
while exists (s', m', sn') ∈ pending : s' = s and sn' = next[s]
next[s] := next[s] + 1
pending := pending ∖ {(s, m', sn')}
trigger frb.Deliver(s, m')

FIFO-order uniform reliable broadcast

Events

furb.Broadcast(m)request

Broadcasts a message m to all processes.

furb.Deliver(p, m)indication

Delivers a message m broadcast by process p.

Properties

1
Validity liveness

If a correct process p broadcasts a message m, then p eventually delivers m.

2
No duplication safety

No message is delivered more than once.

3
No creation safety

If a process delivers a message m with sender s, then m was previously broadcast by process s.

4
Uniform agreement liveness

If a message m is delivered by some process (whether correct or faulty), then m is eventually delivered by every correct process.

5
FIFO delivery safety

If some process broadcasts message m1 before it broadcasts message m2, then no correct process delivers m2 unless it has already delivered m1.

Broadcast with Sequence Number

implements FIFOUniformReliableBroadcast as furb
on furb.Init
lsn := 0
pending := ∅
next := [1]N
on furb.Broadcast(m)
lsn := lsn + 1
trigger urb.Broadcast(DATA(self, m, lsn))
on urb.Deliver(p, DATA(s, m, sn))
pending := pending ∪ {(s, m, sn)}
while exists (s', m', sn') ∈ pending : s' = s and sn' = next[s]
next[s] := next[s] + 1
pending := pending ∖ {(s, m', sn')}
trigger furb.Deliver(s, m')

Causal-order reliable broadcast

Events

crb.Broadcast(m)request

Broadcasts a message m to all processes.

crb.Deliver(p, m)indication

Delivers a message m broadcast by process p.

Properties

1
Validity liveness

If a correct process p broadcasts a message m, then p eventually delivers m.

2
No duplication safety

No message is delivered more than once.

3
No creation safety

If a process delivers a message m with sender s, then m was previously broadcast by process s.

4
Agreement liveness

If a message m is delivered by some correct process, then m is eventually delivered by every correct process.

5
Causal delivery safety

For any message m1 that potentially caused a message m2, i.e., m1 → m2, no process delivers m2 unless it has already delivered m1.

No-Waiting Causal Broadcast

on crb.Init
delivered := ∅
past := []
on crb.Broadcast(m)
trigger rb.Broadcast(DATA(past, m))
append(past, (self, m))
on rb.Deliver(p, DATA(m_past, m))
if m ∉ delivered
for (s, n) ∈ m_past// by the order in the list
if n ∉ delivered
trigger crb.Deliver(s, n)
delivered := delivered ∪ {n}
if (s, n) ∉ past
append(past, (s, n))
trigger crb.Deliver(p, m)
delivered := delivered ∪ {m}
if (p, m) ∉ past
append(past, (p, m))

Garbage-Collection of Causal Past

on crb.Init
delivered := ∅
past := []
correct := Π
ack[m] := ∅ for all m
on crb.Broadcast(m)
trigger rb.Broadcast(DATA(past, m))
append(past, (self, m))
on rb.Deliver(p, DATA(m_past, m))
if m ∉ delivered
for (s, n) ∈ m_past// by the order in the list
if n ∉ delivered
trigger crb.Deliver(s, n)
delivered := delivered ∪ {n}
if (s, n) ∉ past
append(past, (s, n))
trigger crb.Deliver(p, m)
delivered := delivered ∪ {m}
if (p, m) ∉ past
append(past, (p, m))
on P.Crash(p)
correct := correct ∖ {p}
when exists m ∈ delivered : self ∉ ack[m]
ack[m] := ack[m] ∪ {self}
trigger rb.Broadcast(ACK(m))
on rb.Deliver(p, ACK(m))
ack[m] := ack[m] ∪ {p}
when exists (s, m) ∈ past : correct ⊆ ack[m]
remove(past, (s, m))

Waiting Causal Broadcast

on crb.Init
V := [0]N
lsn := 0
pending := ∅
on crb.Broadcast(m)
W := V
W[rank(self)] := lsn
lsn := lsn + 1
trigger rb.Broadcast(DATA(W, m))
on rb.Deliver(p, DATA(W, m))
pending := pending ∪ {(p, W, m)}
while exists (p', W', m') ∈ pending : W' ≤ V
pending := pending ∖ {(p', W', m')}
V[rank(p')] := V[rank(p')] + 1
trigger crb.Deliver(p', m')

No-Waiting Causal Broadcast using FIFO Broadcast

on crb.Init
delivered := ∅
list := []
on crb.Broadcast(m)
append(list, (self, m))
trigger frb.Broadcast(DATA(list))
list := []
on frb.Deliver(p, DATA(m_list))
for (s, n) ∈ m_list// by the order in the list
if n ∉ delivered
trigger crb.Deliver(s, n)
delivered := delivered ∪ {n}
if (s, n) ∉ list
append(list, (s, n))

Causal-order uniform reliable broadcast

Events

curb.Broadcast(m)request

Broadcasts a message m to all processes.

curb.Deliver(p, m)indication

Delivers a message m broadcast by process p.

Properties

1
Validity liveness

If a correct process p broadcasts a message m, then p eventually delivers m.

2
No duplication safety

No message is delivered more than once.

3
No creation safety

If a process delivers a message m with sender s, then m was previously broadcast by process s.

4
Uniform agreement liveness

If a message m is delivered by some process (whether correct or faulty), then m is eventually delivered by every correct process.

5
Causal delivery safety

For any message m1 that potentially caused a message m2, i.e., m1 → m2, no process delivers m2 unless it has already delivered m1.

Byzantine consistent broadcast

Events

sparameter

The sender.

bcb.Broadcast(m)request

Broadcasts a message m to all processes. Executed only by process s.

bcb.Deliver(p, m)indication

Delivers a message m broadcast by process p.

Properties

1
Validity liveness

If a correct process p broadcasts a message m, then every correct process eventually delivers m.

2
No duplication safety

Every correct process delivers at most one message.

3
Integrity safety

If some correct process delivers a message m with sender p and process p is correct, then m was previously broadcast by p.

4
Consistency safety

If some correct process delivers a message m and another correct process delivers a message m', then m = m'.

Authenticated Echo Broadcast

implements ByzantineConsistentBroadcast as bcb with sender s
assumes N > 3f
on bcb.Init
sent_echo := false
delivered := false
echos := [⊥]N
on bcb.Broadcast(m)// only process s
for q ∈ Π
trigger al.Send(q, SEND(m))
on al.Deliver(p, SEND(m)) where p = s and not sent_echo
sent_echo := true
for q ∈ Π
trigger al.Send(q, ECHO(m))
on al.Deliver(p, ECHO(m))
if echos[p] = ⊥
echos[p] := m
when exists m ≠ ⊥ : #{p ∈ Π : echos[p] = m} > (N + f)/2 and not delivered
delivered := true
trigger bcb.Deliver(s, m)

Signed Echo Broadcast

implements ByzantineConsistentBroadcast as bcb with sender s
assumes N > 3f
on bcb.Init
sent_echo := false
sent_final := false
delivered := false
echos := [⊥]N
Σ := [⊥]N
on bcb.Broadcast(m)// only process s
for q ∈ Π
trigger al.Send(q, SEND(m))
on al.Deliver(p, SEND(m)) where p = s and not sent_echo
sent_echo := true
σ := sign(self, bcb‖self‖ECHO‖m)
trigger al.Send(s, ECHO(m, σ))
on al.Deliver(p, ECHO(m, σ))// only process s
if echos[p] = ⊥ and verify_sig(p, bcb‖p‖ECHO‖m, σ)
echos[p] := m
Σ[p] := σ
when exists m ≠ ⊥ : #{p ∈ Π : echos[p] = m} > (N + f)/2 and not sent_final
sent_final := true
for q ∈ Π
trigger al.Send(q, FINAL(m, Σ))
on al.Deliver(p, FINAL(m, Σ'))
if #{q ∈ Π : Σ'[q] ≠ ⊥ and verify_sig(q, bcb‖q‖ECHO‖m, Σ'[q])} > (N + f)/2 and not delivered
delivered := true
trigger bcb.Deliver(s, m)

Byzantine reliable broadcast

Events

sparameter

The sender.

brb.Broadcast(m)request

Broadcasts a message m to all processes. Executed only by process s.

brb.Deliver(p, m)indication

Delivers a message m broadcast by process p.

Properties

1
Validity liveness

If a correct process p broadcasts a message m, then every correct process eventually delivers m.

2
No duplication safety

Every correct process delivers at most one message.

3
Integrity safety

If some correct process delivers a message m with sender p and process p is correct, then m was previously broadcast by p.

4
Consistency safety

If some correct process delivers a message m and another correct process delivers a message m', then m = m'.

5
Totality liveness

If some message is delivered by any correct process, every correct process eventually delivers a message.

Authenticated Double-Echo Broadcast

implements ByzantineReliableBroadcast as brb with sender s
assumes N > 3f
on brb.Init
sent_echo := false
sent_ready := false
delivered := false
echos := [⊥]N
readys := [⊥]N
on brb.Broadcast(m)// only process s
for q ∈ Π
trigger al.Send(q, SEND(m))
on al.Deliver(p, SEND(m)) where p = s and not sent_echo
sent_echo := true
for q ∈ Π
trigger al.Send(q, ECHO(m))
on al.Deliver(p, ECHO(m))
if echos[p] = ⊥
echos[p] := m
when exists m ≠ ⊥ : #{p ∈ Π : echos[p] = m} > (N + f)/2 and not sent_ready
sent_ready := true
for q ∈ Π
trigger al.Send(q, READY(m))
on al.Deliver(p, READY(m))
if readys[p] = ⊥
readys[p] := m
when exists m ≠ ⊥ : #{p ∈ Π : readys[p] = m} > f and not sent_ready
sent_ready := true
for q ∈ Π
trigger al.Send(q, READY(m))
when exists m ≠ ⊥ : #{p ∈ Π : readys[p] = m} > 2f and not delivered
delivered := true
trigger brb.Deliver(s, m)

Byzantine consistent channel

Events

bcch.Broadcast(m)request

Broadcasts a message m to all processes.

bcch.Deliver(p, ℓ, m)indication

Delivers a message m with label ℓ broadcast by process p.

Properties

1
Validity liveness

If a correct process p broadcasts a message m, then every correct process eventually delivers m.

2
No duplication safety

For every process p and label ℓ, every correct process delivers at most one message with label ℓ and sender p.

3
Integrity safety

If some correct process delivers a message m with sender p and process p is correct, then m was previously broadcast by p.

4
Consistency safety

If some correct process delivers a message m with label ℓ and sender s, and another correct process delivers a message m' with label ℓ and sender s, then m = m'.

Byzantine Consistent Channel

on bcch.Init
n := [0]N
ready := true
for p ∈ Π
bcb[p][n[p]] := new ByzantineConsistentBroadcast with sender p
on bcch.Broadcast(m) where ready
trigger bcb[self][n[self]].Broadcast(m)
ready := false
on bcb[p][i].Deliver(s, m) where i = n[p]
trigger bcch.Deliver(p, n[p], m)
n[p] := n[p] + 1
bcb[p][n[p]] := new ByzantineConsistentBroadcast with sender p
if p = self
ready := true

Byzantine reliable channel

Events

brch.Broadcast(m)request

Broadcasts a message m to all processes.

brch.Deliver(p, ℓ, m)indication

Delivers a message m with label ℓ broadcast by process p.

Properties

1
Validity liveness

If a correct process p broadcasts a message m, then every correct process eventually delivers m.

2
No duplication safety

For every process p and label ℓ, every correct process delivers at most one message with label ℓ and sender p.

3
Integrity safety

If some correct process delivers a message m with sender p and process p is correct, then m was previously broadcast by p.

4
Agreement liveness

If some correct process delivers a message m with label ℓ and sender s, then every correct process eventually delivers message m with label ℓ and sender s.

Byzantine Reliable Channel

uses ByzantineReliableBroadcast as brb[p][i]
on brch.Init
n := [0]N
ready := true
for p ∈ Π
brb[p][n[p]] := new ByzantineReliableBroadcast with sender p
on brch.Broadcast(m) where ready
trigger brb[self][n[self]].Broadcast(m)
ready := false
on brb[p][i].Deliver(s, m) where i = n[p]
trigger brch.Deliver(p, n[p], m)
n[p] := n[p] + 1
brb[p][n[p]] := new ByzantineReliableBroadcast with sender p
if p = self
ready := true

(1, N) regular register

Events

onrr.Readrequest

Invokes a read operation on the register.

onrr.Write(v)request

Invokes a write operation with value v on the register.

onrr.ReadReturn(v)indication

Completes a read operation on the register with return value v.

onrr.WriteReturnindication

Completes a write operation on the register.

Properties

1
Termination liveness

If a correct process invokes an operation, then the operation eventually completes.

2
Validity safety

A read that is not concurrent with a write returns the last value written; a read that is concurrent with a write returns the last value written or the value concurrently written.

Read-One Write-All

implements (1, N)-RegularRegister as onrr
on onrr.Init
val := ⊥
correct := Π
write_set := ∅
on P.Crash(p)
correct := correct ∖ {p}
on onrr.Read
trigger onrr.ReadReturn(val)
on onrr.Write(v)
trigger beb.Broadcast(WRITE(v))
on beb.Deliver(q, WRITE(v))
val := v
trigger pl.Send(q, ACK)
on pl.Deliver(p, ACK)
write_set := write_set ∪ {p}
when correct ⊆ write_set
write_set := ∅
trigger onrr.WriteReturn

Majority Voting Regular Register

implements (1, N)-RegularRegister as onrr
assumes N > 2f
on onrr.Init
(ts, val) := (0, ⊥)
wts := 0
acks := 0
rid := 0
read_list := [⊥]N
on onrr.Write(v)
wts := wts + 1
acks := 0
trigger beb.Broadcast(WRITE(wts, v))
on beb.Deliver(p, WRITE(ts', v'))
if ts' > ts
(ts, val) := (ts', v')
trigger pl.Send(p, ACK(ts'))
on pl.Deliver(q, ACK(ts')) where ts' = wts
acks := acks + 1
if acks > N/2
acks := 0
trigger onrr.WriteReturn
on onrr.Read
rid := rid + 1
read_list := [⊥]N
trigger beb.Broadcast(READ(rid))
on beb.Deliver(p, READ(r))
trigger pl.Send(p, VALUE(r, ts, val))
on pl.Deliver(q, VALUE(r, ts', v')) where r = rid
read_list[q] := (ts', v')
if #read_list > N/2
v := highest_val(read_list)
read_list := [⊥]N
trigger onrr.ReadReturn(v)

(1, N) atomic register

Events

onar.Readrequest

Invokes a read operation on the register.

onar.Write(v)request

Invokes a write operation with value v on the register.

onar.ReadReturn(v)indication

Completes a read operation on the register with return value v.

onar.WriteReturnindication

Completes a write operation on the register.

Properties

1
Termination liveness

If a correct process invokes an operation, then the operation eventually completes.

2
Validity safety

A read that is not concurrent with a write returns the last value written; a read that is concurrent with a write returns the last value written or the value concurrently written.

3
Ordering safety

If a read returns a value v and a subsequent read returns a value w, then the write of w does not precede the write of v.

From (1, N) Regular to (1, 1) Atomic Registers

implements (1, 1)-AtomicRegister as ooar
on ooar.Init
(ts, val) := (0, ⊥)
wts := 0
on ooar.Write(v)
wts := wts + 1
trigger onrr.Write((wts, v))
on onrr.WriteReturn
trigger ooar.WriteReturn
on ooar.Read
trigger onrr.Read
on onrr.ReadReturn((ts', v'))
if ts' > ts
(ts, val) := (ts', v')
trigger ooar.ReadReturn(val)

From (1, 1) Atomic to (1, N) Atomic Registers

implements (1, N)-AtomicRegister as onar
uses (1, 1)-AtomicRegister as ooar[q][r]
on onar.Init
ts := 0
acks := 0
writing := false
read_val := ⊥
read_list := [⊥]N
for q ∈ Π
for r ∈ Π
ooar[q][r] := new (1, 1)-AtomicRegister with writer r, reader q
on onar.Write(v)
ts := ts + 1
writing := true
for q ∈ Π
trigger ooar[q][self].Write((ts, v))
on ooar[q][self].WriteReturn
acks := acks + 1
if acks = N
acks := 0
if writing
trigger onar.WriteReturn
writing := false
else
trigger onar.ReadReturn(read_val)
on onar.Read
for r ∈ Π
trigger ooar[self][r].Read
on ooar[self][r].ReadReturn((ts', v'))
read_list[r] := (ts', v')
if #read_list = N
(max_ts, read_val) := highest(read_list)
read_list := [⊥]N
for q ∈ Π
trigger ooar[q][self].Write((max_ts, read_val))

Read-Impose Write-All

implements (1, N)-AtomicRegister as onar
on onar.Init
(ts, val) := (0, ⊥)
correct := Π
write_set := ∅
read_val := ⊥
reading := false
on P.Crash(p)
correct := correct ∖ {p}
on onar.Read
reading := true
read_val := val
trigger beb.Broadcast(WRITE(ts, val))
on onar.Write(v)
trigger beb.Broadcast(WRITE(ts + 1, v))
on beb.Deliver(p, WRITE(ts', v'))
if ts' > ts
(ts, val) := (ts', v')
trigger pl.Send(p, ACK)
on pl.Deliver(p, ACK)
write_set := write_set ∪ {p}
when correct ⊆ write_set
write_set := ∅
if reading
reading := false
trigger onar.ReadReturn(read_val)
else
trigger onar.WriteReturn

Read-Impose Write-Majority

implements (1, N)-AtomicRegister as onar
assumes N > 2f
on onar.Init
(ts, val) := (0, ⊥)
wts := 0
acks := 0
rid := 0
read_list := [⊥]N
read_val := ⊥
reading := false
on onar.Read
rid := rid + 1
acks := 0
read_list := [⊥]N
reading := true
trigger beb.Broadcast(READ(rid))
on beb.Deliver(p, READ(r))
trigger pl.Send(p, VALUE(r, ts, val))
on pl.Deliver(q, VALUE(r, ts', v')) where r = rid
read_list[q] := (ts', v')
if #read_list > N/2
(max_ts, read_val) := highest(read_list)
read_list := [⊥]N
trigger beb.Broadcast(WRITE(rid, max_ts, read_val))
on onar.Write(v)
rid := rid + 1
wts := wts + 1
acks := 0
trigger beb.Broadcast(WRITE(rid, wts, v))
on beb.Deliver(p, WRITE(r, ts', v'))
if ts' > ts
(ts, val) := (ts', v')
trigger pl.Send(p, ACK(r))
on pl.Deliver(q, ACK(r)) where r = rid
acks := acks + 1
if acks > N/2
acks := 0
if reading
reading := false
trigger onar.ReadReturn(read_val)
else
trigger onar.WriteReturn

(N, N) atomic register

Events

nnar.Readrequest

Invokes a read operation on the register.

nnar.Write(v)request

Invokes a write operation with value v on the register.

nnar.ReadReturn(v)indication

Completes a read operation on the register with return value v.

nnar.WriteReturnindication

Completes a write operation on the register.

Properties

1
Termination liveness

If a correct process invokes an operation, then the operation eventually completes.

2
Atomicity safety

Every read operation returns the value that was written most recently in a hypothetical execution, where every failed operation appears to be complete or does not appear to have been invoked at all, and every complete operation appears to have been executed at some instant between its invocation and its completion.

From (1, N) Atomic to (N, N) Atomic Registers

implements (N, N)-AtomicRegister as nnar
uses (1, N)-AtomicRegister as onar[q]
on nnar.Init
val := ⊥
writing := false
read_list := [⊥]N
for q ∈ Π
onar[q] := new (1, N)-AtomicRegister with writer q
on nnar.Write(v)
val := v
writing := true
for q ∈ Π
trigger onar[q].Read
on nnar.Read
for q ∈ Π
trigger onar[q].Read
on onar[q].ReadReturn((ts', v'))
read_list[q] := (ts', rank(q), v')
if #read_list = N
(ts, v) := highest(read_list)
read_list := [⊥]N
if writing
writing := false
trigger onar[self].Write((ts + 1, val))
else
trigger nnar.ReadReturn(v)
on onar[self].WriteReturn
trigger nnar.WriteReturn

Read-Impose Write-Consult-All

implements (N, N)-AtomicRegister as nnar
on nnar.Init
(ts, wr, val) := (0, 0, ⊥)
correct := Π
write_set := ∅
read_val := ⊥
reading := false
on P.Crash(p)
correct := correct ∖ {p}
on nnar.Read
reading := true
read_val := val
trigger beb.Broadcast(WRITE(ts, wr, val))
on nnar.Write(v)
trigger beb.Broadcast(WRITE(ts + 1, rank(self), v))
on beb.Deliver(p, WRITE(ts', wr', v'))
if (ts', wr') > (ts, wr)
(ts, wr, val) := (ts', wr', v')
trigger pl.Send(p, ACK)
on pl.Deliver(p, ACK)
write_set := write_set ∪ {p}
when correct ⊆ write_set
write_set := ∅
if reading
reading := false
trigger nnar.ReadReturn(read_val)
else
trigger nnar.WriteReturn

Read-Impose Write-Consult-Majority

implements (N, N)-AtomicRegister as nnar
assumes N > 2f
on nnar.Init
(ts, wr, val) := (0, 0, ⊥)
acks := 0
write_val := ⊥
rid := 0
read_list := [⊥]N
read_val := ⊥
reading := false
on nnar.Read
rid := rid + 1
acks := 0
read_list := [⊥]N
reading := true
trigger beb.Broadcast(READ(rid))
on beb.Deliver(p, READ(r))
trigger pl.Send(p, VALUE(r, ts, wr, val))
on pl.Deliver(q, VALUE(r, ts', wr', v')) where r = rid
read_list[q] := (ts', wr', v')
if #read_list > N/2
(max_ts, rr, read_val) := highest(read_list)
read_list := [⊥]N
if reading
trigger beb.Broadcast(WRITE(rid, max_ts, rr, read_val))
else
trigger beb.Broadcast(WRITE(rid, max_ts + 1, rank(self), write_val))
on nnar.Write(v)
rid := rid + 1
write_val := v
acks := 0
read_list := [⊥]N
trigger beb.Broadcast(READ(rid))
on beb.Deliver(p, WRITE(r, ts', wr', v'))
if (ts', wr') > (ts, wr)
(ts, wr, val) := (ts', wr', v')
trigger pl.Send(p, ACK(r))
on pl.Deliver(q, ACK(r)) where r = rid
acks := acks + 1
if acks > N/2
acks := 0
if reading
reading := false
trigger nnar.ReadReturn(read_val)
else
trigger nnar.WriteReturn

(1, N) logged regular register

Events

lonrr.Readrequest

Invokes a read operation on the register.

lonrr.Write(v)request

Invokes a write operation with value v on the register.

lonrr.ReadReturn(v)indication

Completes a read operation on the register with return value v.

lonrr.WriteReturnindication

Completes a write operation on the register.

Properties

1
Termination liveness

If a process invokes an operation and never crashes, then the operation eventually completes.

2
Validity safety

A read that is not concurrent with a write returns the last value written; a read that is concurrent with a write returns the last value written or the value concurrently written.

Logged Majority Voting

implements (1, N)-LoggedRegularRegister as lonrr
assumes N > 2f
on lonrr.Init
(ts, val) := (0, ⊥)
wts := 0
rid := 0
ack_list := [⊥]N
writing := false
read_list := [⊥]N
reading := false
store(wts, ts, val, rid, writing)
on lonrr.Recovery
retrieve(wts, ts, val, rid, writing)
ack_list := [⊥]N
read_list := [⊥]N
reading := false
if writing
rid := rid + 1
trigger sbeb.Broadcast(WRITE(rid, ts, val))
on lonrr.Write(v)
wts := wts + 1
(ts, val) := (wts, v)
rid := rid + 1
ack_list := [⊥]N
writing := true
store(wts, ts, val, rid, writing)
trigger sbeb.Broadcast(WRITE(rid, wts, v))
on sbeb.Deliver(p, WRITE(r, ts', v'))
if ts' > ts
(ts, val) := (ts', v')
store(ts, val)
trigger sl.Send(p, ACK(r))
on sl.Deliver(q, ACK(r)) where r = rid
ack_list[q] := ACK
if #ack_list > N/2 and writing
ack_list := [⊥]N
writing := false
store(writing)
trigger lonrr.WriteReturn
on lonrr.Read
rid := rid + 1
store(rid)
read_list := [⊥]N
reading := true
trigger sbeb.Broadcast(READ(rid))
on sbeb.Deliver(p, READ(r))
trigger sl.Send(p, VALUE(r, ts, val))
on sl.Deliver(q, VALUE(r, ts', v')) where r = rid
read_list[q] := (ts', v')
if #read_list > N/2 and reading
v := highest_val(read_list)
read_list := [⊥]N
reading := false
trigger lonrr.ReadReturn(v)

(1, N) Byzantine safe register

Events

wparameter

The writer.

bonsr.Readrequest

Invokes a read operation on the register.

bonsr.Write(v)request

Invokes a write operation with value v on the register. Executed only by process w.

bonsr.ReadReturn(v)indication

Completes a read operation on the register with return value v.

bonsr.WriteReturnindication

Completes a write operation on the register. Occurs only at process w.

Properties

1
Termination liveness

If a correct process invokes an operation, then the operation eventually completes.

2
Validity safety

A read that is not concurrent with a write returns the last value written.

Byzantine Masking Quorum

implements (1, N)-ByzantineSafeRegister as bonsr with writer w
assumes N > 4f
on bonsr.Init
(ts, val) := (0, ⊥)
wts := 0
ack_list := [⊥]N
rid := 0
read_list := [⊥]N
on bonsr.Write(v)// only process w
wts := wts + 1
ack_list := [⊥]N
for q ∈ Π
trigger al.Send(q, WRITE(wts, v))
on al.Deliver(p, WRITE(ts', v')) where p = w
if ts' > ts
(ts, val) := (ts', v')
trigger al.Send(p, ACK(ts'))
on al.Deliver(q, ACK(ts')) where ts' = wts
ack_list[q] := ACK
if #ack_list > (N + 2f)/2
ack_list := [⊥]N
trigger bonsr.WriteReturn
on bonsr.Read
rid := rid + 1
read_list := [⊥]N
for q ∈ Π
trigger al.Send(q, READ(rid))
on al.Deliver(p, READ(r))
trigger al.Send(p, VALUE(r, ts, val))
on al.Deliver(q, VALUE(r, ts', v')) where r = rid
read_list[q] := (ts', v')
if #read_list > (N + 2f)/2
v := byz_highest_val(read_list)
read_list := [⊥]N
trigger bonsr.ReadReturn(v)

(1, N) Byzantine regular register

Events

wparameter

The writer.

bonrr.Readrequest

Invokes a read operation on the register.

bonrr.Write(v)request

Invokes a write operation with value v on the register. Executed only by process w.

bonrr.ReadReturn(v)indication

Completes a read operation on the register with return value v.

bonrr.WriteReturnindication

Completes a write operation on the register. Occurs only at process w.

Properties

1
Termination liveness

If a correct process invokes an operation, then the operation eventually completes.

2
Validity safety

A read that is not concurrent with a write returns the last value written; a read that is concurrent with a write returns the last value written or the value concurrently written.

Authenticated-Data Byzantine Quorum

implements (1, N)-ByzantineRegularRegister as bonrr with writer w
assumes N > 3f
on bonrr.Init
(ts, val, σ) := (0, ⊥, ⊥)
wts := 0
ack_list := [⊥]N
rid := 0
read_list := [⊥]N
on bonrr.Write(v)// only process w
wts := wts + 1
ack_list := [⊥]N
σ := sign(self, bonrr‖self‖WRITE‖wts‖v)
for q ∈ Π
trigger al.Send(q, WRITE(wts, v, σ))
on al.Deliver(p, WRITE(ts', v', σ')) where p = w
if ts' > ts
(ts, val, σ) := (ts', v', σ')
trigger al.Send(p, ACK(ts'))
on al.Deliver(q, ACK(ts')) where ts' = wts
ack_list[q] := ACK
if #ack_list > (N + f)/2
ack_list := [⊥]N
trigger bonrr.WriteReturn
on bonrr.Read
rid := rid + 1
read_list := [⊥]N
for q ∈ Π
trigger al.Send(q, READ(rid))
on al.Deliver(p, READ(r))
trigger al.Send(p, VALUE(r, ts, val, σ))
on al.Deliver(q, VALUE(r, ts', v', σ')) where r = rid
if (ts', v') = (0, ⊥) or verify_sig(w, bonrr‖w‖WRITE‖ts'‖v', σ')
read_list[q] := (ts', v')
if #read_list > (N + f)/2
v := highest_val(read_list)
read_list := [⊥]N
trigger bonrr.ReadReturn(v)

Double-Write Byzantine Quorum

implements (1, N)-ByzantineRegularRegister as bonrr with writer w
assumes N > 3f
on bonrr.Init
(pts, pval) := (0, ⊥)
(ts, val) := (0, ⊥)
(wts, wval) := (0, ⊥)
pre_ack_list := [⊥]N
ack_list := [⊥]N
rid := 0
read_list := [⊥]N
on bonrr.Write(v)// only process w
(wts, wval) := (wts + 1, v)
pre_ack_list := [⊥]N
ack_list := [⊥]N
for q ∈ Π
trigger al.Send(q, PREWRITE(wts, wval))
on al.Deliver(p, PREWRITE(pts', pval')) where p = w and pts' = pts + 1
(pts, pval) := (pts', pval')
trigger al.Send(p, PREACK(pts))
on al.Deliver(q, PREACK(pts')) where pts' = wts
pre_ack_list[q] := PREACK
if #pre_ack_list ≥ N − f
pre_ack_list := [⊥]N
for p ∈ Π
trigger al.Send(p, WRITE(wts, wval))
on al.Deliver(p, WRITE(ts', val')) where p = w and ts' = pts and ts' > ts
(ts, val) := (ts', val')
trigger al.Send(p, ACK(ts))
on al.Deliver(q, ACK(ts')) where ts' = wts
ack_list[q] := ACK
if #ack_list ≥ N − f
ack_list := [⊥]N
trigger bonrr.WriteReturn
on bonrr.Read
rid := rid + 1
read_list := [⊥]N
for q ∈ Π
trigger al.Send(q, READ(rid))
on al.Deliver(p, READ(r))
trigger al.Send(p, VALUE(r, pts, pval, ts, val))
on al.Deliver(q, VALUE(r, pts', pval', ts', val')) where r = rid
if pts' = ts' + 1 or (pts', pval') = (ts', val')
read_list[q] := (pts', pval', ts', val')
if exists (t, v) in an entry of read_list : authentic(t, v, read_list) and exists Q ⊆ read_list : #Q > (N + f)/2 and selected_max(t, v, Q)
read_list := [⊥]N
trigger bonrr.ReadReturn(v)
else
trigger al.Send(q, READ(r))

(1, N) Byzantine atomic register

Events

wparameter

The writer.

bonar.Readrequest

Invokes a read operation on the register.

bonar.Write(v)request

Invokes a write operation with value v on the register. Executed only by process w.

bonar.ReadReturn(v)indication

Completes a read operation on the register with return value v.

bonar.WriteReturnindication

Completes a write operation on the register. Occurs only at process w.

Properties

1
Termination liveness

If a correct process invokes an operation, then the operation eventually completes.

2
Validity safety

A read that is not concurrent with a write returns the last value written; a read that is concurrent with a write returns the last value written or the value concurrently written.

3
Ordering safety

If a read returns a value v and a subsequent read returns a value w, then the write of w does not precede the write of v.

Byzantine Quorum with Listeners

implements (1, N)-ByzantineAtomicRegister as bonar with writer w
assumes N > 3f
on bonar.Init
(ts, val) := (0, ⊥)
wts := 0
ack_list := [⊥]N
rid := 0
reading := false
listening := [⊥]N
answers[t] := [UNDEFINED]N for all t ≥ 0
on bonar.Write(v)// only process w
wts := wts + 1
ack_list := [⊥]N
for q ∈ Π
trigger al.Send(q, WRITE(wts, v))
on al.Deliver(p, WRITE(ts', v')) where p = w
if ts' > ts
(ts, val) := (ts', v')
for q ∈ Π
if listening[q] ≠ ⊥
trigger al.Send(q, VALUE(listening[q], ts, val))
trigger al.Send(p, ACK(ts))
on al.Deliver(q, ACK(ts')) where ts' = wts
ack_list[q] := ACK
if #ack_list > (N + f)/2
ack_list := [⊥]N
trigger bonar.WriteReturn
on bonar.Read
rid := rid + 1
reading := true
answers[t] := [UNDEFINED]N for all t ≥ 0
for q ∈ Π
trigger al.Send(q, READ(rid))
on al.Deliver(p, READ(r))
listening[p] := r
trigger al.Send(p, VALUE(r, ts, val))
on al.Deliver(q, VALUE(r, ts', v')) where r = rid and reading
if answers[ts'][q] = UNDEFINED
answers[ts'][q] := v'
if exists t, v ≠ UNDEFINED : #{p ∈ Π : answers[t][p] = v} > (N + f)/2
reading := false
answers[t'] := [UNDEFINED]N for all t' ≥ 0
for q' ∈ Π
trigger al.Send(q', READ_COMPLETE(rid))
trigger bonar.ReadReturn(v)
on al.Deliver(p, READ_COMPLETE(r)) where r = listening[p]
listening[p] := ⊥

Consensus

Events

c.Propose(v)request

Proposes value v for consensus.

c.Decide(v)indication

Outputs a decided value v of consensus.

Properties

1
Termination liveness

Every correct process eventually decides some value.

2
Validity safety

If a process decides v, then v was proposed by some process.

3
Integrity safety

No process decides twice.

4
Agreement safety

No two correct processes decide differently.

Flooding Consensus

implements Consensus as c
on c.Init
correct := Π
round := 1
decision := ⊥
received_from := [∅]N
proposals := [∅]N
received_from[0] := Π
on P.Crash(p)
correct := correct ∖ {p}
on c.Propose(v)
proposals[1] := proposals[1] ∪ {v}
trigger beb.Broadcast(PROPOSAL(1, proposals[1]))
on beb.Deliver(p, PROPOSAL(r, ps))
received_from[r] := received_from[r] ∪ {p}
proposals[r] := proposals[r] ∪ ps
when correct ⊆ received_from[round] and decision = ⊥
if received_from[round] = received_from[round − 1]
decision := min(proposals[round])
trigger beb.Broadcast(DECIDED(decision))
trigger c.Decide(decision)
else
round := round + 1
trigger beb.Broadcast(PROPOSAL(round, proposals[round − 1]))
on beb.Deliver(p, DECIDED(v)) where p ∈ correct and decision = ⊥
decision := v
trigger beb.Broadcast(DECIDED(decision))
trigger c.Decide(decision)

Hierarchical Consensus

implements Consensus as c
on c.Init
detected_ranks := ∅
round := 1
proposal := ⊥
proposer := 0
delivered := [false]N
broadcast := false
on P.Crash(p)
detected_ranks := detected_ranks ∪ {rank(p)}
on c.Propose(v) where proposal = ⊥
proposal := v
when round = rank(self) and proposal ≠ ⊥ and not broadcast
broadcast := true
trigger beb.Broadcast(DECIDED(proposal))
trigger c.Decide(proposal)
when round ∈ detected_ranks or delivered[round]
round := round + 1
on beb.Deliver(p, DECIDED(v))
r := rank(p)
if r < rank(self) and r > proposer
proposal := v
proposer := r
delivered[r] := true

Uniform consensus

Events

uc.Propose(v)request

Proposes value v for consensus.

uc.Decide(v)indication

Outputs a decided value v of consensus.

Properties

1
Termination liveness

Every correct process eventually decides some value.

2
Validity safety

If a process decides v, then v was proposed by some process.

3
Integrity safety

No process decides twice.

4
Uniform agreement safety

No two processes decide differently.

Flooding Uniform Consensus

implements UniformConsensus as uc
on uc.Init
correct := Π
round := 1
decision := ⊥
proposal_set := ∅
received_from := ∅
on P.Crash(p)
correct := correct ∖ {p}
on uc.Propose(v)
proposal_set := proposal_set ∪ {v}
trigger beb.Broadcast(PROPOSAL(1, proposal_set))
on beb.Deliver(p, PROPOSAL(r, ps)) where r = round
received_from := received_from ∪ {p}
proposal_set := proposal_set ∪ ps
when correct ⊆ received_from and decision = ⊥
if round = N
decision := min(proposal_set)
trigger uc.Decide(decision)
else
round := round + 1
received_from := ∅
trigger beb.Broadcast(PROPOSAL(round, proposal_set))

Hierarchical Uniform Consensus

implements UniformConsensus as uc
on uc.Init
detected_ranks := ∅
ack_ranks := ∅
round := 1
proposal := ⊥
decision := ⊥
proposed := [⊥]N
sent_proposal := false
sent_decided := false
on P.Crash(p)
detected_ranks := detected_ranks ∪ {rank(p)}
on uc.Propose(v) where proposal = ⊥
proposal := v
when round = rank(self) and proposal ≠ ⊥ and decision = ⊥ and not sent_proposal
sent_proposal := true
trigger beb.Broadcast(PROPOSAL(proposal))
on beb.Deliver(p, PROPOSAL(v))
proposed[rank(p)] := v
if rank(p) ≥ round
trigger pl.Send(p, ACK)
when round ∈ detected_ranks
if proposed[round] ≠ ⊥
proposal := proposed[round]
round := round + 1
on pl.Deliver(q, ACK)
ack_ranks := ack_ranks ∪ {rank(q)}
when detected_ranks ∪ ack_ranks = {1, …, N} and not sent_decided
sent_decided := true
trigger rb.Broadcast(DECIDED(proposal))
on rb.Deliver(p, DECIDED(v)) where decision = ⊥
decision := v
trigger uc.Decide(decision)

Leader-Driven Consensus

implements UniformConsensus as uc
uses EpochChange as ec
uses EpochConsensus as ep[ts]
on uc.Init
val := ⊥
proposed := false
decided := false
// obtain the leader ℓ₀ of the initial epoch with timestamp 0 from ec
ep[0] := new EpochConsensus with timestamp 0, leader ℓ₀, state (0, ⊥)
(ets, ℓ) := (0, ℓ₀)
(new_ts, new_ℓ) := (0, ⊥)
on uc.Propose(v)
val := v
on ec.StartEpoch(new_ts', new_ℓ')
(new_ts, new_ℓ) := (new_ts', new_ℓ')
trigger ep[ets].Abort
on ep[ts].Aborted(state) where ts = ets
(ets, ℓ) := (new_ts, new_ℓ)
proposed := false
ep[ets] := new EpochConsensus with timestamp ets, leader ℓ, state state
when ℓ = self and val ≠ ⊥ and not proposed
proposed := true
trigger ep[ets].Propose(val)
on ep[ts].Decide(v) where ts = ets
if not decided
decided := true
trigger uc.Decide(v)

Rotating Coordinator

implements UniformConsensus as uc
assumes N > 2f
on uc.Init
round := 1
suspected := ∅
proposal := ⊥
sent_propose := false
sent_vote := false
estimate := ⊥
votes := ∅
decided := false
on ◇P.Suspect(p)
suspected := suspected ∪ {p}
on ◇P.Restore(p)
suspected := suspected ∖ {p}
on uc.Propose(v) where proposal = ⊥
proposal := v
when leader(round) = self and proposal ≠ ⊥ and not sent_propose
sent_propose := true
trigger beb.Broadcast(PROPOSE(round, proposal))
on beb.Deliver(p, PROPOSE(r, v)) where r = round
estimate := v// proposal received from p = leader(round)
when (estimate ≠ ⊥ or leader(round) ∈ suspected) and not sent_vote
sent_vote := true
trigger beb.Broadcast(VOTE(round, estimate))
on beb.Deliver(p, VOTE(r, v)) where r = round
votes := votes ∪ {(p, v)}
when #votes > N/2 and sent_vote
V := {v : (p, v) ∈ votes}
if exists v ≠ ⊥ : V = {v}
trigger urb.Broadcast(DECIDED(v))
proposal := v
else if exists v ≠ ⊥ : V = {v, ⊥}
proposal := v
round := round + 1
sent_propose := false
sent_vote := false
estimate := ⊥
votes := ∅
on urb.Deliver(p, DECIDED(v))
if not decided
decided := true
trigger uc.Decide(v)

Lattice agreement

Events

la.Propose(I)request

Proposes a set of values I for lattice agreement.

la.Decide(D)indication

Outputs a decided set of values D of lattice agreement.

Properties

1
Validity safety

If a process p proposes I and decides D, then I ⊆ D, and every value in D was proposed by some process.

2
Consistency safety

If a process decides D and a process decides D', then D ⊆ D' or D' ⊆ D.

3
Termination liveness

Every correct process eventually decides some set.

Proposer-Acceptor Lattice Agreement

implements LatticeAgreement as la
assumes N > 2f
on la.Init
active := false
ack_count := 0
nack_count := 0
active_proposal_number := 0
proposed_value := ∅
accepted_value := ∅
on la.Propose(proposal)// proposer
proposed_value := proposal
active := true
active_proposal_number := active_proposal_number + 1
ack_count := 0
nack_count := 0
trigger beb.Broadcast(PROPOSAL(proposed_value, active_proposal_number))
on pl.Deliver(q, ACK(n)) where n = active_proposal_number
ack_count := ack_count + 1
on pl.Deliver(q, NACK(n, value)) where n = active_proposal_number
proposed_value := proposed_value ∪ value
nack_count := nack_count + 1
when nack_count > 0 and ack_count + nack_count > N/2 and active
active_proposal_number := active_proposal_number + 1
ack_count := 0
nack_count := 0
trigger beb.Broadcast(PROPOSAL(proposed_value, active_proposal_number))
when ack_count > N/2 and nack_count = 0 and active
active := false
trigger la.Decide(proposed_value)
on beb.Deliver(p, PROPOSAL(value, n))// acceptor
if accepted_value ⊆ value
accepted_value := value
trigger pl.Send(p, ACK(n))
else
accepted_value := accepted_value ∪ value
trigger pl.Send(p, NACK(n, accepted_value))

Epoch-change

Events

ec.StartEpoch(ts, ℓ)indication

Starts the epoch identified by timestamp ts with leader ℓ.

Properties

1
Monotonicity safety

If a correct process starts an epoch (ts, ℓ) and later starts an epoch (ts', ℓ'), then ts' > ts.

2
Consistency safety

If a correct process starts an epoch (ts, ℓ) and another correct process starts an epoch (ts', ℓ') with ts = ts', then ℓ = ℓ'.

3
Eventual leadership liveness

There is a time after which every correct process has started some epoch and starts no further epoch, such that the last epoch started at every correct process is epoch (ts, ℓ) and process ℓ is correct.

Leader-Based Epoch-Change

implements EpochChange as ec
on ec.Init
trusted := ℓ₀
last_ts := 0
ts := rank(self)
on Ω.Trust(p)
trusted := p
if p = self
ts := ts + N
trigger beb.Broadcast(NEWEPOCH(ts))
on beb.Deliver(ℓ, NEWEPOCH(new_ts))
if ℓ = trusted and new_ts > last_ts
last_ts := new_ts
trigger ec.StartEpoch(new_ts, ℓ)
else
trigger pl.Send(ℓ, NACK)
on pl.Deliver(p, NACK)
if trusted = self
ts := ts + N
trigger beb.Broadcast(NEWEPOCH(ts))

Epoch consensus

Events

tsparameter

The timestamp of the epoch.

ℓparameter

The leader of the epoch.

ep.Propose(v)request

Proposes value v for epoch consensus. Executed only by the leader ℓ.

ep.Abortrequest

Aborts epoch consensus.

ep.Decide(v)indication

Outputs a decided value v of epoch consensus.

ep.Aborted(state)indication

Signals that epoch consensus has completed the abort and outputs internal state state.

Properties

1
Validity safety

If a correct process ep-decides v, then v was ep-proposed by the leader ℓ' of some epoch consensus with timestamp ts' ≤ ts and leader ℓ'.

2
Uniform agreement safety

No two processes ep-decide differently.

3
Integrity safety

Every correct process ep-decides at most once.

4
Lock-in safety

If a correct process has ep-decided v in an epoch consensus with timestamp ts' < ts, then no correct process ep-decides a value different from v.

5
Termination liveness

If the leader ℓ is correct, has ep-proposed a value, and no correct process aborts this epoch consensus, then every correct process eventually ep-decides some value.

6
Abort behavior liveness, safety

When a correct process aborts an epoch consensus, it eventually will have completed the abort; moreover, a correct process completes an abort only if the epoch consensus has been aborted by some correct process.

Read/Write Epoch Consensus

implements EpochConsensus as ep with timestamp ets, leader ℓ
assumes N > 2f
on ep.Init(state)
(val_ts, val) := state
tmp_val := ⊥
states := [⊥]N
accepted := 0
on ep.Propose(v)// only leader ℓ
tmp_val := v
trigger beb.Broadcast(READ)
on beb.Deliver(p, READ) where p = ℓ
trigger pl.Send(ℓ, STATE(val_ts, val))
on pl.Deliver(q, STATE(ts, v))// only leader ℓ
states[q] := (ts, v)
when #states > N/2// only leader ℓ
(ts, v) := highest(states)
if v ≠ ⊥
tmp_val := v
states := [⊥]N
trigger beb.Broadcast(WRITE(tmp_val))
on beb.Deliver(p, WRITE(v)) where p = ℓ
(val_ts, val) := (ets, v)
trigger pl.Send(ℓ, ACCEPT)
on pl.Deliver(q, ACCEPT)// only leader ℓ
accepted := accepted + 1
when accepted > N/2// only leader ℓ
accepted := 0
trigger beb.Broadcast(DECIDED(tmp_val))
on beb.Deliver(p, DECIDED(v)) where p = ℓ
trigger ep.Decide(v)
on ep.Abort
trigger ep.Aborted((val_ts, val))
halt// stop operating when aborted

Logged epoch-change

Events

lec.StartEpoch(start_ts, start_ℓ)indication

Notifies the upper layer that variables start_ts and start_ℓ in stable storage contain the timestamp and leader of the next epoch to start; the epoch is then log-started.

Properties

1
Monotonicity safety

If a correct process log-starts an epoch (ts, ℓ) and later log-starts an epoch (ts', ℓ'), then ts' > ts.

2
Consistency safety

If a correct process log-starts an epoch (ts, ℓ) and another correct process log-starts an epoch (ts', ℓ') with ts = ts', then ℓ = ℓ'.

3
Eventual leadership liveness

There is a time after which every correct process has log-started some epoch and log-starts no further epoch, such that the last epoch log-started at every correct process is epoch (ts, ℓ) and process ℓ never crashes.

Logged Leader-Based Epoch-Change

implements LoggedEpochChange as lec
on lec.Init
trusted := ℓ₀
(start_ts, start_ℓ) := (0, ℓ₀)
ts := rank(self) − N
store(start_ts, start_ℓ)
on lec.Recovery
retrieve(start_ts, start_ℓ)
trusted := ℓ₀
ts := rank(self) − N
on Ω.Trust(p)
trusted := p
if p = self
ts := ts + N
trigger sbeb.Broadcast(NEWEPOCH(ts))
on sbeb.Deliver(ℓ, NEWEPOCH(new_ts))
if ℓ = trusted and new_ts > start_ts
(start_ts, start_ℓ) := (new_ts, ℓ)
store(start_ts, start_ℓ)
trigger lec.StartEpoch(start_ts, start_ℓ)
else if (new_ts, ℓ) ≠ (start_ts, start_ℓ)
trigger sl.Send(ℓ, NACK(new_ts))
on sl.Deliver(p, NACK(nts)) where nts = ts
if trusted = self
ts := ts + N
trigger sbeb.Broadcast(NEWEPOCH(ts))

Logged epoch consensus

Events

tsparameter

The timestamp of the epoch.

ℓparameter

The leader of the epoch.

lep.Propose(v)request

Proposes value v for logged epoch consensus. Executed only by the leader ℓ.

lep.Abortrequest

Aborts logged epoch consensus.

lep.Decide(epoch_decision)indication

Notifies the upper layer that the variable epoch_decision in stable storage contains the decided value of logged epoch consensus; the value is then log-decided.

lep.Aborted(state)indication

Signals that logged epoch consensus has completed the abort and outputs internal state state.

Properties

1
Validity safety

If a correct process log-decides v, then v was proposed by the leader ℓ' of some logged epoch consensus with timestamp ts' ≤ ts and leader ℓ'.

2
Uniform agreement safety

No two processes log-decide differently.

3
Lock-in safety

If a correct process has log-decided v in a logged epoch consensus with timestamp ts' < ts, then no correct process log-decides a value different from v.

4
Abort behavior liveness, safety

When a correct process aborts a logged epoch consensus, it eventually will have completed the abort; moreover, a correct process completes an abort only if the logged epoch consensus has been aborted by some correct process.

5
Termination liveness

If the leader ℓ never crashes, has proposed a value, and no correct process aborts this logged epoch consensus instance, then every correct process eventually log-decides some value in this instance.

Logged Read/Write Epoch Consensus

implements LoggedEpochConsensus as lep with timestamp ets, leader ℓ
assumes N > 2f
on lep.Init(state)
(val_ts, val) := state
store(val_ts, val)
tmp_val := ⊥
states := [⊥]N
accepted := ∅
on lep.Recovery
retrieve(val_ts, val)
tmp_val := ⊥
states := [⊥]N
accepted := ∅
on lep.Propose(v)// only leader ℓ
tmp_val := v
trigger sbeb.Broadcast(READ)
on sbeb.Deliver(p, READ) where p = ℓ
trigger sl.Send(ℓ, STATE(val_ts, val))
on sl.Deliver(q, STATE(ts, v))// only leader ℓ
states[q] := (ts, v)
when #states > N/2// only leader ℓ
(ts, v) := highest(states)
if v ≠ ⊥
tmp_val := v
states := [⊥]N
trigger sbeb.Broadcast(WRITE(tmp_val))
on sbeb.Deliver(p, WRITE(v)) where p = ℓ
(val_ts, val) := (ets, v)
store(val_ts, val)
trigger sl.Send(ℓ, ACCEPT)
on sl.Deliver(q, ACCEPT)// only leader ℓ
accepted := accepted ∪ {q}
when #accepted > N/2// only leader ℓ
accepted := ∅
trigger sbeb.Broadcast(DECIDED(tmp_val))
on sbeb.Deliver(p, DECIDED(v)) where p = ℓ
epoch_decision := v
store(epoch_decision)
trigger lep.Decide(epoch_decision)
on lep.Abort
trigger lep.Aborted((val_ts, val))
halt// stop operating when aborted

Logged uniform consensus

Events

luc.Propose(v)request

Proposes value v for consensus.

luc.Decide(decision)indication

Notifies the upper layer that variable decision in stable storage contains the decided value of consensus; the value is then log-decided.

Properties

1
Termination liveness

Every correct process that never crashes eventually log-decides some value.

2
Validity safety

If a process log-decides v, then v was proposed by some process.

3
Uniform agreement safety

No two processes log-decide differently.

Logged Leader-Driven Consensus

implements LoggedUniformConsensus as luc
uses LoggedEpochChange as lec
uses LoggedEpochConsensus as lep[ts]
on luc.Init
val := ⊥
decision := ⊥
aborted := false
proposed := false
// obtain the initial leader ℓ₀ from the logged epoch-change instance lec
lep[0] := new LoggedEpochConsensus with timestamp 0, leader ℓ₀, state (0, ⊥)
(ets, ℓ) := (0, ℓ₀)
store(ets, ℓ, decision)
on luc.Recovery
retrieve(ets, ℓ, decision)
retrieve(start_ts, start_ℓ) of lec
(new_ts, new_ℓ) := (start_ts, start_ℓ)
retrieve(epoch_decision) of lep[ets]
if epoch_decision ≠ ⊥ and decision = ⊥
decision := epoch_decision
store(decision)
trigger luc.Decide(decision)
val := ⊥
proposed := false
aborted := false
on luc.Propose(v)
val := v
on lec.StartEpoch(start_ts, start_ℓ)
retrieve(start_ts, start_ℓ) of lec
(new_ts, new_ℓ) := (start_ts, start_ℓ)
when (ets, ℓ) ≠ (new_ts, new_ℓ) and not aborted
aborted := true
trigger lep[ets].Abort
on lep[ts].Aborted(state) where ts = ets
(ets, ℓ) := (new_ts, new_ℓ)
store(ets, ℓ)
aborted := false
proposed := false
lep[ets] := new LoggedEpochConsensus with timestamp ets, leader ℓ, state state
when ℓ = self and val ≠ ⊥ and not proposed
proposed := true
trigger lep[ets].Propose(val)
on lep[ts].Decide(epoch_decision) where ts = ets
retrieve(epoch_decision) of lep[ets]
if decision = ⊥
decision := epoch_decision
store(decision)
trigger luc.Decide(decision)

Randomized consensus

Events

rc.Propose(v)request

Proposes value v for consensus.

rc.Decide(v)indication

Outputs a decided value v of consensus.

Properties

1
Probabilistic termination liveness

With probability 1, every correct process eventually decides some value.

2
Validity safety

If a process decides v, then v was proposed by some process.

3
Integrity safety

No process decides twice.

4
Agreement safety

No two correct processes decide differently.

Randomized Binary Consensus

implements RandomizedConsensus as rc with domain {0, 1}
uses CommonCoin as coin[r]
assumes N > 2f
on rc.Init
round := 0
phase := 0
proposal := ⊥
decision := ⊥
decided := false
val := [⊥]N
received := ∅
on rc.Propose(v)
proposal := v
round := 1
phase := 1
trigger beb.Broadcast(PHASE1(round, proposal))
on beb.Deliver(p, PHASE1(r, v)) where phase = 1 and r = round
val[p] := v
received := received ∪ {p}
when #received > N/2 and phase = 1 and decision = ⊥
if exists v ≠ ⊥ : #{p ∈ Π : val[p] = v} > N/2
proposal := v
else
proposal := ⊥
val := [⊥]N
received := ∅
phase := 2
trigger beb.Broadcast(PHASE2(round, proposal))
on beb.Deliver(p, PHASE2(r, v)) where phase = 2 and r = round
val[p] := v
received := received ∪ {p}
when #received ≥ N − f and phase = 2 and decision = ⊥
phase := 0
coin[round] := new CommonCoin with domain {0, 1}
trigger coin[round].Release
on coin[r].Output(c) where r = round
if exists v ≠ ⊥ : #{p ∈ Π : val[p] = v} > f
decision := v
trigger rb.Broadcast(DECIDED(decision))
else
if exists p ∈ Π, w ≠ ⊥ : val[p] = w
proposal := w
else
proposal := c
val := [⊥]N
received := ∅
round := round + 1
phase := 1
trigger beb.Broadcast(PHASE1(round, proposal))
on rb.Deliver(p, DECIDED(v))
if not decided
decided := true
decision := v
trigger rc.Decide(decision)

Randomized Consensus with Large Domain

implements RandomizedConsensus as rc
uses CommonCoin as coin[r]
assumes N > 2f
on rc.Init
round := 0
phase := 0
proposal := ⊥
decision := ⊥
decided := false
val := [⊥]N
received := ∅
values := ∅
on rc.Propose(v)
proposal := v
round := 1
phase := 1
trigger beb.Broadcast(PHASE1(round, proposal))
values := values ∪ {v}
trigger rb.Broadcast(PROPOSAL(v))
on rb.Deliver(p, PROPOSAL(v))
values := values ∪ {v}
on beb.Deliver(p, PHASE1(r, v)) where phase = 1 and r = round
val[p] := v
received := received ∪ {p}
when #received > N/2 and phase = 1 and decision = ⊥
if exists v ≠ ⊥ : #{p ∈ Π : val[p] = v} > N/2
proposal := v
else
proposal := ⊥
val := [⊥]N
received := ∅
phase := 2
trigger beb.Broadcast(PHASE2(round, proposal))
on beb.Deliver(p, PHASE2(r, v)) where phase = 2 and r = round
val[p] := v
received := received ∪ {p}
when #received ≥ N − f and phase = 2 and decision = ⊥
phase := 0
coin[round] := new CommonCoin with domain values
trigger coin[round].Release
on coin[r].Output(c) where r = round
if exists v ≠ ⊥ : #{p ∈ Π : val[p] = v} > f
decision := v
trigger rb.Broadcast(DECIDED(decision))
else
if exists p ∈ Π, w ≠ ⊥ : val[p] = w
proposal := w
else
proposal := c
val := [⊥]N
received := ∅
round := round + 1
phase := 1
trigger beb.Broadcast(PHASE1(round, proposal))
on rb.Deliver(p, DECIDED(v))
if not decided
decided := true
decision := v
trigger rc.Decide(decision)

Common coin

Events

Bparameter

The domain: the set of values the coin can output.

coin.Releaserequest

Releases the coin.

coin.Output(b)indication

Outputs the coin value b ∈ B.

Properties

1
Termination liveness

Every correct process eventually outputs a coin value.

2
Unpredictability randomness

Unless at least one correct process has released the coin, no process has any information about the coin output by a correct process.

3
Matching randomness

With probability at least δ, every correct process outputs the same coin value.

4
No bias randomness

In the event that all correct processes output the same coin value, the distribution of the coin is uniform over B (i.e., a matching coin outputs any value in B with probability 1/#B).

Weak Byzantine consensus

Events

wbc.Propose(v)request

Proposes value v for consensus.

wbc.Decide(v)indication

Outputs a decided value v of consensus.

Properties

1
Termination liveness

Every correct process eventually decides some value.

2
Weak validity safety

If all processes are correct and propose the same value v, then no correct process decides a value different from v; furthermore, if all processes are correct and some process decides v, then v was proposed by some process.

3
Integrity safety

No correct process decides twice.

4
Agreement safety

No two correct processes decide differently.

Byzantine Leader-Driven Consensus

implements WeakByzantineConsensus as wbc
uses ByzantineEpochConsensus as bep[ts]
on wbc.Init
val := ⊥
proposed := false
decided := false
T := 0
// obtain the leader ℓ₀ of the initial epoch with timestamp 0 from bec
bep[0] := new ByzantineEpochConsensus with timestamp 0, leader ℓ₀, state (0, ⊥, ∅)
T := T + Δ
start_timer(T)
(ets, ℓ) := (0, ℓ₀)
(new_ts, new_ℓ) := (0, ⊥)
on wbc.Propose(v)
val := v
on bec.StartEpoch(new_ts', new_ℓ')
(new_ts, new_ℓ) := (new_ts', new_ℓ')
trigger bep[ets].Abort
on bep[ts].Aborted(state) where ts = ets
(ets, ℓ) := (new_ts, new_ℓ)
proposed := false
bep[ets] := new ByzantineEpochConsensus with timestamp ets, leader ℓ, state state
T := T + Δ
start_timer(T)
when ℓ = self and val ≠ ⊥ and not proposed
proposed := true
trigger bep[ets].Propose(val)
on bep[ts].Decide(v) where ts = ets
if not decided
decided := true
trigger wbc.Decide(v)
on Timeout
trigger bld.Complain(ℓ)

Byzantine consensus

Events

bc.Propose(v)request

Proposes value v for consensus.

bc.Decide(v)indication

Outputs a decided value v of consensus.

Properties

1
Termination liveness

Every correct process eventually decides some value.

2
Strong validity safety

If all correct processes propose the same value v, then no correct process decides a value different from v; otherwise, a correct process may only decide a value that was proposed by some correct process or the special value □.

3
Integrity safety

No correct process decides twice.

4
Agreement safety

No two correct processes decide differently.

From Anchored Validity to Strong Validity

implements ByzantineConsensus as bc
uses ValidatedByzantineConsensus as vbc with predicate valid_proposed(·)
assumes N > 3f
function valid_proposed((v, Σ))
if #{p ∈ Π : verify_sig(p, bc‖PROPOSAL‖v, Σ[p])} > f
return true
else if v = □
return true
else
return false
on bc.Init
proposals := [⊥]N
Σ := [⊥]N
proposed := false
on bc.Propose(v)
σ := sign(self, bc‖PROPOSAL‖v)
for q ∈ Π
trigger al.Send(q, PROPOSE(v, σ))
on al.Deliver(p, PROPOSE(v, σ))
if proposals[p] = ⊥ and verify_sig(p, bc‖PROPOSAL‖v, σ)
proposals[p] := v
Σ[p] := σ
when exists v ≠ ⊥ : #{p ∈ Π : proposals[p] = v} > f and not proposed
proposed := true
trigger vbc.Propose((v, Σ))
when #proposals ≥ N − f and not proposed
proposed := true
if exists v ≠ ⊥ : #{p ∈ Π : proposals[p] = v} > f
trigger vbc.Propose((v, Σ))
else
trigger vbc.Propose((□, Σ))
on vbc.Decide((v', Σ'))
trigger bc.Decide(v')

Byzantine epoch-change

Events

bec.StartEpoch(ts, ℓ)indication

Starts the epoch identified by timestamp ts with leader ℓ.

Properties

1
Monotonicity safety

If a correct process starts an epoch (ts, ℓ) and later starts an epoch (ts', ℓ'), then ts' > ts.

2
Consistency safety

If a correct process starts an epoch (ts, ℓ) and another correct process starts an epoch (ts', ℓ') with ts = ts', then ℓ = ℓ'.

3
Eventual leadership liveness

There is a time after which every correct process has started some epoch and starts no further epoch, such that the last epoch started at every correct process is epoch (ts, ℓ) and process ℓ is correct.

Byzantine Leader-Based Epoch-Change

implements ByzantineEpochChange as bec
assumes N > 3f
on bec.Init
last_ts := 0
next_ts := 0
trusted := 0
new_epoch := [⊥]N
on bld.Trust(p)
trusted := p
when next_ts = last_ts and trusted ≠ leader(last_ts)
next_ts := last_ts + 1
for q ∈ Π
trigger al.Send(q, NEWEPOCH(next_ts))
on al.Deliver(p, NEWEPOCH(ts)) where ts = last_ts + 1
new_epoch[p] := NEWEPOCH
when #new_epoch > f and next_ts = last_ts
next_ts := last_ts + 1
for q ∈ Π
trigger al.Send(q, NEWEPOCH(next_ts))
when #new_epoch > 2f and next_ts > last_ts
last_ts := next_ts
new_epoch := [⊥]N
trigger bec.StartEpoch(last_ts, leader(last_ts))

Byzantine epoch consensus

Events

tsparameter

The timestamp of the epoch.

ℓparameter

The leader of the epoch.

bep.Propose(v)request

Proposes value v for epoch consensus. Executed only by the leader ℓ.

bep.Abortrequest

Aborts epoch consensus.

bep.Decide(v)indication

Outputs a decided value v of epoch consensus.

bep.Aborted(state)indication

Signals that epoch consensus has completed the abort and outputs internal state state.

Properties

1
Validity safety

If a correct process ep-decides v, then v was ep-proposed by the leader ℓ' of some epoch consensus with timestamp ts' ≤ ts and leader ℓ'.

2
Agreement safety

No two correct processes ep-decide differently.

3
Integrity safety

Every correct process ep-decides at most once.

4
Lock-in safety

If a correct process has ep-decided v in an epoch consensus with timestamp ts' < ts, then no correct process ep-decides a value different from v.

5
Termination liveness

If the leader ℓ is correct, has ep-proposed a value, and no correct process aborts this epoch consensus, then every correct process eventually ep-decides some value.

6
Abort behavior liveness, safety

When a correct process aborts an epoch consensus, it eventually will have completed the abort; moreover, a correct process completes an abort only if the epoch consensus has been aborted by some correct process.

Byzantine Read/Write Epoch Consensus

implements ByzantineEpochConsensus as bep with timestamp ets, leader ℓ
uses ConditionalCollect as cc with leader ℓ, predicate sound(·)
assumes N > 3f
on bep.Init(epoch_state)
(val_ts, val, write_set) := epoch_state
written := [⊥]N
accepted := [⊥]N
on bep.Propose(v)// only leader ℓ
if val = ⊥
val := v
for q ∈ Π
trigger al.Send(q, READ)
on al.Deliver(p, READ) where p = ℓ
trigger cc.Input(STATE(val_ts, val, write_set))
on cc.Collected(states)
// states[p] = STATE(ts, v, ws) or states[p] = UNDEFINED
tmp_val := ⊥
if exists ts ≥ 0, v ≠ ⊥ : binds(ts, v, states)
tmp_val := v
else if exists v ≠ ⊥ : unbound(states) and states[ℓ] = STATE(·, v, ·)
tmp_val := v
if tmp_val ≠ ⊥
if exists ts : (ts, tmp_val) ∈ write_set
write_set := write_set ∖ {(ts, tmp_val)}
write_set := write_set ∪ {(ets, tmp_val)}
for q ∈ Π
trigger al.Send(q, WRITE(tmp_val))
on al.Deliver(p, WRITE(v))
written[p] := v
when exists v ≠ ⊥ : #{p ∈ Π : written[p] = v} > (N + f)/2
(val_ts, val) := (ets, v)
written := [⊥]N
for q ∈ Π
trigger al.Send(q, ACCEPT(val))
on al.Deliver(p, ACCEPT(v))
accepted[p] := v
when exists v ≠ ⊥ : #{p ∈ Π : accepted[p] = v} > (N + f)/2
accepted := [⊥]N
trigger bep.Decide(v)
on bep.Abort
trigger bep.Aborted((val_ts, val, write_set))
halt// stop operating when aborted

Conditional collect

Events

ℓparameter

The leader.

Cparameter

The output predicate.

cc.Input(m)request

Inputs a message m.

cc.Collected(M)indication

Outputs a vector M of collected messages.

Properties

1
Consistency safety

If the leader is correct, then every correct process collects the same M, and this M contains at least N − f messages different from UNDEFINED.

2
Integrity safety

If some correct process collects M with M[p] ≠ UNDEFINED for some process p and p is correct, then p has input message M[p].

3
Termination liveness

If all correct processes input compliant messages and the leader is correct, then every correct process eventually collects some M such that C(M) = true.

Signed Conditional Collect

implements ConditionalCollect as cc with leader ℓ, output predicate C
assumes N > 3f
on cc.Init
messages := [UNDEFINED]N
Σ := [⊥]N
collected := false
on cc.Input(m)
σ := sign(self, cc‖self‖INPUT‖m)
trigger al.Send(ℓ, SEND(m, σ))
on al.Deliver(p, SEND(m, σ))// only leader ℓ
if verify_sig(p, cc‖p‖INPUT‖m, σ)
messages[p] := m
Σ[p] := σ
when #{p ∈ Π : messages[p] ≠ UNDEFINED} ≥ N − f and C(messages)// only leader ℓ
for q ∈ Π
trigger al.Send(q, COLLECTED(messages, Σ))
messages := [UNDEFINED]N
Σ := [⊥]N
on al.Deliver(p, COLLECTED(M, Σ')) where p = ℓ
if not collected and #{q ∈ Π : M[q] ≠ UNDEFINED} ≥ N − f and C(M) and forall q ∈ Π : M[q] = UNDEFINED or verify_sig(q, cc‖q‖INPUT‖M[q], Σ'[q])
collected := true
trigger cc.Collected(M)

Echo Conditional Collect

implements ConditionalCollect as cc with leader ℓ, output predicate C
assumes N > 3f
on cc.Init
received := [false]N
echos := [⊥]N × [⊥]N
messages := [UNDEFINED]N// only leader ℓ
sent_choice := false
choice := ⊥
collected := false
on cc.Input(m)
for q ∈ Π
trigger al.Send(q, SEND(m))
on al.Deliver(p, SEND(m))
if not received[p]
received[p] := true
for q ∈ Π
trigger al.Send(q, ECHO(p, m))
on al.Deliver(p, ECHO(s, m))
echos[s, p] := m
if self = ℓ and #{q ∈ Π : echos[s, q] = m} > 2f and messages[s] = UNDEFINED // only leader ℓ
messages[s] := m
when self = ℓ and not sent_choice and #{s ∈ Π : messages[s] ≠ UNDEFINED} ≥ N − f and C(messages) // only leader ℓ
sent_choice := true
for q ∈ Π
trigger al.Send(q, CHOICE(messages))
messages := [UNDEFINED]N
on al.Deliver(p, CHOICE(M)) where p = ℓ
if choice = ⊥ and #{s ∈ Π : M[s] ≠ UNDEFINED} ≥ N − f and C(M)
choice := M
when choice ≠ ⊥ and not collected and forall s ∈ Π : choice[s] = UNDEFINED or #{q ∈ Π : echos[s, q] = choice[s]} > f
collected := true
trigger cc.Collected(choice)

Byzantine randomized consensus

Events

brc.Propose(v)request

Proposes value v for consensus.

brc.Decide(v)indication

Outputs a decided value v of consensus.

Properties

1
Probabilistic termination liveness

With probability 1, every correct process eventually decides some value.

2
Strong validity safety

If all correct processes propose the same value v, then no correct process decides a value different from v; otherwise, a correct process may only decide a value that was proposed by some correct process or the special value □.

3
Integrity safety

No correct process decides twice.

4
Agreement safety

No two correct processes decide differently.

Byzantine Randomized Binary Consensus

implements ByzantineRandomizedConsensus as brc with domain {0, 1}
uses CommonCoin as coin[r]
assumes N > 5f
on brc.Init
round := 0
phase := 0
proposal := ⊥
decision := ⊥
val := [⊥]N
received := ∅
on brc.Propose(v)
proposal := v
round := 1
phase := 1
for q ∈ Π
trigger al.Send(q, PHASE1(round, proposal))
on al.Deliver(p, PHASE1(r, v)) where phase = 1 and r = round
val[p] := v
received := received ∪ {p}
when #received ≥ N − f and phase = 1
if exists v ≠ ⊥ : #{p ∈ Π : val[p] = v} > (N + f)/2
proposal := v
else
proposal := ⊥
val := [⊥]N
received := ∅
phase := 2
for p ∈ Π
bcb[round][p] := new ByzantineConsistentBroadcast with sender p
trigger bcb[round][self].Broadcast(PHASE2(round, proposal))
on bcb[r][p].Deliver(s, PHASE2(r', v)) where r = round and phase = 2 and r' = round
val[p] := v
received := received ∪ {p}
when #received ≥ N − f and phase = 2
phase := 0
coin[round] := new CommonCoin with domain {0, 1}
trigger coin[round].Release
on coin[r].Output(c) where r = round
if exists v ≠ ⊥ : #{p ∈ Π : val[p] = v} > 2f
if decision = ⊥
decision := v
trigger brc.Decide(decision)
proposal := v
else if exists w ≠ ⊥ : #{p ∈ Π : val[p] = w} > f
proposal := w
else
proposal := c
val := [⊥]N
received := ∅
round := round + 1
phase := 1
for q ∈ Π
trigger al.Send(q, PHASE1(round, proposal))

Validated Byzantine consensus

Events

P(·)parameter

The validity predicate.

vbc.Propose(v)request

Proposes value v for consensus.

vbc.Decide(v)indication

Outputs a decided value v of consensus.

Properties

1
Termination liveness

Every correct process eventually decides some value.

2
Anchored validity safety

Every correct process only decides a value v such that P(v) = true. Moreover, if all processes are correct and propose v, then no correct process decides a value different from v.

3
Integrity safety

No correct process decides twice.

4
Agreement safety

No two correct processes decide differently.

Total-order broadcast

Events

tob.Broadcast(m)request

Broadcasts a message m to all processes.

tob.Deliver(p, m)indication

Delivers a message m broadcast by process p.

Properties

1
Validity liveness

If a correct process p broadcasts a message m, then p eventually delivers m.

2
No duplication safety

No message is delivered more than once.

3
No creation safety

If a process delivers a message m with sender s, then m was previously broadcast by process s.

4
Agreement liveness

If a message m is delivered by some correct process, then m is eventually delivered by every correct process.

5
Total order safety

Let m1 and m2 be any two messages and suppose p and q are any two correct processes that deliver m1 and m2. If p delivers m1 before m2, then q delivers m1 before m2.

Consensus-Based Total-Order Broadcast

implements TotalOrderBroadcast as tob
uses Consensus as c[r]
on tob.Init
unordered := ∅
delivered := ∅
round := 1
wait := false
on tob.Broadcast(m)
trigger rb.Broadcast(m)
on rb.Deliver(p, m)
if (p, m) ∉ delivered
unordered := unordered ∪ {(p, m)}
when unordered ≠ ∅ and not wait
wait := true
c[round] := new Consensus
trigger c[round].Propose(unordered)
on c[r].Decide(decided) where r = round
for (s, m) ∈ sort(decided)// by the order in the resulting sorted list
trigger tob.Deliver(s, m)
delivered := delivered ∪ decided
unordered := unordered ∖ decided
round := round + 1
wait := false

Uniform total-order broadcast

Events

utob.Broadcast(m)request

Broadcasts a message m to all processes.

utob.Deliver(p, m)indication

Delivers a message m broadcast by process p.

Properties

1
Validity liveness

If a correct process p broadcasts a message m, then p eventually delivers m.

2
No duplication safety

No message is delivered more than once.

3
No creation safety

If a process delivers a message m with sender s, then m was previously broadcast by process s.

4
Uniform agreement liveness

If a message m is delivered by some process (whether correct or faulty), then m is eventually delivered by every correct process.

5
Uniform total order safety

Let m1 and m2 be any two messages and suppose p and q are any two processes that deliver m1 and m2 (whether correct or faulty). If p delivers m1 before m2, then q delivers m1 before m2.

Byzantine total-order broadcast

Events

btob.Broadcast(m)request

Broadcasts a message m to all processes.

btob.Deliver(p, m)indication

Delivers a message m broadcast by process p.

Properties

1
Validity liveness

If a correct process p broadcasts a message m, then p eventually delivers m.

2
No duplication safety

No correct process delivers the same message more than once.

3
Integrity safety

If some correct process delivers a message m with sender p and process p is correct, then m was previously broadcast by p.

4
Agreement liveness

If a message m is delivered by some correct process, then m is eventually delivered by every correct process.

5
Total order safety

Let m1 and m2 be any two messages and suppose p and q are any two correct processes that deliver m1 and m2. If p delivers m1 before m2, then q delivers m1 before m2.

Rotating Sender Byzantine Broadcast

implements ByzantineTotalOrderBroadcast as btob
uses ByzantineConsensus as bc[r]
on btob.Init
unordered := [[]]N
delivered := ∅
round := 1
wait := false
lsn := 0
next := [1]N
on btob.Broadcast(m)
lsn := lsn + 1
for q ∈ Π
trigger al.Send(q, DATA(lsn, m))
on al.Deliver(p, DATA(sn, m)) where sn = next[p]
next[p] := next[p] + 1
if m ∉ delivered
append(unordered[p], m)
when exists p ∈ Π : unordered[p] ≠ [] and not wait
wait := true
bc[round] := new ByzantineConsensus
if unordered[leader(round)] ≠ []
m := head(unordered[leader(round)])
else
m := □
trigger bc[round].Propose(m)
on bc[r].Decide(m) where r = round
s := leader(round)
if m ≠ □ and m ∉ delivered
delivered := delivered ∪ {m}
trigger btob.Deliver(s, m)
remove(unordered[s], m)
round := round + 1
wait := false

Uniform terminating reliable broadcast

Events

sparameter

The sender.

utrb.Broadcast(m)request

Broadcasts a message m to all processes. Executed only by process s.

utrb.Deliver(p, m)indication

Delivers a message m broadcast by process p or the symbol △.

Properties

1
Validity liveness

If a correct process p broadcasts a message m, then p eventually delivers m.

2
Termination safety, liveness

No process delivers more than one message, and every correct process eventually delivers one.

3
Integrity safety

If a correct process delivers some message m, then m was either previously broadcast by process s or it holds m = △.

4
Uniform agreement liveness

If any process delivers a message m, then every correct process eventually delivers m.

Consensus-Based Uniform Terminating Reliable Broadcast

implements UniformTerminatingReliableBroadcast as utrb with sender s
uses UniformConsensus as uc
on utrb.Init
proposal := ⊥
on utrb.Broadcast(m)// only process s
trigger beb.Broadcast(m)
on beb.Deliver(p, m) where p = s
if proposal = ⊥
proposal := m
trigger uc.Propose(proposal)
on P.Crash(p)
if p = s and proposal = ⊥
proposal := △
trigger uc.Propose(proposal)
on uc.Decide(decided)
trigger utrb.Deliver(s, decided)

Uniform fast consensus

Events

ufc.Propose(v)request

Proposes value v for consensus.

ufc.Decide(v)indication

Outputs a decided value v of consensus.

Properties

1
Fast termination liveness

If all processes propose the same value then every correct process decides some value after one communication step. Otherwise, every correct process eventually decides some value.

2
Validity safety

If a process decides v, then v was proposed by some process.

3
Integrity safety

No process decides twice.

4
Uniform agreement safety

No two processes decide differently.

From Uniform Consensus to Uniform Fast Consensus

implements UniformFastConsensus as ufc
uses UniformConsensus as uc
assumes N > 3f
on ufc.Init
proposal := ⊥
decision := ⊥
val := [⊥]N
on ufc.Propose(v)
proposal := v
trigger beb.Broadcast(PROPOSAL(proposal))
on beb.Deliver(p, PROPOSAL(v))
val[p] := v
if #val = N − f and decision = ⊥
if exists w ≠ ⊥ : #{q ∈ Π : val[q] = w} = N − f
decision := w
trigger ufc.Decide(w)
trigger urb.Broadcast(DECIDED(decision))
else
if exists w ≠ ⊥ : #{q ∈ Π : val[q] = w} ≥ N − 2f
proposal := w
val := [⊥]N
trigger uc.Propose(proposal)
on urb.Deliver(p, DECIDED(v))
if decision = ⊥
decision := v
trigger ufc.Decide(v)
on uc.Decide(v)
if decision = ⊥
decision := v
trigger ufc.Decide(v)

Fast Byzantine consensus

Events

fbc.Propose(v)request

Proposes value v for consensus.

fbc.Decide(v)indication

Outputs a decided value v of consensus.

Properties

1
Fast termination liveness

If all processes are correct and propose the same value, then every correct process decides some value after one communication step. Otherwise, every correct process eventually decides some value.

2
Strong validity safety

If all correct processes propose the same value v, then no correct process decides a value different from v; otherwise, a correct process may only decide a value that was proposed by some correct process or the special value □.

3
Integrity safety

No correct process decides twice.

4
Agreement safety

No two correct processes decide differently.

From Byzantine Consensus to Fast Byzantine Consensus

implements FastByzantineConsensus as fbc
assumes N > 5f
on fbc.Init
proposal := □
decision := ⊥
val := [⊥]N
on fbc.Propose(v)
proposal := v
for q ∈ Π
trigger al.Send(q, PROPOSAL(proposal))
on al.Deliver(p, PROPOSAL(v))
val[p] := v
if #val = N − f
if exists w ≠ ⊥ : #{q ∈ Π : val[q] = w} = N − f
decision := w
trigger fbc.Decide(w)
if exists w ≠ ⊥ : #{q ∈ Π : val[q] = w} > (N − f)/2
proposal := w
val := [⊥]N
trigger bc.Propose(proposal)
on bc.Decide(v)
if decision = ⊥
decision := v
trigger fbc.Decide(v)

Nonblocking atomic commit

Events

nbac.Propose(v)request

Proposes value v = COMMIT or v = ABORT for the commit.

nbac.Decide(v)indication

Outputs the decided value for the commit.

Properties

1
Termination liveness

Every correct process eventually decides some value.

2
Abort-validity safety

A process can only decide ABORT if some process proposes ABORT or a process crashes.

3
Commit-validity safety

A process can only decide COMMIT if no process proposes ABORT.

4
Integrity safety

No process decides twice.

5
Uniform agreement safety

No two processes decide differently.

Consensus-Based Nonblocking Atomic Commit

implements NonBlockingAtomicCommit as nbac
uses UniformConsensus as uc
on nbac.Init
voted := ∅
proposed := false
on P.Crash(p)
if not proposed
trigger uc.Propose(ABORT)
proposed := true
on nbac.Propose(v)
trigger beb.Broadcast(v)
on beb.Deliver(p, v)
if v = ABORT and not proposed
trigger uc.Propose(ABORT)
proposed := true
else
voted := voted ∪ {p}
if voted = Π and not proposed
trigger uc.Propose(COMMIT)
proposed := true
on uc.Decide(decided)
trigger nbac.Decide(decided)

Group membership

Events

gm.View(V)indication

Installs a new view V = (id, M) with view identifier id and membership M.

Properties

1
Monotonicity safety

If a process p installs a view V = (id, M) and subsequently installs a view V' = (id', M'), then id < id' and M ⊇ M'.

2
Uniform agreement safety

If some process installs a view V = (id, M) and another process installs some view V' = (id, M'), then M = M'.

3
Completeness liveness

If a process p crashes, then eventually every correct process installs a view (id, M) such that p ∉ M.

4
Accuracy safety

If some process installs a view (id, M) with q ∉ M for some process q ∈ Π, then q has crashed.

Consensus-Based Group Membership

implements GroupMembership as gm
uses UniformConsensus as uc[i]
on gm.Init
(id, M) := (0, Π)
correct := Π
wait := false
trigger gm.View((id, M))
on P.Crash(p)
correct := correct ∖ {p}
when correct ⊊ M and not wait
id := id + 1
wait := true
uc[id] := new UniformConsensus
trigger uc[id].Propose(correct)
on uc[i].Decide(M') where i = id
M := M'
wait := false
trigger gm.View((id, M))

View-synchronous communication

Events

vs.Broadcast(m)request

Broadcasts a message m to all processes.

vs.Deliver(p, m)indication

Delivers a message m broadcast by process p.

vs.View(V)indication

Installs a new view V = (id, M) with view identifier id and membership M.

vs.Blockindication

Requests that no new messages are broadcast temporarily until the next view is installed.

vs.BlockOkrequest

Confirms that no new messages will be broadcast until the next view is installed.

Properties

1
View inclusion safety

If some process delivers a message m from process p in view V, then m was broadcast by p in view V.

2
Validity liveness

If a correct process p broadcasts a message m, then p eventually delivers m.

3
No duplication safety

No message is delivered more than once.

4
No creation safety

If a process delivers a message m with sender s, then m was previously broadcast by process s.

5
Agreement liveness

If a message m is delivered by some correct process, then m is eventually delivered by every correct process.

6
Monotonicity safety

If a process p installs a view V = (id, M) and subsequently installs a view V' = (id', M'), then id < id' and M ⊇ M'.

7
Uniform agreement safety

If some process installs a view V = (id, M) and another process installs some view V' = (id, M'), then M = M'.

8
Completeness liveness

If a process p crashes, then eventually every correct process installs a view (id, M) such that p ∉ M.

9
Accuracy safety

If some process installs a view (id, M) with q ∉ M for some process q ∈ Π, then q has crashed.

TRB-Based View-Synchronous Communication

uses GroupMembership as gm
on vs.Init
(vid, M) := (0, ∅)// current view V = (vid, M)
flushing := false
blocked := true
in_view := ∅
delivered := ∅
pending_views := []
trb_done := ∅
on vs.Broadcast(m) where not blocked
in_view := in_view ∪ {(self, m)}
delivered := delivered ∪ {m}
trigger vs.Deliver(self, m)
trigger beb.Broadcast(DATA(vid, m))
on beb.Deliver(p, DATA(id, m))
if id = vid and not blocked and m ∉ delivered
in_view := in_view ∪ {(p, m)}
delivered := delivered ∪ {m}
trigger vs.Deliver(p, m)
on gm.View(V')
if exists M' : V' = (0, M')// start the initial view
(vid, M) := (0, M')
blocked := false
else
append(pending_views, V')
when pending_views ≠ [] and not flushing// start collective flush procedure
flushing := true
trigger vs.Block
on vs.BlockOk
blocked := true
for p ∈ M
utrb[vid][p] := new UniformTerminatingReliableBroadcast with sender p
if p = self
trigger utrb[vid][p].Broadcast(in_view)
on utrb[i][p].Deliver(s, iv) where i = vid
trb_done := trb_done ∪ {p}
if iv ≠ △
for (s', m) ∈ iv
if m ∉ delivered
delivered := delivered ∪ {m}
trigger vs.Deliver(s', m)
when trb_done = M and blocked// ready to install new view
V := head(pending_views)
remove(pending_views, V)
(vid, M) := V
flushing := false
blocked := false
in_view := ∅
trb_done := ∅
trigger vs.View((vid, M))

Direct Consensus-Based View-Synchronous Communication

uses UniformConsensus as uc[i]
on vs.Init
(vid, M) := (0, Π)// current view V = (vid, M)
correct := Π
flushing := false
blocked := false
wait := false
in_view := ∅
delivered := ∅
seen := [⊥]N
trigger vs.View((vid, M))
on vs.Broadcast(m) where not blocked
in_view := in_view ∪ {(self, m)}
delivered := delivered ∪ {m}
trigger vs.Deliver(self, m)
trigger beb.Broadcast(DATA(vid, m))
on beb.Deliver(p, DATA(id, m))
if id = vid and not blocked and m ∉ delivered
in_view := in_view ∪ {(p, m)}
delivered := delivered ∪ {m}
trigger vs.Deliver(p, m)
on P.Crash(p)
correct := correct ∖ {p}
when correct ⊊ M and not flushing
flushing := true
trigger vs.Block
on vs.BlockOk
blocked := true
trigger beb.Broadcast(INVIEW(vid, in_view))
on beb.Deliver(p, INVIEW(id, iv)) where id = vid
seen[p] := iv
when (forall p ∈ correct : seen[p] ≠ ⊥) and not wait
wait := true
vid := vid + 1
uc[vid] := new UniformConsensus
trigger uc[vid].Propose((correct, seen))
on uc[i].Decide((M', S)) where i = vid// install new view
for p ∈ M'
if S[p] ≠ ⊥
for (s, m) ∈ S[p]
if m ∉ delivered
delivered := delivered ∪ {m}
trigger vs.Deliver(s, m)
flushing := false
blocked := false
wait := false
in_view := ∅
seen := [⊥]N
M := M'
trigger vs.View((vid, M))

Uniform view-synchronous communication

Events

uvs.Broadcast(m)request

Broadcasts a message m to all processes.

uvs.Deliver(p, m)indication

Delivers a message m broadcast by process p.

uvs.View(V)indication

Installs a new view V = (id, M) with view identifier id and membership M.

uvs.Blockindication

Requests that no new messages are broadcast temporarily until the next view is installed.

uvs.BlockOkrequest

Confirms that no new messages will be broadcast until the next view is installed.

Properties

1
View inclusion safety

If some process delivers a message m from process p in view V, then m was broadcast by p in view V.

2
Validity liveness

If a correct process p broadcasts a message m, then p eventually delivers m.

3
No duplication safety

No message is delivered more than once.

4
No creation safety

If a process delivers a message m with sender s, then m was previously broadcast by process s.

5
Uniform agreement liveness

If a message m is delivered by some process (whether correct or faulty), then m is eventually delivered by every correct process.

6
Monotonicity safety

If a process p installs a view V = (id, M) and subsequently installs a view V' = (id', M'), then id < id' and M ⊇ M'.

7
Uniform agreement (views) safety

If some process installs a view V = (id, M) and another process installs some view V' = (id, M'), then M = M'.

8
Completeness liveness

If a process p crashes, then eventually every correct process installs a view (id, M) such that p ∉ M.

9
Accuracy safety

If some process installs a view (id, M) with q ∉ M for some process q ∈ Π, then q has crashed.

Consensus-Based Uniform View-Synchronous Communication

uses UniformConsensus as uc[i]
on uvs.Init
(vid, M) := (0, Π)// current view V = (vid, M)
correct := Π
flushing := false
blocked := false
wait := false
pending := ∅
delivered := ∅
ack[m] := ∅ for all m
seen := [⊥]N
trigger uvs.View((vid, M))
on uvs.Broadcast(m) where not blocked
pending := pending ∪ {(self, m)}
trigger beb.Broadcast(DATA(vid, self, m))
on beb.Deliver(p, DATA(id, s, m))
if id = vid and not blocked
ack[m] := ack[m] ∪ {p}
if (s, m) ∉ pending
pending := pending ∪ {(s, m)}
trigger beb.Broadcast(DATA(vid, s, m))
when exists (s, m) ∈ pending : M ⊆ ack[m] and m ∉ delivered
delivered := delivered ∪ {m}
trigger uvs.Deliver(s, m)
on P.Crash(p)
correct := correct ∖ {p}
when correct ⊊ M and not flushing
flushing := true
trigger uvs.Block
on uvs.BlockOk
blocked := true
trigger beb.Broadcast(PENDING(vid, pending))
on beb.Deliver(p, PENDING(id, pd)) where id = vid
seen[p] := pd
when (forall p ∈ correct : seen[p] ≠ ⊥) and not wait
wait := true
vid := vid + 1
uc[vid] := new UniformConsensus
trigger uc[vid].Propose((correct, seen))
on uc[i].Decide((M', S)) where i = vid// install new view
for p ∈ M'
if S[p] ≠ ⊥
for (s, m) ∈ S[p]
if m ∉ delivered
delivered := delivered ∪ {m}
trigger uvs.Deliver(s, m)
flushing := false
blocked := false
wait := false
pending := ∅
ack[m] := ∅ for all m
seen := [⊥]N
M := M'
trigger uvs.View((vid, M))

Logged uniform total-order broadcast

Events

lutob.Broadcast(m)request

Broadcasts a message m to all processes.

lutob.Deliver(delivered)indication

Notifies the upper layer of potential updates to variable delivered in stable storage, where delivered is a sequence of sender/message pairs. A message is log-delivered once it appears in delivered.

Properties

1
Validity liveness

If a process that never crashes broadcasts a message m, then every correct process eventually log-delivers m.

2
No duplication safety

No message is log-delivered more than once.

3
No creation safety

If a process log-delivers a message m with sender s, then m was previously broadcast by process s.

4
Uniform agreement liveness

If a message m is log-delivered by some process (whether correct or faulty), then m is eventually log-delivered by every correct process.

5
Logged uniform total order safety

For any two processes p and q, suppose p log-delivers a sequence of messages dp and q log-delivers a sequence of messages dq. Then dp is either a prefix of dq or dq is a prefix of dp.

Logged Uniform Total-Order Broadcast

uses LoggedUniformConsensus as luc[r]
on lutob.Init
unordered := ∅
delivered := []
round := 1
recovering := false
wait := false
proposals[r] := ⊥ for all r > 0
store(proposals)
on lutob.Recovery
unordered := ∅
delivered := []
round := 1
recovering := true
wait := false
retrieve(proposals)
if proposals[1] ≠ ⊥
trigger luc[1].Propose(proposals[1])
else
recovering := false
on lutob.Broadcast(m)
trigger lurb.Broadcast(m)
on lurb.Deliver(lurb_delivered)
unordered := unordered ∪ lurb_delivered
when unordered ∖ delivered ≠ ∅ and not wait and not recovering
wait := true
luc[round] := new LoggedUniformConsensus
proposals[round] := unordered ∖ delivered
store(proposals)
trigger luc[round].Propose(proposals[round])
on luc[r].Decide(decided) where r = round
for (s, m) ∈ sort(decided)// by the order in the resulting sorted list
append(delivered, (s, m))
store(delivered)
round := round + 1
if recovering
if proposals[round] ≠ ⊥
trigger luc[round].Propose(proposals[round])
else
recovering := false
else
wait := false
trigger lutob.Deliver(delivered)

Replicated state machine

Events

rsm.Execute(command)request

Requests that the state machine executes the command given in command.

rsm.Output(response)indication

Indicates that the state machine has executed a command with output response.

Properties

1
Agreement safety, liveness

All correct processes obtain the same sequence of outputs.

2
Termination liveness

If a correct process executes a command, then the command eventually produces an output.

Replicated State Machine using Total-Order Broadcast

implements ReplicatedStateMachine as rsm
on rsm.Init
state := initial_state
on rsm.Execute(command)
trigger utob.Broadcast(command)
on utob.Deliver(p, command)
(response, new_state) := execute(command, state)
state := new_state
trigger rsm.Output(response)