2017-04-08 18:26:05 +02:00
|
|
|
[package]
|
2018-05-16 12:59:36 +02:00
|
|
|
name = "libp2p-core"
|
2021-11-26 09:34:58 -07:00
|
|
|
edition = "2021"
|
2022-11-18 22:04:16 +11:00
|
|
|
rust-version = "1.60.0"
|
2018-12-06 19:22:06 +01:00
|
|
|
description = "Core traits and structs of libp2p"
|
2022-12-20 09:52:08 +01:00
|
|
|
version = "0.39.0"
|
2017-04-08 18:26:05 +02:00
|
|
|
authors = ["Parity Technologies <admin@parity.io>"]
|
2018-07-21 12:15:42 +02:00
|
|
|
license = "MIT"
|
2018-12-06 19:22:06 +01:00
|
|
|
repository = "https://github.com/libp2p/rust-libp2p"
|
|
|
|
keywords = ["peer-to-peer", "libp2p", "networking"]
|
|
|
|
categories = ["network-programming", "asynchronous"]
|
2017-04-08 18:26:05 +02:00
|
|
|
|
|
|
|
[dependencies]
|
2021-03-22 13:53:47 +01:00
|
|
|
asn1_der = "0.7.4"
|
2020-11-09 14:49:25 +01:00
|
|
|
bs58 = "0.4.0"
|
2020-10-20 17:03:10 +02:00
|
|
|
ed25519-dalek = "1.0.1"
|
Multiple connections per peer (#1440)
* Allow multiple connections per peer in libp2p-core.
Instead of trying to enforce a single connection per peer,
which involves quite a bit of additional complexity e.g.
to prioritise simultaneously opened connections and can
have other undesirable consequences [1], we now
make multiple connections per peer a feature.
The gist of these changes is as follows:
The concept of a "node" with an implicit 1-1 correspondence
to a connection has been replaced with the "first-class"
concept of a "connection". The code from `src/nodes` has moved
(with varying degrees of modification) to `src/connection`.
A `HandledNode` has become a `Connection`, a `NodeHandler` a
`ConnectionHandler`, the `CollectionStream` was the basis for
the new `connection::Pool`, and so forth.
Conceptually, a `Network` contains a `connection::Pool` which
in turn internally employs the `connection::Manager` for
handling the background `connection::manager::Task`s, one
per connection, as before. These are all considered implementation
details. On the public API, `Peer`s are managed as before through
the `Network`, except now the API has changed with the shift of focus
to (potentially multiple) connections per peer. The `NetworkEvent`s have
accordingly also undergone changes.
The Swarm APIs remain largely unchanged, except for the fact that
`inject_replaced` is no longer called. It may now practically happen
that multiple `ProtocolsHandler`s are associated with a single
`NetworkBehaviour`, one per connection. If implementations of
`NetworkBehaviour` rely somehow on communicating with exactly
one `ProtocolsHandler`, this may cause issues, but it is unlikely.
[1]: https://github.com/paritytech/substrate/issues/4272
* Fix intra-rustdoc links.
* Update core/src/connection/pool.rs
Co-Authored-By: Max Inden <mail@max-inden.de>
* Address some review feedback and fix doc links.
* Allow responses to be sent on the same connection.
* Remove unnecessary remainders of inject_replaced.
* Update swarm/src/behaviour.rs
Co-Authored-By: Pierre Krieger <pierre.krieger1708@gmail.com>
* Update swarm/src/lib.rs
Co-Authored-By: Pierre Krieger <pierre.krieger1708@gmail.com>
* Update core/src/connection/manager.rs
Co-Authored-By: Pierre Krieger <pierre.krieger1708@gmail.com>
* Update core/src/connection/manager.rs
Co-Authored-By: Pierre Krieger <pierre.krieger1708@gmail.com>
* Update core/src/connection/pool.rs
Co-Authored-By: Pierre Krieger <pierre.krieger1708@gmail.com>
* Incorporate more review feedback.
* Move module declaration below imports.
* Update core/src/connection/manager.rs
Co-Authored-By: Toralf Wittner <tw@dtex.org>
* Update core/src/connection/manager.rs
Co-Authored-By: Toralf Wittner <tw@dtex.org>
* Simplify as per review.
* Fix rustoc link.
* Add try_notify_handler and simplify.
* Relocate DialingConnection and DialingAttempt.
For better visibility constraints.
* Small cleanup.
* Small cleanup. More robust EstablishedConnectionIter.
* Clarify semantics of `DialingPeer::connect`.
* Don't call inject_disconnected on InvalidPeerId.
To preserve the previous behavior and ensure calls to
`inject_disconnected` are always paired with calls to
`inject_connected`.
* Provide public ConnectionId constructor.
Mainly needed for testing purposes, e.g. in substrate.
* Move the established connection limit check to the right place.
* Clean up connection error handling.
Separate connection errors into those occuring during
connection setup or upon rejecting a newly established
connection (the `PendingConnectionError`) and those
errors occurring on previously established connections,
i.e. for which a `ConnectionEstablished` event has
been emitted by the connection pool earlier.
* Revert change in log level and clarify an invariant.
* Remove inject_replaced entirely.
* Allow notifying all connection handlers.
Thereby simplify by introducing a new enum `NotifyHandler`,
used with a single constructor `NetworkBehaviourAction::NotifyHandler`.
* Finishing touches.
Small API simplifications and code deduplication.
Some more useful debug logging.
Co-authored-by: Max Inden <mail@max-inden.de>
Co-authored-by: Pierre Krieger <pierre.krieger1708@gmail.com>
Co-authored-by: Toralf Wittner <tw@dtex.org>
2020-03-04 13:49:25 +01:00
|
|
|
either = "1.5"
|
2018-03-07 11:51:52 +01:00
|
|
|
fnv = "1.0"
|
2023-01-31 23:34:17 +00:00
|
|
|
futures = { version = "0.3.26", features = ["executor", "thread-pool"] }
|
2020-02-05 12:12:18 +01:00
|
|
|
futures-timer = "3"
|
2021-10-30 12:41:30 +02:00
|
|
|
instant = "0.1.11"
|
2021-10-22 18:09:02 +08:00
|
|
|
libsecp256k1 = { version = "0.7.0", optional = true }
|
2018-03-16 16:39:02 +01:00
|
|
|
log = "0.4"
|
2022-12-20 09:52:08 +01:00
|
|
|
multiaddr = { version = "0.17.0" }
|
|
|
|
multihash = { version = "0.17.0", default-features = false, features = ["std", "multihash-impl", "identity", "sha2"] }
|
2022-11-18 22:04:16 +11:00
|
|
|
multistream-select = { version = "0.12.1", path = "../misc/multistream-select" }
|
2022-11-23 11:51:47 +11:00
|
|
|
p256 = { version = "0.11.1", default-features = false, features = ["ecdsa", "std"], optional = true }
|
2022-02-16 15:16:04 +01:00
|
|
|
parking_lot = "0.12.0"
|
2020-10-14 11:17:15 +02:00
|
|
|
pin-project = "1.0.0"
|
2022-08-16 08:49:09 +02:00
|
|
|
prost = "0.11"
|
2023-02-16 07:13:37 +00:00
|
|
|
once_cell = "1.17.1"
|
2021-10-22 18:09:02 +08:00
|
|
|
rand = "0.8"
|
2022-05-16 19:17:49 +02:00
|
|
|
rw-stream-sink = { version = "0.3.0", path = "../misc/rw-stream-sink" }
|
2022-11-23 11:51:47 +11:00
|
|
|
sec1 = { version = "0.3.0", features = ["std"] } # Activate `std` feature until https://github.com/RustCrypto/traits/pull/1131 is released.
|
|
|
|
serde = { version = "1", optional = true, features = ["derive"] }
|
2021-12-08 15:07:29 +01:00
|
|
|
sha2 = "0.10.0"
|
2021-03-15 12:31:21 +01:00
|
|
|
smallvec = "1.6.1"
|
2020-01-10 21:03:59 +08:00
|
|
|
thiserror = "1.0"
|
2021-02-13 20:15:14 +01:00
|
|
|
unsigned-varint = "0.7"
|
2018-09-14 13:18:10 +02:00
|
|
|
void = "1"
|
2019-10-28 18:04:01 +01:00
|
|
|
zeroize = "1"
|
2019-03-11 13:42:53 +01:00
|
|
|
|
2020-06-30 17:31:02 +02:00
|
|
|
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
|
2022-09-07 09:16:22 +03:00
|
|
|
ring = { version = "0.16.9", features = ["alloc", "std"], default-features = false, optional = true}
|
2017-12-04 18:49:47 +01:00
|
|
|
|
|
|
|
[dev-dependencies]
|
2021-01-12 13:35:11 +01:00
|
|
|
async-std = { version = "1.6.2", features = ["attributes"] }
|
2022-12-21 03:35:25 +00:00
|
|
|
base64 = "0.20.0"
|
2022-09-14 07:01:41 +04:00
|
|
|
criterion = "0.4"
|
2022-12-13 07:58:01 +11:00
|
|
|
libp2p-mplex = { path = "../muxers/mplex" }
|
|
|
|
libp2p-noise = { path = "../transports/noise" }
|
2022-12-20 09:52:08 +01:00
|
|
|
multihash = { version = "0.17.0", default-features = false, features = ["arb"] }
|
2022-09-22 12:48:32 +04:00
|
|
|
quickcheck = { package = "quickcheck-ext", path = "../misc/quickcheck-ext" }
|
2022-02-13 21:57:38 +01:00
|
|
|
rmp-serde = "1.0"
|
|
|
|
serde_json = "1.0"
|
2019-03-11 13:42:53 +01:00
|
|
|
|
2020-01-15 12:02:02 +01:00
|
|
|
[build-dependencies]
|
2022-08-16 08:49:09 +02:00
|
|
|
prost-build = "0.11"
|
2020-01-15 12:02:02 +01:00
|
|
|
|
2019-03-11 13:42:53 +01:00
|
|
|
[features]
|
2021-11-30 17:47:35 +01:00
|
|
|
secp256k1 = [ "libsecp256k1" ]
|
|
|
|
ecdsa = [ "p256" ]
|
2022-09-07 09:16:22 +03:00
|
|
|
rsa = [ "dep:ring" ]
|
2022-09-08 11:30:43 +03:00
|
|
|
serde = ["multihash/serde-codec", "dep:serde"]
|
2020-12-07 18:06:41 +01:00
|
|
|
|
|
|
|
[[bench]]
|
|
|
|
name = "peer_id"
|
|
|
|
harness = false
|
2022-10-24 04:00:20 +02:00
|
|
|
|
2022-12-20 09:52:08 +01:00
|
|
|
# Passing arguments to the docsrs builder in order to properly document cfg's.
|
2022-10-24 04:00:20 +02:00
|
|
|
# More information: https://docs.rs/about/builds#cross-compiling
|
|
|
|
[package.metadata.docs.rs]
|
|
|
|
all-features = true
|
|
|
|
rustdoc-args = ["--cfg", "docsrs"]
|
|
|
|
rustc-args = ["--cfg", "docsrs"]
|