-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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: add peer block filter option #8772
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -281,9 +281,10 @@ func Online(bcfg *BuildCfg, cfg *config.Config) fx.Option { | |||||||||||||||
|
||||||||||||||||
/* don't provide from bitswap when the strategic provider service is active */ | ||||||||||||||||
shouldBitswapProvide := !cfg.Experimental.StrategicProviding | ||||||||||||||||
pbrf := bcfg.PeerBlockRequestFilter | ||||||||||||||||
|
||||||||||||||||
return fx.Options( | ||||||||||||||||
fx.Provide(OnlineExchange(cfg, shouldBitswapProvide)), | ||||||||||||||||
fx.Provide(OnlineExchange(cfg, shouldBitswapProvide, pbrf)), | ||||||||||||||||
Comment on lines
+284
to
+287
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I belive you inspired your pbrf variable from the line above, this code (
Suggested change
|
||||||||||||||||
maybeProvide(Graphsync, cfg.Experimental.GraphsyncEnabled), | ||||||||||||||||
fx.Provide(DNSResolver), | ||||||||||||||||
fx.Provide(Namesys(ipnsCacheSize)), | ||||||||||||||||
|
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.
I'm not sure which we prefer:
PeerBlockRequestFilter
function, shown here,bitswap.Option
function.(2) is more "obviously future-proof", but that'd mean we'd have two different ways to configure most values in the bitswap instance (json from cfg and code from buildcfg).
Access control is probably a cross-cutting concern that will eventually span multiple modules and protocols, not only bitswap. So by decoupling the access control config from the bitswap option, (1) might make it easier to build upon this feature.