CAR Pool & More

A presentation at IPFS þing in July 2022 in Reykjavík, Iceland by Brooklyn Zelenka

Slide 1

Slide 1

⚡📦 CAR Pool & More 🚙💨 A Pragmatic Improvement to Sync Performance github.com/fission-suite/spec/car-pool

Slide 2

Slide 2

Slide 3

Slide 3

The limitation of local knowledge is the fundamental fact about the setting in which we work, and it is a very powerful limitation – Nancy Lynch, A Hundred Impossibility Proofs for Distributed Computing

Slide 4

Slide 4

Slide 5

Slide 5

Some peers are “more peer” than others (especially in an operator context)

Slide 6

Slide 6

BROOKLYN ZELENKA JUSTIN JOHNSON @expede CTO @ Fission @justincjohnson IPFS Engineer @ Fission Won’t have time to cover everything in depth. Come talk to us after, or read the spec ;)

Slide 7

Slide 7

Caveat Trusted, Point-to-Point IPLD Transfer

Slide 8

Slide 8

The Problem Pain In Practice ❤🩹

Slide 9

Slide 9

The Problem Why?

Slide 10

Slide 10

The Problem Why? We 💕 IPLD Fission has deeply nested, cross-linked data that Cannot fit into browser storage Benefits from deduplication Has multiple writers Using mature, universally supported transports would be awesome “Light clients” Speed of light concerns

Slide 11

Slide 11

The Problem Food. Water. Shelter.

Slide 12

Slide 12

The Problem Food. Water. Shelter.

Slide 13

Slide 13

The Problem Flakiness in Browsers & CLI & GitHub Actions

Slide 14

Slide 14

The Problem Flakiness in Browsers & CLI & GitHub Actions 🖥

Slide 15

Slide 15

The Problem Are You There? 🤳

Slide 16

Slide 16

The Problem Are You There? 🤳 Keeping nodes reliably connected in production is extremely di cult (browser, server, desktop, mobile) Private networks don’t make sense for our use case ffi (We’d love to share an operator node architecture wish list with any maintainers, though)

Slide 17

Slide 17

The Problem Are You There? 🤳 Keeping nodes reliably connected in production is extremely di cult (browser, server, desktop, mobile) Private networks don’t make sense for our use case (We’d love to share an operator node architecture wish list with any maintainers, though) ffi Up/down over a HTTP Gateway is just LARPing decentralization 🌶

Slide 18

Slide 18

The Problem Are You There? 🤳 Keeping nodes reliably connected in production is extremely di cult (browser, server, desktop, mobile) Private networks don’t make sense for our use case (We’d love to share an operator node architecture wish list with any maintainers, though) Up/down over a HTTP Gateway is just LARPing decentralization 🌶 ffi Native push doesn’t make sense

Slide 19

Slide 19

The Problem Are You There? 🤳 Keeping nodes reliably connected in production is extremely di cult (browser, server, desktop, mobile) Private networks don’t make sense for our use case (We’d love to share an operator node architecture wish list with any maintainers, though) Up/down over a HTTP Gateway is just LARPing decentralization 🌶 Native push doesn’t make sense ffi 🖥

Slide 20

Slide 20

The Problem Are You There? 🤳 Keeping nodes reliably connected in production is extremely di cult (browser, server, desktop, mobile) Private networks don’t make sense for our use case (We’d love to share an operator node architecture wish list with any maintainers, though) Up/down over a HTTP Gateway is just LARPing decentralization 🌶 Native push doesn’t make sense ffi 🖥 💾

Slide 21

Slide 21

The Problem Bitswap Redux

Slide 22

Slide 22

The Problem Bitswap Redux

Slide 23

Slide 23

The Problem Bitswap Redux 🎁?

Slide 24

Slide 24

The Problem Bitswap Redux 🎁? 🎁!

Slide 25

Slide 25

The Problem Bitswap Redux 🎁? 👀 🎁!

Slide 26

Slide 26

The Problem Bitswap Redux 🎁? 👀 🎁! 🔑🌲?

Slide 27

Slide 27

The Problem Bitswap Redux 🎁? 👀 🎁! 🔑🌲? 🔑🌲!

Slide 28

Slide 28

The Problem Bitswap Redux 🎁? 👀 🎁! 🔑🌲? 🔑🌲! 👀

Slide 29

Slide 29

The Problem Bitswap Redux 🎁? 👀 🎁! 🔑🌲? 🔑🌲! 👀 💾 🎟 🖼?

Slide 30

Slide 30

The Problem Bitswap Redux 🎁? 👀 🎁! 🔑🌲? 🔑🌲! 👀 💾 🎟 🖼? 🎟!

Slide 31

Slide 31

The Problem Bitswap Redux 🎁? 👀 🎁! 🔑🌲? 🔑🌲! 👀 💾 🎟 🖼? 🎟! 👀

Slide 32

Slide 32

The Problem Bitswap Redux 🎁? 👀 🎁! 🔑🌲? 🔑🌲! 👀 💾 🎟 🖼? 🎟! 👀 🧸?

Slide 33

Slide 33

The Problem Bitswap Redux 🎁? 👀 🎁! 🔑🌲? 🔑🌲! 👀 💾 🎟 🖼? 🎟! 👀 🧸? 🧸!

Slide 34

Slide 34

The Problem Bitswap Redux 🎁? 👀 🎁! 🔑🌲? 🔑🌲! 👀 💾 🎟 🖼? 🎟! 👀 🧸? 🧸!

Slide 35

Slide 35

The Problem Bitswap Redux 🗜 🎁? 👀 🎁! 🔑🌲? 🔑🌲! 👀 💾 🎟 🖼? 🎟! 👀 🧸? 🧸!

Slide 36

Slide 36

The Problem Breadth vs Depth

Slide 37

Slide 37

The Problem Breadth vs Depth

Slide 38

Slide 38

The Problem Breadth vs Depth ✅

Slide 39

Slide 39

The Problem Breadth vs Depth ✅

Slide 40

Slide 40

The Problem Breadth vs Depth ✅ ❌

Slide 41

Slide 41

The Problem Breadth vs Depth ❌ ✅ ☝

Slide 42

Slide 42

Prior Art On the Shoulders of Giants

Slide 43

Slide 43

Prior Art IPFS Ecosystem

Slide 44

Slide 44

Prior Art IPFS Ecosystem Qri’s DSync GraphSync, Selectors (orthogonal) WNFS(v1) Hashed History Table Merkle Bloom

Slide 45

Slide 45

The Problem Papers 📜

Slide 46

Slide 46

The Problem Papers 📜 To Push or Pull: On Reducing Communication and Synchronization in Graph Computations What’s The Di erence? E cient Set Reconciliation Without Prior Context Synchronizing Namespaces with Invertible Bloom Filters The Hash History Approach for Reconciling Mutual Inconsistency HEX BLOOM: An E cient Method for Authenticity and Integrity Verification in Privacy-preserving Computing ffi ffi ff The Distributed Bloom Filter

Slide 47

Slide 47

CAR Mirror One-to-One

Slide 48

Slide 48

CAR Mirror Strategy

Slide 49

Slide 49

CAR Mirror Strategy Reduce graph scope Send index with request Use heuristics to find deduplication

Slide 50

Slide 50

CAR Mirror

Slide 51

Slide 51

CAR Mirror Balancing Factors

Slide 52

Slide 52

CAR Mirror Balancing Factors Latency Accuracy/Deduplication

Slide 53

Slide 53

CAR Mirror Balancing Factors Latency Accuracy/Deduplication

Slide 54

Slide 54

CAR Mirror Balancing Factors Latency Accuracy/Deduplication

Slide 55

Slide 55

CAR Mirror Balancing Factors Latency Equilibrium TL;DR We can a ord to be messy ff Accuracy/Deduplication

Slide 56

Slide 56

CAR Mirror First Reduce Scope

Slide 57

Slide 57

CAR Mirror First Reduce Scope AOT Mutable pointers (IPNS, DNSLink, ENS, di ed CID, etc) ff Previous CAR Mirror sessions

Slide 58

Slide 58

CAR Mirror First Reduce Scope AOT Mutable pointers (IPNS, DNSLink, ENS, di ed CID, etc) Previous CAR Mirror sessions Adaptive Optimization ff Previous CAR Mirror rounds

Slide 59

Slide 59

CAR Mirror First Reduce Scope AOT Mutable pointers (IPNS, DNSLink, ENS, di ed CID, etc) Previous CAR Mirror sessions Adaptive Optimization Previous CAR Mirror rounds No Overlap or Cold Start If the set is small, use random nodes ff “Worst case” looks very similar to Bitswap

Slide 60

Slide 60

CAR Mirror Back of the Napkin

Slide 61

Slide 61

CAR Mirror Back of the Napkin 500k nodes

Slide 62

Slide 62

CAR Mirror Back of the Napkin 500k nodes 46-59 chars + 1 delimiter each ~ average 53 chars each

Slide 63

Slide 63

CAR Mirror Back of the Napkin 500k nodes 46-59 chars + 1 delimiter each ~ average 53 chars each 53 ASCII chars x 500k nodes = 26.5MB

Slide 64

Slide 64

CAR Mirror Back of the Napkin 500k nodes 46-59 chars + 1 delimiter each ~ average 53 chars each 53 ASCII chars x 500k nodes = 26.5MB Gzipped ~ 11.5MB

Slide 65

Slide 65

CAR Mirror Back of the Napkin 500k nodes 46-59 chars + 1 delimiter each ~ average 53 chars each 53 ASCII chars x 500k nodes = 26.5MB Gzipped ~ 11.5MB

Slide 66

Slide 66

CAR Mirror Back of the Napkin 500k nodes 46-59 chars + 1 delimiter each ~ average 53 chars each 53 ASCII chars x 500k nodes = 26.5MB Gzipped ~ 11.5MB 🤔 ? r e t t e b o d e w Can

Slide 67

Slide 67

CAR Mirror Bloom Filter Primer

Slide 68

Slide 68

CAR Mirror Context and Heuristics

Slide 69

Slide 69

CAR Mirror Context and Heuristics 500k nodes @ FPP 1/1M = 1.71MB

Slide 70

Slide 70

CAR Mirror Context and Heuristics (Recommend +1 OOM) 500k nodes @ FPP 1/1M = 1.71MB

Slide 71

Slide 71

CAR Mirror Context and Heuristics (Recommend +1 OOM) 500k nodes @ FPP 1/1M = 1.71MB 93% savings! 👍

Slide 72

Slide 72

CAR Mirror Context and Heuristics (Recommend +1 OOM) 500k nodes @ FPP 1/1M = 1.71MB Gzipped ~ 896 KB 93% savings! 👍

Slide 73

Slide 73

CAR Mirror Context and Heuristics (Recommend +1 OOM) 500k nodes @ FPP 1/1M = 1.71MB 93% savings! 👍 Gzipped ~ 896 KB 92% savings! 👍

Slide 74

Slide 74

CAR Mirror Context and Heuristics (Recommend +1 OOM) 500k nodes @ FPP 1/1M = 1.71MB 93% savings! 👍 Gzipped ~ 896 KB 92% savings! 👍 AKA ~ 1 x OOM 🎉 Zero false positives on average

Slide 75

Slide 75

CAR Mirror Stages

Slide 76

Slide 76

CAR Mirror Stages Selection Narrowing Transmission Graph Status Cleanup

Slide 77

Slide 77

CAR Mirror Stages Selection Narrowing Transmission Graph Status Cleanup Next Round

Slide 78

Slide 78

CAR Mirror Over the Wire

Slide 79

Slide 79

CAR Mirror Over the Wire Bloom CID Roots CAR

Slide 80

Slide 80

CAR Mirror Over the Wire Requestor Pull Bloom CID Roots CAR

Slide 81

Slide 81

CAR Mirror Over the Wire Requestor Pull Bloom CID Roots CAR Requestor Push

Slide 82

Slide 82

Meta Pull Previous Round Bloom & Roots 🥺 🦸 📃🌸 Analyze New Roots New Bloom 📀📀📀📀📀 Updated Bloom & Roots Previous Round Hash Set Analyze & Fetch Response CAR Updated Hash Set

Slide 83

Slide 83

Meta Push Previous Round Bloom & Roots 🥺 🦸 Previous Round Hash Set 🥵 📀📀📀📀📀📃 Store & Analyze Request CAR DAG Bloom 🌸 📃 Updated Bloom & Roots Bloom & CID Roots Updated Hash Set

Slide 84

Slide 84

CAR Mirror Straggler Cleanup 🧹 🧹 🧹

Slide 85

Slide 85

CAR Mirror Graph Contraction

Slide 86

Slide 86

CAR Pool Many-to-One

Slide 87

Slide 87

CAR Pool Why

Slide 88

Slide 88

CAR Pool Why Recover multiple providers Stream in true parallel Work sharing Stepping stone to trustless network seeding (more later)

Slide 89

Slide 89

CAR Pool Requestor-Controlled Sharding A-H I-P Q-Z 🦸 🦸 🦸 📱

Slide 90

Slide 90

CAR Pool Invertible Bloom Filter (IBF) Primer

Slide 91

Slide 91

CAR Pool Invertible Bloom Filter (IBF) Primer 1 0 1 1 0 1 0 0 0 1 0 0 0 1 0 1 0 0

Slide 92

Slide 92

CAR Pool Invertible Bloom Filter (IBF) Primer 1 0 1 1 0 1 0 0 0 1 0 (Not to scale 📏) 0 0 1 0 1 0 0

Slide 93

Slide 93

CAR Pool Invertible Bloom Filter (IBF) Primer 1 0 1 1 0 1 0 0 0 1 0 0 0 1 0 1 0 0 (Not to scale 📏) XOR 3 XOR 2 XOR 6 XOR 4 XOR 7 XOR 5 XOR 2

Slide 94

Slide 94

CAR Pool Invertible Bloom Filter (IBF) Primer 1 0 1 1 0 1 0 0 0 1 0 0 0 1 0 1 0 0 (Not to scale 📏) XORed CIDs XOR 3 XOR 2 XOR 6 XOR 4 XOR 7 XOR 5 XOR 2

Slide 95

Slide 95

CAR Pool Invertible Bloom Filter (IBF) Primer 1 0 1 1 0 1 0 0 0 1 0 0 0 1 0 1 0 0 (Not to scale 📏) Counter XORed CIDs XOR 3 XOR 2 XOR 6 XOR 4 XOR 7 XOR 5 XOR 2

Slide 96

Slide 96

CAR Pool Invertible Bloom Filter (IBF) Primer 1 0 1 1 0 1 0 0 0 1 0 0 0 1 0 1 0 0 (Not to scale 📏) Counter XORed CIDs XOR 3 XOR 2 XOR 6 XOR 4 XOR 7 XOR 5 XOR 2 XOR 1 XOR 4 XOR 3 XOR 1 XOR 2 XOR 2 XOR 3

Slide 97

Slide 97

CAR Pool Invertible Bloom Filter (IBF) Primer 1 0 1 1 0 1 0 0 0 1 0 0 0 1 0 1 0 0 (Not to scale 📏) Counter XORed CIDs XOR 3 XOR 2 XOR 6 XOR 4 XOR 7 XOR 5 XOR 2 XOR 1 XOR 4 XOR 3 XOR 1 XOR 2 XOR 2 XOR 3 +

Slide 98

Slide 98

CAR Pool Invertible Bloom Filter (IBF) Primer 1 0 1 1 0 1 0 0 0 1 0 0 0 1 0 1 0 0 (Not to scale 📏) Counter XORed CIDs XOR 3 XOR 2 XOR 6 XOR 4 XOR 7 XOR 5 XOR 2 XOR 1 XOR 4 XOR 3 XOR 1 XOR 2 XOR 2 XOR 3

  • =

Slide 99

Slide 99

CAR Pool Invertible Bloom Filter (IBF) Primer 1 0 1 1 0 1 0 0 0 1 0 0 0 1 0 1 0 0 (Not to scale 📏) Counter XORed CIDs XOR 3 XOR 2 XOR 6 XOR 4 XOR 7 XOR 5 XOR 2 XOR 1 XOR 4 XOR 3 XOR 1 XOR 2 XOR 2 XOR 3 XOR 1 XOR 4 XOR 3 XOR 1 XOR 2 XOR 2 XOR 3

  • =

Slide 100

Slide 100

CAR Pool Invertible Bloom Filter (IBF) Primer 1 0 1 1 0 1 0 0 0 1 0 0 0 1 0 1 0 0 (Not to scale 📏) Counter XORed CIDs XOR 3 XOR 2 XOR 6 XOR 4 XOR 7 XOR 5 XOR 2 XOR 1 XOR 4 XOR 3 XOR 1 XOR 2 XOR 2 XOR 3

  • = XOR 1 XOR 4 XOR 3 XOR 1 XOR 2 XOR 2 XOR 3

Slide 101

Slide 101

CAR Pool Invertible Bloom Filter (IBF) Primer 1 0 1 1 0 1 0 0 0 1 0 0 0 1 0 1 0 0 (Not to scale 📏) Counter XORed CIDs XOR 3 XOR 2 XOR 6 XOR 4 XOR 7 XOR 5 XOR 2 + = XOR 1 XOR 4 XOR 3 XOR 1 XOR 2 XOR 2 XOR 3

XOR 1 XOR 4 XOR 3 XOR 1 XOR 2 XOR 2 XOR 3

Slide 102

Slide 102

CAR Pool Invertible Bloom Filter (IBF) Primer 1 0 1 1 0 1 0 0 0 1 0 0 0 1 0 1 0 0 (Not to scale 📏) Counter XORed CIDs XOR 3 XOR 2 XOR 6 XOR 4 XOR 7 XOR 5 XOR 2 + = XOR 1 XOR 4 XOR 3 XOR 1 XOR 2 XOR 2 XOR

3 🧹Cleanup XOR 1 XOR 4 XOR 3 XOR 1 XOR 2 XOR 2 XOR 3

Slide 103

Slide 103

CAR Pool Invertible Bloom Filter (IBF) Primer 1 0 1 1 0 1 0 0 0 1 0 0 0 1 0 1 0 0 (Not to scale 📏) Counter XORed CIDs XOR 3 XOR 2 XOR 6 XOR 4 XOR 7 XOR 5 XOR 2 + = XOR 1 XOR 4 XOR 3 XOR 1 XOR 2 XOR 2 XOR

3 🧹Cleanup XOR 1 XOR 4 XOR 3 XOR 1 XOR 2 XOR 2 XOR 3

Slide 104

Slide 104

CAR Pool Provider Coordinator 🦸 🌸🔁 🤹 📱 🌸🔁 🦸

Slide 105

Slide 105

CAR Pool Linear Network Coding

Slide 106

Slide 106

BONUS: Wild Ideas for Future Research PSI, PSU, NN Compression, XOR-Folding, etc

Slide 107

Slide 107

CAR Pool PSI youtube.com/watch?v=tsCD4i9SpxA

Slide 108

Slide 108

CAR Pool XOR-Folding https://papers.ssrn.com/sol3/papers.cfm?abstract_id=3527984

Slide 109

Slide 109

An Eager Backbone 🦴 Content Addressed Alliance Teaser

Slide 110

Slide 110

🎉 Thank You, IPFS þing 🇮🇸 https://fission.codes ✨ github.com/fission-suite/spec ✨ {brooklyn,justin}@fission.codes @expede & @justincjohnson