1 / 28

Blockchains

Blockchains. Lecture 8. State Machine Replication, BFT, and Blockchains. State Machine Replication. Single Server Architecture. State Machine Replication. Single Server Architecture. A single point of failure!. State Machine Replication. State Machine Replication.

jamil
Download Presentation

Blockchains

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Blockchains Lecture 8

  2. State Machine Replication, BFT, and Blockchains

  3. StateMachineReplication SingleServerArchitecture

  4. StateMachineReplication SingleServerArchitecture • Asinglepointoffailure!

  5. StateMachineReplication StateMachineReplication • Interactiveprotocolamongservers • State machine replication gives safetyand liveness.

  6. StateMachineReplication StateMachineReplication(SMR) • Replicas maintain the same state • Replicas start in the same state • Operations are deterministic • Replicas execute operations in the same order(i.e.,totalorder) • Replicassendrepliestoclients • Clientsvoteonreplicareplies

  7. Roughly, Consensus:AllAboutAchieving“TotalOrder” [Lamport, ACM TOPLAS 1984] • Blockchains (modeled as state machine replication) $100 $100 $100

  8. The“TotalOrder”Requirement Client 1: “Deposit $100” $100 $200 Client 1: “Deposit $100” $100 $200 $100

  9. The“TotalOrder”Requirement Chase: “Charge 10%” Client 1: “Deposit $100” $100 $200 $180 Chase: “Charge 10%” Client 1: “Deposit $100” $180 $100 $200 $100

  10. The“TotalOrder”Requirement Chase: “Charge 10%” Client 1: “Deposit $100” $100 $200 $180 Chase: “Charge 10%” Client 1: “Deposit $100” $180 $100 $200 $100

  11. The“TotalOrder”Requirement Chase: “Charge 10%” Client 1: “Deposit $100” $100 $90 $190 Chase: “Charge 10%” Client 1: “Deposit $100” $190 $100 $90 $100

  12. The“TotalOrder”Requirement Chase: “Charge 10%” Client 1: “Deposit $100” $100 $90 $190 Chase: “Charge 10%” Client 1: “Deposit $100” $180 $100 $200 $100

  13. StateMachineReplication Crash Fault-Tolerant SMR • 2f+1replicastotolerateffailures • Example: • Paxos: SMRforcrashfailures • The“most”important backbonearchitecture • Eachmajorservice • BigTable,Chubby,Spanner,Azure,AmazonWebServices,Ceph,IBMSAN,VMwareNSX,… [Lamport, ACMTOCS1998];goingbackto1989

  14. StateMachineReplication Paxos [Lamport. Paxos made simple. ACM SIGACT News2001] [Lamport, ACMTOCS1998];goingbackto1989 “For fundamental contributions to the theory and practice of distributed and concurrent systems, notably the invention of concepts such as causality and logical clocks, safety and liveness, replicated state machines, and sequential consistency.” TuringAward2013

  15. StateMachineReplication ByzantineFault-TolerantSMR(BFTProtocols) • Traditionallyimportant • Powerful: Byzantine/arbitrary failures & attacks • Systems, distributed systems, theory, crypto, security, … • Recentlygainprominence • Realthreatstorealsystems • Blockchains • Mission-criticalsystems (SpaceX) • …

  16. StateMachineReplication ByzantineFault-TolerantSMR(BFTProtocols) • Traditionallyimportant • Powerful: Byzantine/arbitrary failures & attacks • Systems, distributed systems, theory, crypto, security, … • Recentlygainprominence • Realthreatstorealsystems • Blockchains • Mission-criticalsystems (SpaceX) • …

  17. StateMachineReplication PBFT • 3f+1replicastotoleratefByzantinefailures [CastroandLiskov,OSDI1999] “For contributions to practical and theoretical foundations of programming language and system design, especially related to data abstraction, fault tolerance, and distributed computing.” TuringAward2008

  18. Client sends request to all Why not just send to one? Normal Case

  19. Primary sends pre-prepare message to all Records operation in log as pre-prepared Normal Case

  20. Replicas check the pre-prepare and if it is ok: Record operation in log as pre-prepared Send prepare messages to all All to all communication Normal Case

  21. Replicas wait for 2f+1 matching prepares Record operation in log as prepared Send commit message to all Trust the group, not the individuals Normal Case

  22. Replicas wait for 2f+1 matching commits Record operation in log as committed Execute the operation Send result to the client Normal Case

  23. Client waits for f+1 matching replies Normal Case

  24. Request Pre-Prepare Prepare Commit Reply Client Primary Replica 2 Replica 3 Replica 4 BFT

  25. Replicas watch the primary Request a view change send a do-viewchange request to all new primary requires f+1 requests sends new-view with this certificate Rest is similar View Change (Quite Complex!)

  26. Lower latency for writes (4 messages) Replicas respond at prepare Client waits for 2f+1 matching responses Fast reads (one round trip) Client sends to all; they respond immediately Client waits for 2f+1 matching responses Improved Performance

  27. Batching Run protocol every K requests Improvements

  28. Yet with three differences: In blockchains, only append-only operations are allowed; delete, for instance, is disabled. Blockchains operations are batched and written in the database; SMR does not explicitly require this. Blockchains typically allow anyone to deploy programs (“smart contracts”); SMR typically only allows the system designer to write fixed programs. In this sense, blockchains are more general! Blockchains are SMR (e.g., PBFT)

More Related