Skip to content

Commit

Permalink
Bump most dependencies (libp2p#1268)
Browse files Browse the repository at this point in the history
* Bump most dependencies

This actually builds 😊.

* Bump all dependencies

Includes the excellent work of @rschulman in libp2p#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
  • Loading branch information
Demi-Marie authored and tomaka committed Nov 6, 2019
1 parent c7f18b3 commit 707d08a
Show file tree
Hide file tree
Showing 15 changed files with 49 additions and 46 deletions.
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ libp2p-swarm = { version = "0.2.0", path = "swarm" }
libp2p-uds = { version = "0.12.0", path = "transports/uds" }
libp2p-wasm-ext = { version = "0.5.0", path = "transports/wasm-ext" }
libp2p-yamux = { version = "0.12.0", path = "muxers/yamux" }
parking_lot = "0.8"
parking_lot = "0.9.0"
smallvec = "0.6"
tokio-codec = "0.1"
tokio-executor = "0.1"
Expand All @@ -48,7 +48,7 @@ libp2p-tcp = { version = "0.12.0", path = "transports/tcp" }
libp2p-websocket = { version = "0.12.0", path = "transports/websocket", optional = true }

[dev-dependencies]
env_logger = "0.6.0"
env_logger = "0.7.1"
tokio = "0.1"
tokio-stdin-stdout = "0.1"

Expand Down
16 changes: 8 additions & 8 deletions core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ categories = ["network-programming", "asynchronous"]

[dependencies]
asn1_der = "0.6.1"
bs58 = "0.2.0"
bs58 = "0.3.0"
bytes = "0.4"
ed25519-dalek = "1.0.0-pre.1"
ed25519-dalek = "1.0.0-pre.2"
failure = "0.1"
fnv = "1.0"
futures-timer = "0.3"
Expand All @@ -23,10 +23,10 @@ multiaddr = { package = "parity-multiaddr", version = "0.5.0", path = "../misc/m
multihash = { package = "parity-multihash", version = "0.1.0", path = "../misc/multihash" }
multistream-select = { version = "0.5.0", path = "../misc/multistream-select" }
futures-preview = { version = "0.3.0-alpha.18", features = ["compat", "io-compat"] }
parking_lot = "0.8"
parking_lot = "0.9.0"
protobuf = "2.8"
quick-error = "1.2"
rand = "0.6"
rand = "0.7"
rw-stream-sink = { version = "0.1.1", path = "../misc/rw-stream-sink" }
libsecp256k1 = { version = "0.3.1", optional = true }
sha2 = "0.8.0"
Expand All @@ -37,17 +37,17 @@ void = "1"
zeroize = "1"

[target.'cfg(not(any(target_os = "emscripten", target_os = "unknown")))'.dependencies]
ring = { version = "^0.16", features = ["alloc", "std"], default-features = false }
untrusted = { version = "0.6" }
ring = { version = "0.16.9", features = ["alloc", "std"], default-features = false }
untrusted = "0.7.0"

[dev-dependencies]
async-std = "0.99"
libp2p-swarm = { version = "0.2.0", path = "../swarm" }
libp2p-tcp = { version = "0.12.0", path = "../transports/tcp" }
libp2p-mplex = { version = "0.12.0", path = "../muxers/mplex" }
libp2p-secio = { version = "0.12.0", path = "../protocols/secio" }
rand = "0.6"
quickcheck = "0.8"
rand = "0.7.2"
quickcheck = "0.9.0"
wasm-timer = "0.2"
assert_matches = "1.3"

Expand Down
12 changes: 8 additions & 4 deletions core/src/identity/ed25519.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

use ed25519_dalek as ed25519;
use failure::Fail;
use rand::RngCore;
use super::error::DecodingError;
use zeroize::Zeroize;
use core::fmt;
Expand All @@ -32,7 +33,7 @@ pub struct Keypair(ed25519::Keypair);
impl Keypair {
/// Generate a new Ed25519 keypair.
pub fn generate() -> Keypair {
Keypair(ed25519::Keypair::generate(&mut rand::thread_rng()))
Keypair::from(SecretKey::generate())
}

/// Encode the keypair into a byte array by concatenating the bytes
Expand Down Expand Up @@ -94,9 +95,9 @@ impl From<Keypair> for SecretKey {
/// Promote an Ed25519 secret key into a keypair.
impl From<SecretKey> for Keypair {
fn from(sk: SecretKey) -> Keypair {
let secret = sk.0;
let secret: ed25519::ExpandedSecretKey = (&sk.0).into();
let public = ed25519::PublicKey::from(&secret);
Keypair(ed25519::Keypair { secret, public })
Keypair(ed25519::Keypair { secret: sk.0, public })
}
}

Expand Down Expand Up @@ -151,7 +152,10 @@ impl fmt::Debug for SecretKey {
impl SecretKey {
/// Generate a new Ed25519 secret key.
pub fn generate() -> SecretKey {
SecretKey(ed25519::SecretKey::generate(&mut rand::thread_rng()))
let mut bytes = [0u8; 32];
rand::thread_rng().fill_bytes(&mut bytes);
SecretKey(ed25519::SecretKey::from_bytes(&bytes)
.expect("this returns `Err` only if the length is wrong; the length is correct; qed"))
}

/// Create an Ed25519 secret key from a byte slice, zeroing the input on success.
Expand Down
8 changes: 4 additions & 4 deletions misc/multiaddr/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ version = "0.5.0"

[dependencies]
arrayref = "0.3"
bs58 = "0.2.0"
bs58 = "0.3.0"
byteorder = "1.3.1"
bytes = "0.4.12"
data-encoding = "2.1"
Expand All @@ -22,8 +22,8 @@ url = { version = "2.1.0", default-features = false }

[dev-dependencies]
bincode = "1"
bs58 = "0.2.0"
bs58 = "0.3.0"
data-encoding = "2"
quickcheck = "0.8.1"
rand = "0.6.5"
quickcheck = "0.9.0"
rand = "0.7.2"
serde_json = "1.0"
8 changes: 4 additions & 4 deletions misc/multistream-select/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ edition = "2018"

[dependencies]
bytes = "0.4"
futures = { version = "0.1" }
futures = "0.1"
log = "0.4"
smallvec = "0.6"
tokio-io = "0.1"
unsigned-varint = { version = "0.2.2" }
unsigned-varint = "0.2.2"

[dev-dependencies]
tokio = "0.1"
tokio-tcp = "0.1"
quickcheck = "0.8"
rand = "0.6"
quickcheck = "0.9.0"
rand = "0.7.2"
4 changes: 2 additions & 2 deletions protocols/deflate/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ flate2 = "1.0"

[dev-dependencies]
async-std = "0.99"
env_logger = "0.6"
env_logger = "0.7.1"
libp2p-tcp = { version = "0.12.0", path = "../../transports/tcp" }
rand = "0.7"
quickcheck = "0.8"
quickcheck = "0.9.0"
2 changes: 1 addition & 1 deletion protocols/floodsub/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ keywords = ["peer-to-peer", "libp2p", "networking"]
categories = ["network-programming", "asynchronous"]

[dependencies]
bs58 = "0.2.0"
bs58 = "0.3.0"
bytes = "0.4"
cuckoofilter = "0.3.2"
fnv = "1.0"
Expand Down
8 changes: 4 additions & 4 deletions protocols/kad/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ keywords = ["peer-to-peer", "libp2p", "networking"]
categories = ["network-programming", "asynchronous"]

[dependencies]
arrayvec = "0.4.7"
arrayvec = "0.5.1"
bytes = "0.4"
either = "1.5"
fnv = "1.0"
Expand All @@ -22,7 +22,7 @@ libp2p-swarm = { version = "0.2.0", path = "../../swarm" }
multiaddr = { package = "parity-multiaddr", version = "0.5.0", path = "../../misc/multiaddr" }
multihash = { package = "parity-multihash", version = "0.1.0", path = "../../misc/multihash" }
protobuf = "2.8"
rand = "0.6.0"
rand = "0.7.2"
sha2 = "0.8.0"
smallvec = "0.6"
wasm-timer = "0.2"
Expand All @@ -34,5 +34,5 @@ void = "1.0"
libp2p-secio = { version = "0.12.0", path = "../secio" }
libp2p-tcp = { version = "0.12.0", path = "../../transports/tcp" }
libp2p-yamux = { version = "0.12.0", path = "../../muxers/yamux" }
quickcheck = "0.8"
rand = "0.6.0"
quickcheck = "0.9.0"
rand = "0.7.2"
8 changes: 4 additions & 4 deletions protocols/noise/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,16 @@ lazy_static = "1.2"
libp2p-core = { version = "0.12.0", path = "../../core" }
log = "0.4"
protobuf = "2.8"
rand = "^0.7"
ring = { version = "^0.16", features = ["alloc"], default-features = false }
rand = "^0.7.2"
ring = { version = "0.16.9", features = ["alloc"], default-features = false }
snow = { version = "0.6.1", features = ["ring-resolver"], default-features = false }
tokio-io = "0.1"
x25519-dalek = "0.5"
zeroize = "1"

[dev-dependencies]
env_logger = "0.6"
env_logger = "0.7.1"
libp2p-tcp = { version = "0.12.0", path = "../../transports/tcp" }
quickcheck = "0.8"
quickcheck = "0.9.0"
tokio = "0.1"
sodiumoxide = "^0.2.5"
1 change: 0 additions & 1 deletion protocols/noise/src/protocol.rs
Original file line number Diff line number Diff line change
Expand Up @@ -252,4 +252,3 @@ impl rand::RngCore for Rng {
impl rand::CryptoRng for Rng {}

impl snow::types::Random for Rng {}

4 changes: 2 additions & 2 deletions protocols/ping/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ libp2p-swarm = { version = "0.2.0", path = "../../swarm" }
log = "0.4.1"
multiaddr = { package = "parity-multiaddr", version = "0.5.0", path = "../../misc/multiaddr" }
futures-preview = "0.3.0-alpha.18"
rand = "0.6"
rand = "0.7.2"
wasm-timer = "0.2"
void = "1.0"

[dev-dependencies]
libp2p-tcp = { version = "0.12.0", path = "../../transports/tcp" }
libp2p-secio = { version = "0.12.0", path = "../../protocols/secio" }
libp2p-yamux = { version = "0.12.0", path = "../../muxers/yamux" }
quickcheck = "0.8"
quickcheck = "0.9.0"
tokio = "0.1"
tokio-tcp = "0.1"
8 changes: 4 additions & 4 deletions protocols/plaintext/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ keywords = ["peer-to-peer", "libp2p", "networking"]
categories = ["network-programming", "asynchronous"]

[dependencies]
bytes = "0.4"
futures-preview = "0.3.0-alpha.18"
libp2p-core = { version = "0.12.0", path = "../../core" }
log = "0.4.6"
void = "1"
bytes = "0.4.12"
log = "0.4.8"
void = "1.0.2"
tokio-io = "0.1.12"
protobuf = "2.3"
protobuf = "2.8.1"
rw-stream-sink = { version = "0.1.1", path = "../../misc/rw-stream-sink" }
6 changes: 3 additions & 3 deletions protocols/secio/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ hmac = "0.7.0"
unsigned-varint = { version = "0.2.3", features = ["futures-codec"] }

[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
ring = { version = "^0.16", features = ["alloc"], default-features = false }
untrusted = { version = "0.6" }
ring = { version = "0.16.9", features = ["alloc"], default-features = false }
untrusted = "0.7.0"

[target.'cfg(target_arch = "wasm32")'.dependencies]
js-sys = "0.3.10"
Expand All @@ -45,7 +45,7 @@ aes-all = ["aesni"]

[dev-dependencies]
async-std = "0.99"
criterion = "0.2"
criterion = "0.3.0"
libp2p-mplex = { version = "0.12.0", path = "../../muxers/mplex" }
libp2p-tcp = { version = "0.12.0", path = "../../transports/tcp" }

Expand Down
4 changes: 2 additions & 2 deletions swarm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ void = "1"

[dev-dependencies]
libp2p-mplex = { version = "0.12.0", path = "../muxers/mplex" }
quickcheck = "0.8"
rand = "0.6"
quickcheck = "0.9.0"
rand = "0.7.2"
2 changes: 1 addition & 1 deletion transports/websocket/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ log = "0.4.8"
rw-stream-sink = { version = "0.1.1", path = "../../misc/rw-stream-sink" }
soketto = { git = "https://github.com/paritytech/soketto.git", branch = "develop", features = ["deflate"] }
url = "2.1.0"
webpki-roots = "0.17.0"
webpki-roots = "0.18.0"

[dev-dependencies]
libp2p-tcp = { version = "0.12.0", path = "../tcp" }

0 comments on commit 707d08a

Please sign in to comment.