-
Notifications
You must be signed in to change notification settings - Fork 12
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
feat: shared cache for manual peering #114
Conversation
5acdfbb
to
2a02d63
Compare
c7e3924
to
9f64e24
Compare
8e9ddf7
to
ee70d5d
Compare
bswap := bsclient.New(bsctx, bn, blkst, | ||
bswap := bitswap.New(bsctx, bn, blkst, | ||
// --- Client Options | ||
// default is 1 minute to search for a random live-want (1 | ||
// CID). I think we want to search for random live-wants more | ||
// often although probably it overlaps with general | ||
// rebroadcasts. | ||
bsclient.RebroadcastDelay(delay.Fixed(10*time.Second)), | ||
bitswap.RebroadcastDelay(delay.Fixed(10*time.Second)), | ||
// ProviderSearchDelay: default is 1 second. | ||
bsclient.ProviderSearchDelay(time.Second), | ||
bsclient.WithoutDuplicatedBlockStats(), | ||
bitswap.ProviderSearchDelay(time.Second), | ||
bitswap.WithoutDuplicatedBlockStats(), | ||
|
||
// ---- Server Options | ||
bitswap.WithPeerBlockRequestFilter(peerBlockRequestFilter), | ||
bitswap.ProvideEnabled(provideEnabled), | ||
) |
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.
Another option here would be to create only a client with bsclient.New
if peering cache is disabled. But to me it seemed that a peer block request filter that always returns false
should do the same thing. Depends a bit more on the internals of the bitswap package.
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.
This might be ok, but we should measure our libp2p egress bandwidth to hosts we don't control to see to validate that this is true.
@@ -0,0 +1,94 @@ | |||
package main |
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.
ℹ️ Just moved some shared test utilities to this file.
ee70d5d
to
e317e2d
Compare
f1ed448
to
c011630
Compare
7d7a783
to
e259336
Compare
0558af0
to
ae6d7cc
Compare
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.
lgtm, pushed small cosmetics, should be good to ship as v1.1.0 (but see #102 (review) first)
also, print version as the very first thing
ae6d7cc
to
f6bd4ce
Compare
CC #109 #27