mirror of
https://github.com/sigp/lighthouse.git
synced 2026-04-20 14:28:37 +00:00
Remove state lru cache (#8724)
N/A In https://github.com/sigp/lighthouse/pull/4801 , we added a state lru cache to avoid having too many states in memory which was a concern with 200mb+ states pre tree-states. With https://github.com/sigp/lighthouse/pull/5891 , we made the overflow cache a simpler in memory lru cache that can only hold 32 pending states at the most and doesn't flush anything to disk. As noted in #5891, we can always fetch older blocks which never became available over rpc if they become available later. Since we merged tree states, I don't think the state lru cache is relevant anymore. Instead of having the `DietAvailabilityPendingExecutedBlock` that stores only the state root, we can just store the full state in the `AvailabilityPendingExecutedBlock`. Given entries in the cache can span max 1 epoch (cache size is 32), the underlying `BeaconState` objects in the cache share most of their memory. The state_lru_cache is one level of indirection that doesn't give us any benefit. Please check me on this cc @dapplion Co-Authored-By: Pawan Dhananjay <pawandhananjay@gmail.com>
This commit is contained in:
@@ -222,7 +222,6 @@ pub fn test_da_checker<E: EthSpec>(
|
||||
Duration::from_secs(spec.seconds_per_slot),
|
||||
);
|
||||
let kzg = get_kzg(&spec);
|
||||
let store = Arc::new(HotColdDB::open_ephemeral(<_>::default(), spec.clone()).unwrap());
|
||||
let ordered_custody_column_indices = generate_data_column_indices_rand_order::<E>();
|
||||
let custody_context = Arc::new(CustodyContext::new(
|
||||
node_custody_type,
|
||||
@@ -234,7 +233,6 @@ pub fn test_da_checker<E: EthSpec>(
|
||||
complete_blob_backfill,
|
||||
slot_clock,
|
||||
kzg,
|
||||
store,
|
||||
custody_context,
|
||||
spec,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user