Skip to content

Commit be7a772

Browse files
fixes CI
1 parent b6874b8 commit be7a772

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

beacon_node/store/src/state_cache.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -206,10 +206,10 @@ impl<E: EthSpec> StateCache<E> {
206206
// Do not attempt to rebase states prior to the finalized state. This method might be called
207207
// with states on the hdiff grid prior to finalization, as part of the reconstruction of
208208
// some later unfinalized state.
209-
if let Some(finalized_state) = &self.finalized_state {
210-
if state.slot() >= finalized_state.state.slot() {
211-
state.rebase_on(&finalized_state.state, spec)?;
212-
}
209+
if let Some(finalized_state) = &self.finalized_state
210+
&& state.slot() >= finalized_state.state.slot()
211+
{
212+
state.rebase_on(&finalized_state.state, spec)?;
213213
}
214214

215215
Ok(())
@@ -436,7 +436,7 @@ impl<E: EthSpec> StateCache<E> {
436436
// }
437437
for (_, (_, state)) in &self.states {
438438
total_bytes += tracker
439-
.track_item(&BeaconStateWrapper(&state))
439+
.track_item(&BeaconStateWrapper(state))
440440
.differential_size;
441441
}
442442

@@ -454,7 +454,7 @@ impl<E: EthSpec> StateCache<E> {
454454
total_bytes as i64,
455455
);
456456

457-
let batch = self.headroom.get().max(5).min(64); // tune batch size
457+
let batch = self.headroom.get().clamp(5, 64); // tune batch size
458458

459459
while total_bytes > self.max_cached_bytes {
460460
// Cull the cache until we are under the max_cached_bytes limit.

book/src/help_bn.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -380,6 +380,9 @@ Options:
380380
--state-cache-headroom <N>
381381
Minimum number of states to cull from the state cache when it gets
382382
full [default: 1]
383+
--state-cache-max-bytes <BYTES>
384+
Specifies the maximum size of the state cache in bytes [default:
385+
536870912]
383386
--state-cache-size <STATE_CACHE_SIZE>
384387
Specifies the size of the state cache [default: 128]
385388
--suggested-fee-recipient <SUGGESTED-FEE-RECIPIENT>

0 commit comments

Comments
 (0)