Switch trie cache random seed (#1935)

Use a more secure seed for hashsets of cache.
This commit is contained in:
cheme authored and GitHub committed 2023-10-20 12:13:19 +09:00
1 parent e1e0381380
commit f4c4c0fe29
3 files changed
+8 -1

No files matched your search

+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 {