422 Commits

Author SHA1 Message Date
Volker Mische
3f38c1c8bb
feat: upgrade multihash (#1792)
* feat: upgrade to multihash 0.13

`multihash` changes a lot internally, it is using stack allocation instead
of heap allocation. This leads to a few limitations in regards on how
`Multihash` can be used.

Therefore `PeerId` is now using a `Bytes` internally so that only minimal
changes are needed.

* Update versions and changelogs.

Co-authored-by: Roman Borschel <romanb@users.noreply.github.com>
Co-authored-by: Roman S. Borschel <roman@parity.io>
2020-11-17 11:15:20 +01:00
Roman S. Borschel
9c74b40870 Prepare 0.30.1 2020-11-11 14:11:17 +01:00
Roman Borschel
f771bcc35f
[plaintext] Retain remaining read buffer after handshake. (#1831)
* Retain remaining read buffer.

When the plaintext protocol handshake finishes and
the `Framed` I/O is discarded in favour of the underlying
I/O stream, the remaining read buffer of `Framed` must
be retained, as it may have buffered data beyond the
end of the handshake.

* Update versions and changelogs.
2020-11-11 14:09:33 +01:00
Max Inden
5f8a003bcd
*: Update changelogs to release v0.30.0 (#1829)
* *: Update changelogs to release v0.30.0

* muxers/mplex/CHANGELOG: Reference pull request

* misc/multistream-select/CHANGELOG: Update date
2020-11-09 17:46:07 +01:00
Max Inden
c48cacfcf5
*/Cargo.toml: Update multihash (#1828) 2020-11-09 14:31:51 +01:00
Roman Borschel
2ba78b4ce7
[mplex, yamux] Streamline configuration API. (#1822)
* Streamline mplex and yamux configurations.

  * For all configuration options that exist for both multiplexers
    and have the same semantics, use the same names for the
    configuration.
  * Rename `Config` to `YamuxConfig` for consistentcy with
    the majority of other protocols, e.g. `MplexConfig`, `PingConfig`,
    `KademliaConfig`, etc.
  * Completely hide `yamux` APIs within `libp2p-yamux`. This allows
    to fully control the libp2p API and streamline it with other
    muxer APIs, consciously choosing e.g. which configuration options
    to make configurable in libp2p and which to fix to certain values.
    It does also not necessarily prescribe new incompatible version bumps of
    yamux for `libp2p-yamux`, as no `yamux` types are exposed. The cost
    is some more duplication of configuration options in the API, as well
    as the need to update `libp2p-yamux` if `yamux` introduces new
    configuration options that `libp2p-yamux` wants to expose as well.

* Update CHANGELOGs.
2020-11-06 09:46:22 +01:00
Roman Borschel
689eeaf533
[kad] Update local routing table on new connections after protocol confirmation. (#1821)
* Delay routing table update on new connections.

In order to avoid adding peers to the local routing table
which use a different protocol name and thus a different
overlay network, only update the local routing table
for newly established connections once the associated
connection handler reports that the protocol has been
confirmed.

* Update CHANGELOG.
2020-11-05 20:58:14 +01:00
dependabot[bot]
c812b8d56c
Update tokio requirement from 0.2 to 0.3 (#1796)
* Update tokio requirement from 0.2 to 0.3

Updates the requirements on [tokio](https://github.com/tokio-rs/tokio) to permit the latest version.
- [Release notes](https://github.com/tokio-rs/tokio/releases)
- [Commits](https://github.com/tokio-rs/tokio/compare/tokio-0.2.0...tokio-0.3.0)

Signed-off-by: dependabot[bot] <support@github.com>

* protocols/mdns: Ensure to set non_blocking on tokio udp socket

* transports/tcp: Ensure to set non_blocking on tokio tcp socket

See https://github.com/tokio-rs/tokio/pull/3016 for details.

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Max Inden <mail@max-inden.de>
2020-11-03 14:09:10 +01:00
dependabot[bot]
8f53ec61fd
Update minicbor requirement from 0.6 to 0.7 (#1819)
Updates the requirements on [minicbor](https://gitlab.com/twittner/minicbor) to permit the latest version.
- [Release notes](https://gitlab.com/twittner/minicbor/tags)
- [Commits](https://gitlab.com/twittner/minicbor/compare/minicbor-v0.6.0...minicbor-v0.7.0)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-11-02 09:27:11 +01:00
Thomas Eizinger
335e55e60d
Remove ConnectionInfo trait (#1813)
In all cases, we pass the PeerId directly as the connection info.
The flexbility of doing something different here was originally
envisioned but turned out to be never needed.

For reference see: https://github.com/libp2p/rust-libp2p/issues/1798#issuecomment-714526056

Co-authored-by: Max Inden <mail@max-inden.de>
2020-10-30 15:51:27 +01:00
dependabot[bot]
a3d6c8149e
Update env_logger requirement from 0.7.1 to 0.8.1 (#1806)
Updates the requirements on [env_logger](https://github.com/env-logger-rs/env_logger) to permit the latest version.
- [Release notes](https://github.com/env-logger-rs/env_logger/releases)
- [Changelog](https://github.com/env-logger-rs/env_logger/blob/master/CHANGELOG.md)
- [Commits](https://github.com/env-logger-rs/env_logger/commits/v0.8.1)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-10-20 10:00:18 +02:00
Roman Borschel
a5f210adf3
Prepare release. (#1797) 2020-10-16 20:36:47 +02:00
Roman Borschel
dc56d44edb
Refine boxing during transport construction. (#1794)
* Rework boxing during transport construction.

* Cleanup

* Fix chat-tokio example.

* Update changelogs and versions.
2020-10-16 16:53:02 +02:00
dependabot[bot]
b48b93f4f7
Update pin-project requirement from 0.4.17 to 1.0.0 (#1793)
Updates the requirements on [pin-project](https://github.com/taiki-e/pin-project) to permit the latest version.
- [Release notes](https://github.com/taiki-e/pin-project/releases)
- [Changelog](https://github.com/taiki-e/pin-project/blob/master/CHANGELOG.md)
- [Commits](https://github.com/taiki-e/pin-project/compare/v0.4.17...v1.0.0)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-10-14 11:17:15 +02:00
Qinxuan Chen
b74285a8fb
protocols/tcp: Replace get_if_addrs with if-addrs (#1788)
Signed-off-by: koushiro <koushiro.cqx@gmail.com>
2020-10-09 14:18:39 +02:00
Roman Borschel
3e31ea9337
[multistream-select] Fix panic with V1Lazy (regression) and more convenient transport boxing. (#1783)
* [multistream-select] Fix panic with V1Lazy and add integration tests.

Fixes a panic when using the `V1Lazy` negotiation protocol,
a regression introduced in https://github.com/libp2p/rust-libp2p/pull/1484.

Thereby adds integration tests for a transport upgrade with both
`V1` and `V1Lazy` to the `multistream-select` crate to prevent
future regressions.

* Cleanup.

* Update changelog.
2020-10-07 11:10:54 +02:00
dependabot[bot]
2a5c1832a1
Update base64 requirement from 0.12.3 to 0.13.0 (#1782)
Updates the requirements on [base64](https://github.com/marshallpierce/rust-base64) to permit the latest version.
- [Release notes](https://github.com/marshallpierce/rust-base64/releases)
- [Changelog](https://github.com/marshallpierce/rust-base64/blob/master/RELEASE-NOTES.md)
- [Commits](https://github.com/marshallpierce/rust-base64/compare/v0.12.3...v0.13.0)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-10-05 10:12:40 +02:00
Roman S. Borschel
049d808566 Update mdns version and changelog. 2020-10-05 10:11:50 +02:00
Robert Klotzner
fe30849eec
Fix #1778: Double mdns recv_buffer to 4096 bytes (#1779)
Also add warn if parsing of a packet fails, so problems with for example packet
sizes can more easily be detected.

Reasoning:

The previous 2048 bytes is already larger than the recommend size by
[rfc6762](https://tools.ietf.org/html/rfc6762#page-46), which recommends
a packet size that fits within the interface MTU.

Nevertheless the rfc also states, that if more data needs to be
transmitted one should rely on IP fragments, which would only pose
problems when interfacing with devices not understanding IP fragments.
The standard also imposes a strict upper limit of 9000 bytes.

Therefore raising `recv_buffer` to 4096 seems sensible, given that we
already exceed the recommend size and given that we are not restricting
the size when sending in any way. Meaning the implementation already
sends packets larger than recommended, just can't handle them on
reception.
2020-10-05 10:03:21 +02:00
Qinxuan Chen
c19344dee7
Update dependencies not detected by dependabot (#1776)
- parking_lot to 0.11.0
- salsa20 to 0.6.0
- sha3  to 0.9

Signed-off-by: koushiro <koushiro.cqx@gmail.com>
2020-09-30 18:26:35 +02:00
dependabot[bot]
aaa6e4add3
Update cuckoofilter requirement from 0.3.2 to 0.5.0 (#1763)
* Update cuckoofilter requirement from 0.3.2 to 0.5.0

Updates the requirements on [cuckoofilter](https://github.com/axiomhq/rust-cuckoofilter) to permit the latest version.
- [Release notes](https://github.com/axiomhq/rust-cuckoofilter/releases)
- [Changelog](https://github.com/axiomhq/rust-cuckoofilter/blob/master/CHANGELOG.md)
- [Commits](https://github.com/axiomhq/rust-cuckoofilter/commits)

Signed-off-by: dependabot[bot] <support@github.com>

* protocols/floodsub: Warn when Cuckoofilter has to evict item

With Cuckoofilter `v0.4.0` `add` and `test_and_add` return an error when
an old element has to be evicted in favor of a new one to take its
place. The previous behavior was panicing.

With this commit the error is logged on `warn` level.

* *: Update changelogs and cargo tomls

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Max Inden <mail@max-inden.de>
2020-09-29 11:46:57 +02:00
Roman Borschel
f66f40bcd7
[ping] Add missing flush after write. (#1770)
After sending the ping and before awaiting the pong,
the stream must be flushed to guarantee the data is
sent before awaiting the reply.
2020-09-28 10:57:02 +02:00
dependabot[bot]
c14f0c5b18
Update minicbor requirement from 0.5 to 0.6 (#1772)
* Update minicbor requirement from 0.5 to 0.6

Updates the requirements on [minicbor](https://gitlab.com/twittner/minicbor) to permit the latest version.
- [Release notes](https://gitlab.com/twittner/minicbor/tags)
- [Commits](https://gitlab.com/twittner/minicbor/compare/minicbor-v0.5.0...minicbor-v0.6.0)

Signed-off-by: dependabot[bot] <support@github.com>

* *: Update changelogs and cargo tomls

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Max Inden <mail@max-inden.de>
2020-09-23 21:28:15 +02:00
Max Inden
87f3cb8024
protocols/plaintext: Do not UVI encode goodput (#1765)
* protocols/plaintext: Do not UVI encode goodput

Only prefix handshake messages with the message length in bytes as an
unsigned varint. Return a plain socket once handshaking succeeded.

* *: Bump minor version in changelogs and cargo tomls
2020-09-17 15:29:47 +02:00
dependabot[bot]
5099ab592f
Update unsigned-varint requirement from 0.4 to 0.5 (#1761)
* Update unsigned-varint requirement from 0.4 to 0.5

Updates the requirements on [unsigned-varint](https://github.com/paritytech/unsigned-varint) to permit the latest version.
- [Release notes](https://github.com/paritytech/unsigned-varint/releases)
- [Changelog](https://github.com/paritytech/unsigned-varint/blob/master/CHANGELOG.md)
- [Commits](https://github.com/paritytech/unsigned-varint/commits/v0.5.1)

Signed-off-by: dependabot[bot] <support@github.com>

* *: Update changelogs and Cargo tomls

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Max Inden <mail@max-inden.de>
2020-09-16 10:27:33 +02:00
Max Inden
e300ba323a
protocols/plaintext: Remove wrong debug log (#1759)
Don't log errors happening after plaintext handshake as errors happening
during plaintext handshake.
2020-09-16 09:08:45 +02:00
dependabot[bot]
7aac4e971c
Update x25519-dalek requirement from 0.6.0 to 1.1.0 (#1745)
* Update x25519-dalek requirement from 0.6.0 to 1.1.0

Updates the requirements on [x25519-dalek](https://github.com/dalek-cryptography/x25519-dalek) to permit the latest version.
- [Release notes](https://github.com/dalek-cryptography/x25519-dalek/releases)
- [Changelog](https://github.com/dalek-cryptography/x25519-dalek/blob/master/CHANGELOG.md)
- [Commits](https://github.com/dalek-cryptography/x25519-dalek/compare/0.6.0...1.1.0)

Signed-off-by: dependabot[bot] <support@github.com>

* *: Add CHANGELOG and Cargo.toml entries

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Max Inden <mail@max-inden.de>
Co-authored-by: Roman Borschel <romanb@users.noreply.github.com>
2020-09-15 11:17:58 +02:00
dependabot[bot]
84f9b70763
Update curve25519-dalek requirement from 2.0.0 to 3.0.0 (#1753)
* Update curve25519-dalek requirement from 2.0.0 to 3.0.0

Updates the requirements on [curve25519-dalek](https://github.com/dalek-cryptography/curve25519-dalek) to permit the latest version.
- [Release notes](https://github.com/dalek-cryptography/curve25519-dalek/releases)
- [Changelog](https://github.com/dalek-cryptography/curve25519-dalek/blob/master/CHANGELOG.md)
- [Commits](https://github.com/dalek-cryptography/curve25519-dalek/compare/2.0.0...3.0.0)

Signed-off-by: dependabot[bot] <support@github.com>

* *: Add CHANGELOG and Cargo.toml entries

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Max Inden <mail@max-inden.de>
Co-authored-by: Roman Borschel <romanb@users.noreply.github.com>
2020-09-15 10:53:14 +02:00
dependabot[bot]
36d33f1eaa
Update sha2 requirement from 0.8.0 to 0.9.1 (#1747)
* Update sha2 requirement from 0.8.0 to 0.9.1

Updates the requirements on [sha2](https://github.com/RustCrypto/hashes) to permit the latest version.
- [Release notes](https://github.com/RustCrypto/hashes/releases)
- [Commits](https://github.com/RustCrypto/hashes/compare/whirlpool-v0.8.1...sha2-v0.9.1)

Signed-off-by: dependabot[bot] <support@github.com>

* Fix update errors.

* Update CHANGELOGs and versions.

* Update Cargo.toml

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Toralf Wittner <tw@dtex.org>
2020-09-14 13:31:20 +02:00
dependabot[bot]
9647557f0d
Update base64 requirement from 0.11.0 to 0.12.3 (#1749)
* Update base64 requirement from 0.11.0 to 0.12.3

Updates the requirements on [base64](https://github.com/marshallpierce/rust-base64) to permit the latest version.
- [Release notes](https://github.com/marshallpierce/rust-base64/releases)
- [Changelog](https://github.com/marshallpierce/rust-base64/blob/master/RELEASE-NOTES.md)
- [Commits](https://github.com/marshallpierce/rust-base64/compare/v0.11.0...v0.12.3)

Signed-off-by: dependabot[bot] <support@github.com>

* protocols/gossipsub/CHANGELOG: Make dependency entry generic

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Max Inden <mail@max-inden.de>
2020-09-11 15:19:05 +02:00
dependabot[bot]
51dc834b23
Update lru_time_cache requirement from 0.10.0 to 0.11.0 (#1746)
* Update lru_time_cache requirement from 0.10.0 to 0.11.0

Updates the requirements on [lru_time_cache](https://github.com/maidsafe/lru_time_cache) to permit the latest version.
- [Release notes](https://github.com/maidsafe/lru_time_cache/releases)
- [Changelog](https://github.com/maidsafe/lru_time_cache/blob/master/CHANGELOG.md)
- [Commits](https://github.com/maidsafe/lru_time_cache/commits)

Signed-off-by: dependabot[bot] <support@github.com>

* *: Update changelogs and cargo manifests

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Max Inden <mail@max-inden.de>
2020-09-11 12:16:36 +02:00
Roman Borschel
a262609db4
Prepare release(s). (#1738) 2020-09-09 12:20:25 +02:00
Toralf Wittner
f86bc01e20
Add back the LRU cache to Throttled. (#1731)
* Restore `RequestResponse::throttled`.

In contrast to the existing "throttled" approach this PR adds back-
pressure to the protocol without requiring pre-existing knowledge
of all nodes about their limits. It adds small, CBOR-encoded headers
to the actual payload data. Extra credit messages communicate back
to the sender how many more requests it is allowed to send.

* Remove some noise.

* Resend credit grant after connection closed.

Should an error in some lower layer cause a connection to be closed,
our previously sent credit grant may not have reached the remote peer.
Therefore, pessimistically, a credit grant is resent whenever a
connection is closed. The remote ignores duplicate grants.

* Remove inbound/outbound tracking per peer.

* Send ACK as response to duplicate credit grants.

* Simplify.

* Fix grammar.

* Incorporate review feedback.

- Remove `ResponseSent` which was a leftover from previous attemps
  and issue a credit grant immediately in `send_response`.
- Only resend credit grants after a connection is closed if we are
  still connected to this peer.

* Move codec/header.rs to throttled/codec.rs.

* More review suggestions.

* Generalise `ProtocolWrapper` and use shorter prefix.

* Update protocols/request-response/src/lib.rs

Co-authored-by: Roman Borschel <romanb@users.noreply.github.com>

* Update protocols/request-response/src/throttled.rs

Co-authored-by: Roman Borschel <romanb@users.noreply.github.com>

* Update protocols/request-response/src/throttled.rs

Co-authored-by: Roman Borschel <romanb@users.noreply.github.com>

* Minor comment changes.

* Limit max. header size to 8KiB

* Always construct initial limit with 1.

Since honest senders always assume a send budget of 1 and wait for
credit afterwards, setting the default limit to a higher value
can only become effective after informing the peer about it which
means leaving `max_recv` at 1 and setting `next_max` to the desired
value.

* Use LRU cache to keep previous peer infos.

Peers may send all their requests, reconnect and send again all their
requests, starting from a fresh budget. The LRU cache keeps the peer
information around and reuses it when the peer reconnects, continuing
with the previous remaining limit.

Co-authored-by: Roman Borschel <romanb@users.noreply.github.com>
2020-09-09 11:04:20 +02:00
Max Inden
5a3e7f7e6e
protocols/gossipsub/tests/smoke: Improve wait_for reporting (#1737) 2020-09-09 09:54:02 +02:00
Roman Borschel
6599ff13e1
[kad] Increase default payload limits. (#1730)
* libp2p-kad: Increase default max packet size.

For better interoperability by default, picking up the
suggestion in https://github.com/libp2p/rust-libp2p/issues/1622.

* Update changelog.
2020-09-08 11:21:01 +02:00
Roman S. Borschel
08a7b1dcd2 Update request-response changelog. 2020-09-07 17:25:15 +02:00
Toralf Wittner
d988b05f85
Restore RequestResponse::throttled. (#1726)
* Restore `RequestResponse::throttled`.

In contrast to the existing "throttled" approach this PR adds back-
pressure to the protocol without requiring pre-existing knowledge
of all nodes about their limits. It adds small, CBOR-encoded headers
to the actual payload data. Extra credit messages communicate back
to the sender how many more requests it is allowed to send.

* Remove some noise.

* Resend credit grant after connection closed.

Should an error in some lower layer cause a connection to be closed,
our previously sent credit grant may not have reached the remote peer.
Therefore, pessimistically, a credit grant is resent whenever a
connection is closed. The remote ignores duplicate grants.

* Remove inbound/outbound tracking per peer.

* Send ACK as response to duplicate credit grants.

* Simplify.

* Fix grammar.

* Incorporate review feedback.

- Remove `ResponseSent` which was a leftover from previous attemps
  and issue a credit grant immediately in `send_response`.
- Only resend credit grants after a connection is closed if we are
  still connected to this peer.

* Move codec/header.rs to throttled/codec.rs.

* More review suggestions.

* Generalise `ProtocolWrapper` and use shorter prefix.

* Update protocols/request-response/src/lib.rs

Co-authored-by: Roman Borschel <romanb@users.noreply.github.com>

* Update protocols/request-response/src/throttled.rs

Co-authored-by: Roman Borschel <romanb@users.noreply.github.com>

* Update protocols/request-response/src/throttled.rs

Co-authored-by: Roman Borschel <romanb@users.noreply.github.com>

* Minor comment changes.

* Limit max. header size to 8KiB

* Always construct initial limit with 1.

Since honest senders always assume a send budget of 1 and wait for
credit afterwards, setting the default limit to a higher value
can only become effective after informing the peer about it which
means leaving `max_recv` at 1 and setting `next_max` to the desired
value.

Co-authored-by: Roman Borschel <romanb@users.noreply.github.com>
2020-09-07 17:22:40 +02:00
Roman Borschel
ed5aec14f3
Deprecate secio. (#1729)
SECIO is removed from all libp2p implementations.
See https://blog.ipfs.io/2020-08-07-deprecating-secio/.
2020-09-07 12:13:10 +02:00
Roman S. Borschel
c94262d03a Set development versions appropriately and update changelogs. 2020-09-03 12:31:45 +02:00
Roman Borschel
6a1279407e
[noise] Remove (by default) support for receiving legacy handshakes. (#1685)
* Remove (by default) support for receiving legacy noise handshakes.

* Update noise version.
2020-09-01 11:20:57 +02:00
Roman S. Borschel
1c7f6b1c11 Update libp2p-kad changelog. 2020-08-31 17:19:02 +02:00
Max Inden
0136af5025
protocols/kad: Implement ilog2 for Distance (#1719)
In order to make use of the distances returned by `KBucketRef::range` in
a human readable format, one needs to be able to translate the 256 bit in
a `Distance` to a smaller space.
2020-08-28 09:00:07 +02:00
Toralf Wittner
0b05b21093
Add ProtocolsHandler::InboundOpenInfo. (#1714)
* Add `ProtocolsHandler::InboundOpenInfo`.

* Update swarm/src/protocols_handler/multi.rs

Co-authored-by: Roman Borschel <romanb@users.noreply.github.com>

* Update CHANGELOGs and versions.

Co-authored-by: Roman Borschel <romanb@users.noreply.github.com>
2020-08-23 16:57:20 +02:00
Max Inden
740a2e0235
protocols/kad/src/kbuckets: Explicitly convert u8 to usize (#1716)
Compiling libp2p-kad for `--target wasm32-unknown-unknown` fails with
the cryptic error message `cannot infer type for type `usize``.
Explicitly converting to `usize` solves the issue.

Co-authored-by: Andronik Ordian <write@reusable.software>
2020-08-19 17:44:41 +02:00
Max Inden
3d07a05f8b
*: Prepare v0.24.0 release (#1713)
* */CHANGELOG: Update dates

* Cargo.toml: Update to 0.24.0
2020-08-18 17:04:34 +02:00
Max Inden
cbdbf656c0
protocols/mdns: Make libp2p-mdns socket agnostic (#1699)
Allow libp2p-mdns to use either async-std or tokio to drive required UDP
socket.

Co-authored-by: Roman Borschel <romanb@users.noreply.github.com>
2020-08-18 14:51:03 +02:00
Toralf Wittner
b4ad2d6297
Disable RequestResponse::throttled. (#1711)
Can be enabled again after #1706 is resolved.

Co-authored-by: Roman Borschel <romanb@users.noreply.github.com>
2020-08-18 14:29:38 +02:00
Roman Borschel
e1df920703
[kad] Store addresses of provider records. (#1708)
* Store addresses of provider records.

So far, provider records are stored without their
addresses and the addresses of provider records are
obtained from the routing table on demand. This has
two shortcomings:

  1. We can only return provider records whose provider
  peers happen to currently be in the local routing table.

  2. The local node never returns itself as a provider for
  a key, even if it is indeed a provider.

These issues are addressed here by storing the addresses
together with the provider records, falling back to
addresses from the routing table only for backward-compatibility
with existing implementations of `RecordStore` using persistent
storage.

Resolves https://github.com/libp2p/rust-libp2p/issues/1526.

* Update protocols/kad/src/behaviour.rs

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

* Remove negligible use of with_capacity.

* Update changelog.

Co-authored-by: Max Inden <mail@max-inden.de>
2020-08-18 14:14:31 +02:00
Arnaud Lefebvre
d1024d272c
protocols/kad: fix doc for the event emitted by start_providing (#1705) 2020-08-14 16:10:39 +02:00
Roman Borschel
96484fcd5e
Fix connection keep-alive for request-response. (#1700) 2020-08-13 13:13:23 +02:00