Saral Shiksha Yojna
Courses/Distributed Systems

Distributed Systems

CS3.401
Prof. Kishore KothapalliMonsoon 2025-264 credits

Crash Consensus + Byzantine Agreement (OM(m), Phase King) + FLP

NotesStoryCaveman
Unit 7 — Consensus & Byzantine Agreement

Whole tribe must point same way, even when some go bad

Consensus — a bunch of stone-computers (nodes) must all agree on ONE value, even though some are broken or lying. Sound easy. Is the HARDEST thing in the cave. How hard depends only on HOW the bad ones go bad.

Three shapes of the agree-problem

  • Consensus — every hunter starts with his own value. All good hunters must land on ONE value. Big rule: if EVERYONE starts with the same , they MUST decide . No inventing new berries.
  • Interactive consistency — agree on a whole ROW of values , one slot per hunter. If hunter is good and holds , then slot MUST be .
  • Byzantine agreement (BA) — one hunter is the shouter (source). He broadcasts one value; all good hunters must agree on what he said.

Handy: BA solves all three — learn BA, you learn all.

Two kinds of bad hunter

Crash failure — hunter falls down, goes silent, sends nothing more. Never lies. Once fallen, stays fallen.

Byzantine failure — hunter goes EVIL. Sends wrong values. Tells Ugg one thing, tells Grok a different thing. Stays quiet to trick. Lies about what he heard.

Dead-quiet hunter is easy. Lying hunter is the nightmare by the fire.

Easy fire: only fallers, no liars

Say hunters, up to may fall (), and the cave is synchronous (rounds tick together, silence gets noticed). Run rounds. Each round: shout your value to all, wait for the round's shouts, then keep the SMALLEST rock you saw:

After the last round, decide . Why it works:

  • Termination — always exactly rounds. Fixed.
  • Validity — only real inputs ever move around. All start the same, so only that value can exist.
  • Agreement — if Grok decided a smaller rock than Ugg, some faller had to hide that rock from Ugg by crashing mid-shout, round after round — a chain of crashes. But only can fall! One short. Cannot happen.

Cost: rounds, about shouts each, so shouts total. Cheap and polynomial.

Hard fire: when hunters LIE

Now three stone-carved laws box you in:

1. **Need — more than two-thirds of the tribe must be good. Fewer than that? No recipe EXISTS. Impossible, not just hard. 2. Need at least rounds. Cannot rush it. 3. In a no-clock (asynchronous) cave, NO fixed recipe works at all — even with a single quiet faller. This is the FLP** curse (Fischer-Lynch-Paterson, 1985).

Why three hunters with one liar always breaks

Source , lieutenants and ; exactly one may be evil.

Story A: is good, says 0 to both. Evil whispers to , " said 1." So sees " said 0, says said 1." Since and are both good, must decide 0.

Story B: is evil, says 0 to but 1 to . Now sees " said 0, says said 1" — the SAME eyes as Story A! So decides 0 again. But sees " said 1, says said 0" and must decide 1. Both and are good, yet they split. Broken. So is impossible — stretch the same trick and you always need .

OM(m): pass the whisper down the line

Lamport-Shostak-Pease Oral Messages — call it OM(m) — is the classic recursive recipe, with resilience number .

  • Bottom case OM(0): the general shouts his value to all lieutenants; each just takes what he heard (or "undef" on silence).
  • Recursive case OM(t), : the general shouts to all; then each lieutenant BECOMES a little general and runs OM(t-1) to pass that value to the other lieutenants. After rounds, each hunter takes the majority of all the values he gathered.

OM's rules: every message arrives, you always know WHO spoke, silence is detectable, and a liar may twist his OWN words but cannot FORGE another's word in flight.

OM tolerates liars when , and needs rounds — but the shouts explode to , which is exponential. That is OM's big curse. (Check: , even a lying general leaves each loyal lieutenant with , majority 0. All good ones agree.)

Phase King: crown a chief each phase

OM's shout-explosion is too costly for many liars. Phase King trades MORE hunters for FEWER shouts: it needs (more than OM), but the protocol is simple. Run phases, each with 2 rounds, so rounds total, and only polynomial shouts. Each phase:

  • Round 1: everyone shouts their current value. Each hunter finds the majority value AND its multiplicity (how many voted for it).
  • Round 2: the phase's crowned king shouts his value . Then each hunter decides:

Meaning: keep your own majority ONLY if it is strong (more than voters); else trust the king. Why it works: phases with at most evil kings means at least ONE king is good; after that king's phase all good hunters lock onto one value and it sticks. Why ? The strong-majority threshold must beat liars PLUS a split honest vote, forcing .

OM vs Phase King — which spear to grab

  • Hunters needed: OM ; Phase King (PK needs more).
  • Rounds: OM ; PK .
  • Shouts: OM exploding; PK tame.
  • Shape: OM is tricky recursion; PK is simple two-round phases.

Small ? OM is fine. Big ? Phase King wins.

FLP: what the curse really says (and does not)

FLP kills only the DETERMINISTIC recipe in an ASYNCHRONOUS cave. It does NOT say consensus is impossible everywhere. Real tribes dodge it: assume clocks eventually behave (partial synchrony gives Paxos, Raft), or throw bones (randomization gives Ben-Or, Honey Badger BFT), or accept eventual "good enough." One more trick: if hunters sign their words (authenticated Byzantine), the bound drops to — but you need the signing magic.

Ugg warn: no do this!

  • No say "Byzantine needs ." That is only for SIGNED-word Byzantine. Plain talk needs .
  • No say "OM is cheap or polynomial." OM is EXPONENTIAL; Phase King is the polynomial one.
  • No mix them up: Consensus = each hunter has own input; BA = the source broadcasts; interactive consistency = agree on a whole row.
  • No say "FLP means consensus is always impossible." FLP kills only deterministic async; randomized and synchronous recipes still work.
  • No say "Phase King needs ." It needs — more hunters, but fewer shouts.

Ugg remember

  • Consensus = the tribe agrees on one value despite bad hunters. Three shapes exist, and BA solves all three.
  • Crash (silent fallers): rounds, shouts, just take the min each round. Easy.
  • Byzantine (liars): need and at least rounds; is impossible because good hunters get identical, look-alike views.
  • OM(m): recursive, , rounds, but EXPONENTIAL shouts. Phase King: , rounds, polynomial shouts, and one honest king saves the tribe.
  • FLP: no deterministic consensus in a no-clock cave — dodge it with clocks (Paxos/Raft), bones (randomization), or signatures ().
End of storyUnit 7 — Consensus & Byzantine Agreement · Crash Consensus + Byzantine Agreement (OM(m), Phase King) + FLP