-
Notifications
You must be signed in to change notification settings - Fork 97
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove content routing from bitswap network #535
base: move-providing-responsabilities
Are you sure you want to change the base?
Remove content routing from bitswap network #535
Conversation
Codecov ReportAttention:
@@ Coverage Diff @@
## move-providing-responsabilities #535 +/- ##
==================================================================
Coverage ? 65.39%
==================================================================
Files ? 204
Lines ? 25386
Branches ? 0
==================================================================
Hits ? 16600
Misses ? 7305
Partials ? 1481
|
2a2f368
to
1347809
Compare
Keeps in sync with: - ipfs/boxo#534 - ipfs/boxo#535 - ipfs/boxo#536
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
29ff0cc
to
94be73e
Compare
1347809
to
28f6549
Compare
@@ -18,9 +18,14 @@ The following emojis are used to highlight certain changes: | |||
|
|||
* 🛠 `pinning/pinner`: you can now give a custom name when pinning a CID. To reflect this, the `Pinner` has been adjusted. | |||
- `blockservice` now have a `WithProvider` option, this allows to recreate the behavior of advertising added blocks the bitswap server used to do. | |||
- `bitswap` & `bitswap/client` now have a `WithContentSearch` option, this pickup the content routing job from `bitswap/network`. | |||
It used to be a commun pattern for consumers which do not need external content routing to pass a [`routinghelpers.Null`](https://pkg.go.dev/github.com/libp2p/go-libp2p-routing-helpers#Null), now this can be ommited completely which is more efficient. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It used to be a commun pattern for consumers which do not need external content routing to pass a [`routinghelpers.Null`](https://pkg.go.dev/github.com/libp2p/go-libp2p-routing-helpers#Null), now this can be ommited completely which is more efficient. | |
It used to be a common pattern for consumers which do not need external content routing to pass a [`routinghelpers.Null`](https://pkg.go.dev/github.com/libp2p/go-libp2p-routing-helpers#Null), now this can be omitted completely which is more efficient. |
- 🛠 `bitswap/network` no longer manages content routing, related Methods and function Arguments have been removed. | ||
- `Network.ConnectTo` method has been changed from [`peer.ID`](https://pkg.go.dev/github.com/libp2p/go-libp2p/core/peer#ID) to [`peer.AddrInfo`](https://pkg.go.dev/github.com/libp2p/go-libp2p/core/peer#AddrInfo), given adding addresses hints used to be a side effect of the network. Theses now need to be passed in as values. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- 🛠 `bitswap/network` no longer manages content routing, related Methods and function Arguments have been removed. | |
- `Network.ConnectTo` method has been changed from [`peer.ID`](https://pkg.go.dev/github.com/libp2p/go-libp2p/core/peer#ID) to [`peer.AddrInfo`](https://pkg.go.dev/github.com/libp2p/go-libp2p/core/peer#AddrInfo), given adding addresses hints used to be a side effect of the network. Theses now need to be passed in as values. | |
- 🛠 `bitswap/network` no longer manages content routing, related methods and function arguments have been removed. | |
- `Network.ConnectTo` method has been changed from [`peer.ID`](https://pkg.go.dev/github.com/libp2p/go-libp2p/core/peer#ID) to [`peer.AddrInfo`](https://pkg.go.dev/github.com/libp2p/go-libp2p/core/peer#AddrInfo), given adding addresses hints used to be a side effect of the network. Theses now need to be passed in as values. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Considering the title, this seems to do what it says. Just left a comment in line with a question.
94be73e
to
ac0f6e0
Compare
28f6549
to
301d5b5
Compare
301d5b5
to
d414841
Compare
ac0f6e0
to
e0d5341
Compare
d414841
to
5eb2dbc
Compare
5eb2dbc
to
0cd80af
Compare
0cd80af
to
6740401
Compare
… to an option of the client Given that the previous commit remove the content advertising from the server, it did not made sense to share these paths on the network. The code has been reworked: - addresses aren't magically added to the peerstore as a side-effect of calling `Network.FindProvidersAsync`. Instead they are passed as hints to ConnectTo which copies libp2p `host.ConnectTo` API. - the providerquerymanager is completely shutdown when not using `WithContentSearch` option, this helps usecase where `routinghelpers.Null` is used for content routing and the consumer exclusively rely on broadcast, like networks where most peoples have all the content (Filecoin, Celestia, ...).
6740401
to
2dbd42a
Compare
Keeps in sync with: - ipfs/boxo#578 - ipfs/boxo#534 - ipfs/boxo#535 - ipfs/boxo#536
@@ -38,7 +37,7 @@ func TestFetchIPLDPrimeNode(t *testing.T) { | |||
}) | |||
})) | |||
|
|||
net := tn.VirtualNetwork(mockrouting.NewServer(), delay.Fixed(0*time.Millisecond)) | |||
net := tn.VirtualNetwork(delay.Fixed(0 * time.Millisecond)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Define a const for delay.
Based on #534