found few people who were comfortable with Paxos, even among seasoned researchers. We… were not able to understand the complete protocol until after reading several simplified explanations and designing our own alternative protocol, a process that took almost a year.” (from the Raft paper) 19
Naive Solution • proposer node sends new value to every other node in the system Paxos • proposer node sends out ballots that other nodes can vote on • each round of consensus requires two rounds of voting
number nʹ prepare(nʹ) value: prepared: n accepted: n value: prepared: n accepted: n value: prepared: n accepted: n value: prepared: n accepted: n value: prepared: n accepted: n
prepared: nʹ accepted: n value: prepared: nʹ accepted: n value: prepared: nʹ accepted: n value: prepared: nʹ accepted: n value: prepared: nʹ accepted: n
3b: Tell nodes to accept the value accept(nʹ, x) value: prepared: nʹ accepted: n value: prepared: nʹ accepted: n value: prepared: nʹ accepted: n value: prepared: nʹ accepted: n value: prepared: nʹ accepted: n
number nʹ prepare(nʹ) value: prepared: n accepted: n value: prepared: n accepted: n value: prepared: n accepted: n value: prepared: n accepted: n value: prepared: n accepted: n
number nʹ prepare(nʹ) value: prepared: n accepted: n value: prepared: n accepted: n value: prepared: n accepted: n value: prepared: n accepted: n value: prepared: n accepted: n
prepare(<nʹ, b>) value: prepared: n accepted: n value: prepared: n accepted: n value: prepared: n accepted: n value: prepared: n accepted: n value: prepared: n accepted: n B A
ballot ack(<nʹ,b>, n) value: prepared: nʹ,b accepted: n value: prepared: nʹ,b accepted: n value: prepared: nʹ,b accepted: n value: prepared: nʹ,b accepted: n value: prepared: nʹ,b accepted: n B A ack(<nʹ,b>, n)
Count acks value: prepared: nʹ,b accepted: n value: prepared: nʹ,b accepted: n value: prepared: nʹ,b accepted: n value: prepared: nʹ,b accepted: n I have received acks from 0/5 nodes, so I must stop value: prepared: nʹ,b accepted: n
prepared: nʹ,b accepted: n value: prepared: nʹ,b accepted: n value: prepared: nʹ,b accepted: n value: prepared: nʹ,b accepted: n value: prepared: nʹ,b accepted: n
3b: Tell nodes to accept the value accept(<nʹ,b>, x) value: prepared: nʹ,b accepted: n value: prepared: nʹ,b accepted: n value: prepared: nʹ,b accepted: n value: prepared: nʹ,b accepted: n value: prepared: nʹ,b accepted: n
value: y term: 1 index: 2 value: z term: 2 index: 3 value: a term: 3 index: 4 represents the period between each election the position of this entry within the log this is an entry
• If two entries in different logs have the same index and term, then they store the same command. • If two entries in different logs have the same index and term, then the logs are identical in all preceding entries. the Log-Matching Property
1 index: 3 term: 1 index: 2 term: 1 index: 1 I’d like to append to the log. My most recent entry has term 1 and index 3. Uh oh, I’m missing that entry. Can you replay your log from after index 2?
hash: 8e43 nonce: 89 hash: 9876 nonce: abc hash: 89a0 block, hash block, hash block, hash block, hash * in Bitcoin, nodes gossip; not every node is connected to every other node
node must decide on a value the value must be the same for every node that value must be produced by some process 76 termination agreement validity Reminder
• accidental forks • tricks like ASICs (application-specific integrated circuits, special hardware) can make it less fair • boils the ocean the trouble with Proof of Work
• probabilities are tied to amount staked • either amount held or a “security deposit” • nodes exhibiting Byzantine behavior will be “slashed” Proof of Stake
Get in touch: @_tessr or [email protected] • Please don’t forget to rate this session • Thank you to Peter Bourgon, Jeremy Rubin and Peter Alvaro for their help with this talk thanks! 106