Skip to content

Commit

Permalink
chore: add more comments
Browse files Browse the repository at this point in the history
  • Loading branch information
twoeths committed Apr 22, 2023
1 parent f3e4e5b commit de5dd3b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/beacon-node/src/chain/chain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -338,8 +338,9 @@ export class BeaconChain implements IBeaconChain {
}

async getHeadStateAtEpoch(epoch: Epoch, regenCaller: RegenCaller): Promise<CachedBeaconStateAllForks> {
// using getHeadState() means we'll use checkpointStateCache if it's available
const headState = this.getHeadState();
// head is in current epoch, or we pulled up head from previous epoch already
// head state is in the same epoch, or we pulled up head state already from past epoch
if (computeEpochAtSlot(headState.slot) <= epoch) {
// should go to this most of the time
return this.getHeadState();
Expand Down

0 comments on commit de5dd3b

Please sign in to comment.