Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Libraの現状と技術面をざっくりと / astudy20191114

Libraの現状と技術面をざっくりと / astudy20191114

アスクル社内勉強会で発表した資料です!

B54cc1be9e7ea6e3ff17eaf995fbe35f?s=128

Akihito Nakano

November 14, 2019
Tweet

Transcript

  1. த໺ڿਓΞεΫϧגࣜձࣾ "4UVEZ ΞεΫϧࣾ಺ษڧձ -JCSBͷݱঢ়ͱٕज़໘Λͬ͘͟Γͱ ʙιϑτ΢ΣΞʹҿΈࠐ·Ε͍ͯ͘ੈքʹੜ͖Δࢲͨͪʙ

  2. 8FCΞϓϦέʔγϣϯΤϯδχΞ த໺ڿਓ IUUQTBDLJOUPTIHJUIVCJPBCPVU BDLJOUPTI /","/0@"LJIJUP

  3. 044׆ಈ w0QFO"1*(FOFSBUPS wIUUQTHJUIVCDPN0QFO"1*5PPMTPQFOBQJHFOFSBUPS w(BOFTIB Ψωʔγϟ  wIUUQTHJUIVCDPNBDLJOUPTIHBOFTIB w4OJEFM εφΠσϧ 

    wIUUQTHJUIVCDPNBDLJOUPTITOJEFM
  4. ໨࣍ w ൃදͷΰʔϧ w ֓ཁͱݱঢ় w ໨త w खஈ w

    ݱঢ় w ٕज़໘ w ߹ҙΞϧΰϦζϜ w σʔλߏ଄ w ͓ΘΓʹ ɾॳ०࣌఺ͷ৘ใ ɾઈࢍΩϟονΞοϓதͳͷͰ ɹཧղ͕ؒҧͬͯΔͱ͜Ζ͕͋ͬͨΒ͝ΊΜͳ͍͞ʂ
  5. ൃදͷΰʔϧ w ͍··ͰΩϟονΞοϓͯ͠ͳ͔ͬͨͻͱʹ w -JCSBͬͯͦ͏͍͏ײ͡ͳͷͶʂͱࢥͬͯ΋Β͏͜ͱ ɾ-JCSBʹ͍ͭͯ͸൱ఆ΋ߠఆ΋͠·ͤΜ ɾϒϩοΫνΣʔϯ·ΘΓͷٕज़ʹڵຯ͕͋Δਓ͕ؒ-JCSBʹ͍ͭͯ ·ͱΊͯΈ·ͨ͠ɺͱ͍͏ൃදͰ͢

  6. ໨࣍ w ൃදͷΰʔϧ w ֓ཁͱݱঢ় w ໨త w खஈ w

    ݱঢ় w ٕज़໘ w ߹ҙΞϧΰϦζϜ w σʔλߏ଄ w ͓ΘΓʹ
  7. -JCSB w 'BDFCPPL͕։ൃΛओಋ͍ͯ͠ΔԾ૝௨՟ ҉߸ࢿ࢈ ϓϩδΣΫτ w ൃද w IUUQTMJCSBPSH w

    ϗϫΠτϖʔύʔIUUQTMJCSBPSHXIJUFQBQFS w ςΫχΧϧϖʔύʔIUUQTEFWFMPQFSTMJCSBPSHEPDTUIFMJCSBCMPDLDIBJOQBQFS
  8. ໨త

  9. ໨త w ਺ेԯͷਓͼͱʹྗΛ༩͑ΔɺγϯϓϧͰάϩʔόϧͳ௨՟ͱۚ༥Πϯϑϥ IUUQTMJCSBPSH

  10. ໨త w 4.4ฒΈͷखܰ͞ͱ҆͞Ͱ͓ۚΛૹΕΔΑ͏ʹͳΔ΂͖ IUUQTDBMJCSBDPN

  11. ໨త՝୊ײ w ԯਓ͕ۜߦޱ࠲Λ΋͍ͬͯͳ͍ w ஍ٿਓޱશମͷ w ւ֎ૹۚͷ஗͞ w ʙӦۀ೔͘Β͍ w

    ݱۚऔҾίετͷߴ͞ w ࠃࡍؒͷ৔߹ɺฏۉ IUUQTMJCSBPSH ͜Εʹ͍ͭͯ͸΋͏গ͠ৄ͘͠ௐ΂ͨͷͰ ࣍ͷεϥΠυͰ঺հ͠·͢
  12. ໨త՝୊ײˠ6OCBOLFEʹ͍ͭͯ w ԯਓதࠃɺΠϯυɺύΩελϯʹಛʹଟ͍ ˞  w ޱ࠲ͷҡ࣋ख਺ྉ͕ߴ͍ ૹۚख਺ྉ͕ߴ͍ͱ͍ͬͨཧ༝΋ ˞ 

    w ͦͷ͏ͪԯਓ͸ܞଳి࿩Λ͍࣋ͬͯΔ w ͨͩ͠ܞଳͱΠϯλʔωοτΞΫηεͷ
 ྆ํΛ͍࣋ͬͯΔਓ͸ͦͷ͏ͪ w ˞ΠϯλʔωοτΞΫηεεϚʔτϑΥϯɺ1$ɺωοτΧϑΣͳͲ w (MPCBM'JOEFYͷϨϙʔτͰ͸σδλϧϖΠϝϯτ͕
 ༗ޮͰ͋Δ͜ͱʹ͍ͭͯݴٴ͞Ε͍ͯΔ 5IF(MPCBM'JOEFY%BUBCBTF IUUQTHMPCBMpOEFYXPSMECBOLPSH ˞ ˞
  13. ໨తظ଴஋ w ൃల్্ࠃʹஹυϧΛ΋ͨΒ͢ w  ສਓͷ৽͍͠ޏ༻Λ૑ग़ w ਓʑͷऩೖ͕޲্ w ۃ౓ͷශࠔΛ࡟ݮ

    IUUQTMJCSBPSH
  14. ໨తࢲͨͪͷ฻Β͠΁ͷӨڹ w ೔ຊͰ฻Β͍ͯ͠Δࢲͨͪʹͱͬͯ͸՝୊ײʹগ͠ڑ཭Λײ͡Δʁ w Έͳ͞Μ͸Ͳ͏ࢥ͍·͔͢ʁ

  15. खஈ

  16. खஈϢʔβʔΠϯλʔϑΣʔε w ΢ΥϨοτΞϓϦ$BMJCSB w 'BDFCPPLࢠձࣾͰ͋ΓɺϦϒϥڠձͷҰһͰ΋͋Δ$BMJCSB͕ࣾ։ൃ w .FTTFOHFS΍8IBUT"QQͱͷ࿈ܞͷՄೳੑ

  17. खஈٕज़ w εςʔϒϧίΠϯ w όεέοτ௨՟ w ௨՟಺༁ͱߏ੒ൺ཰ w ถυϧɺϢʔϩɺ೔ຊԁɺӳϙϯυɺγϯΨϙʔϧυϧ w

    σϏουɾϚʔΧε$&0͸υϧ΍Ϣʔϩ౳ͱରͰϖοά͢ΔՄೳੑ΋ݴٴ  w ಠࣗϒϩοΫνΣʔϯ w ߹ҙΞϧΰϦζϜ-JCSB#'5ɺεϚʔτίϯτϥΫτݴޠ.PWF
  18. खஈӡӦମ੍ w -JCSBڠձ w εΠεʹڌ఺ w $BMJCSBؚࣾΉ༷ʑͳۀքͷࢀՃاۀͰߏ੒ w /10ͳͲͷඇӦར૊৫΋ w

    ൃද౰ॳࣾˠࣾ ઃཱ૯ձ࣌఺ IUUQTMJCSBPSHFO64BTTPDJBUJPOGPVOEJOH@NFNCFST IUUQTMJCSBPSHFO64BTTPDJBUJPODPVODJMQSJODJQMFTPWFSWJFX
  19. खஈ։ൃମ੍ w Φʔϓϯιʔε w ͢Ͱʹެ։͞Ε͍ͯΔ IUUQTHJUIVCDPNMJCSBMJCSB ίϯτϦϏϡʔτ͠·ͨ͠

  20. ঢ়گ

  21. ঢ়گ w ౰ॳͷϦϦʔε༧ఆ͸Ԇظ w ೥લ൒ˠະఆʁ w βοΧʔόʔάࢯ͕ެௌձͰʮۚ༥౰ہͷݒ೦ʹશ໘తʹରॲͰ͖Δ·Ͱ։࢝ Λ஗ΒͤΔʯͱ໌ݴ w ౰ॳൃද͞Ε͍ͯͨࢀՃاۀ͕͍͔ͭ͘୤ୀ

    w ൃද౰ॳࣾ  ˠࣾ ઃཱ૯ձ࣌఺  w 1BZ1BMɺFCBZɺ7*4"ɺ.BTUFS$BSEɺTUSJQFɺNFSDBEPQBHPɺ#PPLJOHDPN
  22. ঢ়گ w ใಓ w ถԼӃۚ༥αʔϏεҕһ௕-JCSBͷ։ൃܭըͷఀࢭΛٻΊΔ w (࡞ۀ෦ձٞ௕-JCSBɺن੍্ͷݒ೦ղফ͢Δ·Ͱ࣮ݱ͠ͳ͍ w ถ੓෎͕-JCSBڠձࢀՃاۀ΁จষΛૹ෇ w

    (ࡒ຿লɾதۜ૯ࡋձٞʮਂࠁͳϦεΫʹద੾ʹରॲʯ͢Δ·ͰൃߦΛೝΊͳ͍ํ਑ w ಠ෹ҏ͕-JCSBΛϒϩοΫ͢Δํ਑Λද໌ w ࠃࡍػؔ౳͔Βग़͞Εͨจॻ w (8PSLJOH(SPVQPO4UBCMF$PJOT*OWFTUJHBUJOHUIFJNQBDUPGHMPCBMTUBCMFDPJOT w (ࡒ຿େਉɾதԝۜߦ૯ࡋձٞάϩʔόϧɾεςʔϒϧίΠϯʹؔ͢Δ(ϓϨεϦϦʔε w '"5'.POFZMBVOEFSJOHSJTLTGSPNlTUBCMFDPJOTzBOEPUIFSFNFSHJOHBTTFUT
  23. ঢ়گ w ެௌձ w  Ϧϒϥͷ੹೚ऀσϏουɾϚʔΧεࢯ͕ূݴ w ʮΘΕΘΕ͕ߦಈ͠ͳ͚Ε͹ɺՁ஋؍͕ϑΣΠεϒοΫͷͦΕͱ͸·ͬͨ͘ҟͳΔਓʑ͕؅ཧ͢Δσδλ ϧ௨՟͕ɺ͙͢͞·ग़ͯ͘Δ͜ͱͰ͠ΐ͏ʯ w

    'BDFCPPL$&0ϚʔΫɾβοΧʔόʔάࢯ͕ূݴ w ʮ΋͠ڐೝՄͳ͠Ͱ-JCSBڠձ͕ܭըΛਐΊΑ͏ͱ͢Ε͹ɺ'BDFCPPL͸ڠձΛ཭୤͢Δʯ w ʮ-JCSB͸ૹۚΛ༰қʹ͢Δ͜ͱ͕໨తͰ͋Γɺ๏ఆ௨՟ͱͷڝ߹΍ۚ༥੓ࡦʹӨڹΛٴ΅͢͜ͱ͸ҙਤ ͍ͯ͠ͳ͍ʯ w ʮถࠃ͕͜ͷ෼໺ΛϦʔυ͠ͳ͚Ε͹ɺଞࠃ͕͢ΔͩΖ͏ɻଞࠃͷ੓෎΍اۀ͸ɺถࠃͱಉ͡ن੍੍౓΍ ಁ໌ੑʹର͢ΔίϛοτϝϯτΛ࣋ͨͣʹ࣮ߦ͢Δ͔΋͠Εͳ͍ʯ &YBNJOJOH'BDFCPPL`T1SPQPTFE$SZQUPDVSSFODZBOE*UT*NQBDUPO &WFOU*%  IUUQTXXXZPVUVCFDPNXBUDI W;5L$/8X "O&YBNJOBUJPOPG'BDFCPPLBOE*UT*NQBDUPOUIF'JOBODJBM4FSWJDF &WFOU*%  IUUQTXXXZPVUVCFDPNXBUDI WJT5##QM4"
  24. ঢ়گݒ೦ͷϙΠϯτ w ๏తͳ໌֬͞ w Ψόφϯεʢཪ෇͚ࢿ࢈΁ͷ౤ࢿɺՁ஋҆ఆԽϝΧχζϜʹ͍ͭͯʣ w Ϛωϩϯɺςϩࢿۚڙ༩౳ෆਖ਼ͳࢿۚऔҾʹ࢖ΘΕΔϦεΫ w ϓϥΠόγʔอޢ w

    ফඅऀอޢɾ౤ࢿՈอޢ w ੫຿্ͷίϯϓϥΠΞϯε w ۚ༥੓ࡦ΁ͷѱӨڹ w ࠃࡍతͳ௨՟ମ੍΁ͷѱӨڹ εςʔϒϧίΠϯʹؔ͢Δ(ٞ௕੠໌ IUUQXXXCPKPSKQBOOPVODFNFOUTSFMFBTF@SFMEIUN
  25. ঢ়گ w ΩϟαϦϯɾϙʔλʔࢯ͕CUPLZPͰొஃ w ʮڠௐʯΛ܁Γฦ͠ൃݴ͞Ε͍ͯͨ w ˠʮ֤ࠃͷن੍౰ہͱे෼ʹڠௐ͠ͳ͕ΒαʔϏε։࢝Λ໨ࢦ͍ͨ͠ʯ IUUQTOBWFOVFKQCUPLZP

  26. ঢ়گ͜͜·Ͱͷͬ͘͟Γ·ͱΊ w ن੍౰ہͳͲ w άϩʔόϧεςʔϒϧίΠϯʹطଘͷ໰୊ΛղܾͰ͖ΔՄೳੑ͕͋Δ͜ͱ͸͔֬ͩ ͕ɺॾʑͷϧʔϧ͕੔උͰ͖͍ͯͳ͍ w ๏཯ɺن੍্ͷ՝୊͕ΫϦΞʹͳΒͳ͍͏ͪ͸ϓϩδΣΫτͷ։࢝͸ೝΊͳ͍ w 'BDFCPPLɺ$BMJCSB

    w ϦεΫΛ๊͑ͨ··ϩʔϯν͢Δؾ͸ແ͍ w -JCSBͷ։ൃΛߦ͍ͳ͕Βڠௐͯ͠ਐΊ͍͖͍ͯͨ աڈͷ'BDFCPPLͷݸਓ৘ใ΍ϑΣΠΫ χϡʔεͳͲͷ໰୊Λڍ͛ͯڧ͘൷൑͢Δ ਓͨͪ΋ɻ ͔ͦ͜Βઌͷٞ࿦͸ʁ
  27. ໨࣍ w ൃදͷΰʔϧ w ֓ཁͱݱঢ় w ໨త w खஈ w

    ݱঢ় w ٕज़໘ w ߹ҙΞϧΰϦζϜ w σʔλߏ଄ w ͓ΘΓʹ
  28. ٕज़໘࿩͢͜ͱ࿩͞ͳ͍͜ͱ w ࿩͢͜ͱ߹ҙΞϧΰϦζϜɺσʔλߏ଄ ΞΧ΢ϯτ͚ͩ  w ࿩͞ͳ͍͜ͱ.PWFݴޠ IUUQTEFWFMPQFSTMJCSBPSHEPDTBTTFUTQBQFSTUIFMJCSBCMPDLDIBJOQEG

  29. ߹ҙΞϧΰϦζϜ

  30. ߹ҙΞϧΰϦζϜԿΛ߹ҙ͍ͯ͠Δͷ͔ w τϥϯβΫγϣϯͷॱ൪ w τϥϯβΫγϣϯͷ݁Ռ w ˠ4UBUF.BDIJOF3FQMJDBUJPO 4.3 IUUQTEFWFMPQFSTMJCSBPSHEPDTMJCSBQSPUPDPM -JCSB1SPUPDPM,FZ$PODFQUT5SBOTBDUJPOTBOE4UBUFT

  31. ߹ҙΞϧΰϦζϜ-JCSB#'5ͷݩʹͳ͍ͬͯΔΞϧΰϦζϜ IUUQTNFEJVNDPNDPJONPOLTQCGUVOEFSTUBOEJOHUIFBMHPSJUINCBBF IUUQTNFEJVNDPNPOUPMPHZOFUXPSLIPUTUV⒎UIFDPOTFOTVTQSPUPDPMCFIJOEGBDFCPPLTMJCSBCGUBC 1#'5 )PU4UV⒎

  32. ߹ҙΞϧΰϦζϜ-JCSB#'5ͷมߋ఺ w 4.3ͷܾఆੑ͕όάͬͯ΋େৎ෉ͳΑ͏ʹɺόϦσʔλ͸5Yͷॱ൪͚ͩͰͳ݁͘Ռʹ ΋ॺ໊͢Δʢ'BJMTBGFͷͨΊʁʣ HotStuff Extensions and Modifications IUUQTHJUIVCDPNMJCSBMJCSBUSFFNBTUFSDPOTFOTVTIPUTUV⒎FYUFOTJPOTBOENPEJpDBUJPOT ʢଞʹ΋มߋ఺͕͍͔ͭ͘ॻ͍ͯ͋Δ͚ͲɺΑ͘Θ͔Γ·ͤΜͰͨ͠…ʣ

    ͔ͨ͠ʹHotStuffͰ͸ɺ ʹॺ໊͍ͯ͠Δ ⟨type, viewNumber, node⟩ LibraBFT > 4.2. Verification of Network Records IUUQTEFWFMPQFSTMJCSBPSHEPDTBTTFUTQBQFSTMJCSBDPOTFOTVTTUBUFNBDIJOFSFQMJDBUJPOJOUIFMJCSBCMPDLDIBJOQEG HotStuff > 4.2 Data Structure IUUQTBSYJWPSHQEGQEG (௥ه) ਵ࣌վળ͕ߦΘΕ͍ͯΔ໛༷ ˠIUUQTEFWFMPQFSTMJCSBPSHCMPH
  33. ߹ҙΞϧΰϦζϜ5SBOTBDUJPOT1FS4FDPOE 514 w ϖʔύʔͷઆ໌Ͱ͸ 514 w ࢀߟ"MJQBZ͕8  ʹ 514

    w શવ଍Γͳ͍ʁ IUUQTEFWFMPQFSTMJCSBPSHEPDTBTTFUTQBQFSTUIFMJCSBCMPDLDIBJOQEG 1FSGPSNBODF 8FBOUJDJQBUFUIBUNBOZQBZNFOUUSBOTBDUJPOTXJMMPDDVSP⒎DIBJO GPSFYBNQMF XJUIJO BDVTUPEJBMXBMMFUPSCZVTJOHQBZNFOUDIBOOFMT<> w αΠυνΣʔϯతͳ΋ͷΛ૝ఆ͍ͯ͠Δͱॻ͔Ε͍ͯΔ ࢀߟ ΠʔαϦΞϜεέʔϦϯάͷഎܠͱ֓ཁ IUUQTTQFBLFSEFDLDPNPTVLFJTBSJBNVTVLFSJOHVGBMTFCFJKJOHUPHBJZBP TMJEF ΦϑνΣʔϯͷٕज़Λ࢖͏͜ͱͰϝΠϯνΣʔϯͷঢ়ଶભҠΛ࠷খݶʹ͢Δ ˣ ϘτϧωοΫ͕߹ҙΞϧΰϦζϜ͔ΒΦϑνΣʔϯଆͷॲཧೳྗʹҠΔ ˣ ཧ࿦తʹ͸ݱࡏͱಉ౳ͷύϑΥʔϚϯε͕ग़Δ͸ͣ
  34. σʔλߏ଄

  35. σʔλߏ଄4UPSBHFϞδϡʔϧ w -FEHFS*OGP 5SBOTBDUJPOT  w &WFOUT "DDPVOU4UBUFT IUUQTEFWFMPQFSTMJCSBPSHEPDTDSBUFTTUPSBHF IUUQTEFWFMPQFSTMJCSBPSHEPDTMJCSBQSPUPDPM

  36. σʔλߏ଄+FMMZpTI.FSLMF5SFF w CJUͷ4QBSTF.FSLMF5SFF w *OUFSOBM/PEFͱ-FBG/PEFͰߏ੒ IUUQTHJUIVCDPNMJCSBMJCSBCMPCNBTUFSTUPSBHFKFMMZpTINFSLMFTSDMJCST

  37. σʔλߏ଄+FMMZpTI.FSLMF5SFF w ࢀߟ4QBSTF.FSLMF5SFF IUUQTNFEJVNDPN!LFMWJOpDIUFSXIBUTBTQBSTFNFSLMFUSFFBDEBBFC lؚ·Ε͍ͯΔzূ໌ lؚ·Ε͍ͯͳ͍zূ໌

  38. σʔλߏ଄+FMMZpTI.FSLMF5SFF w *OUFSOBM/PEFͱ4QBSTF.FSLMF5SFF CJUͷ4QBSTF.FSLMF5SFF ˣ CJUͷ4QBSTF.FSLMF5SFF͕࠷େਂ͞·Ͱॏͳͬͯ CJUΞυϨεͷεςʔτΛදݱ͍ͯ͠Δ

  39. σʔλߏ଄+FMMZpTI.FSLMF5SFF w ϒϩάʹॻ͖·ͨ͠ w ιʔείʔυΛ௥ͬͨΓɺ w &UIFSFVNͱͷൺֱΛ͍ͯ͠·͢ IUUQTBDLJOUPTIHJUIVCJPCMPHKFMMZpTINFSLMFUSFF

  40. ໨࣍ w ൃදͷΰʔϧ w ֓ཁͱݱঢ় w ໨త w खஈ w

    ݱঢ় w ٕज़໘ w ߹ҙΞϧΰϦζϜ w σʔλߏ଄ w ͓ΘΓʹ
  41. ͓ΘΓʹ w -JCSBͷݱঢ়ͱٕज़໘ʹ͍ͭͯͬ͘͟ΓΈ͖ͯ·ͨ͠ w ͦ͏͍͏ײ͡ͳͷͶʂͱࢥͬͯ΋Β͑ͨΒΰʔϧୡ੒ w -JCSB͸εϚʔτίϯτϥΫτͷ࣮ߦ͕Մೳ  w &UIFSFVN΍&04ͷΑ͏ʹΞϓϦέʔγϣϯ։ൃ͕Մೳ

  42. ͓ΘΓʹ w ιϑτ΢ΣΞ͕ੈքΛҿΈࠐΜͰ͍͘CZϚʔΫɾΞϯυϦʔηϯ w ΋͠-JCSB͕ίέͯ΋ɺผͷ-JCSBతͳ΋ͷ͕ීٴ͢ΔͷͰ͸ͳ͍͔ ຽؒɺࠃɺͦͷଞʁʣ w ιϑτ΢ΣΞͰͰ͖Δ͜ͱ͕ͲΜͲΜ޿͕͍ͬͯ͘͜ͷ࣌୅ʹιϑτ΢ΣΞͷϓϩͱ͠ ͯੜ͖͍ͯΔͷ͸޾ӡͳ͜ͱ IUUQTXXXXTKDPNBSUJDMFT4#

    ೔ຊޠ༁IUUQTPSBSBJOCPXBQQTDPNTPGUXBSF #BOLJOHJTOFDFTTBSZ —#BOLTBSFOPU #JMM(BUFT 
  43. ͢΂ͯΦʔϓϯιʔε ΍͍͖ͬͯ·͠ΐ͏