diff --git a/benchmark/Cargo.toml b/benchmark/Cargo.toml index 591d376771..27e85628a2 100644 --- a/benchmark/Cargo.toml +++ b/benchmark/Cargo.toml @@ -12,7 +12,7 @@ metrics = "0.24.1" metrics-util = "0.19.0" metrics-exporter-prometheus = "0.16.1" tokio = { version = "1.36.0", features = ["rt", "sync", "macros", "rt-multi-thread"] } -rand = "0.8.5" +rand = "0.9.0" pretty-duration = "0.1.1" tikv-jemallocator = "0.6.0" env_logger = "0.11.5" diff --git a/benchmark/src/zipf.rs b/benchmark/src/zipf.rs index a054abdfbc..cb179642d8 100644 --- a/benchmark/src/zipf.rs +++ b/benchmark/src/zipf.rs @@ -6,8 +6,8 @@ use firewood::db::{BatchOp, Db}; use firewood::v2::api::{Db as _, Proposal as _}; use log::{debug, trace}; use pretty_duration::pretty_duration; -use rand::prelude::Distribution as _; -use rand::thread_rng; +use rand::distr::Distribution as _; +use rand::rng; use sha2::{Digest, Sha256}; use std::collections::HashSet; use std::error::Error; @@ -74,7 +74,7 @@ fn generate_updates( zipf: &zipf::ZipfDistribution, ) -> impl Iterator, Vec>> { let hash_of_batch_id = Sha256::digest(batch_id.to_ne_bytes()).to_vec(); - let rng = thread_rng(); + let rng = rng(); zipf.sample_iter(rng) .take(batch_size) .map(|inner_key| { diff --git a/firewood/Cargo.toml b/firewood/Cargo.toml index 58f7155166..71e3bceb8b 100644 --- a/firewood/Cargo.toml +++ b/firewood/Cargo.toml @@ -44,7 +44,7 @@ branch_factor_256 = [ "storage/branch_factor_256" ] [dev-dependencies] criterion = {version = "0.5.1", features = ["async_tokio"]} -rand = "0.8.5" +rand = "0.9.0" triehash = "0.8.4" clap = { version = "4.5.0", features = ['derive'] } pprof = { version = "0.14.0", features = ["flamegraph"] } diff --git a/grpc-testtool/Cargo.toml b/grpc-testtool/Cargo.toml index db238dc8c4..fcc2e1e329 100644 --- a/grpc-testtool/Cargo.toml +++ b/grpc-testtool/Cargo.toml @@ -33,7 +33,7 @@ tonic-build = "0.12.1" [dev-dependencies] criterion = {version = "0.5.1", features = ["async_tokio"]} -rand = "0.8.5" +rand = "0.9.0" [lints.rust] unsafe_code = "deny" diff --git a/storage/Cargo.toml b/storage/Cargo.toml index e390de49d4..a3ff23ea46 100644 --- a/storage/Cargo.toml +++ b/storage/Cargo.toml @@ -24,7 +24,7 @@ bitfield = "0.17.0" fastrace = { version = "0.7.4" } [dev-dependencies] -rand = "0.8.5" +rand = "0.9.0" test-case = "3.3.1" criterion = { version = "0.5.1", features = ["async_tokio", "html_reports"] } pprof = { version = "0.14.0", features = ["flamegraph"] }