333 Commits

Author SHA1 Message Date
folex
cc690f1fea
Return iterator from local_closest_peers (#50) 2021-06-09 18:21:30 +03:00
Aleksey Proshutisnkiy
43544e635a
Identity rework (#49) 2021-04-15 21:07:50 +03:00
folex
47f5452f66 Update TrustGraph 2021-03-09 17:47:13 +03:00
folex
4d6478a38e Merge branch 'upstream_master' into merge_0.36
# Conflicts:
#	Cargo.toml
#	core/Cargo.toml
#	examples/distributed-key-value-store.rs
#	misc/multiaddr/Cargo.toml
#	misc/multiaddr/src/onion_addr.rs
#	misc/multistream-select/Cargo.toml
#	muxers/mplex/Cargo.toml
#	muxers/yamux/Cargo.toml
#	protocols/floodsub/Cargo.toml
#	protocols/gossipsub/Cargo.toml
#	protocols/identify/Cargo.toml
#	protocols/kad/Cargo.toml
#	protocols/kad/src/addresses.rs
#	protocols/kad/src/behaviour.rs
#	protocols/kad/src/behaviour/test.rs
#	protocols/kad/src/kbucket/bucket.rs
#	protocols/kad/src/kbucket/key.rs
#	protocols/mdns/Cargo.toml
#	protocols/ping/Cargo.toml
#	protocols/request-response/Cargo.toml
#	protocols/secio/Cargo.toml
#	swarm-derive/Cargo.toml
#	swarm/Cargo.toml
#	transports/deflate/Cargo.toml
#	transports/dns/Cargo.toml
#	transports/noise/Cargo.toml
#	transports/plaintext/Cargo.toml
#	transports/tcp/Cargo.toml
#	transports/uds/Cargo.toml
#	transports/wasm-ext/Cargo.toml
#	transports/websocket/Cargo.toml
2021-03-05 15:20:08 +03:00
Roman Borschel
7dd42fcaaf
[swarm] Remove substream-specific protocol negotiation version. (#1962)
* Remove substream-specific protocol negotiation version.

Remove the option for a substream-specific multistream select protocol override.
The override at this granularity is no longer deemed useful, in particular because
it can usually not be configured for existing protocols like `libp2p-kad` and others.
There is a `Swarm`-scoped configuration for this version available since
[1858](https://github.com/libp2p/rust-libp2p/pull/1858).

* Update protocol crate versions and changelogs.

* Clean up documentation.
2021-02-25 11:35:52 +01:00
Roman Borschel
cda7c3504e
Prepare v0.35 (#1957) 2021-02-15 20:06:50 +01:00
DieMyst
9d8f6ae964 fix test, add contact if there is no contact in queries 2021-02-15 18:36:03 +03:00
folex
159cb6b2ca
Add function to get neighborhood locally (#40) 2021-02-15 15:52:47 +03:00
Roman Borschel
6499e924a3
Make clippy "happy". (#1950)
* Make clippy "happy".

Address all clippy complaints that are not purely stylistic (or even
have corner cases with false positives). Ignore all "style" and "pedantic" lints.

* Fix tests.

* Undo unnecessary API change.
2021-02-15 11:59:51 +01:00
dependabot[bot]
639e5c678e
Update unsigned-varint and asynchronous-codec (#1946)
* Update unsigned-varint requirement from 0.6 to 0.7

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/compare/v0.6.0...v0.7.0)

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

* *: Update to asynchronous-codec v0.6

* transports/plaintext: Use Framed::into_parts

* *: Update cargo tomls and changelogs

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Max Inden <mail@max-inden.de>
2021-02-13 20:15:14 +01:00
Roman Borschel
d94d53abbb
Move some crates. (#1941)
Move transport upgrade protocols from `protocols/`
to `transports/`, such that only "application protocols"
that depend on `libp2p-swarm` remain in `protocols/`,
whereas there is no such dependency in `transports/`
outside of integration tests.

Tweak README and top-level CHANGELOG.
2021-02-01 16:37:19 +01:00
Max Inden
db02cfae37
*: Prepare v0.34.0 release (#1918)
Co-authored-by: Roman Borschel <romanb@users.noreply.github.com>
2021-01-12 20:33:43 +01:00
Max Inden
477f7ae6c4
*: Update to prost-build v0.7 (#1917) 2021-01-12 14:41:07 +01:00
dependabot[bot]
7367927bd8
Update uint requirement from 0.8 to 0.9 (#1915)
Updates the requirements on [uint](https://github.com/paritytech/parity-common) to permit the latest version.
- [Release notes](https://github.com/paritytech/parity-common/releases)
- [Commits](https://github.com/paritytech/parity-common/compare/uint-v0.8.3...uint-v0.9.0)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-01-12 13:53:51 +01:00
Max Inden
c98b9ef407
*: Switch futures_codec to asynchronous-codec (#1908)
`futures-codec` has not been updated in the recent months. It still
depends on `bytes` `v0.5` preventing all downstream dependencies to
upgrade to `bytes` `v1.0`.

This commit replaces `futures_codec` in favor of `asynchronous-codec`
The latter is a fully upgraded fork of the former.

In addition this commit upgrades:

- bytes to v1
- unsigned-varint to v0.6.0
- prost to v0.7
2021-01-12 12:48:37 +01:00
Max Inden
5be6a8bb72
protocols/kad: Prepare v0.27.1 patch release 2021-01-11 12:26:04 +01:00
Ivan Zderadicka
6538745b64
protocols/kad: Add From impl for kbucket::Key (#1909)
- From<record::Key>
- From<Vec<u8>

This will enable to use additional types in kad.get_closest_peers as it was
possible in pre 0.33 version.

Co-authored-by: Max Inden <mail@max-inden.de>
2021-01-11 12:23:36 +01:00
folex
3ab739eccf remove unused use 2021-01-07 20:03:33 +03:00
folex
f837ceb91e fix trust-graph 2021-01-07 19:41:41 +03:00
folex
e3d6fb4823 Fix everything except trust-graph 2021-01-07 18:31:41 +03:00
folex
263407b6f0 fix package names to fluence-fork 2021-01-07 16:52:53 +03:00
folex
f230d74a55 Merge branch 'upstream_master' into merge_0.33
# Conflicts:
#	Cargo.toml
#	core/Cargo.toml
#	examples/distributed-key-value-store.rs
#	muxers/mplex/Cargo.toml
#	muxers/yamux/Cargo.toml
#	protocols/deflate/Cargo.toml
#	protocols/floodsub/Cargo.toml
#	protocols/gossipsub/Cargo.toml
#	protocols/identify/Cargo.toml
#	protocols/kad/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/kbucket/key.rs
#	protocols/kad/src/query/peers/closest.rs
#	protocols/kad/src/record.rs
#	protocols/mdns/Cargo.toml
#	protocols/noise/Cargo.toml
#	protocols/ping/Cargo.toml
#	protocols/plaintext/Cargo.toml
#	protocols/request-response/Cargo.toml
#	protocols/secio/Cargo.toml
#	swarm/Cargo.toml
#	transports/dns/Cargo.toml
#	transports/tcp/Cargo.toml
#	transports/uds/Cargo.toml
#	transports/wasm-ext/Cargo.toml
#	transports/websocket/Cargo.toml
2021-01-07 16:47:59 +03:00
folex
02f83ec9d4
Rename crates to 'fluence-fork-$name' (#30) 2021-01-07 16:15:02 +03:00
folex
64aff5506e use trust-graph from crates.io 2020-12-31 13:11:55 +03:00
folex
5d4d0fec51 cargo workspaces: package.metadata.workspaces.independent = true 2020-12-31 11:06:27 +03:00
Max Inden
dd9f56e7f9
*CHANGELOG.md: Prepare v0.33.0 release (#1895) 2020-12-18 10:03:20 +01:00
Max Inden
22817b5d2b
swarm: Remove NotifyHandler::All (#1880)
Remove `NotifyHandler::All` thus removing the requirement for events
send from a `NetworkBehaviour` to a `ProtocolsHandler` to be `Clone`. An
implementor of `NetworkBehaviour` can still notify all
`ProtocolHandler`s for a given peer by emitting one `NotifyHandler`
event per connection to that peer.
2020-12-17 11:01:45 +01:00
David Craven
23b0aa016f
Stack allocated PeerId (#1874)
* Stack allocate PeerId.

* Update stuff.

* Upgrade rusttls to fix build.

* Remove unnecessary manual implementations.

* Remove PeerId::into_bytes.

* Remove bytes dependency.

* Perform some cleanup.

* Use Into<kbucket::Key<K>>.

* Update versions and changelogs.

* Fix PR link.

* Fix benchmarks.

Co-authored-by: Roman S. Borschel <roman@parity.io>
2020-12-15 14:40:39 +01:00
Roman Borschel
bc102bc923
Prepare release of libp2p-v0.31 and all unreleased sub-crates. (#1857)
* Prepare v0.31

* Update core-derive

* Update minimum multiaddr patch version in libp2p crate.
2020-11-25 15:30:13 +01:00
Roman Borschel
65c4bf88dc
[multistream] Make the lazy variant more interoperable. (#1855)
* Make the lazy variant interoperable.

The remaining optimisation for `V1Lazy` for a listener
in the negotiation, whereby the listener delays flushing
of the multistream version header, is hereby removed.
The remaining effect of `V1Lazy` is only on the side of
the dialer, which delays flushing of its singular
protocol proposal in order to send it together with
the first application data (or an attempt is made to
read from the negotiated stream, which similarly
triggers a flush of the protocol proposal). This
permits `V1Lazy` dialers to be interoperable with
`V1` listeners. The remaining theoretical pitfall whereby
application data gets misinterpreted as another protocol
proposal by a listener remains, however unlikely.

`V1` remains the default, but we may eventually risk
just making this lazy dialer flush a part of the default
`V1` implementation, removing the dedicated `V1Lazy`
version identifier.

* Update CHANGELOG

* Separate versions from mere header lines.

Every multistream-select version maps to a specific header line,
but there may be different variants of the same multistream-select
version using the same header line, i.e. the same wire protocol.

* Cleanup

* Update misc/multistream-select/CHANGELOG.md
2020-11-25 10:21:02 +01:00
Max Inden
e3af8b7d03
*: Apply clippy suggestions and enable clippy on CI (#1850)
* *: Apply clippy suggestions

* .github: Add clippy check

* protocols/kad/record: Implement custom PartialEq for ProviderRecord
2020-11-24 15:59:22 +01:00
Roman Borschel
1bd013c843
[swarm] Configurable and "infinite" scores for external addresses. (#1842)
* Add "infinite" scores for external addresses.

Extend address scores with an infinite cardinal, permitting
addresses to be retained "forever" or until explicitly removed.

Expose (external) address scores on the API.

* Update swarm/src/registry.rs

Co-authored-by: Pierre Krieger <pierre.krieger1708@gmail.com>

* Fix compilation.

* Update CHANGELOG

Co-authored-by: Pierre Krieger <pierre.krieger1708@gmail.com>
2020-11-18 15:52:33 +01:00
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
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
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
folex
8ea09b93ef Hide QueryFinished log to trace 2020-10-23 14:06:42 +03:00
folex
82dd950771 Move bucket printing & iterlog to Level::Trace 2020-10-21 13:43:54 +03: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
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]
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
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
Roman Borschel
a262609db4
Prepare release(s). (#1738) 2020-09-09 12:20:25 +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 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 S. Borschel
1c7f6b1c11 Update libp2p-kad changelog. 2020-08-31 17:19:02 +02:00