Commit Graph

53 Commits

Author SHA1 Message Date
040d8c8c9a Bump to v0.4 (#964) 2019-02-20 16:39:30 +01:00
e9535c5c02 Add a proper list of addresses type for Kademlia (#928)
* Add a proper list of addresses type for Kademlia

* Some adjustements
2019-02-12 12:56:39 +01:00
eeed66707b Address edition-2018 idioms. (#929) 2019-02-11 14:58:15 +01:00
a22121c8e7 Limit Kademlia messages to 4kiB (#920) 2019-02-06 14:33:45 +01:00
479924f8dc Bump libp2p, libp2p-core, libp2p-core-derive and libp2p-kad (#916)
* Bump libp2p-core, libp2p-core-derive and libp2p-kad

* Bump libp2p as well
2019-02-04 15:46:08 +01:00
c9b7e237b6 Add NetworkBehaviour::inject_replaced (#914)
* Add NetworkBehaviour::inject_replaced

* Address style

* Forgot to call set_disconnected

* Also add incoming addresses to kbuckets
2019-02-04 15:21:50 +01:00
780f4ddbc1 Avoid duplicate addresses in kbuckets (#906)
* Avoid duplicate addresses in kbuckets

* Bump kad to 0.3.1
2019-01-31 10:37:37 +01:00
fcb2ac36e6 Bump to v0.3.0 (#905) 2019-01-30 16:50:47 +01:00
663ec7e8da connection_keep_alive() now returns KeepAlive (#899)
* connection_keep_alive() now returns Option<Instant>

* Use KeepAlive instead of Option<Instant>
2019-01-30 16:37:34 +01:00
bbf56c6371 Update protobuf to version 2.3.0 (#904)
Initially I had hoped that the deprecated `#![allow(clippy)]` would no
longer be put into the generated rust files, but -- as of 2019-01-30 --
it still is (see [1] for details). Since we explicitly update the
protobuf files I decided to *manually edit the generated code* and
replace this with `#![allow(clippy:all)]`. Hopefully, by the time we do
the next upgrade, no such manual tweaking would be necessary anymore. I
think the benefit of a less polluted clippy output is worth it this
time.

[1]: https://github.com/stepancheg/rust-protobuf/pull/332
2019-01-30 16:25:45 +01:00
e23b2733e2 Fix some rustc/clippy warnings. (#895) 2019-01-30 15:41:54 +01:00
a77da73010 Add inject_dial_failure and make addresses_of_peer mut (#901)
* Add inject_dial_failure and make addresses_of_peer mut

* Fix tests
2019-01-30 14:55:39 +01:00
df923526ca Embed the topology in the NetworkBehaviour (#889)
* Embed the topology in the NetworkBehaviour

* Put topologies inside of Floodsub and Kad

* Fix core tests

* Fix chat example

* More work

* Some cleanup

* Restore external addresses system
2019-01-26 23:57:53 +01:00
d9b30c6c6a Make nodes generic over PeerId (#881) 2019-01-23 17:44:40 +01:00
6d24596f9f Update protocols and transport to 2018 edition (#875)
Update the protocols and transport subdirectories to the 2018 edition.

NB: The websocket transport cannot be moved to 2018 edition due to
websocket-rs's use of the keyword async as the name of a module.
2019-01-21 11:33:51 +01:00
4bc5dea27d Fixes to Kademlia queries (#855)
* Fixes to Kademlia queries

* Bump libp2p-kad to 0.2.1

* Fix bucket_num

* Nicer IDs generation in tests
2019-01-15 17:25:09 +01:00
e39d6d8bd2 Version 0.2 (#841) 2019-01-10 13:27:45 +01:00
dbff125df2 Add an Error associated type to transports (#835)
* Add an Error associated type to transports

* Improve raw swarm a bit

* Rename map_other to map

* Use source() instead of cause()

* RawSwarmIncErr -> IncomingError
2019-01-10 11:27:06 +01:00
438b6753a8 Remove assertions in kad protocol (#818) 2019-01-04 16:09:04 +01:00
7da1a860be Automatically close useless connections (#816)
* Automatically close useless connections

* Add a timeout before dropping the connection

* Rework the timeout

* Use OR to combine the outcome
2019-01-04 12:02:39 +01:00
2c2fc8bfd3 Don't allow handlers::poll() to return None (#811) 2019-01-02 14:22:23 +01:00
f903e2b744 Add version numbers of multi* deps (#810) 2019-01-02 13:45:23 +01:00
36c8e9e3f1 Some improvements to k-buckets (#791)
* Rework the KBucketsPeerId trait

* Remove interior mutability from k-buckets

* Reexport the kbuckets module

* Fix tests

* Apply suggestions from code review

Co-Authored-By: tomaka <pierre.krieger1708@gmail.com>
2019-01-02 13:33:44 +01:00
7798e23e78 Add an error associated type to ProtocolsHandler (#795) 2018-12-28 15:11:35 +01:00
f541df391a Chore/semi colons (#799)
* Add helpers for easier Transports creation (#777)

* Add helpers for easier Transports creation

* Fix doctests

* Fix ' ;' occurrences
2018-12-19 23:22:39 +01:00
83320e0347 More precise error passed to inject_dial_upgrade_error (#771)
* More precise error passed to inject_dial_upgrade_error

* Fix concerns

* Fix panic proof
2018-12-18 11:23:13 +01:00
40a503fd63 Store information about the local node in the topology (#772)
* Store information about the local node in the topology

* Fix build

* Store the external addresses in the topology
2018-12-13 19:06:13 +01:00
a152e18821 Simplify handling of upgrade information. (#761) 2018-12-11 15:13:10 +01:00
2dce4294a0 Add version numbers in the deps in Cargo.toml (#768) 2018-12-11 14:54:44 +01:00
a8a6438fbc Rename libp2p-tcp-transport to libp2p-tcp (#762) 2018-12-10 13:39:11 +01:00
d94a768bd9 Rename multiaddr and mulithash to parity-* (#737)
* Rename multiaddr and mulithash to parity-*

* Fix doctests
2018-12-07 15:40:02 +01:00
2ef4d779ca Add metadata to all the Cargo.toml (#743) 2018-12-06 19:22:06 +01:00
4140047f34 Avoid some warnings. (#733)
- mdns: unused `Result` which must be used
- kad: unused import
- mplex: use of deprecated item
2018-12-05 15:01:17 +01:00
9e0f110e47 Remove relay, peerstore and datastore (#723) 2018-12-04 14:52:14 +01:00
c5d08ab48c Enhance the swarm a bit (#711)
* Replace the &mut TTopology with a &mut PollParameters

* Add supported_protocols

* Add external_addresses

* Report out addresses in Kademlia

* Fix the custom derive

* Some comments

* Fix compilation on stable
2018-12-01 13:34:57 +01:00
3aa1fcbdc6 Add a KademliaHandler (#580)
* Rework Kademlia for the new design

* Minor work on protocol.rs

* More work

* Remove QueryTarget::FindValue

* Finish work on query

* Query timeout test

* Work on topology

* More work

* Update protocols/kad/src/topology.rs

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

* Fix trailing whitespaces

* Use if let
2018-11-29 12:11:35 +01:00
95ebee5841 Update some dependencies (#686)
* Update many dependencies

* Upgrade some secio deps
2018-11-27 10:35:47 +01:00
b213fd7bd7 Add PeerId::random() (#661) 2018-11-20 13:44:36 +01:00
2e549884ef Split ConnectionUpgrade. (#642)
Introduce `InboundUpgrade` and `OutboundUpgrade`.
2018-11-15 17:41:11 +01:00
8595219db1 Use expect rather than unwrap (#625) 2018-11-12 13:34:02 +01:00
0f3ef5ee0a eg. -> e.g.; ie. -> i.e. via repren (#592)
* eg. -> e.g.; ie. -> i.e. via repren

* se.g. -> seg.
2018-11-02 16:40:00 +01:00
45cd7db6e9 Remove spaces before semicolons (#591) 2018-10-29 10:38:32 +01:00
490ae980c7 #399 remove tokio_current_thread tests (#577)
* remove tokio_current_thread tests

* Review changes:
Removed newline
Moved uds tokio test crate to top to avoid self and keep with convention of other test crates
Removed sleep from uds test and block until all futures are completed.
2018-10-25 11:26:37 +02:00
46dd6b61b2 Fix panicking when Kad responder is destroyed (#575) 2018-10-18 17:03:47 +01:00
5d1c54cc10 New core (#568)
* New core

* Fix lifetime requirements

* Remove identify transport

* Address &mut & ref ref mut

* Fix whitespaces
2018-10-17 10:17:40 +01:00
c032afbde5 Implement GET_PROVIDERS/ADD_PROVIDER Kademlia messages (#530)
* Implement GET_PROVIDERS/ADD_PROVIDER Kademlia messages

* Use multihash and peer id in protocol.rs

* Fix Kademlia example
2018-10-01 18:40:35 +02:00
4fa680e282 Upgrade smallvec version to fix license issue (#526) 2018-09-30 16:18:19 +02:00
84b089cacc Refactor multiaddr crate. (#498)
Refactor multiaddr crate.

- Remove `AddrComponent`. Instead `Protocol` directly contains its
associated data.

- Various smaller changes around conversions to Multiaddr from other
types, e.g. socket addresses.

- Expand tests to include property tests which test encoding/decoding
identity.
2018-09-20 19:51:00 +02:00
0c43c76965 Implement close() from Sink (#492) 2018-09-17 15:01:37 +02:00
304e9c72c8 Report the entire peers after a result (#467) 2018-09-07 16:46:34 +02:00