Merge remote-tracking branch 'origin/stable' into release-v7.1.0

This commit is contained in:
Michael Sproul
2025-07-09 11:19:16 +10:00
5 changed files with 66 additions and 4 deletions

View File

@@ -345,7 +345,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 =