Switch trie cache random seed (#1935)

Use a more secure seed for hashsets of cache.
This commit is contained in:
cheme
2023-10-20 05:13:19 +02:00
committed by GitHub
parent e1e0381380
commit f4c4c0fe29
3 changed files with 8 additions and 1 deletions
+5 -1
View File
@@ -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 {