Skip to content

Commit

Permalink
fix: transfer cache in prepareNextSlot epoch transition (#6068)
Browse files Browse the repository at this point in the history
  • Loading branch information
twoeths authored Nov 8, 2023
1 parent d3f40d2 commit c8e6b67
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
3 changes: 2 additions & 1 deletion packages/beacon-node/src/chain/prepareNextSlot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,8 @@ export class PrepareNextSlotScheduler {
const prepareState = await this.chain.regen.getBlockSlotState(
headRoot,
prepareSlot,
{dontTransferCache: true},
// the 1st slot of next epoch will likely use this Previous Root Checkpoint state so we transfer cache here
{dontTransferCache: false},
RegenCaller.precomputeEpoch
);

Expand Down
7 changes: 0 additions & 7 deletions packages/beacon-node/src/chain/regen/queued.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,14 +149,7 @@ export class QueuedStateRegenerator implements IStateRegenerator {
if (parentEpoch < blockEpoch) {
const checkpointState = this.checkpointStateCache.getLatest(parentRoot, blockEpoch);
if (checkpointState && computeEpochAtSlot(checkpointState.slot) === blockEpoch) {
// TODO: Miss-use of checkpointStateCache here
return checkpointState;
// console.error({
// "checkpointState.slot": checkpointState.slot,
// "block.slot": block.slot,
// blockEpoch,
// blockEpochStartSlot: computeStartSlotAtEpoch(blockEpoch),
// });
}
}

Expand Down

0 comments on commit c8e6b67

Please sign in to comment.