89 Commits

Author SHA1 Message Date
Aleksey Proshutisnkiy
43544e635a
Identity rework (#49) 2021-04-15 21:07:50 +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 S. Borschel
6b5fa0324d Prepare multistream-select-0.10.2 2021-03-01 15:56:00 +01:00
Roman Borschel
51dba42490
Re-enable 'parallel negotiation'. (#1934)
Based on an estimate of the number of alternative
protocols the dialer supports.
2021-03-01 15:52:54 +01:00
Roman Borschel
cda7c3504e
Prepare v0.35 (#1957) 2021-02-15 20:06:50 +01:00
folex
159cb6b2ca
Add function to get neighborhood locally (#40) 2021-02-15 15:52:47 +03: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
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
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
5d4d0fec51 cargo workspaces: package.metadata.workspaces.independent = true 2020-12-31 11:06:27 +03:00
Roman S. Borschel
4bdb61be0d Prepare multistream-select-0.9.1 2020-12-02 16:41:59 +01:00
Roman Borschel
86402311fc
[multistream-select] Listener conformity for failed negotiations. (#1871)
* [multistream-select] Listener conformity for failed negotiations.

When `V1Lazy` is used and the listener does not support the
optimistic (and singular) proposal of the dialer, it currently
happens that dialer and listener get a different outcome of
the negotiation. The dialer eventually detects the failed
negotiation as soon as it tries to read from the stream, but
the listener either encounters an invalid message or unexpected
premature EOF, depending on the payload that the dialer sent
prematurely after its protocol proposal. In these cases the
listener must be lenient and fail the negotiation "normally",
i.e. not with a protocol violation or an I/O error.

* Update misc/multistream-select/src/tests.rs

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

* Refine error handling.

Only be lenient with garbage or sudden EOF when reading
just after having sent a protocol rejection.

* Update misc/multistream-select/src/listener_select.rs

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

Co-authored-by: Max Inden <mail@max-inden.de>
2020-12-02 16:40:58 +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
edb99eded6
[multistream-select] Fix ls response encoding/decoding (spec-compliance). (#1811)
* Fix ls response encoding/decoding.

Thereby remove the now unnecessary arbitrary protocol name
length limit. Since it an 'ls' response is always terminated
with a dedicated newline (and thus ends with two newlines),
an 'ls' response with a single protocol can be disambiguated
from a single protocol response by this additional newline.

* More commentary

* Update versions and changelogs.

* Resolve remaining conflict.

* Permit empty ls responses, as before.
2020-11-18 12:03:07 +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
70bb2d7c11
misc/multistream-select: Interpretation of EOF as Failed negotiation (#1823)
Treat EOF error as [`NegotiationError::Failed`], not as
[`NegotiationError::ProtocolError`], allowing dropping or closing an I/O stream
as a permissible way to "gracefully" fail a negotiation.

This is e.g. important when a listener rejects a protocol with
[`Message::NotAvailable`] and the dialer does not have alternative protocols to
propose. Then the dialer will stop the negotiation and drop the corresponding
stream. As a listener this EOF should be interpreted as a failed negotiation.
2020-11-09 16:04:00 +01:00
Roman Borschel
e5adb67d73
[multistream-select] Temporarily disable "parallel" negotiation. (#1807)
* [multistream-select] Temp. disable "parallel" negotiation.

In order to later change the "ls" responses for spec-compliance.

* Update version.

* Update misc/multistream-select/CHANGELOG.md

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

Co-authored-by: Max Inden <mail@max-inden.de>
2020-10-20 15:11:20 +02:00
Roman S. Borschel
e901c082d7 Remove wildcard dev dependency. 2020-10-16 20:51:26 +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
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
Roman Borschel
8cec457b5e
[multistream-select] Require remaining negotiation data to be flushed. (#1781)
* Require remaining negotiation data to be flushed.

There appears to still be an edge-case whereby the
`remaining` data to send w.r.t. protocol negotiation to send
is successfully written before a `poll_read` on a `Negotiated` stream,
but where the subsequent `poll_flush()` is pending.
Now `remaining` is empty and the next `poll_read()`
will go straight to reading from the underlying
I/O stream, despite the flush not having happened
yet, which can lead to a form of deadlock during
protocol negotiation.

Rather than complicating the existing code further in
order to accommodate for this case, it seems preferable
to simplify the code by giving up on this optimisation
that only affects the last negotiation protocol message
sent by the "listener". So we give up on the ability
to combine data sent by the "listener" immediately
after protocol negotiation together with the final
negotiation frame in the same transport-level frame/packet.

* Update changelog.

* Add missing comma.
2020-10-01 12:29:51 +02:00
dependabot[bot]
3c72b07e55
Update atomic requirement from 0.4.6 to 0.5.0 (#1766)
* Update atomic requirement from 0.4.6 to 0.5.0

Updates the requirements on [atomic](https://github.com/Amanieu/atomic-rs) to permit the latest version.
- [Release notes](https://github.com/Amanieu/atomic-rs/releases)
- [Commits](https://github.com/Amanieu/atomic-rs/compare/v0.4.6...v0.5.0)

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

* .github/workflows: Update Rust nightly

* misc/multistream-select: Don't mention private item in public doc

* .github/workflows: Update renamed doc flag

* core/src/connection/pool: Don't mention private item in public doc

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Max Inden <mail@max-inden.de>
2020-09-17 10:41:23 +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
Demi Obenour
9178459cc8
Automatic fixes by cargo-fix (#1662) 2020-07-27 22:27:33 +02:00
Roman Borschel
e9952ea9e3
Prepare releases. (#1640)
* Prepare releases.

* Re-export libp2p-request-response from libp2p crate.

* Clean up changelogs.

* Restore upper bounds.

* Version 0.21 for the root crate.

* Stricter lower bound in libp2p-websocket version in root crate.

* Update misc/peer-id-generator/Cargo.toml

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

* Update release date.

* Update misc/peer-id-generator/Cargo.toml

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

Co-authored-by: Toralf Wittner <tw@dtex.org>
2020-07-01 15:36:20 +02:00
Friedel Ziegelmayer
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
Toralf Wittner
0eef487ef8
Prepare release. (#1620) 2020-06-22 11:41:28 +02:00
Taiki Endo
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
Pierre Krieger
c76327e6b5
Pin async-std in a different way (#1600) 2020-06-05 11:14:02 +02:00
Pierre Krieger
a921b7cb73
Publish v0.19.1 (#1592) 2020-05-25 16:02:30 +02:00
Roman Borschel
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
Pierre Krieger
3ae02a56a5
Bump to 0.17.0 (#1537) 2020-04-01 19:53:34 +02:00
Pierre Krieger
31271fc824
Update multistream-select to stable futures (#1484)
* Update multistream-select to stable futures

* Fix intradoc links
2020-03-11 14:49:41 +01:00
Pierre Krieger
be31f66031
Revert bumping multistream-select and bump multihash (#1455)
* Revert bumping multistream-select

* Also bump multihash
2020-02-14 13:33:28 +01:00
Pierre Krieger
ace8123cf2
Publish 0.16.0 (#1453)
* Publish 0.16.0

* Apply suggestions from code review

Co-Authored-By: Toralf Wittner <tw@dtex.org>

Co-authored-by: Toralf Wittner <tw@dtex.org>
2020-02-14 11:33:52 +01:00
Pierre Krieger
fc4dec581e
Check documentation intra-link (#1432)
* Fix broken links in rustdoc

This fixes all of the rustdoc warnings on nightly.

* Check documentation intra-link

* Fix config

* Fix bad indent

* Make nightly explicit

* More links fixes

* Fix link broken after master merge

Co-authored-by: Demi Obenour <48690212+DemiMarie-parity@users.noreply.github.com>
2020-02-10 15:17:07 +01:00
Pierre Krieger
84487cf904
Publish 0.14.0-alpha.1 (#1376)
* Publish 0.14.0-alpha.1

* multiaddr -> 0.7.0
2020-01-07 15:30:39 +01:00
Toralf Wittner
72f1018acd Update to unsigned-varint v0.3 2020-01-02 10:45:43 +01:00
Toralf Wittner
2bc8d9590d Update to bytes v0.5
Except for `multiaddr` which encapsulates its use of bytes v0.4 now.
2019-12-21 15:42:24 +01:00
Pierre Krieger
21f32da045
Merge remote-tracking branch 'upstream/master' into HEAD 2019-12-12 14:10:01 +01:00
Pierre Krieger
22c2a4f09b
Publish multistream-select 0.6.1 2019-12-11 13:04:17 +01:00
Roman S. Borschel
1e8a90c606 Remove a write optimisation in Negotiated. 2019-12-09 21:13:55 +01:00