1261 Commits

Author SHA1 Message Date
Pierre Krieger
cb93c822f1
Turn yamux's error! into debug! (#995) 2019-03-11 14:44:40 +01:00
Roman Borschel
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
Toralf Wittner
26df15641c Call Connection::close in StreamMuxer::shutdown. (#988) 2019-03-01 12:22:23 +01:00
Pierre Krieger
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
Pierre Krieger
a64b18d5ab
Don't call the handler after it has shut down (#985) 2019-03-01 11:45:33 +01:00
Pierre Krieger
b1d55cc7cd
Fall back if no tokio executor available (#975) 2019-02-28 12:48:27 +01:00
Pierre Krieger
245f6fd3b6
Bump to v0.4.2 (#981) v0.4.2 2019-02-27 18:31:41 +01:00
Pierre Krieger
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
Pierre Krieger
c3670c4bf3
Disconnect only after the identify answer (#977) 2019-02-27 11:15:07 +01:00
Pierre Krieger
56a027cd32
Switch the WASM image to something else (#969) 2019-02-25 11:07:56 +01:00
Pierre Krieger
6143a33f18
Fix version of noise (#966) 2019-02-20 17:56:38 +01:00
Pierre Krieger
c192ba9f77
Forgot line in changelog (#965)
* Forgot line in changelog

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

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

* Serialize as slices
2019-02-18 11:39:49 +01:00
Pierre Krieger
2d31c2f733
Minor opti poll Fuse (#946) 2019-02-18 11:24:01 +01:00
Pierre Krieger
965c154093
Accept empty substreams in read_one (#943) 2019-02-18 10:58:12 +01:00
Pierre Krieger
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
Pierre Krieger
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
Pierre Krieger
b7fa7f38b1
Add IdentifyEvent::SendBack (#941) 2019-02-14 12:07:13 +01:00
roignpar
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
Pierre Krieger
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
Pierre Krieger
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
Pierre Krieger
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
Roman Borschel
eeed66707b Address edition-2018 idioms. (#929) 2019-02-11 14:58:15 +01:00
Pierre Krieger
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
Pierre Krieger
4fe77e8658
Update the WASM docker image (#932) 2019-02-11 12:13:55 +01:00
Pierre Krieger
229f5f66bd
Send external addresses first in identify (#930) 2019-02-08 10:46:04 +01:00
Benjamin Kampmann
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
Pierre Krieger
63db253566
Fix duplicate external addresses inserted (#927) 2019-02-07 13:46:39 +01:00
Pierre Krieger
5cac5b5573
Report external addresses in identify (#926) 2019-02-07 11:04:04 +01:00
Pierre Krieger
6b3b3ed2b5
Fix generics in out_event type in derive (#922) 2019-02-06 15:45:19 +01:00
Pierre Krieger
a22121c8e7
Limit Kademlia messages to 4kiB (#920) 2019-02-06 14:33:45 +01:00
Pierre Krieger
909f50f989
Swarm::dial adds addresses when pending (#919)
* Swarm::dial adds addresses when pending

* Bump libp2p-core to 0.3.3
2019-02-05 17:29:30 +01:00
Pierre Krieger
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
v0.3.1
2019-02-04 15:46:08 +01:00
Pierre Krieger
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
Pierre Krieger
7f66c4f4b0
Add Swarm::add_external_address (#915) 2019-02-04 14:33:05 +01:00
Mike Merrill
5fcc192261 fixed small typo in readme (#909) 2019-02-02 11:19:07 +01:00
Pierre Krieger
f999fd506a
Fix the dialing priority system (#907)
* Fix the dialing priority system

* Bump libp2p-core to 0.3.1

* Cancel dialing attempt if we don't have priority

* Add test for simultaneous dialing

* Improve test

* Fix test stuck forever
2019-02-01 15:21:20 +01:00
Pierre Krieger
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
Pierre Krieger
fcb2ac36e6
Bump to v0.3.0 (#905) v0.3.0 2019-01-30 16:50:47 +01:00