Move status cache serialization to the Snapshot Packager service (#6081)
* Move status cache serialization to the Snapshot Packager service * Minor comment updates * use ok_or_else instead of ok_or * satus cache * Remove assert when snapshot format is wrong * Fix compile * Remove slots_to_snapshot from bank forks * Address review comment * Remove unused imports
This commit is contained in:
@@ -1,13 +1,13 @@
|
||||
use log::*;
|
||||
use rand::{thread_rng, Rng};
|
||||
use serde::Serialize;
|
||||
use solana_sdk::clock::{Slot, MAX_HASH_AGE_IN_SECONDS};
|
||||
use solana_sdk::clock::{Slot, MAX_RECENT_BLOCKHASHES};
|
||||
use solana_sdk::hash::Hash;
|
||||
use solana_sdk::signature::Signature;
|
||||
use std::collections::{HashMap, HashSet};
|
||||
use std::sync::{Arc, Mutex};
|
||||
|
||||
pub const MAX_CACHE_ENTRIES: usize = MAX_HASH_AGE_IN_SECONDS;
|
||||
pub const MAX_CACHE_ENTRIES: usize = MAX_RECENT_BLOCKHASHES;
|
||||
const CACHED_SIGNATURE_SIZE: usize = 20;
|
||||
|
||||
// Store forks in a single chunk of memory to avoid another lookup.
|
||||
@@ -430,4 +430,9 @@ mod tests {
|
||||
assert_eq!(cache, status_cache);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_age_sanity() {
|
||||
assert!(MAX_CACHE_ENTRIES <= MAX_RECENT_BLOCKHASHES);
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user