Skip to content

Commit

Permalink
Clarify not yet initialized error for prev proposer duties
Browse files Browse the repository at this point in the history
  • Loading branch information
nflaig committed Oct 10, 2024
1 parent 13002fd commit 6f23703
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/beacon-node/src/api/impl/validator/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -973,7 +973,9 @@ export function getValidatorApi(
case stateEpoch - 1: {
const indexesPrevEpoch = state.epochCtx.getBeaconProposersPrevEpoch();
if (indexesPrevEpoch === null) {
throw new ApiError(500, `Proposer duties for previous epoch ${epoch} not yet initialized`);
// Should not happen as previous proposer duties should be initialized for head state
// and if we load state from `Uint8Array` it will always be the state of requested epoch
throw Error(`Proposer duties for previous epoch ${epoch} not yet initialized`);
}
indexes = indexesPrevEpoch;
break;
Expand Down

0 comments on commit 6f23703

Please sign in to comment.