Commit Graph

721 Commits

Author SHA1 Message Date
96e559b503 Wrap multistream-select streams under a Negotiated (#1001) 2019-03-19 17:27:30 +01:00
63e9e39538 swarm: return references from external_addresses (#1008) 2019-03-19 15:23:58 +01:00
9575fa6c08 Documentation updates (#1005)
* Documentation updates:

  * libp2p: Update the top-level module documentation, already including
    intra-rustdoc links, removing outdated documentation, updating examples and
    polishing the text.

  * libp2p-core: Update the transport documentation to clarify that a `Transport`
    is really an abstraction only for connection-oriented transports.

* More links

* Fix typo.

* Address review comments.

* More doc tweaks.

  * Mention the necessity of creating an identity keypair.
  * Remove another mention of the removed Topology trait.
2019-03-19 12:45:57 +01:00
463e1a5837 examples: fix deprecated add_address (#1009) 2019-03-19 10:14:18 +01:00
fc535f532b Some Kademlia improvements (#994)
* Move QueryTarget to the behaviour

* Rework query system

* Add a few tests

* Add some Kademlia tests

* More tests

* Don't return self entry

* Fix tests
2019-03-18 18:20:57 +01:00
f4e7fed742 Remove unused test keys. (#1006) 2019-03-18 15:47:50 +01:00
bbe0bd3377 Fix warning in mplex (#1000) 2019-03-16 12:18:12 +01:00
1820bcb5ef Version 0.5.0 (#999) v0.5.0 2019-03-13 10:14:55 +01:00
1eb7dd8582 Add half-closed mplex substream support (#984) 2019-03-12 15:59:37 +01:00
8059a693a3 Cleaner shutdown process (#992)
* Cleaner shutdown process

* Finish

* Fix Yamux panic

* Remove irrelevant tests

* Update core/src/nodes/handled_node_tasks.rs

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

* Fix yamux error handling

* Update yamux
2019-03-11 17:19:50 +01:00
cb93c822f1 Turn yamux's error! into debug! (#995) 2019-03-11 14:44:40 +01:00
2c66f82b11 Consolidate keypairs in core. (#972)
* Consolidate keypairs in core.

Introduce the concept of a node's identity keypair in libp2p-core,
instead of only the public key:

  * New module: libp2p_core::identity with submodules for the currently
    supported key types. An identity::Keypair and identity::PublicKey
    support the creation and verification of signatures. The public key
    supports encoding/decoding according to the libp2p specs.

  * The secio protocol is simplified as a result of moving code to libp2p-core.

  * The noise protocol is slightly simplified by consolidating ed25519
    keypairs in libp2p-core and using x25519-dalek for DH. Furthermore,
    Ed25519 to X25519 keypair conversion is now complete and tested.

Generalise over the DH keys in the noise protocol.

Generalise over the DH keys and thus DH parameter in handshake patterns
of the Noise protocol, such that it is easy to support other DH schemes
in the future, e.g. X448.

* Address new review comments.
2019-03-11 13:42:53 +01:00
26df15641c Call Connection::close in StreamMuxer::shutdown. (#988) 2019-03-01 12:22:23 +01:00
f6cbafecbd Fix error being ignored in RwSinkStream (#989)
* Fix error being ignored in RwSinkStream

* Add test for partial reading

* Update misc/rw-stream-sink/src/lib.rs

Co-Authored-By: tomaka <pierre.krieger1708@gmail.com>
2019-03-01 12:08:49 +01:00
a64b18d5ab Don't call the handler after it has shut down (#985) 2019-03-01 11:45:33 +01:00
b1d55cc7cd Fall back if no tokio executor available (#975) 2019-02-28 12:48:27 +01:00
245f6fd3b6 Bump to v0.4.2 (#981) v0.4.2 2019-02-27 18:31:41 +01:00
2e57282efd Ping wasn't working anymore (#979)
* Fix ping

* Update protocols/ping/src/handler.rs

Co-Authored-By: tomaka <pierre.krieger1708@gmail.com>
2019-02-27 18:12:51 +01:00
c3670c4bf3 Disconnect only after the identify answer (#977) 2019-02-27 11:15:07 +01:00
56a027cd32 Switch the WASM image to something else (#969) 2019-02-25 11:07:56 +01:00
6143a33f18 Fix version of noise (#966) 2019-02-20 17:56:38 +01:00
c192ba9f77 Forgot line in changelog (#965)
* Forgot line in changelog

* More lines
2019-02-20 17:36:34 +01:00
040d8c8c9a Bump to v0.4 (#964) v0.4.0 2019-02-20 16:39:30 +01:00
747478a55d Fix simultaneous dialing test (#957) 2019-02-20 16:25:34 +01:00
a380889e90 Add many tests for the raw swarm (#962) 2019-02-20 16:03:05 +01:00
e1ad88f757 Fix an infinite loop in ProtocolsHandlerSelect (#961) 2019-02-20 15:06:49 +01:00
e92c6a219b Make TcpConfig::nat_traversal work with IPv6 (#956) 2019-02-19 16:44:07 +01:00
4fa00725e4 Use different ports in the memory transport tests (#954) 2019-02-19 10:57:40 +01:00
e2f99efb30 Fix the identify test multiplexer (#952) 2019-02-18 17:22:09 +01:00
43e4d1f589 Rewrite the MemoryTransport to be similar to the TcpConfig (#951)
* Rewrite the MemoryTransport to be similar to the TcpConfig

* Add small test

* Test and bug fixes
2019-02-18 17:05:50 +01:00
ca9534a38e Add a user data to CollectionStream (#947)
* Add a user data to CollectionStream

* Make NodeEvent return a PeerMut

* Add PeerMut::user_data_mut()

* Return the previous user data in accept()
2019-02-18 16:10:00 +01:00
6cb2c71ca3 Revert erroneous change in identification delay, and add test for it (#949)
* Revert erroneous id change, and add test

* Improve test
2019-02-18 13:59:12 +01:00
293a986ae4 Fix the multiaddr reexport (#948)
* Fix the multiaddr reexport

* Minor fixes
2019-02-18 13:35:51 +01:00
31dfbf39b9 Decode multiaddresses from visit_seq (#944)
* Decode multiaddresses from visit_seq

* Serialize as slices
2019-02-18 11:39:49 +01:00
2d31c2f733 Minor opti poll Fuse (#946) 2019-02-18 11:24:01 +01:00
965c154093 Accept empty substreams in read_one (#943) 2019-02-18 10:58:12 +01:00
e6c5240567 Add a BandwidthLogging transport wrapper (#911)
* Add a BandwidthLogging transport wrapper

* Update src/bandwidth.rs

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

* Limit by bytes.len

* Write test for bandwidth report

* Use the vector length instead of rolling_seconds
2019-02-14 16:39:18 +01:00
1100325e63 Improve nodes state (#917)
* Improve the state consistency in src/nodes

* Add a user data parameter to tasks

* Remove the tasks HashMap in CollectionStream

* Add TODO
2019-02-14 13:46:52 +01:00
b7fa7f38b1 Add IdentifyEvent::SendBack (#941) 2019-02-14 12:07:13 +01:00
f112f198b6 Add Ord implementation for KeepAlive (#918)
* Add Ord implementation for KeepAlive

* Fix import path

* Implement PartialOrd for KeepAlive

* remove Ord implementation

* Reimplement Ord for KeepAlive

* Add equality cases to KeepAlive Ord implementation
2019-02-14 11:35:24 +01:00
3548c29dcf Improvements to the helpers in upgrade::transfer (#937)
* Improvements to the helpers in upgrade::transfer

* Fix floodsub
2019-02-14 11:00:46 +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
e377a58b49 Fix compiling for WASM with websockets disabled (#934)
* Fix compiling for WASM with websockets disabled

* Comment about usage
2019-02-11 17:45:22 +01:00
eeed66707b Address edition-2018 idioms. (#929) 2019-02-11 14:58:15 +01:00
21810e46bd Fix infinite loop in read_one (#910)
* Fix infinite loop in read_one

* Also fix request_respond
2019-02-11 14:02:29 +01:00
4fe77e8658 Update the WASM docker image (#932) 2019-02-11 12:13:55 +01:00
229f5f66bd Send external addresses first in identify (#930) 2019-02-08 10:46:04 +01:00
bf5ed98895 Update Dependencies (#931)
* update secio dependencies: ed25519-dalek, sha2, hmac
* Update websocket dependencies
* Update multiaddr dependencies
2019-02-08 08:56:31 +01:00
63db253566 Fix duplicate external addresses inserted (#927) 2019-02-07 13:46:39 +01:00
5cac5b5573 Report external addresses in identify (#926) 2019-02-07 11:04:04 +01:00