Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: remove now useless bls init #6513

Merged
merged 2 commits into from
Mar 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
20 changes: 0 additions & 20 deletions packages/light-client/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
import mitt from "mitt";
import {init as initBls} from "@chainsafe/bls/switchable";
import {fromHexString, toHexString} from "@chainsafe/ssz";
import {EPOCHS_PER_SYNC_COMMITTEE_PERIOD} from "@lodestar/params";
import {phase0, RootHex, Slot, SyncPeriod, allForks} from "@lodestar/types";
import {createBeaconConfig, BeaconConfig, ChainForkConfig} from "@lodestar/config";
import {isErrorAborted, sleep} from "@lodestar/utils";
import {getCurrentSlot, slotWithFutureTolerance, timeUntilNextEpoch} from "./utils/clock.js";
import {isNode} from "./utils/utils.js";
import {chunkifyInclusiveRange} from "./utils/chunkify.js";
import {LightclientEmitter, LightclientEvent} from "./events.js";
import {getLcLoggerConsole, ILcLogger} from "./utils/logger.js";
Expand Down Expand Up @@ -153,12 +151,6 @@ export class Lightclient {
): Promise<Lightclient> {
const {transport, checkpointRoot} = args;

// Initialize the BLS implementation. This may requires initializing the WebAssembly instance
// so why it's an async process. This should be initialized once before any bls operations.
// This process has to be done manually because of an issue in Karma runner
// https://github.com/karma-runner/karma/issues/3804
await initBls(isNode ? "blst-native" : "herumi");

// Fetch bootstrap state with proof at the trusted block root
const {data: bootstrap} = await transport.getBootstrap(toHexString(checkpointRoot));

Expand Down Expand Up @@ -189,12 +181,6 @@ export class Lightclient {
}

async sync(fromPeriod: SyncPeriod, toPeriod: SyncPeriod): Promise<void> {
// Initialize the BLS implementation. This may requires initializing the WebAssembly instance
// so why it's a an async process. This should be initialized once before any bls operations.
// This process has to be done manually because of an issue in Karma runner
// https://github.com/karma-runner/karma/issues/3804
await initBls(isNode ? "blst-native" : "herumi");

const periodRanges = chunkifyInclusiveRange(fromPeriod, toPeriod, MAX_PERIODS_PER_REQUEST);

for (const [fromPeriodRng, toPeriodRng] of periodRanges) {
Expand All @@ -211,12 +197,6 @@ export class Lightclient {
}

private async runLoop(): Promise<void> {
// Initialize the BLS implementation. This may requires initializing the WebAssembly instance
// so why it's a an async process. This should be initialized once before any bls operations.
// This process has to be done manually because of an issue in Karma runner
// https://github.com/karma-runner/karma/issues/3804
await initBls(isNode ? "blst-native" : "herumi");

// eslint-disable-next-line no-constant-condition
while (true) {
const currentPeriod = computeSyncPeriodAtSlot(this.currentSlot);
Expand Down