← The Books

The Limits of Agreement

Can machines always agree when one of them may stop silently and messages take any time at all?

We find out by exploring how four mercenaries at the foot of a hill, unable to see one another, tried to agree whether to attack or hold when any of them might be dead.

After Michael J. Fischer, Nancy A. Lynch and Michael S. Paterson, Impossibility of Distributed Consensus with One Faulty Process, 1985

Under a full moon a mercenary in an oxblood-red cloak sits alone at the mouth of his tent at the foot of a steep hill, looking up towards a ruined ring wall on the skyline
Where this book sits
Draws on
Leads to

Each link is an idea one paper took from another. Point at one, or tap it, to read how.

a paper this book retells a paper retold in another book a paper outside the series

First, in machine terms

Many computers, one decision

A group of computers must all settle on the same one of two values, and the value must depend on what the machines started with.

Two things stand in the way. A message may take any time at all: every message arrives, but no delay is too long to be possible. And one machine may stop at any moment, without a word. A machine that hears nothing cannot tell which has happened.

  • No guaranteed decision (Fischer, Lynch and Paterson, 1985): no protocol that acts only on what it has received can guarantee that the group ever decides.
  • Only the ending is lost. No two machines are made to decide differently. What cannot be promised is that the waiting ends.

We tell it with four mercenaries, their ravens, and a hill they must take together or not at all.

Crashed, or only slow?

MACHINE A
?
MACHINE B

A has asked B for its value and is waiting for the reply.

A lone linen tent with a shield and a chest on a rocky slope below a ring wall on the summit, cypresses and pines around it
The foot of Mount Phyle

Four tents, out of sight of one another

Four mercenaries are camped at the foot of Mount Phyle, one to a tent, out of sight of one another and under nobody's command.* Bandits hold the top of the hill, and the four have one question to settle about it.

Only ravensThe four send word to one another only by raven. Every raven arrives, but no raven has a longest flight.
Nobody liesNo man at the foot ever misreports anything, and a raven brings exactly what was written.
Any man may dieAny one of the four may be killed. A dead man's tent simply falls silent: nobody takes the dead man's place, and no bird reports the death.
One question, two answers

Attack, or hold

The question is whether to attack the hill or to hold, and the four mercenaries must all give the same answer. Attacking, they climb together. Holding, each man guards the path down one gully and the hill stays closed. Half attacking while half hold is worse than either: too few to climb, and a hill left open.

Each man formed an opinion at dusk, attack or hold, from what could be seen of that man's own quarter. A man commits by leaving the tent, to climb with the others or to guard a gully, and will not be back before dawn. The four want three things of whatever plan they follow.

First demand

No two commit differently

Nobody attacks while another holds.

Second demand

Both answers stay possible

What they do must depend on what they saw.

Third demand

Somebody eventually commits

Sooner or later at least one man leaves the tent.

The second demand shuts out the plan of holding whatever anyone saw, which keeps the first demand and makes the evening pointless. The third shuts out the plan under which nobody ever moves, which keeps the first two for free. One more condition binds the four: they may not draw lots. Each man acts on what has arrived at that man's tent and nothing else.

Two plans come to mind at once. Try each on the sightings below, then try the second again on a night when tent 3 stays silent, and watch which demand is given up.

Two easy plans try each

The hill from above. The badge beside each tent is what that man saw at dusk: A for attack, H for hold.

Each easy plan keeps two demands. Find the one it gives up.

Waiting for every report keeps all three demands while every man answers, and nobody lies at the foot, so it looks like a sound plan. What it gives up shows only when a tent stays silent, and the reason lies in the birds.

The difficulty, entire

A dead man, or a slow bird?

The birds can be trusted in every way but one. The ravens always arrive, they bring exactly what was written, and they come in no particular order. But they take as long as they take.

A raven may sit in the wooded gullies for an hour or for the night, so no hour comes after which a man can say that nothing more is on its way. A man may always walk to the perch and find nothing there, and that is not news.

Now add that any one of the four may be killed, and that a dead man's tent simply falls silent. A man waiting on a tent that has not answered is then in one of two situations. Wait at tent 2's perch below, and see whether the hours tell them apart.

A tent and a chest in a wooded gully by moonlight, a shield leaning on the chest, and a bare bird perch with nothing on it

Two nights seen from tent 2's perch

One night

Suppose the man at tent 1 is dead. No bird will ever come.

Tent 2's perchempty
Another night

Suppose tent 1's man is well. The raven went out hours ago and is sitting in a pine.

Tent 2's perchempty

Tent 2 has heard nothing from tent 1. Which night is this?

Both nights look like an empty perch, and waiting longer never turns one into the other. So a plan cannot wait for every report: whenever one man is dead it waits for ever, and can never learn of the death. Each man must act, at some point, without hearing from everyone.

Somewhere in the night, then, the matter gets settled without everyone having been heard. The chance that one tent falls silent is enough to force that, and the next thing to say is when it happens.

Three words the argument needs

When is the matter settled?

Saying when the matter is settled takes three words that ordinary speech lacks.

A position

How the night stands, entire

A position is what each of the four men holds in mind, together with every raven aloft and not yet taken in.

An arrival

One man takes in one raven

An arrival is the only kind of thing that happens. Going to the perch and finding nothing counts as a turn, and changes nothing.

Open or closed

Does the order of arrivals still matter?

A position is open if the night can still end in holding and can still end in attacking. A position is closed if only one answer remains.

Open does not describe what anyone thinks. It says only that the answer still depends on the order in which the birds arrive. Once any man has committed, the position is closed, so the matter is settled wherever the night stops being open.

The first tool of the argument is about that order. Below, let one pair of tents trade ravens first, start the night again, let the other pair go first, and compare how the night stands at the end.

Separate folds run them in either order

Each line is one tent, at one moment after another, and each ring further out is later. A raven is an arc from one tent to another. A hollow dot is a man who has not committed.

Tents 1 and 2 have ravens to trade, and so have tents 3 and 4. Which pair goes first?

Two runs of arrivals with no man in common do not interfere: run either first, and the night arrives at the same position. The reason is that an arrival is one man taking in one raven and perhaps writing more. All of that belongs to the one man or to the air, and none of it to anybody else.

With these words the question has a sharper form. At dusk every man has a sighting and no bird has flown. The first thing to find out is whether the night is closed already, by the sightings alone.

Proof · courses with no man in common commute

In the paper's terms a position is a configuration, an arrival an event, a course a schedule, a fair course an admissible run, and open and closed are bivalent and univalent. Lemma 1. Let courses σ₁ and σ₂ both be applicable at a position, and let the set A of men who act in σ₁ and the set B of men who act in σ₂ be disjoint. Then each can be run after the other, and both orders reach the same position.

  1. A position is what is in each man's head together with the ravens aloft. An arrival changes two parts of it: the one man who takes the raven in, and the air — one raven removed, perhaps others added.
  2. Let σ₁ touch a set of men A and σ₂ a set B, disjoint. Running σ₁ alters only men in A, which σ₂ never reads; and conversely.
  3. Neither disables the other through the air: ravens are addressed, so those σ₂ consumes are addressed into B, and σ₁ removes only ravens addressed into A. Both orders are therefore applicable.
  4. In either order, the men of A have taken exactly the arrivals of σ₁ and those of B exactly the arrivals of σ₂, each in its own order, and the air has had the same ravens removed and added. So the positions reached are the same.∎
The night can begin open

The dusk that settles nothing

The sightings at dusk do not always close the night. To see why, line up some possible beginnings so that each differs from the next in one man's sighting, with all-hold at one end and all-attack at the other.

Suppose every beginning in the row were already settled by the sightings alone. The second demand forces the two ends opposite ways. The three in between are yours to settle. Click a beginning to change it, and watch the two that are marked.

A row of beginnings click the middle three

However the row is settled, two neighbours split, and the supposition fails. Nobody died to make that argument work. The other three could not tell a silent man from a slow one, and so could not tell two different beginnings apart. However the four arrange their affairs, the sightings can fall so that the night begins open.

The night can begin open, then. It still seems that it cannot stay open for ever, and that some arrival, sooner or later, must be the one that closes it.

Proof · some beginning is open

In the paper's terms a position is a configuration, an arrival an event, a course a schedule, a fair course an admissible run, and open and closed are bivalent and univalent. A beginning is an initial configuration: the four sightings, with no raven yet aloft. Lemma 2. Whatever the four have arranged, some beginning is open.

  1. Suppose every beginning were closed, each already fated by the sightings alone.
  2. Both fates occur: the second demand forces holding where all four saw hold, and attacking where all four saw attack.
  3. Call two beginnings neighbours when they differ in one man's sighting. Walking from a hold-fated beginning to an attack-fated one by single changes, there must be neighbours B₀ and B₁ fated to hold and to attack, differing only in the sighting of one man p.
  4. Take a fair course from B₀ in which p never stirs; this is permitted, since at most one man may be silent. Being fair, it ends in holding.
  5. Run the same course from B₁. Since p never acts and p's sighting is the only difference, every other man sees exactly the same arrivals in the same order, so the course ends in holding here too.
  6. But B₁ was fated to attack, and a fated beginning admits no course to the other answer. Hence some beginning is open.∎
No arrival has to close it

The raven that would settle it can always be held back

No arrival has to be the one that closes the night. Whichever raven would have settled the matter, the night can go on without it for a while, then take it in, and be open still.

The raven is never kept from landing, because the birds are reliable. The argument asks only whether its landing must settle anything. Scroll slowly, and the picture moves with you.

1 · An open night

One raven is about to land

The night stands open: it can still end either way. One raven is waiting to be taken in. The birds are reliable, so it will land. What is in doubt is whether it must settle anything when it does.

2 · Hold it back

Other arrivals can come first

The top row is the night going on while that raven waits, one arrival at a time. Under each position is the position once the raven lands there.

3 · Suppose

Suppose its landing always settled the night

Then every position in the bottom row is closed, for holding or for attacking. Both must appear, because the night at the top could still end either way.

4 · Neighbours

Somewhere, two neighbours split

Two positions in the top row are one arrival apart. Land the raven at the first and the night is settled for holding. Land it at the second and the night is settled for attacking.

5 · Another tent's arrival

Then the order cannot matter

If that one arrival is another man's business, it and the raven are separate folds: either order reaches the same position. So one more arrival leads from a night settled for holding to a night settled for attacking. That cannot be.

6 · The same tent's arrival

Then let that man go quiet

If both arrivals are one man's business, let that man go quiet, as a man does whose birds are in the pines. The other three must finish without the quiet man. From where they finish, the raven alone still leads to holding, while the quiet man's other arrival and then the raven still leads to attacking. A finished night would still be open. That cannot be either.

7 · So

The raven lands, and the night is open still

The supposition fails. Somewhere in the bottom row a position is open. No single raven is ever the one that has to settle the matter.

Whatever arrives while the raven waits is either another tent's business, so that the order cannot matter, or the same tent's, and then that man can go quiet and the rest cannot tell which landed first. Two facts are now in hand: the night can begin open, and no single arrival need close it. What is left is to see the night they make when both are used without rest.

Proof · an arrival can always be deferred and the night left open

In the paper's terms a position is a configuration, an arrival an event, a course a schedule, a fair course an admissible run, and open and closed are bivalent and univalent. Lemma 3. Let C be an open position and e an arrival applicable at C. Let 𝒞 be the set of positions reachable from C without allowing e, and 𝒟 the set got by allowing e at each position of 𝒞. Then 𝒟 contains an open position.

  1. Let C be open and e an arrival applicable there. Write 𝒞 for the positions reachable from C without allowing e, and 𝒟 for those got by allowing e at each position of 𝒞. Suppose no member of 𝒟 is open.
  2. Both settlements occur in 𝒟. C is open, so some course from it ends in holding and another in attacking. If such a course never allows e, its positions lie in 𝒞 and allowing e at the end gives a member of 𝒟 settled the same way; if it does allow e, the position just after is already in 𝒟.
  3. So 𝒞 holds neighbours that split. 𝒞 is connected, so walking from the position whose image is settled for holding to the one whose image is settled for attacking gives C₀ and C₁ = f(C₀), one arrival apart, whose images D₀ and D₁ are settled opposite ways.
  4. Case one: f is another man's arrival. By the lemma of separate folds e and f commute, so D₁ = f(D₀). But everything reachable from the hold-settled D₀ is settled for holding, and D₁ is settled for attacking.
  5. Case two: f is the same man's arrival, say p's. Take a course σ from C₀ in which p never stirs and which does finish; permitted, since p may be the one silent man. Call the position it reaches A.
  6. σ has no man in common with e or f, so by the lemma it may be run from D₀ and from D₁ as well, reaching e(A) and f then e applied to A — settled for holding and for attacking respectively. So A is open, though σ finished there.
  7. Both cases are impossible, so 𝒟 holds an open position.∎
Two facts, used without rest

A fair night in which nothing is ever settled

Used without rest, the two facts make a night that is entirely fair and never closes. Start from a dusk that leaves the night open, keep the four men in a queue, and let whoever orders the arrivals choose each one so that the night is open after it.

The man at the head of the queue takes in the raven longest aloft for that tent, or walks to the perch and back if none is waiting, and then goes to the back of the queue. Every man's turn comes round again and the oldest raven is always taken first, so no man is starved of a turn and every raven is taken in at last.

Let the night run, and watch the count of men committed. Then give the birds a longest flight, and watch it again.

The night not yet begun

0arrivals taken in0ravens aloft0men committed

No man is starved of a turn, and every raven is taken in at last.

The picture shows the pattern of the argument, not a worked plan: the turns and the ravens are real, and that the night stays open is what the two facts guarantee for any plan the four could have made.

Run for ever, that night is entirely fair, and at every stage of it nothing has been settled. The same night can be arranged against any plan the four could have made, however ingenious.

No plan guarantees that anybody ever commits

Nobody dies in it. The one death the argument allowed was spent on the reasoning and never on the hill. What limits the four is the possibility of a death, which looks exactly like a slow bird.

Nothing goes wrong. Nobody commits to a wrong answer, because nobody commits at all.

One would have been enough. The demand was only that somebody commit, and even that fails.

The hill has nothing to do with it. The same conclusion holds for any number of men from two upward and any two answers.

Mount Phyle from the air: a steep wooded crag with a ruined wall on top

The night ended differently once the birds had a longest flight. That shows where to look for what the four would need.

Three ways out

What would have to change

What the four would need is some way to tell a dead man from a slow bird. Slow birds alone are no trouble, and neither are birds that arrive out of order. The trouble is two things together: no longest flight, and a dead man looking exactly like a slow bird. Three changes would each take it away.

One

A longest flight

Give the birds a longest flight, and enough silence means something.

Two

Some report of who has died

The report must in the end name every dead man, and in the end stop naming at least one living one. Such a report is enough while more than half live.

Three

Every death before dusk

If no man can die once the evening has begun, a majority can manage.

None of the three is on offer at the foot of the hill. The first is on offer at the top, where the bandits' rats have a longest run.*

Back to machines

The camp was a group of machines

Read the camp again with machines in the tents. Every tent is a process, every raven is a message, and a tent that falls silent is a machine that has stopped. Hover over a row, or tap it, to see who is who.

At the foot of the hill
In the machine room

When messages may take any time and even one machine may stop, no protocol can guarantee that the group ever decides.

Agreement itself is never broken. What cannot be promised is an end to the waiting.

Practical protocols live with this by changing the rules a little: delays that are bounded in the end, an imperfect report of who has failed, or a coin.

Setting The Foot of Mount Phyle

The paper behind this book

The paper behind this book. Michael J. Fischer, Nancy A. Lynch and Michael S. Paterson, “Impossibility of Distributed Consensus with One Faulty Process,” Journal of the ACM 32, 2 (April 1985), 374–382.

The ideas. No deterministic protocol can guarantee consensus in an asynchronous system in which even one process may crash. The proof turns on bivalence: a configuration from which both decisions are still reachable. There is always a bivalent initial configuration, and from any bivalent configuration the step that would resolve the indecision can be deferred and then taken without resolving it — so a scheduler can build an admissible run that never decides. Three details carry the weight: the run the proof constructs contains no failure at all, the single permitted fault being spent on the argument; agreement and validity are never violated, only termination is lost; and the result bites even though the requirement is merely that some process decide. The obstruction is not slowness but the inability to distinguish a crashed process from a slow one. Relax it — bound the delays, even only eventually, or supply an imperfect oracle about who has failed — and consensus becomes solvable again; the paper's own §4 relaxes it by letting processes die only before the protocol begins, and gives a protocol that works whenever a majority are sound.

Fischer, M. J., Lynch, N. A., and Paterson, M. S. Impossibility of distributed consensus with one faulty process. J. ACM 32, 2 (1985), 374–382.

Dwork, C., Lynch, N., and Stockmeyer, L. Consensus in the presence of partial synchrony. J. ACM 35, 2 (1988), 288–323.

Chandra, T. D., and Toueg, S. Unreliable failure detectors for reliable distributed systems. J. ACM 43, 2 (1996), 225–267.