mlsm making authenticated storage faster in ethereum
play

mLSM : Making Authenticated Storage Faster in Ethereum Pandian Raju - PowerPoint PPT Presentation

mLSM mLSM : Making Authenticated Storage Faster in Ethereum Pandian Raju 1 , Soujanya Ponnapalli 1 , Evan Kaminsky 1 , Gilad Oved 1 , Zachary Keener 1 Vijay Chidambaram 1,2 , Ittai Abraham 2 1 The University of Texas at Austin; 2 VMware Research 1


  1. mLSM mLSM : Making Authenticated Storage Faster in Ethereum Pandian Raju 1 , Soujanya Ponnapalli 1 , Evan Kaminsky 1 , Gilad Oved 1 , Zachary Keener 1 Vijay Chidambaram 1,2 , Ittai Abraham 2 1 The University of Texas at Austin; 2 VMware Research 1

  2. Et Ethereum • Distributed software platform • Cryptocurrency applications • Key-value store • Accounts : Balances • Trustless Decentralized setting 2

  3. Et Ethereum – Di Distribut buted d De Decentral alized d System B1 B2 B3 B4 Node4 Node4 Node1 Node3 Node2 3

  4. Ne Need for or Au Auth thenti ticated St Stor orage Balance : $0 A User A, Balance: $500 Balance (A) ? Balance : $0 User B, Balance: $5000 User C, Balance: $500000 User A, Balance: $0 User B, Balance: $5000 User C, Balance: $0 4

  5. Au Auth thenti ticated Stor orage • Users can verify the value returned by a node • Each read is returned with the value and a proof User A, Balance: $500 Balance (A) ? A User B, Balance: $5000 [ $500, PROOF ] User C, Balance: $500000 5

  6. Au Auth thenti ticati tion on Techniques in Eth thereum • Ethereum authenticated storage suffer from high IO Amplification • 64x in the worst case • IO Amplification • Ratio of the amount of IO to the amount of user data User data : 10 GB User data : 10 GB Total write IO : 500 GB Client Server Write Amplification : 50 6

  7. Wh Why is s IO Amplification bad? • Reduces the write throughput • Directly impact the life of Flash devices • Flash devices wear out after limited write cycles (Intel SSD DC P4600 can last ~5 years assuming ~5 TB write per day) For the same SSD life expectancy, with 65x IO Amplification, instead of 5TB of data we can now only write ~75 GB of user data per day 7

  8. Ho How to des esign gn an authen enticated ed storage e system em th that t min minimiz imizes s IO O amp amplif lific ication tion? Merkelized LSM • Maintains multiple mutually independent binary merkle trees • Decouples lookup from authentication • Minimizes IO Amplification 8

  9. Ou Outline • Authentication in Ethereum • Why caching doesn’t work? • Merkelized LSM 9

  10. Aut Authe henticated d St Storage in n Et Ethereum 10

  11. Me Merkle Trees – Fu Fundamen ental b building b blocks With a constant sized root hash, we can authenticate all the key-value pairs Root hash is publicly H(v1-4’) H(v1-4) available to all clients H(v1-2) H(v3-4’) H(v3-4) K4 : V4’ K1 : v1 K2 : v2 K3 : v3 K4 : v4 11

  12. Au Auth thenti ticati tion on using g Merkle Trees • Client queries for value of key k4 Root • Server replies with the value P1 P2 K1 : v1 K2 : v2 K3 : v3 K4 : v4 K4 : v4 12

  13. Au Auth thenti ticati tion on using g Merkle Trees • Client queries for value of key k4 Root Root • Server replies with the value • Along with a Merkle Proof P1 P1 P2 K1 : v1 K2 : v2 K3 : v3 K4 : v4 K3 : v3 K4 : v4 13

  14. Auth Au thenti ticati tion on using g Merkle Trees • Client queries for value of key k4 Root • Server replies with the value • Along with a Merkle Proof P1 P2 K1 : v1 K2 : v2 K3 : v3 K4 : v4 K4 : v4 Response : Root P1 k3 : v3 K4 : v4 14

  15. Auth Au thenti ticati tion on using g Merkle Trees • Client verifies the value by calculating the root hash from Root the value and Merkle proof P1 P2 K1 : v1 K2 : v2 K3 : v3 K4 : v4 K4 : v4 Response : Root P1 k3 : v3 K4 : v4 15

  16. Au Auth thenti ticati tion on using g Merkle Trees • Client verifies the value by calculating the root hash from Root the value and Merkle proof P1 P2 K1 : v1 K2 : v2 K3 : v3 K4 : v4 K4 : v4 Response : Root P1 K3 : v3 K4 : v4 16

  17. Au Auth thenti ticati tion on using g Merkle Trees • Client verifies the value by calculating the root hash from Root the value and Merkle proof P1 P2 P2 K1 : v1 K2 : v2 K3 : v3 K4 : v4 Response : Root P1 P2 17

  18. Au Auth thenti ticati tion on using g Merkle Trees • Client queries for value of key k4 Root • Server replies with value and a Merkle Proof P1 P2 K1 : v1 K2 : v2 K3 : v3 K4 : v4 Response : Root P1 P2 18

  19. Auth Au thenti ticati tion on using g Merkle Trees • Client queries for value of key k4 Root • Server replies with value and a Merkle Proof P1 P2 P1 K1 : v1 K2 : v2 K3 : v3 K4 : v4 Response : Root P1 P2 19

  20. Auth Au thenti ticati tion on using g Merkle Trees • Client verifies the value by calculating the root hash from Root the value and Merkle proof P1 P2 K1 : v1 K2 : v2 K3 : v3 K4 : v4 Response : Root Root 20

  21. Au Auth thenti ticati tion on using g Merkle Trees • Client verifies the value by calculating the root hash from Root the value and Merkle proof P1 P2 K1 : v1 K2 : v2 K3 : v3 K4 : v4 Root ? Response : Root 21

  22. Au Auth thenti ticati tion on using g Merkle Trees • Server can no longer lie about the data Root P1 P2 K1 : v1 K2 : v2 K3 : v3 K4 : v4 K4 : v4 Response : Root P1 k3 : v3 K4 : v4’ 22

  23. Au Auth thenti ticati tion on using g Merkle Trees • Server can no longer lie about the value Root P1 P2 K1 : v1 K2 : v2 K3 : v3 K4 : v4 K4 : v4 Response : Root P1 K3 : v3 K4 : v4’ 23

  24. Au Auth thenti ticati tion on using g Merkle Trees • Client verifies the value by calculating the root hash from Root the value and Merkle proof P1 P2 P2 K1 : v1 K2 : v2 K3 : v3 K4 : v4 Response : Root P1 P2’ 24

  25. Au Auth thenti ticati tion on using g Merkle Trees • Client queries for value of key k4 Root • Server replies with value and a Merkle Proof P1 P2 K1 : v1 K2 : v2 K3 : v3 K4 : v4 Response : Root P1 P2’ 25

  26. Auth Au thenti ticati tion on using g Merkle Trees • Client queries for value of key k4 Root • Server replies with value and a Merkle Proof P1 P2 P1 K1 : v1 K2 : v2 K3 : v3 K4 : v4 Response : Root P1 P2’ 26

  27. Auth Au thenti ticati tion on using g Merkle Trees • Client verifies the value by calculating the root hash from Root the value and Merkle proof P1 P2 K1 : v1 K2 : v2 K3 : v3 K4 : v4 Response : Root’ Root 27

  28. Auth Au thenti ticati tion on using g Merkle Trees • Server cannot lie about the value Root P2 P1 K1 : v1 K3 : v3 K4 : v4 K2 : v2 Root’ ? Response : Root 28

  29. Me Merkle Patricia a Trie • Similar to Merkle trees • Lookup based on the key structure Root Hash Branching: 0 - f • Considering 4 bit hex key-value pairs: 2 5 • 0x20 – V1 P1 P2 • 0x2f – V2 • 0x51 – V3 e 1 0 f • 0x5e – V4 V1 V4 V2 V3 29

  30. Au Auth thenti ticated Stor orage in Eth thereum • Trie is flattened and stored as key value pairs Root Hash • For every leaf node V, we store Branching: 0 - f 2 5 [Hash(V) -> V] • For every parent node P, we have an P1 P2 [Hash(P) -> [ … ]]. e 1 0 f V1 V4 V2 V3 30

  31. Au Auth thenti ticated Stor orage in Eth thereum KEY VALUE Root Hash Branching: 0 - f 2 5 P1 P2 e 1 0 f V1 V4 V2 V3 31

  32. Auth Au thenti ticated Stor orage in Eth thereum KEY VALUE Hash (V1) V1 Root Hash Hash (V2) V2 Branching: 0 - f Hash (V3) V3 2 5 Hash (V4) V4 P1 P2 e 1 0 f V1 V4 V2 V3 32

  33. Au Auth thenti ticated Stor orage in Eth thereum KEY VALUE Hash (V1) V1 Root Hash Hash (V2) V2 Branching: 0 - f Hash (V3) V2 2 5 Hash (V4) V3 P1 P2 Hash (P1) Hash (V1), Hash (V2) Hash (P2) Hash (V3), e 1 0 f Hash (V4) V1 V4 V2 V3 33

  34. Au Auth thenti ticated Stor orage in Eth thereum KEY VALUE Hash (V1) V1 Root Hash Hash (V2) V2 Branching: 0 - f Hash (V3) V3 2 5 Hash (V4) V4 P1 P2 Hash (P1) Hash (V1), Hash (V2) Hash (P2) Hash (V3), e 1 0 f Hash (V4) Hash (RH) Hash (P1), Hash (P2) V1 V4 V2 V3 34

  35. Re Read Amplification in Ethereum Get (0x2f) KEY VALUE Hash (V1) V1 Root Hash Hash (V2) V2 Branching: 0 - f Hash (V3) V3 2 5 Hash (V4) V4 P1 P2 Hash (P1) Hash (V1), Hash (V2) Hash (P2) Hash (V3), Hash (V4) e 1 0 f Hash (RH) Hash (P1), Hash (P2) V1 V4 V2 V3 35

  36. Re Read Amplification in Ethereum Get (0x2f) Get (Hash(RH)) KEY VALUE Hash (V1) V1 Root Hash Hash (V2) V2 Branching: 0 - f Hash (V3) V3 2 5 Hash (V4) V4 P1 P2 Hash (P1) Hash (V1), Hash (V2) Hash (P2) Hash (V3), Hash (V4) e 1 0 f Hash (RH) Hash (P1), Hash (P2) V1 V4 V2 V3 36

  37. Re Read Amplification in Ethereum Get (0x2f) Get (Hash(P1)) KEY VALUE Hash (V1) V1 Root Hash Hash (V2) V2 Branching: 0 - f Hash (V3) V3 2 5 Hash (V4) V4 P1 P2 Hash (P1) Hash (V1), Hash (V2) Hash (P2) Hash (V3), Hash (V4) e 1 0 f Hash (RH) Hash (P1), Hash (P2) V1 V4 V2 V3 37

  38. Re Read Amplification in Ethereum Get (0x2f) Get (Hash(V2)) KEY VALUE Hash (V1) V1 Root Hash Hash (V2) V2 Branching: 0 - f Hash (V3) V3 2 5 Hash (V4) V4 P1 P2 Hash (P1) Hash (V1), Hash (V2) Hash (P2) Hash (V3), Hash (V4) e 1 0 f Hash (RH) Hash (P1), Hash (P2) V1 V4 V2 V3 38

Recommend


More recommend