Byzantine Fault Tolerance
Consensus Strikes Back
Byzantine Fault Tolerance Consensus Strikes Back Announcements Lab - - PowerPoint PPT Presentation
Byzantine Fault Tolerance Consensus Strikes Back Announcements Lab 2 Hopefully everyone has started by now, maybe even finished large portions. If not ... you should worry . Please don't change the protobufs. My testing strategy
Consensus Strikes Back
1 2 3 4
1 2 3 4
1 2 3 4
AppendEntries(..., [(index=4)]) Success AppendEntries(..., [], leaderCommit=4)
1 2
RequestVote( term=2) RequestVote( term=2) VoteGranted( term=2) VoteGranted( term=2)
On the internet nobody knows what maps to a user, nor to a machine, ...
1 2 3 4
State State State State State
1 2 3 4
State State State State State
Can't really peer into the state of a remote node, cannot do much.
1 2 3 4 Failed nodes can only interfere by sending messages.
1 2 3 4 Make sure messages sent by all nodes are "correct" before acting.
1 2 3 4
AppendEntries(..., [(index=4)])
1 2 3 4
Success
1 2 3 4
AppendEntries(..., [], leaderCommit = 4)
1 2 3 4
AppendEntries(..., [(index=4)])
1 2 3 4
AppendEntries(..., [], leaderCommit = 4)
1 2 3 4
0->1: AppendEntries(..., [(index=4)])
1 2 3 4
Success Success
1 2 3 4
0->1: AppendEntries(..., [(c0, index=4)]) 0->1: AppendEntries(..., [(c1, index=4)])
1 2 3 4
Success Success
1 thinks slot 4 is c1 Slot 4 is c0 1 thinks slot 4 is c0
1 2 3 4
0->1: AppendEntries(..., [(c0, index=4)]) 0->1: AppendEntries(..., [(c1, index=4)])
1 2 3 4
0->1: c0, 4
1 2 3 4
0->1: c1, 4
1 2 3 4
0->1: c0, 4
1 2 3 4
0->1: c1, 4
1 2 3 4
1 2 3 4
0->1: c0, 4 0->1: c0, 4 0->1: c0, 4 0->1: c0, 4
1 2 3 4
0->1: c1, 4
1 2 3 4
0->1: c0, 4
1 2 3 4
0->1: c1, 4
1 2 3 4
1 2 3 4
0->1: c0, 4 0->1: c0, 4 0->1: c0, 4 0->1: c0, 4
1 2 3 4
0->1: c1, 4 0->1: c1, 4 0->1: c1, 4 0->1: c1, 4
1 2 3 4
0->1: c0, 4 0->1: c0, 4 0->1: c0, 4 0->1: c0, 4
1 2 3 4
0->1: c1, 4 0->1: c1, 4 0->1: c1, 4 0->1: c1, 4
Choose majority, breaking ties deterministically.
1 2 3 4 2
1 2 3 4
0->1: c0, 4 0->1: c0, 4 0->1: c0, 4 0->1: c0, 4
1 2 3 4
0->1: c0, 4 ??? ??? ???
1 2 3 4
0->1: c0, 4 0->1: c0, 4 0->1: c0, 4 0->1: c0, 4
1 2 3 4
0->1: c0, 4 0->1: c0, 4 0->1: c0, 4 0->1: c0, 4
Choose majority, breaking ties deterministically.
1 1 2 2
0->1: x=2 0->1: x=1 0->1: x=1 0->1: x=1
1 1 2 2
0->1: x=2 0->1: x=1 0->1: x=2 0->1: x=1
1 1 2 2
0->1: x=2 0->1: x=1 0->1: x=2 0->1: x=1
Cannot distinguish between these two cases. Cannot meet the two requirements state at the beginning.
1 2 3 4
1 2 3 4
0->1: c0, 4 0->1: c0, 4 0->1: c0, 4 0->1: c0, 4
1 2 3 4
0->1: c1, 4 0->1: c1, 4 0->1: c1, 4 0->1: c1, 4
1 2 3 4
0->1: c0, 4 0->1: c0, 4 0->1: c0, 4 0->1: c0, 4
1 2 3 4
0->1: c1, 4 0->1: c1, 4 0->1: c1, 4 0->1: c1, 4
5 6
0->1: c0, 4 0->1: c1, 4 0->1: c0, 4
1 2 3 4
0->1: c1, 4 0->1: c0, 4 0->1: c1, 4 0->1: c0, 4
1 2 3 4
0->1: c0, 4 0->1: c1, 4 0->1: c1, 4
5 6 5 6 5 6 5 6 5 6 5 6
0->1: c1, 4 0->1: c1, 4 0->1: c1, 4 0->1: c1, 4 0->1: c1, 4 0->1: c0, 4 0->1: c0, 4 0->1: c0, 4 0->1: c0, 4 0->1: c0, 4
1 2 3 4
1 2 3 4
0->1: c0, 4 0->1: c0, 4 0->1: c0, 4 0->1: c0, 4
1 2 3 4
0->1: c1, 4 ??? ??? ???
1 2 3 4
0->1: c0, 4 0->1: c0, 4 0->1: c0, 4 0->1: c0, 4
1 2 3 4
0->1: c1, 4 0->1: c1, 4 0->1: c1, 4 0->1: c1, 4
5 6
0->1: c0, 4 ??? 0->1: c0, 4
1 2 3 4
0->1: c1, 4 0->1: c0, 4 ??? 0->1: c0, 4
1 2 3 4
0->1: c0, 4 0->1: c1, 4 0->1: c1, 4
5 6 5 6 5 6 5 6 5 6 5 6
0->1: c1, 4 0->1: c1, 4 0->1: c1, 4 0->1: c1, 4 0->1: c1, 4 0->1: c0, 4 0->1: c0, 4 0->1: c0, 4 0->1: c0, 4 0->1: c0, 4
2
1 2 3 4
AppendEntries(..., [(index=4)])
1 2 3 4
Success
1 2 3 4
AppendEntries(..., [], leaderCommit = 4), Proof that a majority have accepted entires until 4.
1 2 3 4
AppendEntries(..., [], leaderCommit = 4), Success from 0, 1, 2, 3
1 2 3 4
AppendEntries(..., [], leaderCommit = 4), Success from 0, 1, 2, 3
h Arbitrary length input Fixed length output
f Input Signature g Input ✔ 𝙔
Signature g(m, s) = ✔ if and only if f(m) = s.
f Input Signature g Input ✔ 𝙔
Signature g(m, s) = ✔ if and only if f(m) = s. f g g
O w e y
1 s c
s
i c e c r e a m . f ( O w e y
1 s c
s
i c e c r e a m . ) Owe you 10 scoops of ice cream.f(Owe you 10 scoops of ice cream.) O w e y
s c
s
i c e c r e a m . Owe you 10 scoops of ice cream. f(Owe you 10 scoops of ice cream.)
Provides a non-repudiation mechanism.
You owe Grizzly 10 scoops.
f Input Signature g Input ✔ 𝙔
Signature g(m, s) = ✔ if and only if f(m) = s.
f Input Signature g Input ✔ 𝙔
Signature g(m, s) = ✔ if and only if f(m) = s.
1 2 3 4
AppendEntries(..., [], leaderCommit = 4), Sig(pr1, success), Sig(pr2, success), Sig(pr3, success) Pr0 Pr1 Pr2 Pr3 Pr4
1 2 3 4
AppendEntries(..., [], leaderCommit = 4), Sig(pr1, success), Sig(pr2, success), Sig(pr3, success) Pr0 Pr1 Pr2 Pr3 Pr4
c 1 2 3 req, sigc(req)
c 1 2 3 pre-prep(v, n, d) sig0(pre-prep(v, n, d)) <req , sigc(req)> req, sigc(req)
c 1 2 3 pre-prep(v, n, d) sig0(pre-prep(v, n, d)) <req , sigc(req)> req, sigc(req)
c 1 2 3 req, sigc(req) prep(v, n, d, i) sig1(prep(v, n, d, i))
c 1 2 3 req, sigc(req)
Wait for 2m prepare messages
c 1 2 3 req, sigc(req) commit(v, n, d, i) sig1(commit(v, n, d, i))
c 1 2 3 req, sigc(req)
Wait for 2m commit messages
c 1 2 3 req, sigc(req) resp(r, v, i) sig1(resp)