Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ categories = ["network-programming", "asynchronous"]
[features]
default = [
"autonat",
# TODO: Should this really be a default?
"connection-limit",
Comment on lines +16 to +17
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Long term, I would say no because of #2173. For consistency with the current way of doing things, probably yes.

"deflate",
"dns-async-std",
"floodsub",
Expand All @@ -37,6 +39,7 @@ default = [
]

autonat = ["dep:libp2p-autonat"]
connection-limit = ["dep:libp2p-connection-limit"]
dcutr = ["dep:libp2p-dcutr", "libp2p-metrics?/dcutr"]
deflate = ["dep:libp2p-deflate"]
dns-async-std = ["dep:libp2p-dns", "libp2p-dns?/async-std"]
Expand Down Expand Up @@ -79,6 +82,7 @@ lazy_static = "1.2"

libp2p-autonat = { version = "0.6.0", path = "protocols/autonat", optional = true }
libp2p-core = { version = "0.35.0", path = "core", default-features = false }
libp2p-connection-limit = { version = "0.1.0", path = "protocols/connection-limit", optional = true }
libp2p-dcutr = { version = "0.5.0", path = "protocols/dcutr", optional = true }
libp2p-floodsub = { version = "0.38.0", path = "protocols/floodsub", optional = true }
libp2p-identify = { version = "0.38.0", path = "protocols/identify", optional = true }
Expand Down Expand Up @@ -130,6 +134,7 @@ members = [
"misc/prost-codec",
"muxers/mplex",
"muxers/yamux",
"protocols/connection-limit",
"protocols/dcutr",
"protocols/autonat",
"protocols/floodsub",
Expand Down
24 changes: 24 additions & 0 deletions protocols/connection-limit/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
[package]
name = "libp2p-connection-limit"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this have to be its own crate? I think this could also live in libp2p-swarm.

It can still be feature-flagged there if we want but looking at the dependencies of this crate, we don't really gain much at the moment from separating this out.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Separate crate forces us to deliver on the promise of being able to implement ones own.

That said, agreed that we don't gain much more and instead add complexity.

edition = "2021"
rust-version = "1.56.1"
description = "Basic connection limiting functionality"
version = "0.1.0"
authors = ["Max Inden <[email protected]>"]
license = "MIT"
repository = "https://github.com/libp2p/rust-libp2p"
keywords = ["peer-to-peer", "libp2p", "networking"]
categories = ["network-programming", "asynchronous"]

[dependencies]
libp2p-core = { version = "0.35.0", path = "../../core", default-features = false }
libp2p-swarm = { version = "0.38.0", path = "../../swarm" }
# TODO: Still needed?
fnv = "1.0"
futures = "0.3.0"

[dev-dependencies]
quickcheck = "0.9.0"
libp2p-plaintext = { path = "../../transports/plaintext" }
libp2p-yamux = { path = "../../muxers/yamux" }
libp2p = { version = "0.47.0", path = "../..", default-features = false }
Loading