-
Notifications
You must be signed in to change notification settings - Fork 72
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
Support exposing bitswap publicly #967
Conversation
efdd08b
to
0ccfa8c
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.
This seems generally reasonable.
@ischasny should also review
indexprovider/wrapper.go
Outdated
var eps []xproviders.Info | ||
|
||
// add bitswap extended provider as needed | ||
if cfg.Dealmaking.BitswapPeerID != "" { |
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.
wonder if we can jump directly to this being an array / support multiple bitswap peers?
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.
would rather not jump anything? we'd need to handle multiple private ids too.
indexprovider/wrapper.go
Outdated
if err != nil { | ||
return nil, err | ||
} | ||
if len(cfg.Dealmaking.BitswapPublicAddresses) > 0 { |
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.
so not setting addresses on your bitswap config means that it'll use the main markets host for advertisements? that seems like the wrong thing to condition on - wouldn't it instead be if the bitswap peer ID matches the host ID?
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.
no. In this case, you still use the bitswap peer id but it now uses the protocol proxy to forward bitswap to that separate peer id while publishing the main boost peer id with the indexer.
} | ||
// announce all deals on startup in case of a config change | ||
lc.Append(fx.Hook{ | ||
OnStart: func(ctx context.Context) error { | ||
go func() { | ||
_ = w.IndexerAnnounceAllDeals(ctx) | ||
_ = w.AnnounceExtendedProviders(ctx) |
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 change (from calling IndexerAnnounceAllDeals
to calling AnnounceExtendedProviders
) will now just update the multiaddrs / if bitswap is running.
Before, that method on startup would try to reconcile what was announced with the known deals.
where will we do that now?
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.
That method just got added to the start with booster-bitswap previous release, so I don't think it's all that important. We could run it though for other reasons?
github.com/filecoin-project/go-statestore v0.2.0 | ||
github.com/filecoin-project/index-provider v0.8.1 | ||
github.com/filecoin-project/lotus v1.18.0-rc3 | ||
github.com/filecoin-project/index-provider v0.9.2-0.20221119192528-622ddb90df0e |
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.
v0.9.2 has been cut, please use it
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.
yep
indexprovider/wrapper.go
Outdated
return nil | ||
} | ||
adBuilder := xproviders.NewAdBuilder(w.h.ID(), w.h.Peerstore().PrivKey(w.h.ID()), w.h.Addrs()) | ||
adBuilder.WithExtendedProviders(w.extendedProviders...) |
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.
If you want a bitswap endpoint to also be added for the main provider, don't forget to call .WithMetadata(...)
on the builder.
moved the indexer code cause it was the right thing to do, but still not able to avoid a Lotus deps update |
uses index provider families to switch to advertising bitswap as an extended provider -- this allows us to expose booster-bitswap directly
d5e4879
to
975c488
Compare
node/modules/retrieval.go
Outdated
@@ -51,9 +51,20 @@ func NewTransportsListener(cfg *config.Boost) func(h host.Host) (*lp2pimpl.Trans | |||
}) | |||
} | |||
if cfg.Dealmaking.BitswapPeerID != "" { | |||
addrs := h.Addrs() | |||
if len(cfg.Dealmaking.BitswapPublicAddresses) > 0 { |
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.
Let's add a comment explaining what this code is doing (and why we need it)
indexprovider/wrapper.go
Outdated
if err != nil { | ||
return nil, err | ||
} | ||
if len(cfg.Dealmaking.BitswapPublicAddresses) > 0 { |
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.
Let's add a comment explaining what this code is doing (and why we need it)
Co-authored-by: dirkmc <dirkmdev@gmail.com>
Co-authored-by: dirkmc <dirkmdev@gmail.com>
closing in favor of #1030 |
legacyProv lotus_storagemarket.StorageProvider | ||
prov provider.Interface | ||
dagStore *dagstore.Wrapper | ||
meshCreator idxprov.MeshCreator |
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.
@hannahhoward Can we copy over idxprov from Lotus to Boost?
Goals
Implements #951
Uses index provider families to switch to advertising bitswap as an extended provider in the indexer-- this allows a provider to expose booster-bitswap directly as a public node.
Implementation
For discussion