Commit Graph

1295 Commits

Author SHA1 Message Date
c908e194ef Merge branch 'rust_master' into libp2p_0_20
# Conflicts:
#	.github/workflows/ci.yml
#	Cargo.toml
#	core/Cargo.toml
#	examples/distributed-key-value-store.rs
#	misc/multistream-select/Cargo.toml
#	muxers/mplex/Cargo.toml
#	protocols/deflate/Cargo.toml
#	protocols/gossipsub/Cargo.toml
#	protocols/identify/Cargo.toml
#	protocols/kad/src/behaviour.rs
#	protocols/kad/src/behaviour/test.rs
#	protocols/kad/src/kbucket.rs
#	protocols/kad/src/kbucket/bucket.rs
#	protocols/kad/src/lib.rs
#	protocols/kad/src/query.rs
#	protocols/kad/src/query/peers/closest.rs
#	protocols/mdns/Cargo.toml
#	protocols/ping/Cargo.toml
#	protocols/secio/Cargo.toml
#	transports/tcp/Cargo.toml
#	transports/uds/Cargo.toml
2020-07-01 17:30:41 +03:00
5e0bb10395 Document all features on docs.rs (#1637)
* Enable tcp-tokio on docs.rs

To have the documentation built for the optional feature,
it has to be enabled in package metadata for docs.rs.

* Document all features on docs.rs

Co-authored-by: Pierre Krieger <pierre.krieger1708@gmail.com>
Co-authored-by: Roman Borschel <romanb@users.noreply.github.com>
2020-06-30 18:01:44 +02:00
79ff1e4d31 Some fixes to #[cfg] regarding Wasi (#1633)
Co-authored-by: Roman Borschel <romanb@users.noreply.github.com>
2020-06-30 17:31:02 +02:00
826f5130cd Allow StreamMuxer to notify changes in the address (#1621)
* Allow StreamMuxer to notify changes in the address

* Fix doc link

* Revert accidental rename

* Other accidental rename

Co-authored-by: Roman Borschel <romanb@users.noreply.github.com>
2020-06-30 17:10:53 +02:00
d5b26359bb Remove the Discovered event. (#1632)
See the discussion in https://github.com/libp2p/rust-libp2p/pull/1628.
2020-06-30 16:54:56 +02:00
92b3ce37d5 Support /dns/ as well as /dns4/ and /dns6/ in the websocket wasm ext impl (#1626)
Co-authored-by: Pierre Krieger <pierre.krieger1708@gmail.com>
2020-06-30 16:25:17 +02:00
5afc27869d protocols/kad/src/lib: Expose KademliaBucketInserts (#1638) 2020-06-30 13:09:02 +02:00
9049591d46 Use self.config.idle_timeout in Kademlia handler (#1635) 2020-06-30 07:50:45 +02:00
823c747904 feat: update async-std to 1.6.2 (#1618)
Ref #1612

Co-authored-by: Pierre Krieger <pierre.krieger1708@gmail.com>
Co-authored-by: Roman Borschel <romanb@users.noreply.github.com>
2020-06-29 17:24:38 +02:00
eb8cb43508 Add libp2p-request-response protocol. (#1596)
* Add the libp2p-request-response protocol.

This crate provides a generic implementation for request/response
protocols, whereby each request is sent on a new substream.

* Fix OneShotHandler usage in floodsub.

* Custom ProtocolsHandler and multiple protocols.

  1. Implement a custom ProtocolsHandler instead of using
     the OneShotHandler for better control and error handling.
     In particular, all request/response sending/receiving is
     kept in the substreams upgrades and thus the background
     task of a connection.
  2. Support multiple protocols (usually protocol versions)
     with a single `RequestResponse` instance, with
     configurable inbound/outbound support.

* Small doc clarification.

* Remove unnecessary Sync bounds.

* Remove redundant Clone constraint.

* Update protocols/request-response/Cargo.toml

Co-authored-by: Toralf Wittner <tw@dtex.org>

* Update dev-dependencies.

* Update Cargo.tomls.

* Add changelog.

* Remove Sync bound from RequestResponseCodec::Protocol.

Apparently the compiler just needs some help with the scope
of borrows, which is unfortunate.

* Try async-trait.

* Allow checking whether a ResponseChannel is still open.

Also expand the commentary on `send_response` to indicate that
responses may be discard if they come in too late.

* Add `RequestResponse::is_pending`.

As an analogue of `ResponseChannel::is_open` for outbound requests.

* Revert now unnecessary changes to the OneShotHandler.

Since `libp2p-request-response` is no longer using it.

* Update CHANGELOG for libp2p-swarm.

Co-authored-by: Toralf Wittner <tw@dtex.org>
2020-06-29 17:08:40 +02:00
7270ed8721 [libp2p-kad] More control & insight for k-buckets. (#1628)
* More control & insight for k-buckets.

1) More control: It is now possible to disable automatic
insertions of peers into the routing table via a new
`KademliaBucketInserts` configuration option. The
default is `OnConnected`, but it can be set to `Manual`,
in which case `add_address` must be called explicitly.
In order to communicate all situations in which a user
of `Kademlia` may want to manually update the routing
table, two new events are introduced:

  * `KademliaEvent::RoutablePeer`: When a connection to
    a peer with a known listen address is established
    which may be added to the routing table. This is
    also emitted when automatic inserts are allowed but
    the corresponding k-bucket is full.
  * `KademliaEvent::PendingRoutablePeer`: When a connection
    to a peer with a known listen address is established
    which is pending insertion into the routing table
    (but may not make it). This is only emitted when
    `OnConnected` (i.e. automatic inserts) are used.

These complement the existing `UnroutablePeer` and
`RoutingUpdated` events. It is now also possible to
explicitly remove peers and addresses from the
routing table.

2) More insight: `Kademlia::kbuckets` now gives an
iterator over `KBucketRef`s and `Kademlia::bucket`
a particular `KBucketRef`. A `KBucketRef` in turn
allows iteration over its entries. In this way,
the full contents of the routing table can be
inspected, e.g. in order to decide which peer(s)
to remove.

* Update protocols/kad/src/behaviour.rs

* Update protocols/kad/src/behaviour.rs

Co-authored-by: Max Inden <mail@max-inden.de>

* Update CHANGELOG.

Co-authored-by: Max Inden <mail@max-inden.de>
2020-06-29 16:44:44 +02:00
b61c3f9d04 Update libp2p-dns doc to include /dns/ support (#1634)
Now that /dns/ is supported, it should be mentioned in
the documentation as well.
2020-06-29 15:05:11 +02:00
ea45550d61 Add Deserialize for ed25519::PublicKey (#21) 2020-06-25 13:15:33 +03:00
7fd69ecf3f Fix spelling mistake. (#1627) 2020-06-24 15:19:01 +02:00
c9f121201c Release v0.20.1 (#1624)
- Update `libp2p-kad` CHANGELOG and increment version to 0.20.1.
- Update `libp2p` version to 0.20.1.
- Fix some linter warning in `libp2p-gossipsub` and increment
  version to 0.19.3 and update CHANGELOG.
2020-06-23 11:51:49 +02:00
32cb0a56bd kad: Avoid from/into IteratorIndex. (#1623)
This caused problems with type inference.
2020-06-23 11:28:43 +02:00
0eef487ef8 Prepare release. (#1620) 2020-06-22 11:41:28 +02:00
e8e41f4efb CHANGELOG.md: Add entry for disjoint-paths feature in libp2p-kad (#1617) 2020-06-19 13:57:10 +02:00
9dd2d662e9 protocols/kad: Implement S-Kademlia's lookup over disjoint paths v2 (#1473)
The extension paper S-Kademlia includes a proposal for lookups over
disjoint paths. Within vanilla Kademlia, queries keep track of the
closest nodes in a single bucket. Any adversary along the path can thus
influence all future paths, in case they can come up with the
next-closest (not overall closest) hops. S-Kademlia tries to solve the
attack above by querying over disjoint paths using multiple buckets.

To adjust the libp2p Kademlia implementation accordingly this change-set
introduces an additional peers iterator: `ClosestDisjointPeersIter`.
This new iterator wraps around a set of `ClosestPeersIter`
`ClosestDisjointPeersIter` enforces that each of the `ClosestPeersIter`
explore disjoint paths by having each peer instantly return that was
queried by a different iterator before.
2020-06-19 12:22:26 +02:00
00fc223487 Deprecate StreamMuxer::is_remote_acknowledged (#1616) 2020-06-19 11:59:24 +02:00
563d3374ed Update CHANGELOG and increment version to 0.19.2 (#1615) 2020-06-19 11:13:02 +02:00
168b00ed3e Add CHANGELOG and increment version to 0.19.2 (#1614) 2020-06-18 17:02:23 +02:00
859aa59bd8 Avoid recursive dependencies due to tests. (#1609)
Remove `version` from workspace `dev-dependencies`.
2020-06-18 10:27:47 +02:00
44236b5ba3 Bump snow to version 0.7.0 (#1610) 2020-06-16 14:58:06 +02:00
b983c94c59 Update to soketto v0.4.0 (#1603)
* Update to soketto v0.4.0

* Remove patch section from Cargo.toml

Co-authored-by: Roman Borschel <romanb@users.noreply.github.com>
2020-06-15 16:23:07 +02:00
569113e368 Update README.md (#1607)
Add marcopoloprotocol to the list
2020-06-15 16:06:29 +02:00
926274e88c Add PartialOrd and Ord for PeerId (#1594)
for using PeerId in order based collections. Ord uses borrow to be
consistent with equality.
2020-06-15 16:04:43 +02:00
e8bf34fcf1 [libp2p-ping] Properly close the substream in the InboundUpgrade. (#1606)
Not doing so may result in FIN/RST frames being sent before
earlier data frames. See https://github.com/paritytech/yamux/pull/81#issuecomment-643169973.
2020-06-12 17:41:04 +02:00
d7c1989340 better iterlog (#20) 2020-06-10 18:11:36 +03:00
9aaf042410 Remove uses of pin_project::project attribute (#1604)
pin-project will deprecate the project attribute due to some unfixable
limitations.

Refs: https://github.com/taiki-e/pin-project/issues/225
2020-06-09 18:01:57 +02:00
c36397b7de Report bucket size to prometheus (#19) 2020-06-09 15:17:16 +03:00
b7ec948326 Add prometheus metrics (#18) 2020-06-05 21:15:18 +03:00
3e2ed64faa Weighted routing (#17) 2020-06-05 20:04:53 +03:00
cacd7300de Fix MultiHandler panicking when empty (#1598) 2020-06-05 11:48:53 +02:00
c76327e6b5 Pin async-std in a different way (#1600) 2020-06-05 11:14:02 +02:00
7c63bbf975 Update README.md (#1597)
Add rust-ipfs to the list of notable users

Not sure if it is notable enough, but it is open source and looking for contributors, so it would be cool to have it listed here.

Co-authored-by: Pierre Krieger <pierre.krieger1708@gmail.com>
2020-06-05 10:56:26 +02:00
a4eb67a40d Fix some libp2p-kad types not being reexported (#1595)
* Fix QueryRef/QueryMut not being reexported

* More reexports
2020-06-02 10:33:32 +02:00
ce1b3aab04 Fix tcp-tokio feature (#1582)
Signed-off-by: koushiro <koushiro.cqx@gmail.com>

Co-authored-by: Roman Borschel <romanb@users.noreply.github.com>
2020-05-26 13:47:41 +02:00
fbccf4c72a Readd lost noise upgrades. (#1580) 2020-05-25 18:39:56 +02:00
baac0366f2 Also bump core-derive (#1593) 2020-05-25 16:17:37 +02:00
a921b7cb73 Publish v0.19.1 (#1592) 2020-05-25 16:02:30 +02:00
93ff335c96 Fully qualified std::result::Result in macros (#1587)
Co-authored-by: Roman Borschel <romanb@users.noreply.github.com>
2020-05-25 15:27:49 +02:00
25dc7c08e3 Temporarily bound all async-std dependencies. (#1589)
Co-authored-by: Pierre Krieger <pierre.krieger1708@gmail.com>
2020-05-25 14:49:16 +02:00
e0cf026bbb Try revert to nightly-2020-05-20 (#1590) 2020-05-25 13:28:21 +02:00
0bd3d9b6b6 Use master branch on fluencelabs/fluence #16 2020-05-20 13:06:15 +03:00
c6a6f0a6ad Merge pull request #15 from fluencelabs/libp2p_0.19.0
Libp2p 0.19.0
2020-05-20 12:42:06 +03:00
0fea4a1986 fix wasm build: imports 2020-05-19 23:17:33 +03:00
b4681cca12 fix wasm build 2020-05-19 23:10:33 +03:00
982e23ad39 fn main() {} 2020-05-19 21:49:51 +03:00
f6a4f61fbb disable ipfs-kad & distributed-key-value-store examples 2020-05-19 21:48:26 +03:00