Skip to content

Commit 17b1754

Browse files
committed
Remove libp2p limits on boot and access nodes
1 parent c4980f3 commit 17b1754

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

rolling-shutter/p2p/p2p.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import (
1212
"github.com/libp2p/go-libp2p/core/peer"
1313
"github.com/libp2p/go-libp2p/p2p/discovery/routing"
1414
"github.com/libp2p/go-libp2p/p2p/discovery/util"
15+
rcmgr "github.com/libp2p/go-libp2p/p2p/host/resource-manager"
1516
rhost "github.com/libp2p/go-libp2p/p2p/host/routed"
1617
"github.com/libp2p/go-libp2p/p2p/net/connmgr"
1718
"github.com/multiformats/go-multiaddr"
@@ -268,6 +269,14 @@ func createHost(
268269
libp2p.EnableRelayService(),
269270
)
270271
}
272+
if config.IsBootstrapNode || config.IsAccessNode {
273+
// No resource limits on boot and access nodes for now
274+
mgr, err := rcmgr.NewResourceManager(rcmgr.NewFixedLimiter(rcmgr.InfiniteLimits))
275+
if err != nil {
276+
return nil, nil, err
277+
}
278+
options = append(options, libp2p.ResourceManager(mgr))
279+
}
271280
}
272281

273282
p2pHost, err := libp2p.New(options...)

0 commit comments

Comments
 (0)