Change default state cache size back to 128 (#7364)

Closes:

- https://github.com/sigp/lighthouse/issues/7363


  - Change default state cache size back to 128.
- Make state pruning properly LRU rather than MSU after skipping the cull-exempt states.
This commit is contained in:
Michael Sproul
2025-04-29 11:43:25 +10:00
committed by GitHub
parent 54f7bc5b2c
commit 6c8770e80d
5 changed files with 48 additions and 28 deletions

View File

@@ -245,7 +245,9 @@ impl<E: EthSpec> StateCache<E> {
let mut old_boundary_state_roots = vec![];
let mut good_boundary_state_roots = vec![];
for (&state_root, (_, state)) in self.states.iter().skip(cull_exempt) {
// Skip the `cull_exempt` most-recently used, then reverse the iterator to start at
// least-recently used states.
for (&state_root, (_, state)) in self.states.iter().skip(cull_exempt).rev() {
let is_advanced = state.slot() > state.latest_block_header().slot;
let is_boundary = state.slot() % E::slots_per_epoch() == 0;
let could_finalize =