mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-07 03:48:01 +00:00
Switch trie cache random seed (#1935)
Use a more secure seed for hashsets of cache.
This commit is contained in:
Generated
+1
@@ -17527,6 +17527,7 @@ dependencies = [
|
||||
"nohash-hasher",
|
||||
"parity-scale-codec",
|
||||
"parking_lot 0.12.1",
|
||||
"rand 0.8.5",
|
||||
"scale-info",
|
||||
"schnellru",
|
||||
"sp-core",
|
||||
|
||||
@@ -26,6 +26,7 @@ lazy_static = { version = "1.4.0", optional = true }
|
||||
memory-db = { version = "0.32.0", default-features = false }
|
||||
nohash-hasher = { version = "0.2.0", optional = true }
|
||||
parking_lot = { version = "0.12.1", optional = true }
|
||||
rand = { version = "0.8", optional = true }
|
||||
scale-info = { version = "2.5.0", default-features = false, features = ["derive"] }
|
||||
thiserror = { version = "1.0.48", optional = true }
|
||||
tracing = { version = "0.1.29", optional = true }
|
||||
@@ -53,6 +54,7 @@ std = [
|
||||
"memory-db/std",
|
||||
"nohash-hasher",
|
||||
"parking_lot",
|
||||
"rand",
|
||||
"scale-info/std",
|
||||
"schnellru",
|
||||
"sp-core/std",
|
||||
|
||||
+5
-1
@@ -30,7 +30,11 @@ use std::{
|
||||
use trie_db::{node::NodeOwned, CachedValue};
|
||||
|
||||
lazy_static::lazy_static! {
|
||||
static ref RANDOM_STATE: ahash::RandomState = ahash::RandomState::default();
|
||||
static ref RANDOM_STATE: ahash::RandomState = {
|
||||
use rand::Rng;
|
||||
let mut rng = rand::thread_rng();
|
||||
ahash::RandomState::generate_with(rng.gen(), rng.gen(), rng.gen(), rng.gen())
|
||||
};
|
||||
}
|
||||
|
||||
pub struct SharedNodeCacheLimiter {
|
||||
|
||||
Reference in New Issue
Block a user