FLP Impossibility of Consensus Yan Ji Oct 26, 2017 Slides - - PowerPoint PPT Presentation

flp impossibility of consensus
SMART_READER_LITE
LIVE PREVIEW

FLP Impossibility of Consensus Yan Ji Oct 26, 2017 Slides - - PowerPoint PPT Presentation

FLP Impossibility of Consensus Yan Ji Oct 26, 2017 Slides inspired by Lorenzo Alvisi (CS5414 FA16) slides and Philip Daian (CS6410 FA16) slides I think you ought to know I'm feeling very depressed. I think you ought to know I'm feeling


slide-1
SLIDE 1

FLP Impossibility of Consensus

Yan Ji Oct 26, 2017 Slides inspired by Lorenzo Alvisi (CS5414 FA16) slides and Philip Daian (CS6410 FA16) slides

slide-2
SLIDE 2
slide-3
SLIDE 3

I think you ought to know I'm feeling very depressed.

slide-4
SLIDE 4

I think you ought to know I'm feeling very depressed. I have a million ideas, but, they all point to certain death…

slide-5
SLIDE 5

FLP Impossibility of Consensus

Yan Ji Oct 26, 2017 Slides inspired by Lorenzo Alvisi (CS5414 FA16) slides and Philip Daian (CS6410 FA16) slides

slide-6
SLIDE 6

Timeline

slide-7
SLIDE 7

Impossibility of distributed consensus with

  • ne faulty process (1985)

2001 Dijkstra prize for the most influential paper in distributed computing

Michael Fischer, Yale University

Distributed computing, Cryptography

Nancy Lynch, MIT

Distributed computing theory: Algorithms and lower bounds, Modeling and verification, Wireless networks, Biological algorithms

Mike Paterson, University of Warwick

Algorithms, Complexity

slide-8
SLIDE 8

FLP Result It is impossible to have a deterministic protocol that solves consensus in a message-passing asynchronous system in which at most one process may fail by crashing.

slide-9
SLIDE 9

The Intuition

Considering how Paxos works, what is the most difficult part for reaching consensus in an asynchronous distributed system?

slide-10
SLIDE 10

When does liveness fail in Paxos

1. P1 receives promises for n1

slide-11
SLIDE 11

When does liveness fail in Paxos

1. P1 receives promises for n1 2. P2 receives promises for n2 > n1 3. P1 sends proposal numbered n1, rejected

slide-12
SLIDE 12

When does liveness fail in Paxos

1. P1 receives promises for n1 2. P2 receives promises for n2 > n1 3. P1 sends proposal numbered n1, rejected 4. P1 receives promises for n1′ > n2 5. P2 sends proposal numbered n2, rejected

slide-13
SLIDE 13

When does liveness fail in Paxos

1. P1 receives promises for n1 2. P2 receives promises for n2 > n1 3. P1 sends proposal numbered n1, rejected 4. P1 receives promises for n1′ > n2 5. P2 sends proposal numbered n2, rejected 6. P1 receives promises for n2′ > n1’ 7. P1 sends proposal numbered n1′ , rejected

slide-14
SLIDE 14

When does liveness fail in Paxos

1. P1 receives promises for n1 2. P2 receives promises for n2 > n1 3. P1 sends proposal numbered n1, rejected 4. P1 receives promises for n1′ > n2 5. P2 sends proposal numbered n2, rejected 6. P1 receives promises for n2′ > n1’ 7. P1 sends proposal numbered n1′ , rejected 8. . . .

slide-15
SLIDE 15

The Intuition

Considering how Paxos works, what is the most difficult part for reaching consensus in an asynchronous distributed system?

slide-16
SLIDE 16

The Intuition

Considering how Paxos works, what is the most difficult part for reaching consensus in an asynchronous distributed system? CANNOT DISTINGUISH between processes:

  • Crash failure
  • Slow (e.g. in processing or network message delivering)
slide-17
SLIDE 17

Assumption

It is impossible to have a deterministic protocol that solves consensus in a message-passing asynchronous system in which at most one process may fail by crashing.

slide-18
SLIDE 18

Assumption

It is impossible to have a deterministic protocol that solves consensus in a message-passing asynchronous system in which at most one process may fail by crashing.

  • No assumptions about the relative speeds of processes or about the

delay time in delivering a message

  • Processes don’t have access to synchronized clocks
  • Unable to detect the death of a process
slide-19
SLIDE 19

Assumption

It is impossible to have a deterministic protocol that solves consensus in a message-passing asynchronous system in which at most one process may fail by crashing.

slide-20
SLIDE 20

Assumption

It is impossible to have a deterministic protocol that solves consensus in a message-passing asynchronous system in which at most one process may fail by crashing.

  • Termination: all non-faulty processes eventually decide on a value
  • Agreement: all processes that decide do so on the same value
  • Validity: the value that has been decided must have been proposed by

some process

slide-21
SLIDE 21

Assumption

It is impossible to have a deterministic protocol that solves consensus in a message-passing asynchronous system in which at most one process may fail by crashing. For simplicity,

  • Termination: all non-faulty processes eventually decide on a value in {0, 1}
  • Agreement: all processes that decide do so on the same value
  • Validity: both 0 and 1 are possible decision values
slide-22
SLIDE 22

Assumption

It is impossible to have a deterministic protocol that solves consensus in a message-passing asynchronous system in which at most one process may fail by crashing.

slide-23
SLIDE 23

Assumption

It is impossible to have a deterministic protocol that solves consensus in a message-passing asynchronous system in which at most one process may fail by crashing. No Byzantine, no fail-stop, just CRASH. All processes follow the protocol except for that at most one might crash.

slide-24
SLIDE 24

Model

It is impossible to have a deterministic protocol that solves consensus in a message-passing asynchronous system in which at most one process may fail by crashing.

slide-25
SLIDE 25

Model

It is impossible to have a deterministic protocol that solves consensus in a message-passing asynchronous system in which at most one process may fail by crashing. (p, m) p

slide-26
SLIDE 26

Model

It is impossible to have a deterministic protocol that solves consensus in a message-passing asynchronous system in which at most one process may fail by crashing. Message Buffer M p

slide-27
SLIDE 27

Model

It is impossible to have a deterministic protocol that solves consensus in a message-passing asynchronous system in which at most one process may fail by crashing. Message Buffer M send(p, m) p

slide-28
SLIDE 28

Model

It is impossible to have a deterministic protocol that solves consensus in a message-passing asynchronous system in which at most one process may fail by crashing. (p, m) p

slide-29
SLIDE 29

Model

It is impossible to have a deterministic protocol that solves consensus in a message-passing asynchronous system in which at most one process may fail by crashing. (p, m) p receive(p)

slide-30
SLIDE 30

Model

It is impossible to have a deterministic protocol that solves consensus in a message-passing asynchronous system in which at most one process may fail by crashing. (p, m) p Deal with m

slide-31
SLIDE 31

Model

It is impossible to have a deterministic protocol that solves consensus in a message-passing asynchronous system in which at most one process may fail by crashing. Message Buffer M p

slide-32
SLIDE 32

Model

It is impossible to have a deterministic protocol that solves consensus in a message-passing asynchronous system in which at most one process may fail by crashing. Message Buffer M p receive(p)

slide-33
SLIDE 33

Model

It is impossible to have a deterministic protocol that solves consensus in a message-passing asynchronous system in which at most one process may fail by crashing. Message Buffer M p Deal with Ø

slide-34
SLIDE 34

Model

It is impossible to have a deterministic protocol that solves consensus in a message-passing asynchronous system in which at most one process may fail by crashing. (p, m) p

slide-35
SLIDE 35

Model

It is impossible to have a deterministic protocol that solves consensus in a message-passing asynchronous system in which at most one process may fail by crashing. (p, m) p receive(p)

slide-36
SLIDE 36

Model

It is impossible to have a deterministic protocol that solves consensus in a message-passing asynchronous system in which at most one process may fail by crashing. (p, m) p Deal with Ø

slide-37
SLIDE 37

Model

It is impossible to have a deterministic protocol that solves consensus in a message-passing asynchronous system in which at most one process may fail by crashing.

  • All messages are delivered

correctly and exactly once

  • The message buffer acts

nondeterministically

  • Inserted with arbitrary number of

empty messages Message Buffer M

slide-38
SLIDE 38

Model

It is impossible to have a deterministic protocol that solves consensus in a message-passing asynchronous system in which at most one process may fail by crashing.

slide-39
SLIDE 39

Model

It is impossible to have a deterministic protocol that solves consensus in a message-passing asynchronous system in which at most one process may fail by crashing.

  • Configuration: C = (s, M)

○ M: message buffer ○ s: internal states of processes ■ Input register ■ Output register ■ Internal storage ■ Program counter

Message Buffer M

slide-40
SLIDE 40

Model

It is impossible to have a deterministic protocol that solves consensus in a message-passing asynchronous system in which at most one process may fail by crashing.

  • Configuration: C = (s, M)

○ M: message buffer ○ s: internal states of processes ■ Input register, value in {0, 1} ■ Output register, value in {b, 0, 1} ■ Internal storage ■ Program counter

p1 pk M

. . .

C = (s, M) s

0/1, b/0/1 0/1, b/0/1

slide-41
SLIDE 41

Model

It is impossible to have a deterministic protocol that solves consensus in a message-passing asynchronous system in which at most one process may fail by crashing.

  • Event: e = (p, m)

(pi, m) pi ... ... p1 pk M s

0/1, b/0/1 0/1, b/0/1 0/1, b/0/1

slide-42
SLIDE 42

Model

It is impossible to have a deterministic protocol that solves consensus in a message-passing asynchronous system in which at most one process may fail by crashing.

  • Step: C’= e(C) = (s’, M’)

p1 pk M

. . .

C = (s, M) s

0/1, b/0/1 0/1, b/0/1

(pi, m) pi ... ... p1 pk M s

0/1, b/0/1 0/1, b/0/1 0/1, b/0/1

slide-43
SLIDE 43

Model

It is impossible to have a deterministic protocol that solves consensus in a message-passing asynchronous system in which at most one process may fail by crashing.

  • Step: C’= e(C) = (s’, M’)

p1 pk M

. . .

C = (s, M) s

0/1, b/0/1 0/1, b/0/1

(pi, m) pi ... ... p1 pk M s

0/1, b/0/1 0/1, b/0/1 0/1, b/0/1

p1 pk M

. . .

C = (s, M) s

0/1, b/0/1 0/1, b/0/1

slide-44
SLIDE 44

Model

It is impossible to have a deterministic protocol that solves consensus in a message-passing asynchronous system in which at most one process may fail by crashing.

  • Step: C’= e(C) = (s’, M’)

p1 pk M

. . .

C = (s, M) s

0/1, b/0/1 0/1, b/0/1

(pi, m) pi ... ... p1 pk M s

0/1, b/0/1 0/1, b/0/1 0/1, b/0/1

M (pi, m)

C = (s, M) pi ... ... p1 pk s

0/1, b/0/1 0/1, b/0/1 0/1, b

(pi, m)

slide-45
SLIDE 45

Model

It is impossible to have a deterministic protocol that solves consensus in a message-passing asynchronous system in which at most one process may fail by crashing.

  • Step: C’= e(C) = (s’, M’)

p1 pk M

. . .

C = (s, M) s

0/1, b/0/1 0/1, b/0/1

(pi, m) pi ... ... p1 pk M s

0/1, b/0/1 0/1, b/0/1 0/1, b/0/1

M (pi, m)

C = (s, M) p’i ... ... p1 pk s’

0/1, b/0/1 0/1, b/0/1 0/1, b 0

slide-46
SLIDE 46

Model

It is impossible to have a deterministic protocol that solves consensus in a message-passing asynchronous system in which at most one process may fail by crashing.

  • Step: C’= e(C) = (s’, M’)

p1 pk M

. . .

C = (s, M) s

0/1, b/0/1 0/1, b/0/1

(pi, m) pi ... ... p1 pk M s

0/1, b/0/1 0/1, b/0/1 0/1, b/0/1

M (pi, m)

C = (s, M) p’i ... ... p1 pk s’

0/1, b/0/1 0/1, b/0/1 0/1, b 0

send

slide-47
SLIDE 47

Model

It is impossible to have a deterministic protocol that solves consensus in a message-passing asynchronous system in which at most one process may fail by crashing.

  • Step: C’= e(C) = (s’, M’)

p1 pk M

. . .

C = (s, M) s

0/1, b/0/1 0/1, b/0/1

(pi, m) pi ... ... p1 pk M s

0/1, b/0/1 0/1, b/0/1 0/1, b/0/1

M’ (pi, m)

C’ = (s’, M’) p’i ... ... p1 pk s’

0/1, b/0/1 0/1, b/0/1 0/1, b 0

slide-48
SLIDE 48

Model

It is impossible to have a deterministic protocol that solves consensus in a message-passing asynchronous system in which at most one process may fail by crashing.

  • Step: C’= e(C) = (s’, M’)

p1 pk M

. . .

C = (s, M) s

0/1, b/0/1 0/1, b/0/1

(pi, m) pi ... ... p1 pk M s

0/1, b/0/1 0/1, b/0/1 0/1, b/0/1

M’ (pi, m)

C’ = (s’, M’) p’i ... ... p1 pk s’

0/1, b/0/1 0/1, b/0/1 0/1, b 0

slide-49
SLIDE 49

Proof

It is impossible to have a deterministic protocol that solves consensus in a message-passing asynchronous system in which at most one process may fail by crashing. How to prove impossibility?

slide-50
SLIDE 50

Proof

It is impossible to have a deterministic protocol that solves consensus in a message-passing asynchronous system in which at most one process may fail by crashing. How to prove impossibility? Assume to the contrary that there exists a consensus protocol P such that… How to define P?

slide-51
SLIDE 51

More terms

  • A schedule S of P is a finite or infinite sequence of events (e1, e2, …, ek)of P,

S(C) = ek(...(e2(e1(C)))...)

slide-52
SLIDE 52

More terms

  • A schedule S of P is a finite or infinite sequence of events (e1, e2, …, ek)of P,

S(C) = ek(...(e2(e1(C)))...)

  • A run of P is a sequence of steps associating a schedule S, in other words, a

run is a pair of a configuration C and a schedule S, written as (C, S)

slide-53
SLIDE 53

More terms

  • A configuration C’ is reachable from a configuration C if there exist a

schedule S such that C’ = S(C)

slide-54
SLIDE 54

More terms

  • A configuration C’ is reachable from a configuration C if there exist a

schedule S such that C’ = S(C)

  • A configuration C′ is accessible from an initial configuration C0 if C’ is

reachable from C0

slide-55
SLIDE 55

More terms

  • A configuration C’ is reachable from a configuration C if there exist a

schedule S such that C’ = S(C)

  • A configuration C′ is accessible from an initial configuration C0 if C’ is

reachable from C0

e1(p1, m1)

p1 pk M0

. . .

C0 = (s0, M0) s0

0/1, b 0/1, b

p’1 pk M1

. . .

C1 = (s1, M1) s1

0/1, b 0/1, b

p’1 p’k M2

. . .

C2 = (s2, M2) s2

0/1, b 0/1, b 0

e2(pk, m2)

slide-56
SLIDE 56

More terms

  • A configuration C has decision value v if some process p is in a decision

state with output=v, which is “write-once”/irreversible

slide-57
SLIDE 57

More terms

  • A configuration C has decision value v if some process p is in a decision

state with output=v, which is “write-once”/irreversible

  • A run is a deciding run if some process reaches a decision state.
slide-58
SLIDE 58

More terms

  • A configuration C has decision value v if some process p is in a decision

state with output=v, which is “write-once”/irreversible

  • A run is a deciding run if some process reaches a decision state.

e1(p1, m1)

p1 pk M0

. . .

C0 = (s0, M0) s0

0/1, b 0/1, b

p’1 pk M1

. . .

C1 = (s1, M1) s1

0/1, b 0/1, b

slide-59
SLIDE 59

More terms

  • A configuration C has decision value v if some process p is in a decision

state with output=v, which is “write-once”/irreversible

  • A run is a deciding run if some process reaches a decision state.

e1(p1, m1)

p1 pk M0

. . .

C0 = (s0, M0) s0

0/1, b 0/1, b

p’1 pk M1

. . .

C1 = (s1, M1) s1

0/1, b 0/1, b

p’1 p’k M2

. . .

C2 = (s2, M2) s2

0/1, b 0/1, b 0

e2(pk, m2)

slide-60
SLIDE 60

More terms

  • A consensus protocol P is partially correct if:

○ No accessible configuration has more than one decision value (agreement) ○ For each v in {0, 1}, some accessible configuration has decision value v (validity)

  • A run is admissible if every process, except possibly one (faulty

process), takes infinitely many steps in S

slide-61
SLIDE 61

Assume to the contrary that there exists P such that

  • P is partially correct

○ Agreement + Validity

slide-62
SLIDE 62

Assume to the contrary that there exists P such that

  • P is partially correct

○ Agreement + Validity

  • Every admissible run of P is a deciding run

○ Termination

slide-63
SLIDE 63

Assume to the contrary that there exists P such that

  • P is partially correct

○ Agreement + Validity

  • Every admissible run of P is a deciding run

○ Termination

  • What kind of contradiction should possibly be like?
slide-64
SLIDE 64

Categories of configurations

  • Univalent, or i-valent (i in {0, 1})

○ A configuration C is univalent or i-valent if some process has decided i in C, or if all configurations accessible from C are i-valent

slide-65
SLIDE 65

Categories of configurations

  • Univalent, or i-valent (i in {0, 1})

○ A configuration C is univalent or i-valent if some process has decided i in C, or if all configurations accessible from C are i-valent

p1 pk M

. . .

C = (s, M) s

0, b 0, b

... ... ...

S1 S2 S3

Decide on 0

slide-66
SLIDE 66

Categories of configurations

  • Univalent, or i-valent (i in {0, 1})

○ A configuration C is univalent or i-valent if some process has decided i in C, or if all configurations accessible from C are i-valent

p1 pk M

. . .

C = (s, M) s

1, b 1, b

... ... ...

S1 S2 S3

Decide on 1

slide-67
SLIDE 67

Categories of configurations

  • Bivalent

○ A configuration C is bivalent if some of the configurations accessible from it are 0-valent while others are 1-valent

p1 pk M

. . .

C = (s, M) s

0, b 1, b

... ... ...

S1 S2 S3

Decide on 0 Decide on 1 Decide on 0

slide-68
SLIDE 68

Categories of configurations

  • Bivalent (see Bivalent, read Undeciding)

○ A configuration C is bivalent if some of the configurations accessible from it are 0-valent while others are 1-valent

p1 pk M

. . .

C = (s, M) s

0, b 1, b

... ... ...

S1 S2 S3

Decide on 0 Decide on 1 Decide on 0

slide-69
SLIDE 69

What kind of contradiction should possibly be like?

INDISTINGUISHABILITY between processes:

  • Crashed
  • Simply slow in processing or having a terrible network condition
slide-70
SLIDE 70

What kind of contradiction should possibly be like?

INDISTINGUISHABILITY between processes:

  • Crashed
  • Simply slow in processing or having a terrible network condition

For any protocol, there exists a configuration that is always bivalent.

slide-71
SLIDE 71

What kind of contradiction should possibly be like?

INDISTINGUISHABILITY between processes:

  • Crashed
  • Simply slow in processing or having a terrible network condition

For any protocol, there exists a configuration that is always bivalent. Remaining UNDECIDED in the value

slide-72
SLIDE 72

What kind of contradiction should possibly be like?

INDISTINGUISHABILITY between processes:

  • Crashed
  • Simply slow in processing or having a terrible network condition

For any protocol, there exists a configuration that is always bivalent. Remaining UNDECIDED in the value

slide-73
SLIDE 73

Proof Outline

  • For any protocol, there is an initial configuration that is bivalent
  • Then there is another bivalent configuration reachable from it after

applying some event

  • And another reachable bivalent configuration
  • An infinite undeciding run
slide-74
SLIDE 74

Most exciting part!!!

  • Lemma 1 (commutativity of schedules)

○ Suppose that from some C, the schedules S1, S2 lead to C1, C2

  • respectively. If the steps in S1 and in S2 are disjoint, then S2 can be

applied to C1 and S1 can be applied to C2 and both lead to the same C3.

slide-75
SLIDE 75

Most exciting part!!!

  • Lemma 1 (commutativity of schedules)

○ Suppose that from some C, the schedules S1, S2 lead to C1, C2

  • respectively. If the steps in S1 and in S2 are disjoint, then S2 can be

applied to C1 and S1 can be applied to C2 and both lead to the same C3.

C1 C C3 C2 S1 S2 S1 S2

slide-76
SLIDE 76

Proof Outline

  • For any protocol, there is an initial configuration that is bivalent
  • Then there is another bivalent configuration reachable from it after

applying some event

  • And another reachable bivalent configuration
  • An infinite undeciding run
slide-77
SLIDE 77

Most exciting part!!!

  • Lemma 2

○ P has a bivalent initial configuration.

slide-78
SLIDE 78

Most exciting part!!!

  • Lemma 2

○ P has a bivalent initial configuration. Assume all initial configurations are either 0-valent or 1-valent.

p1 p2 p3

0, b 0, b 1, b 0, b 1, b 0, b 0, b 1, b 1, b 1, b 0, b 0, b 1, b 1, b 1, b 1, b 1, b 0, b 1, b 0, b 1, b 0, b 0, b 0, b

slide-79
SLIDE 79

Most exciting part!!!

  • Lemma 2

○ P has a bivalent initial configuration. Assume all initial configurations are either 0-valent or 1-valent.

p1 p2 p3

0, b 0, b 1, b 0, b 1, b 0, b 0, b 1, b 1, b 1, b 0, b 0, b 1, b 1, b 1, b 1, b 1, b 0, b 1, b 0, b 1, b 0, b 0, b 0, b 1 1 1 1

slide-80
SLIDE 80

Most exciting part!!!

  • Lemma 2

○ P has a bivalent initial configuration. Assume all initial configurations are either 0-valent or 1-valent.

p1 p2 p3

0, b 0, b 1, b 0, b 1, b 0, b 0, b 1, b 1, b 1, b 0, b 0, b 1, b 1, b 1, b 1, b 1, b 0, b 1, b 0, b 1, b 0, b 0, b 0, b 1 1 1 1

slide-81
SLIDE 81

Most exciting part!!!

  • Lemma 2

○ P has a bivalent initial configuration. Assume all initial configurations are either 0-valent or 1-valent.

p1 p2 p3

0, b 0, b 1, b 0, b 1, b 0, b 0, b 1, b 1, b 1, b 0, b 0, b 1, b 1, b 1, b 1, b 1, b 0, b 1, b 0, b 1, b 0, b 0, b 0, b 1 1 1 1

slide-82
SLIDE 82

Most exciting part!!!

  • Lemma 2

○ P has a bivalent initial configuration. Assume all initial configurations are either 0-valent or 1-valent.

p1 p2 p3

0, b 0, b 1, b 0, b 1, b 0, b 0, b 1, b 1, b 1, b 0, b 0, b 1, b 1, b 1, b 1, b 1, b 0, b 1, b 0, b 1, b 0, b 0, b 0, b 1 1 1 1

slide-83
SLIDE 83

Most exciting part!!!

  • Lemma 2

○ P has a bivalent initial configuration. Assume all initial configurations are either 0-valent or 1-valent.

C1 C2 Adjacent: differ in the initial state

  • f a single

process

slide-84
SLIDE 84

Most exciting part!!!

  • Lemma 2

○ P has a bivalent initial configuration. Assume all initial configurations are either 0-valent or 1-valent.

C1 C2 Ci Ci+1 Ck

... ...

Adjacent: differ in the initial state

  • f a single

process

slide-85
SLIDE 85

Most exciting part!!!

  • Lemma 2

○ P has a bivalent initial configuration. Assume all initial configurations are either 0-valent or 1-valent.

C1 C2 Ci Ci+1 Ck 1 1

... ...

Adjacent: differ in the initial state

  • f a single

process

slide-86
SLIDE 86

Most exciting part!!!

  • Lemma 2

○ P has a bivalent initial configuration. Assume all initial configurations are either 0-valent or 1-valent.

C1 C2 Ci Ci+1 Ck 1 1

... ...

Adjacent: differ in the initial state

  • f a single

process

slide-87
SLIDE 87

Most exciting part!!!

  • Lemma 2

○ P has a bivalent initial configuration. Assume all initial configurations are either 0-valent or 1-valent.

C1 C2 Ci Ci+1 Ck 1 1

... ...

Adjacent: differ in the initial state

  • f a single

process Ci Ci+1 differ in the initial state

  • f a single

process p

slide-88
SLIDE 88

Most exciting part!!!

  • Lemma 2

○ P has a bivalent initial configuration. Assume all initial configurations are either 0-valent or 1-valent.

C1 C2 Ci Ci+1 Ck 1 1

... ...

Adjacent: differ in the initial state

  • f a single

process Ci Ci+1 C/p S in which p takes no step differ in the initial state

  • f a single

process p

slide-89
SLIDE 89

Most exciting part!!!

  • Lemma 2

○ P has a bivalent initial configuration. Assume all initial configurations are either 0-valent or 1-valent.

C1 C2 Ci Ci+1 Ck 1 1

... ...

Adjacent: differ in the initial state

  • f a single

process Ci Ci+1 C/p S in which p takes no step differ in the initial state

  • f a single

process p S in which p takes no step

slide-90
SLIDE 90

Most exciting part!!!

  • Lemma 2

○ P has a bivalent initial configuration. Assume all initial configurations are either 0-valent or 1-valent.

C1 C2 Ci Ci+1 Ck 1 1

... ...

Adjacent: differ in the initial state

  • f a single

process Ci Ci+1 C/p S in which p takes no step differ in the initial state

  • f a single

process p S in which p takes no step

slide-91
SLIDE 91

Most exciting part!!!

  • Lemma 2

○ P has a bivalent initial configuration. Assume all initial configurations are either 0-valent or 1-valent.

C1 C2 Ci Ci+1 Ck 1 1

... ...

Adjacent: differ in the initial state

  • f a single

process Ci Ci+1 C/p S in which p takes no step differ in the initial state

  • f a single

process p S in which p takes no step 0/1

slide-92
SLIDE 92

Most exciting part!!!

  • Lemma 2

○ P has a bivalent initial configuration. Assume all initial configurations are either 0-valent or 1-valent.

C1 C2 Ci Ci+1 Ck 1 1

... ...

Adjacent: differ in the initial state

  • f a single

process Ci Ci+1 C/p S in which p takes no step differ in the initial state

  • f a single

process p S in which p takes no step 1

slide-93
SLIDE 93

Most exciting part!!!

  • Lemma 2

○ P has a bivalent initial configuration. Assume all initial configurations are either 0-valent or 1-valent.

C1 C2 Ci Ci+1 Ck 1 1

... ...

Adjacent: differ in the initial state

  • f a single

process Ci Ci+1 C/p S in which p takes no step differ in the initial state

  • f a single

process p S in which p takes no step 1 0/1

slide-94
SLIDE 94

Proof Outline

  • For any protocol, there is an initial configuration that is bivalent
  • Then there is another bivalent configuration reachable from it after

applying some event

  • And another reachable bivalent configuration
  • An infinite undeciding run
slide-95
SLIDE 95

Most exciting part!!!

  • Lemma 3

○ Let C be a bivalent configuration of P, and e=(p, m) be an event that is applicable to C. Let E be the set of configurations reachable from C without applying e, and let D=e(E), the set of configurations after applying e to all those in E. Then, D contains a bivalent configuration.

slide-96
SLIDE 96

Most exciting part!!!

  • Lemma 3

○ Let C be a bivalent configuration of P, and e=(p, m) be an event that is applicable to C. Let E be the set of configurations reachable from C without applying e, and let D=e(E), the set of configurations after applying e to all those in E. Then, D contains a bivalent configuration.

C 0/1

slide-97
SLIDE 97

Any schedule without applying e

Most exciting part!!!

  • Lemma 3

○ Let C be a bivalent configuration of P, and e=(p, m) be an event that is applicable to C. Let E be the set of configurations reachable from C without applying e, and let D=e(E), the set of configurations after applying e to all those in E. Then, D contains a bivalent configuration.

C 0/1 E1 E3 E2

...

E

slide-98
SLIDE 98

Any schedule without applying e

Most exciting part!!!

  • Lemma 3

○ Let C be a bivalent configuration of P, and e=(p, m) be an event that is applicable to C. Let E be the set of configurations reachable from C without applying e, and let D=e(E), the set of configurations after applying e to all those in E. Then, D contains a bivalent configuration.

C 0/1 E1 E3 E2

...

D1 D3 D2

...

Apply e E D

slide-99
SLIDE 99

Any schedule without applying e

Most exciting part!!!

  • Lemma 3

○ Let C be a bivalent configuration of P, and e=(p, m) be an event that is applicable to C. Let E be the set of configurations reachable from C without applying e, and let D=e(E), the set of configurations after applying e to all those in E. Then, D contains a bivalent configuration.

C 0/1 E1 E3 E2

...

D1 D3 D2

...

Apply e 0/1 E D

slide-100
SLIDE 100

Most exciting part!!!

  • Assume all configurations in D are univalent.
slide-101
SLIDE 101

Most exciting part!!!

  • Assume all configurations in D are univalent.
  • There exists both 0-valent configuration and 1-valent configuration in D.
slide-102
SLIDE 102

Most exciting part!!!

  • Assume all configurations in D are univalent.
  • There exists both 0-valent configuration and 1-valent configuration in D.

○ C is bivalent, so for i in {0, 1} there exists a Ci reachable from C that is i-valent.

slide-103
SLIDE 103

Most exciting part!!!

  • Assume all configurations in D are univalent.
  • There exists both 0-valent configuration and 1-valent configuration in D.

○ C is bivalent, so for i in {0, 1} there exists a Ci reachable from C that is i-valent. ○ Consider C0 without loss of generality,

slide-104
SLIDE 104

Most exciting part!!!

  • Assume all configurations in D are univalent.
  • There exists both 0-valent configuration and 1-valent configuration in D.

○ C is bivalent, so for i in {0, 1} there exists a Ci reachable from C that is i-valent. ○ Consider C0 without loss of generality,

C 0/1 C0

slide-105
SLIDE 105

Most exciting part!!!

  • Assume all configurations in D are univalent.
  • There exists both 0-valent configuration and 1-valent configuration in D.

○ C is bivalent, so for i in {0, 1} there exists a Ci reachable from C that is i-valent. ○ Consider C0 without loss of generality,

C 0/1 C0 A schedule without applying e

slide-106
SLIDE 106

Most exciting part!!!

  • Assume all configurations in D are univalent.
  • There exists both 0-valent configuration and 1-valent configuration in D.

○ C is bivalent, so for i in {0, 1} there exists a Ci reachable from C that is i-valent. ○ Consider C0 without loss of generality,

C 0/1 C0 A schedule without applying e D0 Apply e

slide-107
SLIDE 107

Most exciting part!!!

  • Assume all configurations in D are univalent.
  • There exists both 0-valent configuration and 1-valent configuration in D.

○ C is bivalent, so for i in {0, 1} there exists a Ci reachable from C that is i-valent. ○ Consider C0 without loss of generality,

C 0/1 C0 A schedule without applying e D0 Apply e

slide-108
SLIDE 108

Most exciting part!!!

  • Assume all configurations in D are univalent.
  • There exists both 0-valent configuration and 1-valent configuration in D.

○ C is bivalent, so for i in {0, 1} there exists a Ci reachable from C that is i-valent. ○ Consider C0 without loss of generality,

C 0/1 C0 A schedule already applied e

slide-109
SLIDE 109

Most exciting part!!!

  • Assume all configurations in D are univalent.
  • There exists both 0-valent configuration and 1-valent configuration in D.

○ C is bivalent, so for i in {0, 1} there exists a Ci reachable from C that is i-valent. ○ Consider C0 without loss of generality,

C 0/1 C0 C’’ C’ D0 Apply e

slide-110
SLIDE 110

Most exciting part!!!

  • Assume all configurations in D are univalent.
  • There exists both 0-valent configuration and 1-valent configuration in D.

○ C is bivalent, so for i in {0, 1} there exists a Ci reachable from C that is i-valent. ○ Consider C0 without loss of generality,

C 0/1 C0 C’’ C’ D0 Apply e

slide-111
SLIDE 111

Most exciting part!!!

  • Assume all configurations in D are univalent.
  • There exists both 0-valent configuration and 1-valent configuration in D.

○ C is bivalent, so for i in {0, 1} there exists a Ci reachable from C that is i-valent. ○ Consider C0 without loss of generality, ○ There exists D0 that is 0-valent.

slide-112
SLIDE 112

Most exciting part!!!

  • Assume all configurations in D are univalent.
  • There exists both 0-valent configuration and 1-valent configuration in D.
  • Without loss of generality, assume D0=e(C) in D is 0-valent
slide-113
SLIDE 113

Most exciting part!!!

  • Assume all configurations in D are univalent.
  • There exists both 0-valent configuration and 1-valent configuration in D.
  • Without loss of generality, assume D0=e(C) in D is 0-valent

C E1 Neighbor: one result from the other in a single step

slide-114
SLIDE 114

Most exciting part!!!

  • Assume all configurations in D are univalent.
  • There exists both 0-valent configuration and 1-valent configuration in D.
  • Without loss of generality, assume D0=e(C) in D is 0-valent

C E1 Ei Ei+1 Ek

... ...

Neighbor: one result from the other in a single step e=(p, m) Dk 1

slide-115
SLIDE 115

Most exciting part!!!

  • Assume all configurations in D are univalent.
  • There exists both 0-valent configuration and 1-valent configuration in D.
  • Without loss of generality, assume D0=e(C) in D is 0-valent

C E1 Ei Ei+1 D0 Ek Dk

... ...

Neighbor: one result from the other in a single step 1 e=(p, m) e=(p, m)

slide-116
SLIDE 116

Most exciting part!!!

  • Assume all configurations in D are univalent.
  • There exists both 0-valent configuration and 1-valent configuration in D.
  • Without loss of generality, assume D0=e(C) in D is 0-valent

C E1 Ei Ei+1 D0 Ek Dk Di+1 Di D1

... ...

Neighbor: one result from the other in a single step 1 1 e=(p, m)

slide-117
SLIDE 117

Most exciting part!!!

  • Assume all configurations in D are univalent.
  • There exists both 0-valent configuration and 1-valent configuration in D.
  • Without loss of generality, assume D0=e(C) in D is 0-valent

C E1 Ei Ei+1 D0 Ek Dk Di+1 Di D1

... ...

Neighbor: one result from the other in a single step 1 1 e=(p, m) e’=(p’, m’)

slide-118
SLIDE 118

Most exciting part!!!

  • Case 1: p’ != p

Di Ei Di+1 Ei+1 e e’ e C E1 Ei Ei+1 D0 Ek Dk Di+1 Di D1

... ...

Neighbor: one result from the other in a single step 1 1 e=(p, m) e’=(p’, m’)

slide-119
SLIDE 119

Most exciting part!!!

  • Case 1: p’ != p

○ Apply Lemma 1

Di Ei Di+1 Ei+1 e e’ e e’ C E1 Ei Ei+1 D0 Ek Dk Di+1 Di D1

... ...

Neighbor: one result from the other in a single step 1 1 e=(p, m) e’=(p’, m’)

slide-120
SLIDE 120

Most exciting part!!!

  • Case 1: p’ != p

○ Apply Lemma 1

Di Ei Di+1 Ei+1 e e’ e e’ C E1 Ei Ei+1 D0 Ek Dk Di+1 Di D1

... ...

Neighbor: one result from the other in a single step 1 1 e=(p, m) e’=(p’, m’)

slide-121
SLIDE 121

Most exciting part!!!

  • Case 1: p’ != p

○ Apply Lemma 1

Di Ei Di+1 Ei+1 e e’ e e’ C E1 Ei Ei+1 D0 Ek Dk Di+1 Di D1

... ...

Neighbor: one result from the other in a single step 1 1 e=(p, m) e’=(p’, m’)

slide-122
SLIDE 122

Most exciting part!!!

  • Case 2: p’ = p

C E1 Ei Ei+1 D0 Ek Dk Di+1 Di D1

... ...

Neighbor: one result from the other in a single step 1 1 e=(p, m) e’=(p’, m’) Di Ei Ei+1 e e’ Di+1 e

slide-123
SLIDE 123

Most exciting part!!!

  • Case 2: p’ = p

C E1 Ei Ei+1 D0 Ek Dk Di+1 Di D1

... ...

Neighbor: one result from the other in a single step 1 1 e=(p, m) e’=(p’, m’) Di Ei Ei+1 e e’ A A deciding S (p takes no steps) Di+1 e

slide-124
SLIDE 124

Most exciting part!!!

  • Case 2: p’ = p

○ Apply Lemma 1

C E1 Ei Ei+1 D0 Ek Dk Di+1 Di D1

... ...

Neighbor: one result from the other in a single step 1 1 e=(p, m) e’=(p’, m’) Di Ei C0 Ei+1 e S e’ A Di+1 e e A deciding S (p takes no steps)

slide-125
SLIDE 125

Most exciting part!!!

  • Case 2: p’ = p

○ Apply Lemma 1

C E1 Ei Ei+1 D0 Ek Dk Di+1 Di D1

... ...

Neighbor: one result from the other in a single step 1 1 e=(p, m) e’=(p’, m’) Di Ei C0 Ei+1 e S e’ A Di+1 e e A deciding S (p takes no steps)

slide-126
SLIDE 126

Most exciting part!!!

  • Case 2: p’ = p

○ Apply Lemma 1

C E1 Ei Ei+1 D0 Ek Dk Di+1 Di D1

... ...

Neighbor: one result from the other in a single step 1 1 e=(p, m) e’=(p’, m’) Di Ei C0 Ei+1 e e’ S e’ A C1 Di+1 S e e e A deciding S (p takes no steps)

slide-127
SLIDE 127

Most exciting part!!!

  • Case 2: p’ = p

○ Apply Lemma 1

C E1 Ei Ei+1 D0 Ek Dk Di+1 Di D1

... ...

Neighbor: one result from the other in a single step 1 1 e=(p, m) e’=(p’, m’) Di Ei C0 Ei+1 e e’ S e’ A C1 Di+1 S e e e A deciding S (p takes no steps) 1

slide-128
SLIDE 128

Most exciting part!!!

  • Case 2: p’ = p

○ Apply Lemma 1

C E1 Ei Ei+1 D0 Ek Dk Di+1 Di D1

... ...

Neighbor: one result from the other in a single step 1 1 e=(p, m) e’=(p’, m’) Di Ei C0 Ei+1 e e’ S e’ A C1 Di+1 S e e e A deciding S (p takes no steps) 1

slide-129
SLIDE 129

Most exciting part!!!

  • Assume all configurations in D are univalent.
  • There exists both 0-valent configuration and 1-valent configuration in D.
  • Without loss of generality, assume D0=e(C) in D is 0-valent
  • Contradiction!
slide-130
SLIDE 130

Proof Outline

  • For any protocol, there is an initial configuration that is bivalent
  • Then there is another bivalent configuration reachable from it after

applying some event

  • And another reachable bivalent configuration
  • An infinite undeciding run
slide-131
SLIDE 131

Most exciting part!!!

  • Construct an infinite undeciding admissible run
slide-132
SLIDE 132

Most exciting part!!!

  • Construct an infinite undeciding admissible run

C0 0/1 By Lemma 2

slide-133
SLIDE 133

Most exciting part!!!

  • Construct an infinite undeciding admissible run

C0 C1 0/1 0/1 By Lemma 2 By Lemma 3

S1 applying e1 = receive(p1) last

slide-134
SLIDE 134

Most exciting part!!!

  • Construct an infinite undeciding admissible run

C0 C1 C2 0/1 0/1 0/1 By Lemma 2 By Lemma 3 By Lemma 3

S1 applying e1 = receive(p1) last S2 applying e2 = receive(p2) last

slide-135
SLIDE 135

Most exciting part!!!

  • Construct an infinite undeciding admissible run

C0 C1 C2 C3 0/1 0/1 0/1 0/1 By Lemma 2 By Lemma 3 By Lemma 3 By Lemma 3

S1 applying e1 = receive(p1) last S2 applying e2 = receive(p2) last S3 applying e3 = receive(p3) last

slide-136
SLIDE 136

Most exciting part!!!

  • Construct an infinite undeciding admissible run

C0 C1 C2 C3 0/1 0/1 0/1 0/1 By Lemma 2 By Lemma 3 By Lemma 3 By Lemma 3

S1 applying e1 = receive(p1) last S2 applying e2 = receive(p2) last S3 applying e3 = receive(p3) last

C4 0/1 By Lemma 3

S4 applying e4 = receive(p1) last

slide-137
SLIDE 137

Most exciting part!!!

  • Construct an infinite undeciding admissible run

C0 C1 C2 C3 0/1 0/1 0/1 0/1 By Lemma 2 By Lemma 3 By Lemma 3 By Lemma 3

S1 applying e1 = receive(p1) last S2 applying e2 = receive(p2) last S3 applying e3 = receive(p3) last

C4 0/1 By Lemma 3

S4 applying e4 = receive(p1) last

...

slide-138
SLIDE 138

Most exciting part!!!

  • Construct an infinite undeciding admissible run

C0 C1 C2 C3 0/1 0/1 0/1 0/1 By Lemma 2 By Lemma 3 By Lemma 3 By Lemma 3

S1 applying e1 = receive(p1) last S2 applying e2 = receive(p2) last S3 applying e3 = receive(p3) last

C4 0/1 By Lemma 3

S4 applying e4 = receive(p1) last

...

An infinite UNDECIDING run

slide-139
SLIDE 139

Assume to the contrary that there exists P such that

  • P is partially correct

○ Agreement + Validity

  • Every admissible run of P is a deciding run

○ Termination

slide-140
SLIDE 140

Assume to the contrary that there exists P such that

  • P is partially correct

○ Agreement + Validity

  • Every admissible run of P is a deciding run

○ Termination Contradiction!

slide-141
SLIDE 141

Wrap-up

  • Computation determinism

○ Deterministic ○ Probabilistic

  • Timing assumptions

○ Synchronous ○ Asynchronous

  • Failure model

○ Fail-stop ○ Crash ○ Byzantine ○ Permissionless Byzantine

slide-142
SLIDE 142

Wrap-up

  • Computation determinism

○ Deterministic ○ Probabilistic

  • Timing assumptions

○ Synchronous ○ Asynchronous

  • Failure model

○ Fail-stop ○ Crash ○ Byzantine ○ Permissionless Byzantine

slide-143
SLIDE 143

Wrap-up

  • Computation determinism

○ Deterministic ○ Probabilistic

  • Timing assumptions

○ Synchronous ○ Asynchronous

  • Failure model

○ Fail-stop ○ Crash ○ Byzantine ○ Permissionless Byzantine

Impossibility

slide-144
SLIDE 144

Takeaway

You CANNOT guarantee safety and liveness at the same time!

slide-145
SLIDE 145

Takeaway

You CANNOT guarantee safety and liveness at the same time! But you CAN get around FLP: 1. Release the failure model

slide-146
SLIDE 146

Release the failure model

Model: 1. The majority are non-faulty 2. No process dies during the execution of the protocol Two-stage protocol: 1. Listens for messages from L-1 other processes, L=N/2+1 (WHY?), and construct the incoming stream graph G 2. Construct G+ and make decision upon values from the unique initial clique

slide-147
SLIDE 147

Takeaway

You CANNOT guarantee safety and liveness at the same time! But you CAN get around FLP: 1. Release the failure model 2. Terminate with probability of 1 instead of ALWAYS

slide-148
SLIDE 148

Terminate with probability of 1 instead of ALWAYS

Use randomization to terminate with arbitrarily high probability

  • M. Ben Or. “Another advantage of free choice: completely asynchronous agreement protocols”

(PODC 1983, pp. 27-30)

slide-149
SLIDE 149

Takeaway

You CANNOT guarantee safety and liveness at the same time! But you CAN get around FLP: 1. Release the failure model 2. Terminate with probability of 1 instead of ALWAYS 3. Use failure detector

slide-150
SLIDE 150

Use failure detector

Introduce failure detectors to distinguish between crashed processes and very slow processes

Chandra, T.D., Hadzilacos, V. and Toueg, S., 1996. The weakest failure detector for solving

  • consensus. Journal of the ACM (JACM), 43(4), pp.685-722.