Skip to content

Commit

Permalink
fix benchmark
Browse files Browse the repository at this point in the history
  • Loading branch information
ensi321 committed Oct 16, 2024
1 parent 0d89ff5 commit 7807534
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/state-transition/src/block/processDeposit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,11 @@ export function applyDeposit(
state: CachedBeaconStateAllForks,
deposit: DepositData | DepositRequest
): void {
const {config, epochCtx} = state;
const {config, epochCtx, validators} = state;
const {pubkey, withdrawalCredentials, amount, signature} = deposit;

const cachedIndex = epochCtx.getValidatorIndex(pubkey);
const isNewValidator = cachedIndex === null || !Number.isSafeInteger(cachedIndex);
const isNewValidator = cachedIndex === null || !Number.isSafeInteger(cachedIndex) || cachedIndex >= validators.length;

if (fork < ForkSeq.electra) {
if (isNewValidator) {
Expand Down

0 comments on commit 7807534

Please sign in to comment.