Limit incoming connection requests (#1413)

## Issue Addressed

Limits the number of incoming connections and adjusts the buffer sizes in libp2p
This commit is contained in:
Age Manning 2020-07-29 06:39:30 +00:00
parent 36d3d37cb4
commit febb300a2d

View File

@ -103,6 +103,9 @@ impl<TSpec: EthSpec> Service<TSpec> {
}
}
SwarmBuilder::new(transport, behaviour, local_peer_id.clone())
.notify_handler_buffer_size(std::num::NonZeroUsize::new(32).expect("Not zero"))
.connection_event_buffer_size(64)
.incoming_connection_limit(10)
.peer_connection_limit(MAX_CONNECTIONS_PER_PEER)
.executor(Box::new(Executor(executor)))
.build()