374 Commits

Author SHA1 Message Date
Pierre Krieger
480cf380d7
Add ExpandedSwarm (#1046) 2019-04-07 18:34:14 -03:00
Pierre Krieger
b176032a07
Generalize TPeerId into TConnInfo (#1045)
* Generalize TPeerId into TConnInfo

* Final fixes
2019-04-05 13:37:12 -03:00
Pierre Krieger
935825089d
Add getters to RawSwarm (#1037) 2019-04-04 16:49:00 -03:00
Age Manning
1dcb3e5b1c Allow oneshot handler's inactivity_timeout to be configurable (#1039) 2019-04-04 16:28:18 -03:00
Toralf Wittner
fac1ba12ec
Remove ProtocolsHandlerUpgrErr::MuxerDeniedSubstream. (#1043)
Closes #1042.
2019-04-04 19:11:59 +02:00
Pierre Krieger
1d4324ab70
Split the Swarm from the NetworkBehaviour (#1035) 2019-04-04 12:25:42 -03:00
Roman Borschel
8f77e9c45e
Add missing zeroize() call for secp256k1::SecretKey::from_bytes. (#1040)
* Add missing zeroize() call for secp256k1.

* Add a test.
2019-04-03 10:31:09 +02:00
Pierre Krieger
dfc425ea54
Also publish multistream-select 0.4 (#1034) 2019-03-29 14:05:40 -03:00
Pierre Krieger
235ad98863
Publish v0.6.0 (#1031) 2019-03-29 11:41:42 -03:00
Pierre Krieger
be4f8ca908
Add a Toggle NetworkBehaviour (#1024) 2019-03-29 10:17:11 -03:00
mattrutherford
7549948945
Use bounded channels in transport (#987)
* Implement DialFuture

* Update with recommended changes to buffer size, `expect()` and `close()`
2019-03-28 22:34:53 +00:00
Pierre Krieger
03ce6a6ed5
Add method to query external addresses (#1022) 2019-03-28 15:58:02 -03:00
Pierre Krieger
ebbe197d9c
Remove remnants of shutdown process (#1020) 2019-03-28 15:36:26 -03:00
Pierre Krieger
538c3dffdf
Improve Debug and Display for PeerId (#1019)
* Improve Debug and Display for PeerId

* Update core/src/peer_id.rs

Co-Authored-By: tomaka <pierre.krieger1708@gmail.com>
2019-03-23 10:08:07 +01:00
Pierre Krieger
34db72a080
Split address reach error and node reach error (#1013)
* Split address reach error and node reach error

* Small comments about order of operatoins

* Minor doc change
2019-03-20 20:28:55 +01:00
Pierre Krieger
96e559b503
Wrap multistream-select streams under a Negotiated (#1001) 2019-03-19 17:27:30 +01:00
Fedor Sakharov
63e9e39538 swarm: return references from external_addresses (#1008) 2019-03-19 15:23:58 +01:00
Roman Borschel
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
Pierre Krieger
1820bcb5ef
Version 0.5.0 (#999) 2019-03-13 10:14:55 +01:00
Pierre Krieger
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
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
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
040d8c8c9a
Bump to v0.4 (#964) 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
4fa00725e4
Use different ports in the memory transport tests (#954) 2019-02-19 10:57:40 +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
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
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
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
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
63db253566
Fix duplicate external addresses inserted (#927) 2019-02-07 13:46:39 +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
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
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
fcb2ac36e6
Bump to v0.3.0 (#905) 2019-01-30 16:50:47 +01:00
Pierre Krieger
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
Toralf Wittner
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
Toralf Wittner
e23b2733e2
Fix some rustc/clippy warnings. (#895) 2019-01-30 15:41:54 +01:00
Pierre Krieger
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
Pierre Krieger
35ec7f053c
Proper shutdown in ProtocolsHandlerSelect (#870)
* Proper shutdown in ProtocolsHandlerSelect

* Fix infinite loop
2019-01-29 19:52:22 +01:00