From 62d401cea69e9b756d44284227ed62db6cd9bad2 Mon Sep 17 00:00:00 2001 From: g11tech Date: Sun, 5 May 2024 00:17:57 +0530 Subject: [PATCH] chore: fix the rebase build (#6735) * chore: fix the rebase build * fix test --- packages/beacon-node/src/chain/regen/queued.ts | 2 +- .../perf/chain/stateCache/updateUnfinalizedPubkeys.test.ts | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/packages/beacon-node/src/chain/regen/queued.ts b/packages/beacon-node/src/chain/regen/queued.ts index 788fe4074529..e3364f782993 100644 --- a/packages/beacon-node/src/chain/regen/queued.ts +++ b/packages/beacon-node/src/chain/regen/queued.ts @@ -201,7 +201,7 @@ export class QueuedStateRegenerator implements IStateRegenerator { */ updateUnfinalizedPubkeys(validators: UnfinalizedPubkeyIndexMap): void { let numStatesUpdated = 0; - const states = this.stateCache.getStates(); + const states = this.blockStateCache.getStates(); const cpStates = this.checkpointStateCache.getStates(); // Add finalized pubkeys to all states. diff --git a/packages/beacon-node/test/perf/chain/stateCache/updateUnfinalizedPubkeys.test.ts b/packages/beacon-node/test/perf/chain/stateCache/updateUnfinalizedPubkeys.test.ts index 39bf1a1551c9..b8f5c30a70ea 100644 --- a/packages/beacon-node/test/perf/chain/stateCache/updateUnfinalizedPubkeys.test.ts +++ b/packages/beacon-node/test/perf/chain/stateCache/updateUnfinalizedPubkeys.test.ts @@ -7,7 +7,8 @@ import bls from "@chainsafe/bls"; import {ssz} from "@lodestar/types"; import {type CachedBeaconStateAllForks, PubkeyIndexMap} from "@lodestar/state-transition"; import {bytesToBigInt, intToBytes} from "@lodestar/utils"; -import {InMemoryCheckpointStateCache, StateContextCache} from "../../../../src/chain/stateCache/index.js"; +import {InMemoryCheckpointStateCache, BlockStateCacheImpl} from "../../../../src/chain/stateCache/index.js"; +import {BlockStateCache} from "../../../../src/chain/stateCache/types.js"; import {generateCachedElectraState} from "../../../utils/state.js"; // Benchmark date from Mon Nov 21 2023 - Intel Core i7-9750H @ 2.60Ghz @@ -22,7 +23,7 @@ describe("updateUnfinalizedPubkeys perf tests", function () { const numStateCache = 3 * 32; let checkpointStateCache: InMemoryCheckpointStateCache; - let stateCache: StateContextCache; + let stateCache: BlockStateCache; const unfinalizedPubkey2Index = generatePubkey2Index(0, Math.max.apply(null, numPubkeysToBeFinalizedCases)); const baseState = generateCachedElectraState(); @@ -36,7 +37,7 @@ describe("updateUnfinalizedPubkeys perf tests", function () { baseState.epochCtx.index2pubkey = []; checkpointStateCache = new InMemoryCheckpointStateCache({}); - stateCache = new StateContextCache({}); + stateCache = new BlockStateCacheImpl({}); for (let i = 0; i < numCheckpointStateCache; i++) { const clonedState = baseState.clone();