74 Commits

Author SHA1 Message Date
Roman Borschel
2cd2e6d654
Address some minor clippy warnings. (#1868) 2020-11-30 16:45:40 +01:00
Roman S. Borschel
5e5c3226d8 Prepare core-0.25.1 and multiaddr-0.10. 2020-11-25 16:51:07 +01:00
Roman S. Borschel
6f7acc0f41 Add missing multiaddr update.
As a result of the multihash upgrade.
2020-11-25 16:42:39 +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
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
650812abc3 Prepare parity-multiaddr-0.9.6 2020-11-17 10:39:11 +01:00
Roman S. Borschel
4876ac0d7e Update multiaddr CHANGELOG. 2020-11-17 10:32:51 +01:00
Mikhail Zabaluev
fe6e622f3b
multiaddr: feature gate url dependency (#1843)
* multiaddr: feature gate url dependency

Make it possible to exclude url and its dependencies
from the dependency tree, by feature gating the
from_url* functions in the public API.

* Document feature gating of multiaddr::from_url*
2020-11-17 10:31:04 +01:00
Max Inden
6f1edb0e6a
misc/multiaddr: Prepare v0.9.5 release 2020-11-14 20:40:36 +01:00
Max Inden
2e6b0ec1fa
misc/multiaddr: Increase patch version and update changelog 2020-11-14 18:12:52 +01:00
Pawan Dhananjay
f7ab4f7869
misc/multiaddr: Limit initial memory allocation in visit_seq (#1833)
Without a limit, one can send malformed input such that seq.size_hint() returns
a very large value and crashes the program even if the following data is pretty
small.
2020-11-14 18:08:49 +01:00
Max Inden
fabb00c21b
*: Bump changelogs and cargo tomls for parity-multiaddr 2020-11-09 17:56:54 +01:00
dependabot[bot]
cc588ec592
Update bs58 requirement from 0.3.0 to 0.4.0 (#1827)
Updates the requirements on [bs58](https://github.com/mycorrhiza/bs58-rs) to permit the latest version.
- [Release notes](https://github.com/mycorrhiza/bs58-rs/releases)
- [Commits](https://github.com/mycorrhiza/bs58-rs/compare/0.3.0...0.4.0)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-11-09 14:49:25 +01:00
Max Inden
c48cacfcf5
*/Cargo.toml: Update multihash (#1828) 2020-11-09 14:31:51 +01:00
Roman Borschel
a5f210adf3
Prepare release. (#1797) 2020-10-16 20:36: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
Roman S. Borschel
f2c43527f4 Prepare multiaddr-0.9.2 2020-08-31 17:22:43 +02:00
Demi Obenour
9178459cc8
Automatic fixes by cargo-fix (#1662) 2020-07-27 22:27:33 +02:00
Rüdiger Klaehn
e61ccd22df
Add ord for multiaddr (#1653)
So you can use it in ordering based containers
2020-07-13 12:20:10 +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
Toralf Wittner
0eef487ef8
Prepare release. (#1620) 2020-06-22 11:41:28 +02:00
Pierre Krieger
34faf94538
Publish 0.19.0 (#1579) 2020-05-18 15:45:21 +02:00
Mikhail Zabaluev
82156deac5
Support /dns protocol in multiaddr (#1575)
* Add /dns protocol support to multiaddr

The /dns protocol has been added to the spec and has had a de-facto
meaning for years.
See https://github.com/multiformats/multiaddr/pull/100

This adds address parsing and encoding support for /dns to the multiaddr
format library.

* Cover Dns protocol in multiaddr property tests

* transports/dns: Support the /dns protocol

* Support /dns protocol in address translation

* Translate an FQDN URL into a /dns multiaddr

* transports/websocket: Support /dns multiaddr

* Use the /dns protocol in websocket redirects

The whole thing with back-translating from an redirect URL looks a bit
baroque, but at least now the transport does not completely ignore IPv6
addresses resolved from a hostname in a redirect URL.

* Add CHANGELOG entry

Co-authored-by: Pierre Krieger <pierre.krieger1708@gmail.com>
2020-05-18 10:21:55 +02:00
David Craven
0443fea157
Update to latest multihash. (#1566)
* Update to latest multihash.

* Update changelog.

Co-authored-by: Pierre Krieger <pierre.krieger1708@gmail.com>
2020-05-13 17:51:11 +02:00
Pierre Krieger
a203db884c
Bump parity-multiaddr (#1540) 2020-04-02 10:17:36 +02:00
Pierre Krieger
10089c5f46
Use upstream version of multihash instead of a fork (#1472)
The changes from the libp2p fork have been backported to upstream, hence
upstream can now be used instead.
2020-03-05 16:49:36 +01:00
Pierre Krieger
2c40f2880e
Publish 0.16.2 (#1476) 2020-02-28 10:54:52 +01:00
Mazdak Farrokhzad
4496337f93
Onion3Addr::acquire: fix bug due to differing lifetimes (#1468)
Co-authored-by: Pierre Krieger <pierre.krieger1708@gmail.com>
2020-02-24 18:42:43 +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
Toralf Wittner
afb1c877a3
multiaddr: Fix generation of arbitrary onion addr. (#1451)
Exclude port 0 which is not a valid port number for onion addresses.
2020-02-12 20:27:17 +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
Akihito Nakano
69852a580b
Add dnsaddr (#1356)
Co-authored-by: Pierre Krieger <pierre.krieger1708@gmail.com>
2020-02-06 13:54:50 +01:00
Stan Bondi
955b60796a
Added Onion3 support to multiaddr (#1354) 2020-02-04 13:40:57 +01:00
Pierre Krieger
f1f40956d6
Publish 0.15.0 (#1408)
* Publish 0.15.0

* Oops, script too efficient
2020-01-24 17:14:56 +01:00
Qinxuan Chen
af464e18c5 Update some dependenices; Remove some useless dependencies (#1387)
Signed-off-by: koushiro <koushiro.cqx@gmail.com>

Co-authored-by: Pierre Krieger <pierre.krieger1708@gmail.com>
2020-01-10 14:03:59 +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
ab2eb7a51d multiaddr: Replace Bytes with Arc<Vec<u8>>. (#1370)
* multiaddr: Replace `Bytes` with `Arc<Vec<u8>>`.

* Annotate type of `io::Cursor`.

Co-Authored-By: Pierre Krieger <pierre.krieger1708@gmail.com>

* Annotate type of `io::Cursor`.

Co-Authored-By: Pierre Krieger <pierre.krieger1708@gmail.com>

Co-authored-by: Pierre Krieger <pierre.krieger1708@gmail.com>
2020-01-07 13:06:16 +01:00
Akihito Nakano
d83619109b Add protocol string to Error::UnknownProtocolString (#1355)
Co-authored-by: Pierre Krieger <pierre.krieger1708@gmail.com>
2020-01-07 12:36:37 +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
98dac8d509
Merge master into stable-futures (#1325)
* Update parking_lot to v0.9 (#1300)

Signed-off-by: koushiro <koushiro.cqx@gmail.com>

* Publish 0.13.1 (#1304)

* Publish 0.13.1

* Update CHANGELOG.md

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

* Update some deps of core-derive (#1299)

Signed-off-by: koushiro <koushiro.cqx@gmail.com>
2019-11-28 18:03:59 +01:00
Pierre Krieger
c1226b203a
Cherry-pick commits from master to stable-futures (#1296)
* Implement Debug for (ed25519|secp256k1)::(Keypair|SecretKey) (#1285)

* Fix possible arithmetic overflow in libp2p-kad. (#1291)

When the number of active queries exceeds the (internal)
JOBS_MAX_QUERIES limit, which is only supposed to bound
the number of concurrent queries relating to background
jobs, an arithmetic overflow occurs. This is fixed by
using saturating subtraction.

* protocols/plaintext: Add example on how to upgrade with PlainTextConfig1 (#1286)

* [mdns] - Support for long mDNS names (Bug #1232) (#1287)

* Dead code -- commenting out with a note referencing future implementation

* Adding "std" feature so that cargo can build in other directories (notably `misc/mdns`, so that I could run these tests)

* Permitting `PeerID` to be built from an `Identity` multihash

* The length limit for DNS labels is 63 characters, as per RFC1035

* Allocates the vector with capacity for the service name plus additional QNAME encoding bytes

* Added support for encoding/decoding peer IDs with an encoded length greater than 63 characters

* Removing "std" from ring features

Co-Authored-By: Pierre Krieger <pierre.krieger1708@gmail.com>

* Retaining MAX_INLINE_KEY_LENGTH with comment about future usage

* `segment_peer_id` consumes `peer_id` ... plus an early return for IDs that don't need to be segmented

* Fixing logic

* Bump most dependencies (#1268)

* Bump most dependencies

This actually builds 😊.

* Bump all dependencies

Includes the excellent work of @rschulman in #1265.

* Remove use of ed25519-dalek fork

* Monomorphize more dependencies

* Add compatibility hack for rand

Cargo allows a crate to depend on multiple versions of another, but
`cargo-web` panics in that situation.  Use a wrapper crate to work
around the panic.

* Use @tomaka’s idea for using a newer `rand`

instead of my own ugly hack.

* Switch to Parity master

as its dependency-bumping PR has been merged.

* Update some depenendencies again

* Remove unwraps and `#[allow(deprecated)]`.

* Remove spurious changes to dependencies

Bumping minor or patch versions is not needed, and increases likelyhood
of merge conflicts.

* Remove some redundant Cargo.toml changes

* Replace a retry loop with an expect

`ed25519::SecretKey::from_bytes` will never fail for 32-byte inputs.

* Revert changes that don’t belong in this PR

* Remove using void to bypass ICE (#1295)

* Publish 0.13.0 (#1294)
2019-11-06 16:09:15 +01:00
Pierre Krieger
0eeddac86f
Update the stable-futures branch to master (#1288)
* Configurable multistream-select protocol. Add V1Lazy variant. (#1245)

Make the multistream-select protocol (version) configurable
on transport upgrades as well as for individual substreams.

Add a "lazy" variant of multistream-select 1.0 that delays
sending of negotiation protocol frames as much as possible
but is only safe to use under additional assumptions that
go beyond what is required by the multistream-select v1
specification.

* Improve the code readability of the chat example (#1253)

* Add bridged chats (#1252)

* Try fix CI (#1261)

* Print Rust version on CI

* Don't print where not appropriate

* Change caching strategy

* Remove win32 build

* Remove win32 from list

* Update libsecp256k1 dep to 0.3.0 (#1258)

* Update libsecp256k1 dep to 0.3.0

* Sign now cannot fail

* Upgrade url and percent-encoding deps to 2.1.0 (#1267)

* Upgrade percent-encoding dep to 2.1.0

* Upgrade url dep to 2.1.0

* Revert CIPHERS set to null (#1273)

* Update dependency versions (#1265)

* Update versions of many dependencies

* Bump version of rand

* Updates for changed APIs in rand, ring, and webpki

* Replace references to `snow::Session`

`Session` no longer exists in `snow` but the replacement is two structs `HandshakeState` and `TransportState`
Something will have to be done to harmonize `NoiseOutput.session`

* Add precise type for UnparsedPublicKey

* Update data structures/functions to match new snow's API

* Delete diff.diff

Remove accidentally committed diff file

* Remove commented lines in identity/rsa.rs

* Bump libsecp256k1 to 0.3.1

* Implement /plaintext/2.0.0 (#1236)

* WIP

* plaintext/2.0.0

* Refactor protobuf related issues to compatible with the spec

* Rename: new PlainTextConfig -> PlainText2Config

* Keep plaintext/1.0.0 as PlainText1Config

* Config contains pubkey

* Rename: proposition -> exchange

* Add PeerId to Exchange

* Check the validity of the remote's `Exchange`

* Tweak

* Delete unused import

* Add debug log

* Delete unused field: public_key_encoded

* Delete unused field: local

* Delete unused field: exchange_bytes

* The inner instance should not be public

* identity::Publickey::Rsa is not available on wasm

* Delete PeerId from Config as it should be generated from the pubkey

* Catch up for #1240

* Tweak

* Update protocols/plaintext/src/error.rs

Co-Authored-By: Pierre Krieger <pierre.krieger1708@gmail.com>

* Update protocols/plaintext/src/handshake.rs

Co-Authored-By: Pierre Krieger <pierre.krieger1708@gmail.com>

* Update protocols/plaintext/src/error.rs

Co-Authored-By: Pierre Krieger <pierre.krieger1708@gmail.com>

* Update protocols/plaintext/src/error.rs

Co-Authored-By: Roman Borschel <romanb@users.noreply.github.com>

* Update protocols/plaintext/src/error.rs

Co-Authored-By: Roman Borschel <romanb@users.noreply.github.com>

* Rename: pubkey -> local_public_key

* Delete unused error

* Rename: PeerIdValidationFailed -> InvalidPeerId

* Fix: HandShake -> Handshake

* Use bytes insteadof Publickey to avoid code duplication

* Replace with ProtobufError

* Merge HandshakeContext<()> into HandshakeContext<Local>

* Improve the peer ID validation to simplify the handshake

* Propagate Remote to allow extracting the PeerId from the Remote

* Collapse the same kind of errors into the variant

* [noise]: `sodiumoxide 0.2.5` (#1276)

Fixes https://github.com/RustSec/advisory-db/pull/192

* examples/ipfs-kad.rs: Remove outdated reference to `without_init` (#1280)

* CircleCI Test Fix (#1282)

* Disabling "Docker Layer Caching" because it breaks one of the circleci checks

* Bump to trigger CircleCI build

* unbump

* zeroize: Upgrade to v1.0 (#1284)

v1.0 final release is out. Release notes:

https://github.com/iqlusioninc/crates/pull/279

* *: Consolidate protobuf scripts and update to rust-protobuf 2.8.1 (#1275)

* *: Consolidate protobuf generation scripts

* *: Update to rust-protobuf 2.8.1

* *: Mark protobuf generated modules with '_proto'

* examples: Add distributed key value store (#1281)

* examples: Add distributed key value store

This commit adds a basic distributed key value store supporting GET and
PUT commands using Kademlia and mDNS.

* examples/distributed-key-value-store: Fix typo

* Simple Warning Cleanup (#1278)

* Cleaning up warnings - removing unused `use`

* Cleaning up warnings - unused tuple value

* Cleaning up warnings - removing dead code

* Cleaning up warnings - fixing deprecated name

* Cleaning up warnings - removing dead code

* Revert "Cleaning up warnings - removing dead code"

This reverts commit f18a765e4bf240b0ed9294ec3ae5dab5c186b801.

* Enable the std feature of ring (#1289)
2019-10-28 18:04:01 +01:00
Pierre Krieger
abe2f2afc1
Merge master into stable-futures (#1271)
* Configurable multistream-select protocol. Add V1Lazy variant. (#1245)

Make the multistream-select protocol (version) configurable
on transport upgrades as well as for individual substreams.

Add a "lazy" variant of multistream-select 1.0 that delays
sending of negotiation protocol frames as much as possible
but is only safe to use under additional assumptions that
go beyond what is required by the multistream-select v1
specification.

* Improve the code readability of the chat example (#1253)

* Add bridged chats (#1252)

* Try fix CI (#1261)

* Print Rust version on CI

* Don't print where not appropriate

* Change caching strategy

* Remove win32 build

* Remove win32 from list

* Update libsecp256k1 dep to 0.3.0 (#1258)

* Update libsecp256k1 dep to 0.3.0

* Sign now cannot fail

* Upgrade url and percent-encoding deps to 2.1.0 (#1267)

* Upgrade percent-encoding dep to 2.1.0

* Upgrade url dep to 2.1.0

* Fix more conflicts

* Revert CIPHERS set to null (#1273)
2019-10-10 11:31:44 +02:00
Max Inden
5861474d99 core/src/translation: Support dns4 and dns6 (#1204)
* core/src/translation: Add unit tests

* core/src/translation: Support dns4 and dns6

Add dns4 and dns6 as valid protocol replacements for the origin address
to construct external addresses of a given node.

* core/nodes/network: %s/nat_translation/address_translation/

When receiving an observed address on a tcp connection that we initiated, the
observed address contains our tcp dial port, not our tcp listen port. We know
which port we are listening on, thereby we can replace the port within the
observed address.

When receiving an observed address on a tcp connection that we did **not**
initiated, the observed address should contain our listening port. In case it
differs from our listening port there might be a NAT along the path.

With the above in mind, the function name `nat_translation` is misleading.
2019-07-18 18:41:09 +02:00
Pierre Krieger
f51573b628
Publish v0.9.0 (#1160)
* Publish v0.9.0

* Update CHANGELOG.md

Co-Authored-By: Roman Borschel <romanb@users.noreply.github.com>

* Published soketto
2019-06-04 17:17:03 +02:00
Pierre Krieger
e7ab8eb1c3
Allow a path for WS multiaddresses (#1093)
* Allow a path for WS multiaddresses

* Fix tests

* Finish

* Tests

* Don't accept any path other than /
2019-05-24 14:12:44 +02:00
Pierre Krieger
bd96b66fb5
Publish version 0.8.0 (#1123) 2019-05-15 16:50:43 +02:00
Pierre Krieger
43d9084735
Add parity_multiaddr::from_websockets_url (#1113)
* Add parity_multiaddr::from_websockets_url

* Make from_websockets_url more genreic

* Oops, forgot the file

* Use the URL crate

* Add dns_and_port test

* Address review

* Add support for unix
2019-05-14 14:19:07 +02:00
Pierre Krieger
b4345ee8ba
Bump to 0.7.0 (#1081)
* Bump to 0.7.0

* Update CHANGELOG.md

Co-Authored-By: tomaka <pierre.krieger1708@gmail.com>

* Update for #1078

* New version of multihash and multiaddr as well
2019-04-23 13:03:29 +02:00