Skip to content

Commit

Permalink
Update chain.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
dapplion authored Mar 1, 2022
1 parent 8c4b13e commit dfa6731
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions packages/lodestar/src/chain/chain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import {IChainOptions} from "./options";
import {IStateRegenerator, QueuedStateRegenerator, RegenCaller} from "./regen";
import {initializeForkChoice} from "./forkChoice";
import {restoreStateCaches} from "./initState";
import {IBlsVerifier, BlsMultiThreadWorkerPool} from "./bls";
import {IBlsVerifier, BlsSingleThreadVerifier, BlsMultiThreadWorkerPool} from "./bls";
import {
SeenAttesters,
SeenAggregators,
Expand All @@ -44,7 +44,6 @@ import {IEth1ForBlockProduction} from "../eth1";
import {IExecutionEngine} from "../executionEngine";
import {PrecomputeNextEpochTransitionScheduler} from "./precomputeNextEpochTransition";
import {ReprocessController} from "./reprocess";
import {BlsSingleThreadVerifier} from "../chain/bls";

export class BeaconChain implements IBeaconChain {
readonly genesisTime: Number64;
Expand Down Expand Up @@ -120,11 +119,11 @@ export class BeaconChain implements IBeaconChain {

const signal = this.abortController.signal;
const emitter = new ChainEventEmitter();
const blsModules = {logger, metrics, signal: this.abortController.signal};
// by default, verify signatures on both main threads and worker threads
const bls = opts.blsVerifyAllMainThread
? new BlsSingleThreadVerifier({metrics})
: new BlsMultiThreadWorkerPool(opts, blsModules);
: new BlsMultiThreadWorkerPool(opts, {logger, metrics, signal: this.abortController.signal});

const clock = new LocalClock({config, emitter, genesisTime: this.genesisTime, signal});
const stateCache = new StateContextCache({metrics});
const checkpointStateCache = new CheckpointStateCache({metrics});
Expand Down

0 comments on commit dfa6731

Please sign in to comment.