Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent writing to state cache when migrating the database #7067

Merged
merged 2 commits into from
Mar 4, 2025

Conversation

eserilev
Copy link
Collaborator

@eserilev eserilev commented Mar 3, 2025

Added a new flag update_cache to get_state. When set to false, prevent writing fetched state to the cache

@@ -821,7 +821,7 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
.get_blinded_block(&block_root)?
.ok_or(Error::MissingBeaconBlock(block_root))?;
let state = self
.get_state(&block.state_root(), Some(block.slot()))?
.get_state(&block.state_root(), Some(block.slot()), true)?
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only used in tests so doesn't matter

.get_state(
&genesis_block.state_root(),
Some(genesis_block.slot()),
true,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is ok as we almost always have the genesis state in the freezer

- add state-cache-headroom flag to control pruning
- prune old epoch boundary states ahead of mid-epoch states
- never prune head block's state
- avoid caching ancestor states unless they are on an epoch boundary
@michaelsproul michaelsproul merged commit defdc59 into sigp:holesky-rescue Mar 4, 2025
12 of 23 checks passed
@michaelsproul michaelsproul added the v7.0.0-beta.2 Second hacky Holesky rescue release label Mar 5, 2025
@michaelsproul michaelsproul mentioned this pull request Mar 5, 2025
13 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
v7.0.0-beta.2 Second hacky Holesky rescue release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants