Skip to content

Commit

Permalink
Log warning if validator index can't be resolved
Browse files Browse the repository at this point in the history
  • Loading branch information
nflaig committed Sep 27, 2024
1 parent 618f89f commit e595ab7
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/beacon-node/src/api/impl/beacon/state/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ import {
export function getBeaconStateApi({
chain,
config,
}: Pick<ApiModules, "chain" | "config">): ApplicationMethods<routes.beacon.state.Endpoints> {
logger,
}: Pick<ApiModules, "chain" | "config" | "logger">): ApplicationMethods<routes.beacon.state.Endpoints> {
async function getState(
stateId: routes.beacon.StateId
): Promise<{state: BeaconStateAllForks; executionOptimistic: boolean; finalized: boolean}> {
Expand Down Expand Up @@ -98,6 +99,8 @@ export function getBeaconStateApi({
currentEpoch
);
validatorResponses.push(validatorResponse);
} else {
logger.warn(resp.reason, {id});
}
}
return {
Expand Down Expand Up @@ -144,6 +147,8 @@ export function getBeaconStateApi({
const index = resp.validatorIndex;
const {pubkey, activationEpoch} = state.validators.getReadonly(index);
validatorIdentities.push({index, pubkey, activationEpoch});
} else {
logger.warn(resp.reason, {id});
}
}
} else {
Expand Down

0 comments on commit e595ab7

Please sign in to comment.