14 Commits

Author SHA1 Message Date
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
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
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
724d0f5d82
Remove the old API (#565)
* Remove the old API

* Fix integration test
2018-10-15 16:17:55 +01:00
Pierre Krieger
75ceba7809
The SwarmFuture is now a Stream (#442)
* The SwarmFuture is now a Stream

* Return the produced future in the message

* Remove IncomingConnection event

* Pass error when failing to dial

* Fix loop break mistake

* Fix concern

* Rename SwarmFuture to SwarmEvents

* Increase type length limit

* Remove todo
2018-09-04 14:53:27 +02:00
Pierre Krieger
f787c80a42 Merge the changes from polkadot-2 into master (#446) 2018-09-03 16:46:15 +02:00
Pierre Krieger
0e1483f02e Rework the StreamMuxer trait (#437)
* Stronger typing for the swarm handler future
* The swarm future is now a swarm stream of events
* Rewrite StreamMuxer in core
* Update libp2p_mplex for the new stream muxer
* Update yamux for new stream muxer
2018-08-31 10:31:34 +02:00
Pierre Krieger
1110907d78 Rewrite multiplex tests to use the memory transport (#370) 2018-08-06 10:41:11 +02:00
Pierre Krieger
294310cd07
Rewrite multiplex (#261)
* Rewrite multiplex

* Increase the packet size limit to 32 MB

* Fix waiting for poll_complete to finish

* Typo

* Properly close substreams

* Add a limit to the number of substreams

* Add a limit to the length of the internal buffer

* Fix concerns
2018-07-17 16:31:32 +02:00
Pierre Krieger
bd965d1668
Test creating lots of connections amongst lots of swarm (#304)
* Use the new version of tokio

* Add tests for lots of connections in a swarm

* Remove wrongly-added file
2018-07-16 16:56:05 +02:00
Pierre Krieger
16e3453b7f
Use the new version of tokio (#303) 2018-07-16 12:15:27 +02:00
Pierre Krieger
7b375798a5
The Multiaddr of the remote is now a Future (#249)
* The Multiaddr of the remote is now a Future

* The multiaddress future in swarm is now a Box
2018-06-19 14:38:55 +02:00
Pierre Krieger
5c1890e66a
Rename libp2p_swarm to libp2p_core (#189) 2018-05-16 12:59:36 +02:00