-
-
Notifications
You must be signed in to change notification settings - Fork 314
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
Non-checkpoint states are added into checkpoint cache #5848
Comments
yes this happens after we process the 1st block of an epoch where to add more context, this |
It's an issue yes because if there's a re-org on the begning of the epoch you can no longer use that state because it has already processed the first block. If we want to store a regular state in the cache, that's why the state cache exist. Why duplicate it and store also on checkpoint state where it may be miss-used? |
Right now we store 2 checkpoint states per epoch:
So this works as designed, we need to add comments to different places for later reference |
also probably we need to change the condition for the spec checkpoint above to |
@twoeths is this resolved in n-historical-states? |
Currently it looks like we are adding non-checkpoint states into the checkpoint cache
lodestar/packages/beacon-node/src/chain/stateCache/stateContextCheckpointsCache.ts
Line 55 in 5f7f995
This happens when importing a block once every epoch
lodestar/packages/beacon-node/src/chain/blocks/importBlock.ts
Lines 331 to 335 in 9034831
Non-checkpoint states can be determined by checking the state root in block header is a zero hash
We add 2 different states to checkpoint cache each epoch and one of them is not a checkpoint state
cc @dapplion @tuyennhv @wemeetagain
The text was updated successfully, but these errors were encountered: