Skip to content

Commit

Permalink
Assert loaded state epoch matches requested
Browse files Browse the repository at this point in the history
  • Loading branch information
nflaig committed Oct 11, 2024
1 parent 2c21f1e commit 439d26a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/beacon-node/src/api/impl/validator/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -941,6 +941,10 @@ export function getValidatorApi(
},
{skipSyncPubkeys: true, skipSyncCommitteeCache: true}
);

if (state.epochCtx.epoch !== epoch) {
throw Error(`Loaded state epoch ${state.epochCtx.epoch} does not match requested epoch ${epoch}`);
}
}
}

Expand Down

0 comments on commit 439d26a

Please sign in to comment.