fix: do not allow dial to large number of multiaddrs (#954)

This commit is contained in:
Vasco Santos
2021-07-09 08:46:24 +02:00
committed by GitHub
parent 13cf476148
commit af723b355e
5 changed files with 34 additions and 1 deletions

View File

@ -525,6 +525,7 @@ Dialing in libp2p can be configured to limit the rate of dialing, and how long d
| Name | Type | Description |
|------|------|-------------|
| maxParallelDials | `number` | How many multiaddrs we can dial in parallel. |
| maxAddrsToDial | `number` | How many multiaddrs is the dial allowed to dial for a single peer. |
| maxDialsPerPeer | `number` | How many multiaddrs we can dial per peer, in parallel. |
| dialTimeout | `number` | Second dial timeout per peer in ms. |
| resolvers | `object` | Dial [Resolvers](https://github.com/multiformats/js-multiaddr/blob/master/src/resolvers/index.js) for resolving multiaddrs |
@ -549,6 +550,7 @@ const node = await Libp2p.create({
},
dialer: {
maxParallelDials: 100,
maxAddrsToDial: 25,
maxDialsPerPeer: 4,
dialTimeout: 30e3,
resolvers: {