Skip to content

Commit

Permalink
Improve fork_choice spec test runner's time (#5277)
Browse files Browse the repository at this point in the history
  • Loading branch information
twoeths authored Mar 18, 2023
1 parent 7204718 commit 794ebdd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions packages/beacon-node/test/spec/presets/fork_choice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {CheckpointWithHex, ForkChoice} from "@lodestar/fork-choice";
import {phase0, allForks, bellatrix, ssz, RootHex, deneb} from "@lodestar/types";
import {bnToNum} from "@lodestar/utils";
import {createBeaconConfig} from "@lodestar/config";
import {ForkSeq} from "@lodestar/params";
import {ForkSeq, isForkBlobs} from "@lodestar/params";
import {BeaconChain, ChainEvent} from "../../../src/chain/index.js";
import {createCachedBeaconStateTest} from "../../utils/cachedBeaconState.js";
import {testLogger} from "../../utils/logger.js";
Expand Down Expand Up @@ -42,8 +42,10 @@ export const forkChoiceTest = (opts: {onlyPredefinedResponses: boolean}): TestRu
) => {
return {
testFunction: async (testcase) => {
await initCKZG();
loadEthereumTrustedSetup();
if (isForkBlobs(fork)) {
await initCKZG();
loadEthereumTrustedSetup();
}

const {steps, anchorState} = testcase;
const currentSlot = anchorState.slot;
Expand Down
2 changes: 1 addition & 1 deletion packages/params/src/forkName.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export function isForkExecution(fork: ForkName): fork is ForkExecution {

export type ForkWithdrawals = Exclude<ForkExecution, ForkName.bellatrix>;
export function isForkWithdrawals(fork: ForkName): fork is ForkWithdrawals {
return isForkExecution(fork) && fork !== ForkName.capella;
return isForkExecution(fork) && fork !== ForkName.bellatrix;
}

export type ForkBlobs = Exclude<ForkExecution, ForkName.bellatrix | ForkName.capella>;
Expand Down

0 comments on commit 794ebdd

Please sign in to comment.