From 94b0740f921633ec876d8ca214930318124cbca2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 28 Dec 2020 12:02:58 +0000 Subject: [PATCH 1/6] build(deps): update rand requirement from 0.7.2 to 0.8.0 Updates the requirements on [rand](https://github.com/rust-random/rand) to permit the latest version. - [Release notes](https://github.com/rust-random/rand/releases) - [Changelog](https://github.com/rust-random/rand/blob/master/CHANGELOG.md) - [Commits](https://github.com/rust-random/rand/compare/0.7.3...0.8.0) Signed-off-by: dependabot[bot] --- ethbloom/Cargo.toml | 2 +- fixed-hash/Cargo.toml | 2 +- kvdb-rocksdb/Cargo.toml | 2 +- parity-crypto/Cargo.toml | 32 ++++++++++++++++---------------- uint/Cargo.toml | 2 +- 5 files changed, 20 insertions(+), 20 deletions(-) diff --git a/ethbloom/Cargo.toml b/ethbloom/Cargo.toml index 7d21efd5d..c8223ecf3 100644 --- a/ethbloom/Cargo.toml +++ b/ethbloom/Cargo.toml @@ -19,7 +19,7 @@ impl-codec = { version = "0.4.1", path = "../primitive-types/impls/codec", defau [dev-dependencies] criterion = "0.3.0" -rand = "0.7.2" +rand = "0.8.0" hex-literal = "0.3.1" [features] diff --git a/fixed-hash/Cargo.toml b/fixed-hash/Cargo.toml index c8e85585f..9f9f53b99 100644 --- a/fixed-hash/Cargo.toml +++ b/fixed-hash/Cargo.toml @@ -16,7 +16,7 @@ features = ["quickcheck", "api-dummy"] [dependencies] byteorder = { version = "1.3.2", optional = true, default-features = false } quickcheck = { version = "0.9.0", optional = true } -rand = { version = "0.7.2", optional = true, default-features = false } +rand = { version = "0.8.0", optional = true, default-features = false } rustc-hex = { version = "2.0.1", optional = true, default-features = false } static_assertions = "1.0.0" arbitrary = { version = "0.4", optional = true } diff --git a/kvdb-rocksdb/Cargo.toml b/kvdb-rocksdb/Cargo.toml index e623914d9..77ba7aed0 100644 --- a/kvdb-rocksdb/Cargo.toml +++ b/kvdb-rocksdb/Cargo.toml @@ -28,7 +28,7 @@ alloc_counter = "0.0.4" criterion = "0.3" ethereum-types = { path = "../ethereum-types" } kvdb-shared-tests = { path = "../kvdb-shared-tests", version = "0.6" } -rand = "0.7.2" +rand = "0.8.0" tempfile = "3.1.0" keccak-hash = { path = "../keccak-hash" } sysinfo = "0.15.3" diff --git a/parity-crypto/Cargo.toml b/parity-crypto/Cargo.toml index 33ce92f6f..b376db1d9 100644 --- a/parity-crypto/Cargo.toml +++ b/parity-crypto/Cargo.toml @@ -14,26 +14,26 @@ harness = false required-features = ["publickey"] [dependencies] -aes = "0.4.0" -aes-ctr = "0.4.0" -block-modes = "0.5.0" -digest = "0.8" +aes = "0.6.0" +aes-ctr = "0.6.0" +block-modes = "0.7.0" +digest = "0.9.0" ethereum-types = { version = "0.10.0", optional = true, path = "../ethereum-types" } -hmac = "0.7" -lazy_static = { version = "1.0", optional = true } -pbkdf2 = "0.3.0" -rand = "0.7.2" -ripemd160 = "0.8.0" +hmac = "0.10.1" +lazy_static = { version = "1.4.0", optional = true } +pbkdf2 = "0.6.0" +rand = "0.8.0" +ripemd160 = "0.9.1" rustc-hex = { version = "2.1.0", default-features = false, optional = true } -scrypt = { version = "0.2.0", default-features = false } -secp256k1 = { version = "0.19", optional = true, features = ["global-context", "recovery", "rand-std"] } -sha2 = "0.8.0" -subtle = "2.2.1" -tiny-keccak = { version = "2.0", features = ["keccak"] } -zeroize = { version = "1.0.0", default-features = false } +scrypt = { version = "0.5.0" } +secp256k1 = { version = "0.19.0", optional = true, features = ["global-context", "recovery", "rand-std"] } +sha2 = "0.9.2" +subtle = "2.4.0" +tiny-keccak = { version = "2.0.2", features = ["keccak"] } +zeroize = { version = "1.2.0", default-features = false } [dev-dependencies] -criterion = "0.3.0" +criterion = "0.3.3" hex-literal = "0.3.1" [features] diff --git a/uint/Cargo.toml b/uint/Cargo.toml index b27645ac6..b6bb5673d 100644 --- a/uint/Cargo.toml +++ b/uint/Cargo.toml @@ -13,7 +13,7 @@ edition = "2018" byteorder = { version = "1.3.2", default-features = false } crunchy = { version = "0.2.2", default-features = false } qc = { package = "quickcheck", version = "0.9.0", optional = true } -rand = { version = "0.7.2", default-features = false, optional = true } +rand = { version = "0.8.0", default-features = false, optional = true } hex = { version = "0.4", default-features = false } static_assertions = "1.0.0" arbitrary = { version = "0.4", optional = true } From a29d15cd9ea19c2419eb91ae99b524b8ee73eb42 Mon Sep 17 00:00:00 2001 From: David Palm Date: Wed, 30 Dec 2020 13:10:39 +0100 Subject: [PATCH 2/6] Seed from u64 --- fixed-hash/Cargo.toml | 1 + fixed-hash/src/tests.rs | 19 ++----------------- 2 files changed, 3 insertions(+), 17 deletions(-) diff --git a/fixed-hash/Cargo.toml b/fixed-hash/Cargo.toml index 9f9f53b99..3fa37cafc 100644 --- a/fixed-hash/Cargo.toml +++ b/fixed-hash/Cargo.toml @@ -24,6 +24,7 @@ arbitrary = { version = "0.4", optional = true } [dev-dependencies] rand_xorshift = "0.2.0" criterion = "0.3.0" +rand = { version = "0.8.0", default-features = false, features = ["std_rng"] } [features] default = ["std", "rand", "rustc-hex", "byteorder"] diff --git a/fixed-hash/src/tests.rs b/fixed-hash/src/tests.rs index 33c1956b7..5a5f5d94d 100644 --- a/fixed-hash/src/tests.rs +++ b/fixed-hash/src/tests.rs @@ -244,23 +244,8 @@ mod rand { #[test] fn random() { - let default_seed = ::Seed::default(); - let mut rng = StdRng::from_seed(default_seed); - assert_eq!(H32::random_using(&mut rng), H32::from([0x76, 0xa0, 0x40, 0x53])); - } - - #[test] - fn randomize() { - let default_seed = ::Seed::default(); - let mut rng = StdRng::from_seed(default_seed); - assert_eq!( - { - let mut ret = H32::zero(); - ret.randomize_using(&mut rng); - ret - }, - H32::from([0x76, 0xa0, 0x40, 0x53]) - ) + let mut rng = StdRng::seed_from_u64(123); + assert_eq!(H32::random_using(&mut rng), H32::from([0xeb, 0x96, 0xaf, 0x1c])); } } From 0f82a118a95dc2d4a2e2e4baa38ad7adf31fca25 Mon Sep 17 00:00:00 2001 From: Andronik Ordian Date: Mon, 4 Jan 2021 13:43:27 +0100 Subject: [PATCH 3/6] uint: use rand 0.7 for quickcheck feature --- uint/Cargo.toml | 4 ++-- uint/src/lib.rs | 2 +- uint/src/uint.rs | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/uint/Cargo.toml b/uint/Cargo.toml index b6bb5673d..ca650e72e 100644 --- a/uint/Cargo.toml +++ b/uint/Cargo.toml @@ -13,7 +13,7 @@ edition = "2018" byteorder = { version = "1.3.2", default-features = false } crunchy = { version = "0.2.2", default-features = false } qc = { package = "quickcheck", version = "0.9.0", optional = true } -rand = { version = "0.8.0", default-features = false, optional = true } +rand07 = { package = "rand", version = "0.7", default-features = false, optional = true } hex = { version = "0.4", default-features = false } static_assertions = "1.0.0" arbitrary = { version = "0.4", optional = true } @@ -21,7 +21,7 @@ arbitrary = { version = "0.4", optional = true } [features] default = ["std"] std = ["byteorder/std", "crunchy/std", "hex/std"] -quickcheck = ["qc", "rand"] +quickcheck = ["qc", "rand07"] [[example]] name = "modular" diff --git a/uint/src/lib.rs b/uint/src/lib.rs index 0aedc11d8..83ab957a2 100644 --- a/uint/src/lib.rs +++ b/uint/src/lib.rs @@ -27,7 +27,7 @@ pub use qc; #[cfg(feature = "quickcheck")] #[doc(hidden)] -pub use rand; +pub use rand07; #[cfg(feature = "arbitrary")] #[doc(hidden)] diff --git a/uint/src/uint.rs b/uint/src/uint.rs index e6b99e537..edf5c9e5a 100644 --- a/uint/src/uint.rs +++ b/uint/src/uint.rs @@ -1741,8 +1741,8 @@ macro_rules! impl_quickcheck_arbitrary_for_uint { fn arbitrary(g: &mut G) -> Self { let mut res = [0u8; $n_bytes]; - use $crate::rand::Rng; - let p: f64 = $crate::rand::rngs::OsRng.gen(); + use $crate::rand07::Rng; + let p: f64 = $crate::rand07::rngs::OsRng.gen(); // make it more likely to generate smaller numbers that // don't use up the full $n_bytes let range = From 35ab292e79e13bf84e5f7e6e732169906702e604 Mon Sep 17 00:00:00 2001 From: Andronik Ordian Date: Mon, 4 Jan 2021 14:02:51 +0100 Subject: [PATCH 4/6] kvdb-rocksdb: fix compilation for benches --- kvdb-rocksdb/benches/bench_read_perf.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kvdb-rocksdb/benches/bench_read_perf.rs b/kvdb-rocksdb/benches/bench_read_perf.rs index 3a14ac752..32696bae4 100644 --- a/kvdb-rocksdb/benches/bench_read_perf.rs +++ b/kvdb-rocksdb/benches/bench_read_perf.rs @@ -50,7 +50,7 @@ fn open_db() -> Database { /// an `ElasticArray128` so sometimes we save on allocations. fn n_random_bytes(n: usize) -> Vec { let mut rng = rand::thread_rng(); - let variability: i64 = rng.gen_range(0, (n / 5) as i64); + let variability: i64 = rng.gen_range(0 .. (n / 5) as i64); let plus_or_minus: i64 = if variability % 2 == 0 { 1 } else { -1 }; let range = Uniform::from(0..u8::max_value()); rng.sample_iter(&range).take((n as i64 + plus_or_minus * variability) as usize).collect() From 5f5b495bcc47c31142e3065c4f53bf442715dc4b Mon Sep 17 00:00:00 2001 From: Andronik Ordian Date: Mon, 4 Jan 2021 14:05:47 +0100 Subject: [PATCH 5/6] parity-crypto: remove unused dep and fix a warning --- parity-crypto/Cargo.toml | 1 - parity-crypto/src/publickey/secret_key.rs | 1 - 2 files changed, 2 deletions(-) diff --git a/parity-crypto/Cargo.toml b/parity-crypto/Cargo.toml index b376db1d9..35406b32d 100644 --- a/parity-crypto/Cargo.toml +++ b/parity-crypto/Cargo.toml @@ -22,7 +22,6 @@ ethereum-types = { version = "0.10.0", optional = true, path = "../ethereum-type hmac = "0.10.1" lazy_static = { version = "1.4.0", optional = true } pbkdf2 = "0.6.0" -rand = "0.8.0" ripemd160 = "0.9.1" rustc-hex = { version = "2.1.0", default-features = false, optional = true } scrypt = { version = "0.5.0" } diff --git a/parity-crypto/src/publickey/secret_key.rs b/parity-crypto/src/publickey/secret_key.rs index 80a37a590..7f5692f1d 100644 --- a/parity-crypto/src/publickey/secret_key.rs +++ b/parity-crypto/src/publickey/secret_key.rs @@ -8,7 +8,6 @@ //! Secret key implementation. -use std::convert::TryFrom; use std::fmt; use std::ops::Deref; use std::str::FromStr; From 26365cf723dbbaaf732e59dfaa89b20201ed03d0 Mon Sep 17 00:00:00 2001 From: Andronik Ordian Date: Mon, 4 Jan 2021 14:57:16 +0100 Subject: [PATCH 6/6] cargo fmt and another unused dep --- kvdb-rocksdb/benches/bench_read_perf.rs | 2 +- transaction-pool/Cargo.toml | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/kvdb-rocksdb/benches/bench_read_perf.rs b/kvdb-rocksdb/benches/bench_read_perf.rs index 32696bae4..5a956020b 100644 --- a/kvdb-rocksdb/benches/bench_read_perf.rs +++ b/kvdb-rocksdb/benches/bench_read_perf.rs @@ -50,7 +50,7 @@ fn open_db() -> Database { /// an `ElasticArray128` so sometimes we save on allocations. fn n_random_bytes(n: usize) -> Vec { let mut rng = rand::thread_rng(); - let variability: i64 = rng.gen_range(0 .. (n / 5) as i64); + let variability: i64 = rng.gen_range(0..(n / 5) as i64); let plus_or_minus: i64 = if variability % 2 == 0 { 1 } else { -1 }; let range = Uniform::from(0..u8::max_value()); rng.sample_iter(&range).take((n as i64 + plus_or_minus * variability) as usize).collect() diff --git a/transaction-pool/Cargo.toml b/transaction-pool/Cargo.toml index a0de36b27..50537d50a 100644 --- a/transaction-pool/Cargo.toml +++ b/transaction-pool/Cargo.toml @@ -10,7 +10,6 @@ edition = "2018" [dependencies] log = "0.4.8" smallvec = "0.6.10" -trace-time = { path = "../trace-time", version = "0.1" } [dev-dependencies] ethereum-types = { version = "0.10.0", path = "../ethereum-types" }