Skip to content

Commit

Permalink
feat(nodebuilder/p2p): Enable InfiniteLimits for resource manager i…
Browse files Browse the repository at this point in the history
…f bootstrapper (#1496)

Resolves #1494
  • Loading branch information
renaynay committed Dec 15, 2022
1 parent f518fc4 commit 3a58679
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 2 additions & 3 deletions nodebuilder/p2p/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,8 @@ type Config struct {
// announced/advertised, as undialable from WAN
NoAnnounceAddresses []string
// TODO(@Wondertan): This should be a build-time parameter. See
// https://github.com/celestiaorg/celestia-node/issues/63 Bootstrapper is flag telling this node is

// a bootstrapper.
// https://github.com/celestiaorg/celestia-node/issues/63
// Bootstrapper is flag telling this node is a bootstrapper.
Bootstrapper bool
// MutualPeers are peers which have a bidirectional peering agreement with the configured node.
// Connections with those peers are protected from being trimmed, dropped or negatively scored.
Expand Down
5 changes: 4 additions & 1 deletion nodebuilder/p2p/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,10 @@ func ConstructModule(tp node.Type, cfg *Config) fx.Option {
fx.Provide(ContentRouting),
fx.Provide(AddrsFactory(cfg.AnnounceAddresses, cfg.NoAnnounceAddresses)),
fx.Provide(metrics.NewBandwidthCounter),
fx.Provide(func() (network.ResourceManager, error) {
fx.Provide(func(cfg Config) (network.ResourceManager, error) {
if cfg.Bootstrapper {
return rcmgr.NewResourceManager(rcmgr.NewFixedLimiter(rcmgr.InfiniteLimits))
}
return rcmgr.NewResourceManager(rcmgr.NewFixedLimiter(rcmgr.DefaultLimits.AutoScale()))
}),
fx.Provide(newModule),
Expand Down

0 comments on commit 3a58679

Please sign in to comment.