Skip to content

Commit

Permalink
Fix CI
Browse files Browse the repository at this point in the history
  • Loading branch information
ensi321 committed Oct 17, 2024
1 parent 843a2a8 commit 2edf7a2
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 10 deletions.
3 changes: 1 addition & 2 deletions packages/beacon-node/test/spec/presets/operations.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,7 @@ const operationFns: Record<string, BlockProcessFn<CachedBeaconStateAllForks>> =
},

deposit_request: (state, testCase: {deposit_request: electra.DepositRequest}) => {
const fork = state.config.getForkSeq(state.slot);
blockFns.processDepositRequest(fork, state as CachedBeaconStateElectra, testCase.deposit_request);
blockFns.processDepositRequest(state as CachedBeaconStateElectra, testCase.deposit_request);
},

consolidation_request: (state, testCase: {consolidation_request: electra.ConsolidationRequest}) => {
Expand Down
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
6 changes: 1 addition & 5 deletions packages/state-transition/src/block/processDepositRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,7 @@ import {ForkSeq, UNSET_DEPOSIT_REQUESTS_START_INDEX} from "@lodestar/params";

import {CachedBeaconStateElectra} from "../types.js";

export function processDepositRequest(
fork: ForkSeq,
state: CachedBeaconStateElectra,
depositRequest: electra.DepositRequest
): void {
export function processDepositRequest(state: CachedBeaconStateElectra, depositRequest: electra.DepositRequest): void {
if (state.depositRequestsStartIndex === UNSET_DEPOSIT_REQUESTS_START_INDEX) {
state.depositRequestsStartIndex = BigInt(depositRequest.index);
}
Expand Down
2 changes: 1 addition & 1 deletion packages/state-transition/src/block/processOperations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export function processOperations(
const bodyElectra = body as electra.BeaconBlockBody;

for (const depositRequest of bodyElectra.executionRequests.deposits) {
processDepositRequest(fork, stateElectra, depositRequest);
processDepositRequest(stateElectra, depositRequest);
}

for (const elWithdrawalRequest of bodyElectra.executionRequests.withdrawals) {
Expand Down

0 comments on commit 2edf7a2

Please sign in to comment.