67 Commits

Author SHA1 Message Date
Pierre Krieger
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
James Ray
fceaf2293b Chore/grammar (#701)
* Add a space.

* qed -> QED and ' ; qed' -> '; QED'

* ' ; QED' -> '; QED'
2018-11-29 16:38:52 +01:00
Pierre Krieger
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
Pierre Krieger
45114aef46
Move the Swarm in its own module (#681) 2018-11-27 11:22:55 +01:00
Pierre Krieger
95ebee5841
Update some dependencies (#686)
* Update many dependencies

* Upgrade some secio deps
2018-11-27 10:35:47 +01:00
Pierre Krieger
177c6cf842
Remove _priv from IdentifyInfo (#669) 2018-11-22 14:36:48 +01:00
Toralf Wittner
a5fee2dbac
secio: Defer nonce verification. (#667) 2018-11-21 10:39:48 +01:00
David
31962f5920 A few typos (#666) 2018-11-20 21:31:09 +01:00
Toralf Wittner
938b91742f
Add EitherUpgrade and generalise OrUpgrade. (#662) 2018-11-20 15:09:59 +01:00
Pierre Krieger
b213fd7bd7
Add PeerId::random() (#661) 2018-11-20 13:44:36 +01:00
Pierre Krieger
2c1807b646
Remove Send/Sync/'static requirements in identify (#649) 2018-11-16 13:59:56 +01:00
Pierre Krieger
37994b34e7
Behavior -> Behaviour (#650) 2018-11-16 12:59:57 +01:00
Pierre Krieger
23bcd44f18
Remove Send/Sync/'static reqs from ping (#652) 2018-11-16 12:49:55 +01:00
Pierre Krieger
373b05347a
Remove the Send + 'static requirements for floodsub (#637) 2018-11-15 19:00:57 +01:00
Pierre Krieger
1c9091655b
Move protocols_handler to the root (#643) 2018-11-15 18:39:20 +01:00
Pierre Krieger
ded89b4be3
Use a random sequence number in floodsub (#634)
* Use a random sequence number in floodsub

* Comment
2018-11-15 18:03:09 +01:00
Toralf Wittner
2e549884ef Split ConnectionUpgrade. (#642)
Introduce `InboundUpgrade` and `OutboundUpgrade`.
2018-11-15 17:41:11 +01:00
isan_rivkin
0eef1948e5 minor typo in docs (#640) 2018-11-15 11:06:58 +01:00
David
37e2ec38a7 Update connected peers' topics on NodeEvent (#638)
* Update connected peers' topics on NodeEvent

After a peer connects they send us the list of the topics they're subscribed to. This causes a NodeEvent to be emitted. This PR makes sure we update the subscription info we have on the newly connected peer.

* Formatting

* Update protocols/floodsub/src/layer.rs

Co-Authored-By: dvdplm <dvdplm@gmail.com>

* whiespace
2018-11-14 22:03:00 +01:00
Pierre Krieger
24ccefbbc6
Fix the concerns of #603 (#635) 2018-11-14 14:07:54 +01:00
Pierre Krieger
f8ccb0af36
Rewrite floodsub to use the ProtocolsHandler (#603)
* Move lib.rs to protocol.rs

* Rewrite floodsub for ProtocolsHandler

* Add a FloodsubBehaviour

* Fix closing floodsub after a message

* Address concern

* Make it conform to the protocol

* Make it really conformant

* Address concerns
2018-11-13 14:46:57 +01:00
Pierre Krieger
b3b5a4bdfd
Add an IdentifyListen behaviour (#626)
* Add an IdentifyListen behaviour

* Use infos() and infos_mut() instead
2018-11-12 17:23:20 +01:00
David
8595219db1 Use expect rather than unwrap (#625) 2018-11-12 13:34:02 +01:00
Pierre Krieger
a3b0914d73
Add implementations of NetworkBehaviour for ping (#618)
* Add implementations of NetworkBehaviour for ping

* Grumbles
2018-11-09 17:05:53 +01:00
Pierre Krieger
52ce49da95
Add a PeriodicIdentifyBehaviour (#617) 2018-11-09 16:51:07 +01:00
David
3e1eca16d7 Use upstream rust-secp256k1 (#616) 2018-11-09 15:02:27 +01:00
Pierre Krieger
1b4dada4d0
Inject event by value in ProtocolsHandler (#605) 2018-11-05 16:53:04 +01:00
Pierre Krieger
4405518045
Add a PeriodicPingHandler and a PingListenHandler (#574)
* Add ProtocolsHandler trait

* Reexport symbols

* Add a note about shutting down

* Add a PeriodicPingHandler and a PingListenHandler

* Fix core doctest

* Add tolerating not supported

* Fix concerns
2018-11-04 09:47:15 +01:00
James Ray
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
Pierre Krieger
4225d2631b
Add a IdentifyTransport (#569)
* Add a IdentifyTransport

* Retreiver -> Retriever

* Move the muxer in the IdRetrieverState
2018-11-02 14:23:38 +01:00
Pierre Krieger
9d91217193
Add a PeriodicIdentification protocol handler (#579)
* Add ProtocolsHandler trait

* Reexport symbols

* Add a note about shutting down

* Add a PeriodicIdentification protocol handler
2018-11-02 10:06:59 +01:00
Pierre Krieger
4627f21180
Use paritytech/rust-secp256k1 (#598) 2018-10-31 11:17:12 +01:00
James Ray
45cd7db6e9 Remove spaces before semicolons (#591) 2018-10-29 10:38:32 +01:00
Toralf Wittner
585c90a33c
Add protocol to report external address view. (#566)
Add protocol to report external address view.

Address part of #443.
2018-10-28 11:02:26 +01:00
jamartin9
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
Pierre Krieger
46dd6b61b2
Fix panicking when Kad responder is destroyed (#575) 2018-10-18 17:03:47 +01:00
Pierre Krieger
1e223f627d
Remove other unused files (#570) 2018-10-18 15:21:14 +01:00
Pierre Krieger
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
Pierre Krieger
68632ce26b
Fix secio compied with --no-default-features (#545) 2018-10-09 11:21:35 +02:00
Toralf Wittner
f2c3a149d7
Model HandshakeContext with explicit state transitions. (#532)
Instead of having one struct with uninitialised fields
which are mutated, have explicit states and ensure that the types
show that there is no ambiguity which data is available or not.
Consequently, this removes quite a few `unwrap`/`expect` calls.
2018-10-08 14:37:36 +02:00
Pierre Krieger
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
Pierre Krieger
e3efc2dc9a
Make secio almost compile for asmjs/wasm (#519)
* Use the sha2 crate in the handshake

* Return a Digest in algo_support instead of a ring ref

* Switch to ed25519-dalek for keys

* Make ring more or less optional

* Switch to ed25519_dalek for the verification

* Extract the key exchange to its own module

* Remove the ring RNG from the handshake

* Some warning fixes and forgot file

* Move key exchange to own module

* Remove usage of ring::digest

* Remove ring from handshake entirely

* Implement ECDH for WebCrypto

* Remove the libp2p-secio feature

* Fix ring being included

* Address some concerns

* Provde some panics in WebCrypto

* Prove the Hmac panic

* Prove more panics
2018-10-01 15:42:40 +02:00
Pierre Krieger
a9eefe1015
Remove notifying tasks (#528) 2018-10-01 11:18:00 +02:00
Qian LinFeng
4fa680e282 Upgrade smallvec version to fix license issue (#526) 2018-09-30 16:18:19 +02:00
James Ray
bf066773e3 ybsubscribing -> unsubscribing (#513) 2018-09-24 09:32:20 +02:00
Pierre Krieger
a988926c3e
Fix the ping dialer never closed (#504)
* Fix the ping dialer never closed

* Fix not ready
2018-09-21 10:06:04 +02:00
Pierre Krieger
4d8da24c64
Fix the Default implementation of Ping (#501) 2018-09-20 19:53:31 +02:00
Toralf Wittner
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
Pierre Krieger
1969bde4fe
Rework the Ping protocol (#497)
* Rework the Ping upgrade

* Fix concerns
2018-09-20 16:55:57 +02:00
Toralf Wittner
7fb09fbf20
secio: keep ciphertext if start_send is not ready (#494)
* secio: keep ciphertext if start_send is not ready

Otherwise ciphertext may be thrown away and once sent, the cipher states
have diverged, resulting in nonsense messages on decryption side.

* Also attempt to send pending data `Sink::close`.

* Inline `send_pending`.
2018-09-18 22:51:13 +02:00