Skip to content
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 provider query manager #536

Open
wants to merge 1 commit into
base: remove-content-routing-from-bitswap-network
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 2 additions & 18 deletions bitswap/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import (
bsmq "github.com/ipfs/boxo/bitswap/client/internal/messagequeue"
"github.com/ipfs/boxo/bitswap/client/internal/notifications"
bspm "github.com/ipfs/boxo/bitswap/client/internal/peermanager"
bspqm "github.com/ipfs/boxo/bitswap/client/internal/providerquerymanager"
bssession "github.com/ipfs/boxo/bitswap/client/internal/session"
bssim "github.com/ipfs/boxo/bitswap/client/internal/sessioninterestmanager"
bssm "github.com/ipfs/boxo/bitswap/client/internal/sessionmanager"
Expand Down Expand Up @@ -99,7 +98,7 @@ func WithoutDuplicatedBlockStats() Option {
}
}

type ContentSearcher = bspqm.ContentRouter
type ContentSearcher = bssession.ProviderFinder

// WithContentSearch allows the client to search for providers when it is not
// able to find the content itself.
Expand Down Expand Up @@ -155,11 +154,6 @@ func New(parent context.Context, network bsnet.BitSwapNetwork, bstore blockstore
option(bs)
}

if bs.router != nil {
bs.pqm = bspqm.New(ctx, network, bs.router)
bs.pqm.Startup()
}

// bind the context and process.
// do it over here to avoid closing before all setup is done.
go func() {
Expand All @@ -179,10 +173,6 @@ type Client struct {

pm *bspm.PeerManager

// the provider query manager manages requests to find providers
// is nil if content routing is disabled
pqm *bspqm.ProviderQueryManager

// network delivers messages on behalf of the session
network bsnet.BitSwapNetwork

Expand Down Expand Up @@ -244,13 +234,7 @@ func (bs *Client) sessionFactory(
rebroadcastDelay delay.D,
self peer.ID,
) bssm.Session {
// avoid typed nils
var pqm bssession.ProviderFinder
if bs.pqm != nil {
pqm = bs.pqm
}

return bssession.New(sessctx, sessmgr, id, spm, pqm, sim, pm, bpm, notif, provSearchDelay, rebroadcastDelay, self)
return bssession.New(sessctx, sessmgr, id, spm, sim, pm, bpm, notif, provSearchDelay, rebroadcastDelay, bs.router, bs.network)
}

// onDontHaveTimeout is called when a want-block is sent to a peer that
Expand Down
Loading
Loading