-
Notifications
You must be signed in to change notification settings - Fork 950
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multiple connections per peer #1440
Commits on Feb 13, 2020
-
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]: paritytech/substrate#4272
Roman S. Borschel committedFeb 13, 2020 Configuration menu - View commit details
-
Copy full SHA for 4fa8360 - Browse repository at this point
Copy the full SHA 4fa8360View commit details -
Roman S. Borschel committed
Feb 13, 2020 Configuration menu - View commit details
-
Copy full SHA for 5f182f0 - Browse repository at this point
Copy the full SHA 5f182f0View commit details
Commits on Feb 14, 2020
-
Update core/src/connection/pool.rs
Co-Authored-By: Max Inden <mail@max-inden.de>
Configuration menu - View commit details
-
Copy full SHA for 66566e4 - Browse repository at this point
Copy the full SHA 66566e4View commit details
Commits on Feb 16, 2020
-
Address some review feedback and fix doc links.
Roman S. Borschel committedFeb 16, 2020 Configuration menu - View commit details
-
Copy full SHA for 51b7102 - Browse repository at this point
Copy the full SHA 51b7102View commit details -
Allow responses to be sent on the same connection.
Roman S. Borschel committedFeb 16, 2020 Configuration menu - View commit details
-
Copy full SHA for ae6bfe9 - Browse repository at this point
Copy the full SHA ae6bfe9View commit details -
Remove unnecessary remainders of inject_replaced.
Roman S. Borschel committedFeb 16, 2020 Configuration menu - View commit details
-
Copy full SHA for df6c55a - Browse repository at this point
Copy the full SHA df6c55aView commit details
Commits on Feb 17, 2020
-
Co-Authored-By: Pierre Krieger <pierre.krieger1708@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for 0ae2400 - Browse repository at this point
Copy the full SHA 0ae2400View commit details -
Co-Authored-By: Pierre Krieger <pierre.krieger1708@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for 1b3c9cf - Browse repository at this point
Copy the full SHA 1b3c9cfView commit details -
Update core/src/connection/manager.rs
Co-Authored-By: Pierre Krieger <pierre.krieger1708@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for 76fd5d9 - Browse repository at this point
Copy the full SHA 76fd5d9View commit details -
Update core/src/connection/manager.rs
Co-Authored-By: Pierre Krieger <pierre.krieger1708@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for 4c81357 - Browse repository at this point
Copy the full SHA 4c81357View commit details -
Update core/src/connection/pool.rs
Co-Authored-By: Pierre Krieger <pierre.krieger1708@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for 0e836fc - Browse repository at this point
Copy the full SHA 0e836fcView commit details -
Incorporate more review feedback.
Roman S. Borschel committedFeb 17, 2020 Configuration menu - View commit details
-
Copy full SHA for 38f283d - Browse repository at this point
Copy the full SHA 38f283dView commit details -
Move module declaration below imports.
Roman S. Borschel committedFeb 17, 2020 Configuration menu - View commit details
-
Copy full SHA for f3bfe54 - Browse repository at this point
Copy the full SHA f3bfe54View commit details -
Update core/src/connection/manager.rs
Co-Authored-By: Toralf Wittner <tw@dtex.org>
Configuration menu - View commit details
-
Copy full SHA for b0b39fb - Browse repository at this point
Copy the full SHA b0b39fbView commit details -
Update core/src/connection/manager.rs
Co-Authored-By: Toralf Wittner <tw@dtex.org>
Configuration menu - View commit details
-
Copy full SHA for 53810e6 - Browse repository at this point
Copy the full SHA 53810e6View commit details
Commits on Feb 18, 2020
-
Roman S. Borschel committed
Feb 18, 2020 Configuration menu - View commit details
-
Copy full SHA for 017d0e9 - Browse repository at this point
Copy the full SHA 017d0e9View commit details -
Roman S. Borschel committed
Feb 18, 2020 Configuration menu - View commit details
-
Copy full SHA for f95a1dd - Browse repository at this point
Copy the full SHA f95a1ddView commit details -
Add try_notify_handler and simplify.
Roman S. Borschel committedFeb 18, 2020 Configuration menu - View commit details
-
Copy full SHA for 21e9919 - Browse repository at this point
Copy the full SHA 21e9919View commit details -
Relocate DialingConnection and DialingAttempt.
For better visibility constraints.
Roman S. Borschel committedFeb 18, 2020 Configuration menu - View commit details
-
Copy full SHA for 0a34b93 - Browse repository at this point
Copy the full SHA 0a34b93View commit details
Commits on Feb 19, 2020
-
Roman S. Borschel committed
Feb 19, 2020 Configuration menu - View commit details
-
Copy full SHA for efa5fde - Browse repository at this point
Copy the full SHA efa5fdeView commit details
Commits on Feb 20, 2020
-
Merge branch 'master' into multicon
Roman S. Borschel committedFeb 20, 2020 Configuration menu - View commit details
-
Copy full SHA for 73d6241 - Browse repository at this point
Copy the full SHA 73d6241View commit details
Commits on Feb 23, 2020
-
Small cleanup. More robust EstablishedConnectionIter.
Roman S. Borschel committedFeb 23, 2020 Configuration menu - View commit details
-
Copy full SHA for 92d20e8 - Browse repository at this point
Copy the full SHA 92d20e8View commit details -
Clarify semantics of
DialingPeer::connect
.Roman S. Borschel committedFeb 23, 2020 Configuration menu - View commit details
-
Copy full SHA for 3540588 - Browse repository at this point
Copy the full SHA 3540588View commit details
Commits on Feb 24, 2020
-
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`.
Roman S. Borschel committedFeb 24, 2020 Configuration menu - View commit details
-
Copy full SHA for 3838c5e - Browse repository at this point
Copy the full SHA 3838c5eView commit details -
Provide public ConnectionId constructor.
Mainly needed for testing purposes, e.g. in substrate.
Roman S. Borschel committedFeb 24, 2020 Configuration menu - View commit details
-
Copy full SHA for d9938b8 - Browse repository at this point
Copy the full SHA d9938b8View commit details -
Move the established connection limit check to the right place.
Roman S. Borschel committedFeb 24, 2020 Configuration menu - View commit details
-
Copy full SHA for 1d251d6 - Browse repository at this point
Copy the full SHA 1d251d6View commit details -
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.
Roman S. Borschel committedFeb 24, 2020 Configuration menu - View commit details
-
Copy full SHA for 6161f1c - Browse repository at this point
Copy the full SHA 6161f1cView commit details
Commits on Feb 25, 2020
-
Revert change in log level and clarify an invariant.
Roman S. Borschel committedFeb 25, 2020 Configuration menu - View commit details
-
Copy full SHA for 1a5b184 - Browse repository at this point
Copy the full SHA 1a5b184View commit details -
Remove inject_replaced entirely.
Roman S. Borschel committedFeb 25, 2020 Configuration menu - View commit details
-
Copy full SHA for df58cde - Browse repository at this point
Copy the full SHA df58cdeView commit details
Commits on Feb 26, 2020
-
Allow notifying all connection handlers.
Thereby simplify by introducing a new enum `NotifyHandler`, used with a single constructor `NetworkBehaviourAction::NotifyHandler`.
Roman S. Borschel committedFeb 26, 2020 Configuration menu - View commit details
-
Copy full SHA for abf249b - Browse repository at this point
Copy the full SHA abf249bView commit details -
Merge branch 'master' into multicon
Roman S. Borschel committedFeb 26, 2020 Configuration menu - View commit details
-
Copy full SHA for b7d6c58 - Browse repository at this point
Copy the full SHA b7d6c58View commit details
Commits on Feb 28, 2020
-
Merge branch 'master' into multicon
Roman S. Borschel committedFeb 28, 2020 Configuration menu - View commit details
-
Copy full SHA for 7fe86db - Browse repository at this point
Copy the full SHA 7fe86dbView commit details
Commits on Feb 29, 2020
-
Small API simplifications and code deduplication. Some more useful debug logging.
Roman S. Borschel committedFeb 29, 2020 Configuration menu - View commit details
-
Copy full SHA for 3879b65 - Browse repository at this point
Copy the full SHA 3879b65View commit details
Commits on Mar 3, 2020
-
Configuration menu - View commit details
-
Copy full SHA for 86cf85b - Browse repository at this point
Copy the full SHA 86cf85bView commit details