Skip to content

Commit

Permalink
fix: do no keep track of other's wantlists
Browse files Browse the repository at this point in the history
  • Loading branch information
hacdias committed Apr 25, 2024
1 parent 6392c9b commit 9f9311d
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ require (
github.com/felixge/httpsnoop v1.0.4
github.com/ipfs-shipyard/nopfs v0.0.12
github.com/ipfs-shipyard/nopfs/ipfs v0.13.2-0.20231024163508-120e0c51ee3a
github.com/ipfs/boxo v0.19.1-0.20240418055150-eeea41458735
github.com/ipfs/boxo v0.19.1-0.20240425141508-cf4721157323
github.com/ipfs/go-block-format v0.2.0
github.com/ipfs/go-cid v0.4.1
github.com/ipfs/go-datastore v0.6.0
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,8 @@ github.com/ipfs/bbloom v0.0.4 h1:Gi+8EGJ2y5qiD5FbsbpX/TMNcJw8gSqr7eyjHa4Fhvs=
github.com/ipfs/bbloom v0.0.4/go.mod h1:cS9YprKXpoZ9lT0n/Mw/a6/aFV6DTjTLYHeA+gyqMG0=
github.com/ipfs/boxo v0.19.1-0.20240418055150-eeea41458735 h1:S6/0RWEu0f9QeI28vrEWYaHaLe3dW6F5YLBBMi19FVw=
github.com/ipfs/boxo v0.19.1-0.20240418055150-eeea41458735/go.mod h1:hA9Ou/YnfMZOG2nQhngsbBiYt6fiJ1EhWSmccZfV+M0=
github.com/ipfs/boxo v0.19.1-0.20240425141508-cf4721157323 h1:5mK+3r703mtstolx6fIkujm22hLrze5x4NZti+UGjyE=
github.com/ipfs/boxo v0.19.1-0.20240425141508-cf4721157323/go.mod h1:hA9Ou/YnfMZOG2nQhngsbBiYt6fiJ1EhWSmccZfV+M0=
github.com/ipfs/go-bitfield v1.1.0 h1:fh7FIo8bSwaJEh6DdTWbCeZ1eqOaOkKFI74SCnsWbGA=
github.com/ipfs/go-bitfield v1.1.0/go.mod h1:paqf1wjq/D2BBmzfTVFlJQ9IlFOZpg422HL0HqsGWHU=
github.com/ipfs/go-bitswap v0.11.0 h1:j1WVvhDX1yhG32NTC9xfxnqycqYIlhzEzLXG/cU1HyQ=
Expand Down
9 changes: 9 additions & 0 deletions setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,15 @@ func setupBitswap(ctx context.Context, cfg Config, h host.Host, cr routing.Conte
// ---- Server Options
bitswap.WithPeerBlockRequestFilter(peerBlockRequestFilter),
bitswap.ProvideEnabled(false),
// Do not keep track of other peer's wantlists, we only want to reply if we
// have a block. If we get it later, it's no longer relevant.
bitswap.WithNoPeerLedger(),
// Do not notify peers once we get blocks they've asked for, reduces processing.
// This should already be a no-op considering we're not keeping track of other
// peer's wantlists.
bitswap.WithNotifyNewBlocks(false),
// When we don't have a block, don't reply. This reduces processment.
bitswap.SetSendDontHaves(false),
)
bn.Start(bswap)

Expand Down

0 comments on commit 9f9311d

Please sign in to comment.