Commit Graph

1295 Commits

Author SHA1 Message Date
vms
774661c756 are you kidding me? 2020-04-06 13:53:19 +03:00
vms
910ffd580c wip 2020-04-06 13:48:36 +03:00
vms
1c309b5e41 fix patching 2020-04-06 13:25:11 +03:00
vms
865a23e465 Merge pull request #6 from fluencelabs/libp2p_0.17
libp2p 0.17
2020-04-06 13:12:05 +03:00
vms
077b3301ab libp2p 0.17 2020-04-06 12:55:56 +03:00
84110878b8 Bump async-tls (#1532)
* Bump async-tls

* Bump rustls version
2020-04-03 17:48:14 +02:00
3eec3cc85c Update CHANGELOG.md with 0.17.0 (#1541) 2020-04-02 15:51:41 +02:00
a203db884c Bump parity-multiaddr (#1540) v0.17.0 2020-04-02 10:17:36 +02:00
3ae02a56a5 Bump to 0.17.0 (#1537) 2020-04-01 19:53:34 +02:00
6af530d6b2 Re-export OneShotHandlerConfig. Make fields public. (#1538)
Co-authored-by: Pierre Krieger <pierre.krieger1708@gmail.com>
2020-04-01 17:37:27 +02:00
1ddb4c4c0f Update CHANGELOG. (#1534)
* Update CHANGELOG.

* Update CHANGELOG.md

Co-Authored-By: Max Inden <mail@max-inden.de>

* More updates.

* Update format.

Co-authored-by: Max Inden <mail@max-inden.de>
2020-04-01 16:29:16 +02:00
b1059cd801 Pass the error to inject_listener_closed method (#1517)
* Pass the error to inject_listener_closed method

If there is an error when the listener closes, found in the
`NetworkEvent::ListenerClosed` `reason` field, we would like to pass it
on to the `inject_listener_closed()` method so that implementors of this
method have access to it.

Add an error parameter to `inject_listener_closed`.  Convert the
`reason` field from a `Result` to an `Option` and if there is an error
pass `Some(error)` at the method call site.

* Pass 'reason' as a Result

* Finish change

Co-authored-by: Pierre Krieger <pierre.krieger1708@gmail.com>
2020-04-01 14:49:42 +02:00
3f12a5ceaa mplex: Check for error and shutdown. (#1529)
* mplex: Check for error and shutdown.

Issues #1504 and #1523 reported panics caused by polling the sink of
`secio::LenPrefixCodec` after it had entered its terminal state, i.e.
after it had previously encountered an error or was closed. According
to the reports this happened only when using mplex as a stream
multiplexer. It seems that because mplex always stores and keeps the
`Waker` when polling, a wakeup of any of those wakers will resume the
polling even for those cases where the previous poll did not return
`Poll::Pending` but resolved to a value.

To prevent polling after the connection was closed or an error
happened we check for those conditions prior to every poll.

* Keep error when operations fail.

Co-authored-by: Pierre Krieger <pierre.krieger1708@gmail.com>
2020-04-01 14:28:59 +02:00
6b4bdc1fe9 Allow configuration of outbound substream in OneShotHandler. (#1521)
Co-authored-by: Pierre Krieger <pierre.krieger1708@gmail.com>
2020-04-01 13:07:10 +02:00
ec0b5dc364 Log bucket table (#5) 2020-04-01 12:52:37 +03:00
be970466b3 Full support for multiple connections per peer in libp2p-swarm. (#1519)
* [libp2p-swarm] Make the multiple connections per peer first-class.

This commit makes the notion of multiple connections per peer
first-class in the API of libp2p-swarm, introducing the new
callbacks `inject_connection_established` and
`inject_connection_closed`. The `endpoint` parameter from
`inject_connected` and `inject_disconnected` is removed,
since the first connection to open may not be the last
connection to close, i.e. it cannot be guaranteed,
as was previously the case, that the endpoints passed
to these callbacks match up.

* Have identify track all addresses.

So that identify requests can be answered with the correct
observed address of the connection on which the request
arrives.

* Cleanup

* Cleanup

* Improve the `Peer` state API.

* Remove connection ID from `SwarmEvent::Dialing`.

* Mark `DialPeerCondition` non-exhaustive.

* Re-encapsulate `NetworkConfig`.

To retain the possibility of not re-exposing all
network configuration choices, thereby providing
a more convenient API on the \`SwarmBuilder\`.

* Rework Swarm::dial API.

* Update CHANGELOG.

* Doc formatting tweaks.
2020-03-31 15:41:13 +02:00
bc455038fc core/src: Remove poll_broadcast connection notification mechanism (#1527)
* core/src: Remove poll_broadcast connection notification mechanism

The `Network::poll_broadcast` function has not proven to be useful. This
commit removes the mechanism all the way down to the connection manager.

With `poll_broadcast` gone there is no mechanism left to send commands
to pending connections. Thereby command buffering for pending
connections is not needed anymore and is thus removed in this commit as
well.

* core/src/connection/manager.rs: Remove warning comment

Co-Authored-By: Pierre Krieger <pierre.krieger1708@gmail.com>

Co-authored-by: Pierre Krieger <pierre.krieger1708@gmail.com>
2020-03-31 14:56:04 +02:00
2296a87b73 protocols/kad/behaviour: Use HashSet to deduplicate GetProviders (#1528)
Given that the order of `PeerId`s within the `GetProvidersOk.providers`
set is irrelevant but duplication is at best confusing this commit makes
use of a `HashSet` instead of a `Vec` to return unique `PeerId`s only.
2020-03-31 12:00:17 +02:00
034c3e41fe Fix typo in test 2020-03-30 15:04:12 +03:00
b067a022f0 set trust graph branch to master 2020-03-30 12:45:06 +03:00
27e61c9c6b Merge pull request #4 from fluencelabs/weighted_bucket
Weighted bucket & public key exchange
2020-03-30 12:00:20 +03:00
49a51609dd println => log 2020-03-30 11:59:17 +03:00
4f3d6bc587 Tests in weighted 2020-03-29 17:19:34 +03:00
7bc74a0e51 Merge branch 'weighted_tests' into weighted_bucket 2020-03-29 14:13:51 +03:00
c65a93b00e log public key in weight calculation 2020-03-29 00:35:32 +03:00
c6197cae12 Merge branch 'master' into weighted_bucket 2020-03-28 21:11:06 +03:00
a644735e6e start_providing log 2020-03-28 20:47:51 +03:00
b22934be64 hide public key from Debug 2020-03-28 20:24:55 +03:00
d8451e549c log providers 2020-03-28 20:00:50 +03:00
bd888cefd9 log get_providers 2020-03-28 17:14:45 +03:00
8e2cd08956 better logs 2020-03-28 16:57:19 +03:00
5d20ec9ece fix tests in kbucket.rs 2020-03-28 15:57:17 +03:00
ce86462a05 fix closest lgos 2020-03-27 20:18:42 +03:00
816ccac1ff weighted: logs 2020-03-27 19:57:05 +03:00
0a4cd14efa Closest iterators: lots of logs 2020-03-27 19:48:12 +03:00
6ef8f2c299 print calculated weight 2020-03-27 18:39:25 +03:00
98695967dd patch libp2p-core from crates-io 2020-03-27 14:06:15 +03:00
d6d11c4748 libp2p core 0.16.0 2020-03-27 14:00:20 +03:00
87e71d96f8 patch transitive libp2p-core 2020-03-27 13:51:20 +03:00
9db560ede6 libp2p-core 0.16.8 2020-03-27 12:46:10 +03:00
204d574add depend on trust graph via git 2020-03-27 12:30:22 +03:00
0d3e4f2051 Add protocols_handler::multi module. (#1497)
* Add `protocols_handler::multi` module.

An implementation of `ProtocolsHandler` that contains multiple other
`ProtocolsHandler`s indexed by some key type.

* Randomise start position of handler polling.

* Address some review concerns.

* Add `IntoMultiHandler`.

* Check protocol names for uniqueness.

* Changes due to review.

- No more `Debug` bound for the key type and more generic log messages.
- Additional comments.
- Imports instead of fully-qualified use.
- Renamed `DuplicateProtoname` to `DuplicateProtonameError`.

* Replace `HashMap` with `Vec` in `Upgrades`.

* Review suggestion.

Co-authored-by: Roman Borschel <romanb@users.noreply.github.com>
Co-authored-by: Pierre Krieger <pierre.krieger1708@gmail.com>
2020-03-26 18:25:17 +01:00
7220877a5c Make the SwarmEvent report everything (#1515)
* Improve the SwarmEvent to report everything

* Address review

* Update swarm/src/lib.rs

Co-Authored-By: Roman Borschel <romanb@users.noreply.github.com>

Co-authored-by: Roman Borschel <romanb@users.noreply.github.com>
2020-03-26 18:02:37 +01:00
58585f6cf5 .gitignore 2020-03-26 19:42:58 +03:00
3d52a6b021 Sort weighted bucket iter() by weight 2020-03-26 19:06:44 +03:00
3c03467a52 Merge branch 'weighted_bucket' into weighted_tests
# Conflicts:
#	protocols/kad/src/kbucket/weighted.rs
2020-03-26 12:26:18 +03:00
f60d004675 Use Vec instead of ArrayVec 2020-03-26 12:24:03 +03:00
135a181ec3 arbitrary weights 2020-03-26 11:45:42 +03:00
dca9099507 First test for weighted bucket 2020-03-25 20:26:50 +03:00
19a006329a Merge branch 'bucket_ordering' into weighted_bucket
# Conflicts:
#	protocols/kad/src/behaviour/test.rs
2020-03-25 19:26:43 +03:00