Commit 37756ce
Bitswap: move providing -> Exchange-layer, providerQueryManager -> routing (#641)
Bitswap: refactor content provider elements
This PR performs a rather large and touchy refactor of things related to
Content providing and Content discovery previously embedded into Bitswap.
The motivations:
* Make ProviderQueryManager options configurable
* Align and separate coalesced layers: content routing must not be part of
bitswap as in the future we will be using different exchanges (bitswap, http)
for retrieval and content routing should be above exchange.
* Align content routing interfaces with libp2p: to avoid crust, wrappers and
user confusion, align Providers and Discovery types to
libp2p.ContentRouting.
* Reduce duplicated functionality: i.e. code that handles providing in
multiple places and fails to take advantage of ProvideMany optimizations.
As a result:
* ProviderQueryManager is now part of the routing module
* A new providing.Exchange has been created
* Bitswap initialization params have changed and Bitswap Network doesn't
provide anymore (see changelog for more details)
Co-authored-by: Hector Sanjuan <[email protected]>
Co-authored-by: Andrew Gillis <[email protected]>1 parent c91cc1d commit 37756ce
File tree
35 files changed
+725
-550
lines changed- bitswap
- client
- internal
- messagequeue
- session
- internal/defaults
- network
- server
- testinstance
- testnet
- blockservice/test
- examples
- bitswap-transfer
- exchange/providing
- fetcher
- helpers
- impl/blockservice
- provider
- routing
- mock
- providerquerymanager
35 files changed
+725
-550
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
17 | 63 | | |
18 | 64 | | |
19 | 65 | | |
| |||
117 | 163 | | |
118 | 164 | | |
119 | 165 | | |
| 166 | + | |
120 | 167 | | |
121 | 168 | | |
122 | 169 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | 15 | | |
20 | 16 | | |
21 | 17 | | |
22 | 18 | | |
23 | 19 | | |
| 20 | + | |
24 | 21 | | |
25 | 22 | | |
| 23 | + | |
| 24 | + | |
26 | 25 | | |
27 | 26 | | |
28 | 27 | | |
| |||
135 | 134 | | |
136 | 135 | | |
137 | 136 | | |
| 137 | + | |
138 | 138 | | |
139 | 139 | | |
140 | 140 | | |
141 | 141 | | |
142 | 142 | | |
143 | 143 | | |
144 | 144 | | |
145 | | - | |
| 145 | + | |
146 | 146 | | |
147 | 147 | | |
148 | 148 | | |
149 | 149 | | |
150 | 150 | | |
151 | 151 | | |
152 | | - | |
| 152 | + | |
153 | 153 | | |
154 | 154 | | |
155 | | - | |
| 155 | + | |
156 | 156 | | |
157 | 157 | | |
158 | 158 | | |
| |||
294 | 294 | | |
295 | 295 | | |
296 | 296 | | |
297 | | - | |
| 297 | + | |
298 | 298 | | |
299 | | - | |
| 299 | + | |
| 300 | + | |
300 | 301 | | |
301 | 302 | | |
302 | 303 | | |
| |||
312 | 313 | | |
313 | 314 | | |
314 | 315 | | |
315 | | - | |
316 | | - | |
317 | | - | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
318 | 319 | | |
319 | 320 | | |
320 | 321 | | |
| |||
327 | 328 | | |
328 | 329 | | |
329 | 330 | | |
330 | | - | |
331 | | - | |
332 | | - | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
333 | 334 | | |
334 | 335 | | |
335 | 336 | | |
| |||
437 | 438 | | |
438 | 439 | | |
439 | 440 | | |
440 | | - | |
| 441 | + | |
441 | 442 | | |
442 | 443 | | |
443 | 444 | | |
| |||
452 | 453 | | |
453 | 454 | | |
454 | 455 | | |
455 | | - | |
| 456 | + | |
456 | 457 | | |
457 | 458 | | |
458 | | - | |
| 459 | + | |
459 | 460 | | |
460 | 461 | | |
461 | 462 | | |
| |||
473 | 474 | | |
474 | 475 | | |
475 | 476 | | |
476 | | - | |
| 477 | + | |
477 | 478 | | |
478 | 479 | | |
479 | 480 | | |
480 | 481 | | |
481 | | - | |
| 482 | + | |
482 | 483 | | |
483 | 484 | | |
484 | 485 | | |
| |||
490 | 491 | | |
491 | 492 | | |
492 | 493 | | |
493 | | - | |
| 494 | + | |
494 | 495 | | |
495 | 496 | | |
496 | 497 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
9 | 8 | | |
10 | 9 | | |
11 | 10 | | |
| |||
45 | 44 | | |
46 | 45 | | |
47 | 46 | | |
48 | | - | |
49 | | - | |
50 | | - | |
| 47 | + | |
| 48 | + | |
51 | 49 | | |
52 | 50 | | |
53 | 51 | | |
| |||
58 | 56 | | |
59 | 57 | | |
60 | 58 | | |
61 | | - | |
| 59 | + | |
62 | 60 | | |
63 | 61 | | |
64 | 62 | | |
| |||
85 | 83 | | |
86 | 84 | | |
87 | 85 | | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | 86 | | |
93 | 87 | | |
94 | 88 | | |
95 | | - | |
| 89 | + | |
96 | 90 | | |
97 | 91 | | |
98 | 92 | | |
| |||
115 | 109 | | |
116 | 110 | | |
117 | 111 | | |
118 | | - | |
119 | 112 | | |
120 | 113 | | |
121 | 114 | | |
| |||
138 | 131 | | |
139 | 132 | | |
140 | 133 | | |
141 | | - | |
142 | 134 | | |
143 | 135 | | |
144 | 136 | | |
| |||
0 commit comments