chore: enable organize imports for linting (#8410)

**Motivation**

Enable the organize import back which was disabled in #7982 to isolate
the changes for import ordering

**Description**

- Update the organize import config 
- Fix all linting errors

**Steps to test or reproduce**

- Run all tests

---------

Co-authored-by: Cayman <caymannava@gmail.com>
This commit is contained in:
Nazar Hussain
2025-09-20 01:59:28 +02:00
committed by GitHub
parent 3d8b04e1a0
commit feed916580
547 changed files with 974 additions and 991 deletions

View File

@@ -12,7 +12,42 @@
"assist": {
"actions": {
"source": {
"organizeImports": { "level": "off", "options": { "identifierOrder": "lexicographic" } },
"organizeImports": {
"level": "on",
"options": {
"identifierOrder": "lexicographic",
"groups": [
[
// Bun modules
":BUN:",
// Node.js modules
":NODE:"
],
[
// Modules imported with the `npm:` protocol
"npm:*",
"npm:*/**"
],
[
// Libraries
":PACKAGE:",
// Libraries
":PACKAGE_WITH_PROTOCOL:",
"!@chainsafe/**",
"!@lodestar/**"
],
[
// URLs
":URL:",
// Sharp aliases
":ALIAS:"
],
["@chainsafe/**", "@lodestar/**"],
// All other paths
":PATH:"
]
}
},
"useSortedKeys": { "level": "off", "options": { "sortOrder": "lexicographic" } }
}
}

View File

@@ -7,7 +7,6 @@ import {
IHttpClient,
} from "../../utils/client/index.js";
import {Endpoints} from "../routes/index.js";
import * as beacon from "./beacon.js";
import * as configApi from "./config.js";
import * as debug from "./debug.js";

View File

@@ -4,7 +4,8 @@ import type {Endpoints} from "./routes/index.js";
import * as routes from "./routes/index.js";
export {routes};
export {getClient, type ApiClient} from "./client/index.js";
export {type ApiClient, getClient} from "./client/index.js";
export type {Endpoints};
// Declare namespaces for CLI options

View File

@@ -10,26 +10,27 @@ import * as state from "./state.js";
// NOTE: We choose to split the block, pool, state and rewards namespaces so the files are not too big.
// However, for a consumer all these methods are within the same service "beacon"
export {block, pool, state, rewards};
export type {BlockHeaderResponse, BlockId} from "./block.js";
export {BroadcastValidation} from "./block.js";
export type {BlockId, BlockHeaderResponse} from "./block.js";
export type {
BlockRewards,
AttestationsRewards,
BlockRewards,
IdealAttestationsReward,
TotalAttestationsReward,
SyncCommitteeRewards,
TotalAttestationsReward,
} from "./rewards.js";
// TODO: Review if re-exporting all these types is necessary
export type {
StateId,
ValidatorId,
ValidatorIdentities,
ValidatorStatus,
FinalityCheckpoints,
ValidatorResponse,
ValidatorBalance,
EpochCommitteeResponse,
EpochSyncCommitteeResponse,
FinalityCheckpoints,
StateId,
ValidatorBalance,
ValidatorId,
ValidatorIdentities,
ValidatorResponse,
ValidatorStatus,
} from "./state.js";
export type Endpoints = block.Endpoints &

View File

@@ -1,7 +1,6 @@
import {ContainerType, ValueOf} from "@chainsafe/ssz";
import {ChainForkConfig} from "@lodestar/config";
import {Epoch, ssz} from "@lodestar/types";
import {ArrayOf, JsonOnlyReq} from "../../../utils/codecs.js";
import {Endpoint, RouteDefinitions, Schema} from "../../../utils/index.js";
import {ExecutionOptimisticAndFinalizedCodec, ExecutionOptimisticAndFinalizedMeta} from "../../../utils/metadata.js";

View File

@@ -19,7 +19,6 @@ import {
ssz,
sszTypesFor,
} from "@lodestar/types";
import {EmptyMeta, EmptyResponseCodec, EmptyResponseData} from "../../utils/codecs.js";
import {getPostAltairForkTypes, getPostBellatrixForkTypes} from "../../utils/fork.js";
import {Endpoint, RouteDefinitions, Schema} from "../../utils/index.js";

View File

@@ -1,3 +1,4 @@
// biome-ignore assist/source/organizeImports: We want to keep these groups of imports together for better readability
import {Endpoints as BeaconEndpoints} from "./beacon/index.js";
import {Endpoints as ConfigEndpoints} from "./config.js";
import {Endpoints as DebugEndpoints} from "./debug.js";

View File

@@ -1,8 +1,7 @@
import {ChainForkConfig} from "@lodestar/config";
import type {FastifyInstance} from "fastify";
import {ChainForkConfig} from "@lodestar/config";
import {ApplicationMethods, FastifyRoute} from "../../utils/server/index.js";
import {Endpoints} from "../routes/index.js";
import * as beacon from "./beacon.js";
import * as configApi from "./config.js";
import * as debug from "./debug.js";

View File

@@ -1,9 +1,8 @@
import {ChainForkConfig} from "@lodestar/config";
import {HttpClient, HttpClientModules, HttpClientOptions, IHttpClient} from "../utils/client/httpClient.js";
import type {ApiClient} from "./client.js";
import {Endpoints} from "./routes.js";
import * as builder from "./client.js";
import {Endpoints} from "./routes.js";
// NOTE: Don't export server here so it's not bundled to all consumers

View File

@@ -13,7 +13,6 @@ import {
ssz,
} from "@lodestar/types";
import {fromHex, toPubkeyHex, toRootHex} from "@lodestar/utils";
import {
ArrayOf,
EmptyArgs,

View File

@@ -1,5 +1,5 @@
import {ChainForkConfig} from "@lodestar/config";
import type {FastifyInstance} from "fastify";
import {ChainForkConfig} from "@lodestar/config";
import {AnyEndpoint} from "../../utils/codecs.js";
import {ApplicationMethods, FastifyRoute, FastifyRoutes, createFastifyRoutes} from "../../utils/server/index.js";
import {Endpoints, getDefinitions} from "../routes.js";

View File

@@ -1,19 +1,19 @@
// Re-exporting beacon only for backwards compatibility
export * from "./beacon/index.js";
export {HttpStatusCode} from "./utils/httpStatusCode.js";
export {WireFormat} from "./utils/wireFormat.js";
export {HttpHeader, MediaType} from "./utils/headers.js";
export type {HttpErrorCodes, HttpSuccessCodes} from "./utils/httpStatusCode.js";
export {ApiResponse, HttpClient, defaultInit} from "./utils/client/index.js";
export type {ApiRequestInit} from "./utils/client/request.js";
export type {Endpoint} from "./utils/types.js";
export {ApiError} from "./utils/client/error.js";
export type {
ApiClientMethods,
IHttpClient,
HttpClientOptions,
HttpClientModules,
HttpClientOptions,
IHttpClient,
Metrics,
} from "./utils/client/index.js";
export {ApiError} from "./utils/client/error.js";
export {ApiResponse, HttpClient, defaultInit} from "./utils/client/index.js";
export type {ApiRequestInit} from "./utils/client/request.js";
export {HttpHeader, MediaType} from "./utils/headers.js";
export type {HttpErrorCodes, HttpSuccessCodes} from "./utils/httpStatusCode.js";
export {HttpStatusCode} from "./utils/httpStatusCode.js";
export type {Endpoint} from "./utils/types.js";
export {WireFormat} from "./utils/wireFormat.js";
// NOTE: Don't export server here so it's not bundled to all consumers

View File

@@ -5,21 +5,21 @@ import * as keymanager from "./client.js";
// NOTE: Don't export server here so it's not bundled to all consumers
export {ImportStatus, DeletionStatus, ImportRemoteKeyStatus, DeleteRemoteKeyStatus} from "./routes.js";
export type {
ResponseStatus,
SignerDefinition,
RemoteSignerDefinition,
KeystoreStr,
SlashingProtectionData,
PubkeyHex,
BuilderBoostFactorData,
Endpoints,
FeeRecipientData,
GraffitiData,
GasLimitData,
BuilderBoostFactorData,
GraffitiData,
KeystoreStr,
ProposerConfigResponse,
PubkeyHex,
RemoteSignerDefinition,
ResponseStatus,
SignerDefinition,
SlashingProtectionData,
} from "./routes.js";
export {DeleteRemoteKeyStatus, DeletionStatus, ImportRemoteKeyStatus, ImportStatus} from "./routes.js";
export type {ApiClient};

View File

@@ -1,5 +1,5 @@
import {ChainForkConfig} from "@lodestar/config";
import type {FastifyInstance} from "fastify";
import {ChainForkConfig} from "@lodestar/config";
import {AnyEndpoint} from "../../utils/codecs.js";
import {ApplicationMethods, FastifyRoute, FastifyRoutes, createFastifyRoutes} from "../../utils/server/index.js";
import {Endpoints, getDefinitions} from "../routes.js";

View File

@@ -1,5 +1,14 @@
import {ErrorAborted, Logger, MapDef, TimeoutError, isValidHttpUrl, retry, toPrintableUrl} from "@lodestar/utils";
import {fetch, isFetchError} from "@lodestar/utils";
import {
ErrorAborted,
Logger,
MapDef,
TimeoutError,
fetch,
isFetchError,
isValidHttpUrl,
retry,
toPrintableUrl,
} from "@lodestar/utils";
import {mergeHeaders} from "../headers.js";
import {HttpStatusCode} from "../httpStatusCode.js";
import {Endpoint} from "../types.js";

View File

@@ -1,6 +1,6 @@
export * from "./error.js";
export * from "./httpClient.js";
export * from "./method.js";
export * from "./metrics.js";
export * from "./request.js";
export * from "./response.js";
export * from "./error.js";

View File

@@ -1,5 +1,5 @@
import {mapValues} from "@lodestar/utils";
import type * as fastify from "fastify";
import {mapValues} from "@lodestar/utils";
import {getFastifySchema} from "../schema.js";
import {Endpoint, RouteDefinition, RouteDefinitions} from "../types.js";
import {toColonNotationPath} from "../urlFormat.js";

View File

@@ -1,5 +1,5 @@
import {createChainForkConfig, defaultChainConfig} from "@lodestar/config";
import {describe} from "vitest";
import {createChainForkConfig, defaultChainConfig} from "@lodestar/config";
import {getClient} from "../../../../src/beacon/client/beacon.js";
import {Endpoints} from "../../../../src/beacon/routes/beacon/index.js";
import {getRoutes} from "../../../../src/beacon/server/beacon.js";

View File

@@ -1,5 +1,5 @@
import {config} from "@lodestar/config/default";
import {describe, expect, it} from "vitest";
import {config} from "@lodestar/config/default";
import {getClient} from "../../../../src/beacon/client/config.js";
import {Endpoints, getDefinitions} from "../../../../src/beacon/routes/config.js";
import {getRoutes} from "../../../../src/beacon/server/config.js";

View File

@@ -1,9 +1,9 @@
import {FastifyInstance} from "fastify";
import {afterAll, beforeAll, describe, expect, it, vi} from "vitest";
import {toHexString} from "@chainsafe/ssz";
import {createChainForkConfig, defaultChainConfig} from "@lodestar/config";
import {ForkName} from "@lodestar/params";
import {ssz} from "@lodestar/types";
import {FastifyInstance} from "fastify";
import {afterAll, beforeAll, describe, expect, it, vi} from "vitest";
import {getClient} from "../../../../src/beacon/client/debug.js";
import {Endpoints, getDefinitions} from "../../../../src/beacon/routes/debug.js";
import {getRoutes} from "../../../../src/beacon/server/debug.js";

View File

@@ -1,7 +1,7 @@
import {config} from "@lodestar/config/default";
import {sleep} from "@lodestar/utils";
import {FastifyInstance} from "fastify";
import {afterAll, afterEach, beforeAll, beforeEach, describe, expect, it} from "vitest";
import {config} from "@lodestar/config/default";
import {sleep} from "@lodestar/utils";
import {getClient} from "../../../../src/beacon/client/events.js";
import {BeaconEvent, Endpoints, EventType, getDefinitions} from "../../../../src/beacon/routes/events.js";
import {getRoutes} from "../../../../src/beacon/server/events.js";

View File

@@ -1,5 +1,5 @@
import {createChainForkConfig, defaultChainConfig} from "@lodestar/config";
import {describe} from "vitest";
import {createChainForkConfig, defaultChainConfig} from "@lodestar/config";
import {getClient} from "../../../../src/beacon/client/lightclient.js";
import {Endpoints} from "../../../../src/beacon/routes/lightclient.js";
import {getRoutes} from "../../../../src/beacon/server/lightclient.js";

View File

@@ -1,7 +1,7 @@
import {config} from "@lodestar/config/default";
import {ForkName} from "@lodestar/params";
import {FastifyInstance} from "fastify";
import {afterAll, beforeAll, describe, expect, it} from "vitest";
import {config} from "@lodestar/config/default";
import {ForkName} from "@lodestar/params";
import {getClient} from "../../../../src/beacon/client/lodestar.js";
import {Endpoints, getDefinitions} from "../../../../src/beacon/routes/lodestar.js";
import {getRoutes} from "../../../../src/beacon/server/lodestar.js";

View File

@@ -1,5 +1,5 @@
import {config} from "@lodestar/config/default";
import {describe} from "vitest";
import {config} from "@lodestar/config/default";
import {getClient} from "../../../../src/beacon/client/node.js";
import {Endpoints} from "../../../../src/beacon/routes/node.js";
import {getRoutes} from "../../../../src/beacon/server/node.js";

View File

@@ -1,5 +1,5 @@
import {createChainForkConfig, defaultChainConfig} from "@lodestar/config";
import {describe} from "vitest";
import {createChainForkConfig, defaultChainConfig} from "@lodestar/config";
import {getClient} from "../../../../src/beacon/client/proof.js";
import {Endpoints} from "../../../../src/beacon/routes/proof.js";
import {getRoutes} from "../../../../src/beacon/server/proof.js";

View File

@@ -1,5 +1,5 @@
import {createChainForkConfig, defaultChainConfig} from "@lodestar/config";
import {describe} from "vitest";
import {createChainForkConfig, defaultChainConfig} from "@lodestar/config";
import {getClient} from "../../../../src/beacon/client/validator.js";
import {Endpoints} from "../../../../src/beacon/routes/validator.js";
import {getRoutes} from "../../../../src/beacon/server/validator.js";

View File

@@ -1,7 +1,7 @@
import path from "node:path";
import {fileURLToPath} from "node:url";
import {createChainForkConfig, defaultChainConfig} from "@lodestar/config";
import {beforeAll, describe, expect, it} from "vitest";
import {createChainForkConfig, defaultChainConfig} from "@lodestar/config";
import {routes} from "../../../src/beacon/index.js";
import {IgnoredProperty, runTestCheckAgainstSpec} from "../../utils/checkAgainstSpec.js";
import {fetchOpenApiSpec} from "../../utils/fetchOpenApiSpec.js";

View File

@@ -1,5 +1,5 @@
import {createChainForkConfig, defaultChainConfig} from "@lodestar/config";
import {describe} from "vitest";
import {createChainForkConfig, defaultChainConfig} from "@lodestar/config";
import {getClient} from "../../../src/builder/client.js";
import {Endpoints} from "../../../src/builder/routes.js";
import {getRoutes} from "../../../src/builder/server/index.js";

View File

@@ -1,7 +1,6 @@
import path from "node:path";
import {fileURLToPath} from "node:url";
import {createChainForkConfig, defaultChainConfig} from "@lodestar/config";
import {getDefinitions} from "../../../src/builder/routes.js";
import {runTestCheckAgainstSpec} from "../../utils/checkAgainstSpec.js";
import {fetchOpenApiSpec} from "../../utils/fetchOpenApiSpec.js";

View File

@@ -1,7 +1,6 @@
import {fromHexString} from "@chainsafe/ssz";
import {ForkName} from "@lodestar/params";
import {ssz} from "@lodestar/types";
import {Endpoints} from "../../../src/builder/routes.js";
import {GenericServerTestCases} from "../../utils/genericServerTest.js";

View File

@@ -1,8 +1,8 @@
import {IncomingMessage} from "node:http";
import {BooleanType, ContainerType, UintNumberType, ValueOf} from "@chainsafe/ssz";
import {ErrorAborted, TimeoutError, toBase64} from "@lodestar/utils";
import {RouteOptions, fastify} from "fastify";
import {afterEach, describe, expect, it, vi} from "vitest";
import {BooleanType, ContainerType, UintNumberType, ValueOf} from "@chainsafe/ssz";
import {ErrorAborted, TimeoutError, toBase64} from "@lodestar/utils";
import {WireFormat} from "../../../src/index.js";
import {addSszContentTypeParser} from "../../../src/server/index.js";
import {HttpClient, RouteDefinitionExtra} from "../../../src/utils/client/index.js";

View File

@@ -1,5 +1,5 @@
import {fetch} from "@lodestar/utils";
import {afterEach, beforeEach, describe, expect, it, vi} from "vitest";
import {fetch} from "@lodestar/utils";
import {HttpClient, RouteDefinitionExtra} from "../../../src/utils/client/index.js";
import {AnyEndpoint, EmptyRequestCodec, EmptyResponseCodec} from "../../../src/utils/codecs.js";
import {compileRouteUrlFormatter} from "../../../src/utils/urlFormat.js";

View File

@@ -1,5 +1,5 @@
import {config} from "@lodestar/config/default";
import {describe} from "vitest";
import {config} from "@lodestar/config/default";
import {getClient} from "../../../src/keymanager/client.js";
import {Endpoints} from "../../../src/keymanager/routes.js";
import {getRoutes} from "../../../src/keymanager/server/index.js";

View File

@@ -1,6 +1,6 @@
import {ChainForkConfig} from "@lodestar/config";
import {FastifyInstance} from "fastify";
import {MockInstance, afterAll, beforeAll, describe, expect, it} from "vitest";
import {ChainForkConfig} from "@lodestar/config";
import {ApiClientMethods, ApiRequestInit, HttpClient, IHttpClient} from "../../src/utils/client/index.js";
import {Endpoint} from "../../src/utils/index.js";
import {ApplicationMethods, ApplicationResponse, FastifyRoutes} from "../../src/utils/server/index.js";

View File

@@ -1,7 +1,7 @@
import {mapValues} from "@lodestar/utils";
import {FastifyInstance, fastify} from "fastify";
import {parse as parseQueryString} from "qs";
import {MockedObject, vi} from "vitest";
import {mapValues} from "@lodestar/utils";
import {Endpoint} from "../../src/utils/index.js";
import {ApplicationMethods, addSszContentTypeParser} from "../../src/utils/server/index.js";

View File

@@ -1,7 +1,7 @@
import {routes} from "@lodestar/api";
import {ApplicationMethods} from "@lodestar/api/server";
import {ExecutionStatus} from "@lodestar/fork-choice";
import {isForkPostDeneb, isForkPostFulu, ZERO_HASH_HEX} from "@lodestar/params";
import {ZERO_HASH_HEX, isForkPostDeneb, isForkPostFulu} from "@lodestar/params";
import {BeaconState, deneb, fulu, sszTypesFor} from "@lodestar/types";
import {fromAsync, toRootHex} from "@lodestar/utils";
import {isOptimisticBlock} from "../../../util/forkChoice.js";

View File

@@ -1,6 +1,6 @@
export * from "./validator/index.js";
export * from "./beacon/index.js";
export * from "./node/index.js";
export * from "./events/index.js";
export * from "./types.js";
export * from "./api.js";
export * from "./beacon/index.js";
export * from "./events/index.js";
export * from "./node/index.js";
export * from "./types.js";
export * from "./validator/index.js";

View File

@@ -1,6 +1,5 @@
import {ChainForkConfig} from "@lodestar/config";
import {Logger} from "@lodestar/utils";
import {IBeaconChain} from "../../chain/index.js";
import {IBeaconDb} from "../../db/index.js";
import {Metrics} from "../../metrics/index.js";

View File

@@ -1,9 +1,9 @@
import bearerAuthPlugin from "@fastify/bearer-auth";
import {fastifyCors} from "@fastify/cors";
import {addSszContentTypeParser} from "@lodestar/api/server";
import {ErrorAborted, Gauge, Histogram, Logger} from "@lodestar/utils";
import {FastifyInstance, FastifyRequest, errorCodes, fastify} from "fastify";
import {parse as parseQueryString} from "qs";
import {addSszContentTypeParser} from "@lodestar/api/server";
import {ErrorAborted, Gauge, Histogram, Logger} from "@lodestar/utils";
import {isLocalhostIP} from "../../util/ip.js";
import {ApiError, FailureList, IndexedError, NodeIsSyncing} from "../impl/errors.js";
import {HttpActiveSocketsTracker, SocketMetrics} from "./activeSockets.js";

View File

@@ -1,6 +1,5 @@
import {Endpoints} from "@lodestar/api";
import {BeaconApiMethods} from "@lodestar/api/beacon/server";
import {registerRoutes} from "@lodestar/api/beacon/server";
import {BeaconApiMethods, registerRoutes} from "@lodestar/api/beacon/server";
import {ChainForkConfig} from "@lodestar/config";
import {ErrorAborted, Logger} from "@lodestar/utils";
import {NodeIsSyncing} from "../impl/errors.js";

View File

@@ -1,9 +1,9 @@
import {Logger, sleep} from "@lodestar/utils";
import {ChainEventEmitter} from "./emitter.js";
import {Metrics} from "../metrics/metrics.js";
import {ChainForkConfig} from "@lodestar/config";
import {BlockInputColumns} from "./blocks/blockInput/index.js";
import {Logger, sleep} from "@lodestar/utils";
import {Metrics} from "../metrics/metrics.js";
import {DataColumnReconstructionCode, recoverDataColumnSidecars} from "../util/dataColumns.js";
import {BlockInputColumns} from "./blocks/blockInput/index.js";
import {ChainEventEmitter} from "./emitter.js";
/**
* Minimum time to wait before attempting reconstruction

View File

@@ -1,17 +1,17 @@
import {Logger} from "@lodestar/utils";
import {IExecutionEngine} from "../execution/index.js";
import {ChainEventEmitter} from "./emitter.js";
import {Metrics} from "../metrics/metrics.js";
import {ChainForkConfig} from "@lodestar/config";
import {IBlockInput, isBlockInputBlobs} from "./blocks/blockInput/index.js";
import {computeEpochAtSlot} from "@lodestar/state-transition";
import {Logger} from "@lodestar/utils";
import {BLOB_AND_PROOF_V2_RPC_BYTES} from "../execution/engine/types.js";
import {IExecutionEngine} from "../execution/index.js";
import {Metrics} from "../metrics/metrics.js";
import {callInNextEventLoop} from "../util/eventLoop.js";
import {
DataColumnEngineResult,
getBlobSidecarsFromExecution,
getDataColumnSidecarsFromExecution,
} from "../util/execution.js";
import {callInNextEventLoop} from "../util/eventLoop.js";
import {computeEpochAtSlot} from "@lodestar/state-transition";
import {BLOB_AND_PROOF_V2_RPC_BYTES} from "../execution/engine/types.js";
import {IBlockInput, isBlockInputBlobs} from "./blocks/blockInput/index.js";
import {ChainEventEmitter} from "./emitter.js";
export type GetBlobsTrackerInit = {
logger: Logger;

View File

@@ -1,3 +1,3 @@
export * from "./archiveStore.js";
export * from "./interface.js";
export * from "./constants.js";
export * from "./interface.js";

View File

@@ -1,4 +1,4 @@
export * from "./blockInput.js";
export * from "./errors.js";
export * from "./utils.js";
export * from "./types.js";
export * from "./utils.js";

View File

@@ -12,7 +12,8 @@ import {assertLinearChainSegment} from "./utils/chainSegment.js";
import {verifyBlocksInEpoch} from "./verifyBlock.js";
import {verifyBlocksSanityChecks} from "./verifyBlocksSanityChecks.js";
import {removeEagerlyPersistedBlockInputs} from "./writeBlockInputToDb.js";
export {type ImportBlockOpts, AttestationImportOpt} from "./types.js";
export {AttestationImportOpt, type ImportBlockOpts} from "./types.js";
const QUEUE_MAX_LENGTH = 256;

View File

@@ -18,17 +18,15 @@ import {
} from "@lodestar/state-transition";
import {Slot, bellatrix, electra} from "@lodestar/types";
import {ErrorAborted, Logger, toRootHex} from "@lodestar/utils";
import {IEth1ForBlockProduction} from "../../eth1/index.js";
import {IExecutionEngine} from "../../execution/engine/interface.js";
import {ExecutionPayloadStatus} from "../../execution/engine/interface.js";
import {ExecutionPayloadStatus, IExecutionEngine} from "../../execution/engine/interface.js";
import {Metrics} from "../../metrics/metrics.js";
import {IClock} from "../../util/clock.js";
import {BlockError, BlockErrorCode} from "../errors/index.js";
import {BlockProcessOpts} from "../options.js";
import {ImportBlockOpts} from "./types.js";
import {IBlockInput} from "./blockInput/types.js";
import {isBlockInputBlobs, isBlockInputColumns} from "./blockInput/blockInput.js";
import {IBlockInput} from "./blockInput/types.js";
import {ImportBlockOpts} from "./types.js";
export type VerifyBlockExecutionPayloadModules = {
eth1: IEth1ForBlockProduction;

View File

@@ -1,9 +1,11 @@
import path from "node:path";
import {Worker, spawn} from "@chainsafe/threads";
// `threads` library creates self global variable which breaks `timeout-abort-controller` https://github.com/jacobheun/timeout-abort-controller/issues/9
// @ts-expect-error
// biome-ignore lint/suspicious/noGlobalAssign: We need the global `self` to reassign module properties later
self = undefined;
import {PublicKey} from "@chainsafe/blst";
import {ISignatureSet} from "@lodestar/state-transition";
import {Logger} from "@lodestar/utils";

View File

@@ -1,8 +1,10 @@
import path from "node:path";
import {PrivateKey} from "@libp2p/interface";
import {PubkeyIndexMap} from "@chainsafe/pubkey-index-map";
import {CompositeTypeAny, TreeView, Type} from "@chainsafe/ssz";
import {BeaconConfig} from "@lodestar/config";
import {CheckpointWithHex, ExecutionStatus, IForkChoice, ProtoBlock, UpdateHeadOpt} from "@lodestar/fork-choice";
import {LoggerNode} from "@lodestar/logger/node";
import {EFFECTIVE_BALANCE_INCREMENT, GENESIS_SLOT, SLOTS_PER_EPOCH, isForkPostElectra} from "@lodestar/params";
import {
BeaconStateAllForks,
@@ -38,9 +40,6 @@ import {
} from "@lodestar/types";
import {Logger, fromHex, gweiToWei, isErrorAborted, pruneSetToMax, sleep, toRootHex} from "@lodestar/utils";
import {ProcessShutdownCallback} from "@lodestar/validator";
import {PrivateKey} from "@libp2p/interface";
import {LoggerNode} from "@lodestar/logger/node";
import {GENESIS_EPOCH, ZERO_HASH} from "../constants/index.js";
import {IBeaconDb} from "../db/index.js";
import {IEth1ForBlockProduction} from "../eth1/index.js";
@@ -60,8 +59,10 @@ import {BeaconProposerCache} from "./beaconProposerCache.js";
import {IBlockInput} from "./blocks/blockInput/index.js";
import {BlockProcessor, ImportBlockOpts} from "./blocks/index.js";
import {BlsMultiThreadWorkerPool, BlsSingleThreadVerifier, IBlsVerifier} from "./bls/index.js";
import {ColumnReconstructionTracker} from "./ColumnReconstructionTracker.js";
import {ChainEvent, ChainEventEmitter} from "./emitter.js";
import {ForkchoiceCaller, initializeForkChoice} from "./forkChoice/index.js";
import {GetBlobsTracker} from "./GetBlobsTracker.js";
import {CommonBlockBody, FindHeadFnName, IBeaconChain, ProposerPreparationData, StateGetOpts} from "./interface.js";
import {LightClientServer} from "./lightClient/index.js";
import {
@@ -100,8 +101,6 @@ import {FIFOBlockStateCache} from "./stateCache/fifoBlockStateCache.js";
import {InMemoryCheckpointStateCache} from "./stateCache/inMemoryCheckpointsCache.js";
import {PersistentCheckpointStateCache} from "./stateCache/persistentCheckpointsCache.js";
import {ValidatorMonitor} from "./validatorMonitor.js";
import {GetBlobsTracker} from "./GetBlobsTracker.js";
import {ColumnReconstructionTracker} from "./ColumnReconstructionTracker.js";
/**
* The maximum number of cached produced results to keep in memory.

View File

@@ -1,6 +1,5 @@
import {EventEmitter} from "node:events";
import {StrictEventEmitter} from "strict-event-emitter-types";
import {routes} from "@lodestar/api";
import {CheckpointWithHex} from "@lodestar/fork-choice";
import {CachedBeaconStateAllForks} from "@lodestar/state-transition";

View File

@@ -1,10 +1,10 @@
export * from "./attestationError.js";
export * from "./attesterSlashingError.js";
export * from "./blobSidecarError.js";
export * from "./dataColumnSidecarError.js";
export * from "./blockError.js";
export * from "./blsToExecutionChangeError.js";
export * from "./dataColumnSidecarError.js";
export * from "./gossipValidation.js";
export * from "./proposerSlashingError.js";
export * from "./syncCommitteeError.js";
export * from "./voluntaryExitError.js";
export * from "./blsToExecutionChangeError.js";

View File

@@ -16,12 +16,10 @@ import {
isMergeTransitionComplete,
} from "@lodestar/state-transition";
import {Slot} from "@lodestar/types";
import {Logger, toRootHex} from "@lodestar/utils";
import {GENESIS_SLOT} from "../../constants/index.js";
import {Metrics} from "../../metrics/index.js";
import {ChainEventEmitter} from "../emitter.js";
import {ChainEvent} from "../emitter.js";
import {ChainEvent, ChainEventEmitter} from "../emitter.js";
export type ForkChoiceOpts = RawForkChoiceOpts & {
// for testing only

View File

@@ -1,6 +1,6 @@
export * from "./interface.js";
export * from "./emitter.js";
export * from "./chain.js";
export * from "./emitter.js";
export * from "./forkChoice/index.js";
export * from "./initState.js";
export * from "./interface.js";
export * from "./stateCache/index.js";

View File

@@ -38,8 +38,10 @@ import {BeaconProposerCache, ProposerPreparationData} from "./beaconProposerCach
import {IBlockInput} from "./blocks/blockInput/index.js";
import {ImportBlockOpts} from "./blocks/types.js";
import {IBlsVerifier} from "./bls/index.js";
import {ColumnReconstructionTracker} from "./ColumnReconstructionTracker.js";
import {ChainEventEmitter} from "./emitter.js";
import {ForkchoiceCaller} from "./forkChoice/index.js";
import {GetBlobsTracker} from "./GetBlobsTracker.js";
import {LightClientServer} from "./lightClient/index.js";
import {AggregatedAttestationPool} from "./opPools/aggregatedAttestationPool.js";
import {AttestationPool, OpPool, SyncCommitteeMessagePool, SyncContributionAndProofPool} from "./opPools/index.js";
@@ -63,8 +65,6 @@ import {SeenBlockAttesters} from "./seenCache/seenBlockAttesters.js";
import {SeenBlockInput} from "./seenCache/seenGossipBlockInput.js";
import {ShufflingCache} from "./shufflingCache.js";
import {ValidatorMonitor} from "./validatorMonitor.js";
import {GetBlobsTracker} from "./GetBlobsTracker.js";
import {ColumnReconstructionTracker} from "./ColumnReconstructionTracker.js";
export {BlockType, type AssembledBlockType};
export {type ProposerPreparationData};

View File

@@ -45,7 +45,6 @@ import {
sszTypesFor,
} from "@lodestar/types";
import {Logger, MapDef, pruneSetToMax, toRootHex} from "@lodestar/utils";
import {ZERO_HASH} from "../../constants/index.js";
import {IBeaconDb} from "../../db/index.js";
import {NUM_WITNESS, NUM_WITNESS_ELECTRA} from "../../db/repositories/lightclientSyncCommitteeWitness.js";

View File

@@ -9,7 +9,6 @@ import {
} from "@lodestar/params";
import {BeaconStateAllForks, CachedBeaconStateAllForks} from "@lodestar/state-transition";
import {BeaconBlockBody, SSZTypesFor, ssz} from "@lodestar/types";
import {SyncCommitteeWitness} from "./types.js";
export function getSyncCommitteesWitness(fork: ForkName, state: BeaconStateAllForks): SyncCommitteeWitness {

View File

@@ -42,7 +42,7 @@ import {
phase0,
ssz,
} from "@lodestar/types";
import {assert, MapDef, toRootHex} from "@lodestar/utils";
import {MapDef, assert, toRootHex} from "@lodestar/utils";
import {Metrics} from "../../metrics/metrics.js";
import {IntersectResult, intersectUint8Arrays} from "../../util/bitArray.js";
import {getShufflingDependentRoot} from "../../util/dependentRoot.js";

View File

@@ -3,7 +3,7 @@ import {BitArray} from "@chainsafe/ssz";
import {ChainForkConfig} from "@lodestar/config";
import {MAX_COMMITTEES_PER_SLOT, isForkPostElectra} from "@lodestar/params";
import {Attestation, RootHex, SingleAttestation, Slot, isElectraSingleAttestation} from "@lodestar/types";
import {assert, MapDef} from "@lodestar/utils";
import {MapDef, assert} from "@lodestar/utils";
import {Metrics} from "../../metrics/metrics.js";
import {IClock} from "../../util/clock.js";
import {InsertOutcome, OpPoolError, OpPoolErrorCode} from "./types.js";

View File

@@ -1,5 +1,5 @@
export {AggregatedAttestationPool} from "./aggregatedAttestationPool.js";
export {AttestationPool} from "./attestationPool.js";
export {OpPool} from "./opPool.js";
export {SyncCommitteeMessagePool} from "./syncCommitteeMessagePool.js";
export {SyncContributionAndProofPool} from "./syncContributionAndProofPool.js";
export {OpPool} from "./opPool.js";

View File

@@ -6,8 +6,10 @@ import {ForkChoiceOpts} from "./forkChoice/index.js";
import {LightClientServerOpts} from "./lightClient/index.js";
import {ShufflingCacheOpts} from "./shufflingCache.js";
import {DEFAULT_MAX_BLOCK_STATES, FIFOBlockStateCacheOpts} from "./stateCache/fifoBlockStateCache.js";
import {PersistentCheckpointStateCacheOpts} from "./stateCache/persistentCheckpointsCache.js";
import {DEFAULT_MAX_CP_STATE_EPOCHS_IN_MEMORY} from "./stateCache/persistentCheckpointsCache.js";
import {
DEFAULT_MAX_CP_STATE_EPOCHS_IN_MEMORY,
PersistentCheckpointStateCacheOpts,
} from "./stateCache/persistentCheckpointsCache.js";
import {ValidatorMonitorOpts} from "./validatorMonitor.js";
export {ArchiveMode, DEFAULT_ARCHIVE_MODE};

View File

@@ -1,4 +1,4 @@
export * from "./errors.js";
export * from "./interface.js";
export * from "./regen.js";
export * from "./queued.js";
export * from "./regen.js";

View File

@@ -1,2 +1,2 @@
export * from "./types.js";
export * from "./db.js";
export * from "./types.js";

View File

@@ -1,3 +1,3 @@
export * from "./blockStateCacheImpl.js";
export * from "./inMemoryCheckpointsCache.js";
export * from "./fifoBlockStateCache.js";
export * from "./inMemoryCheckpointsCache.js";

View File

@@ -1,7 +1,11 @@
import {routes} from "@lodestar/api";
import {INTERVALS_PER_SLOT} from "@lodestar/params";
import {CachedBeaconStateAllForks, computeStartSlotAtEpoch, getBlockRootAtSlot} from "@lodestar/state-transition";
import {loadCachedBeaconState} from "@lodestar/state-transition";
import {
CachedBeaconStateAllForks,
computeStartSlotAtEpoch,
getBlockRootAtSlot,
loadCachedBeaconState,
} from "@lodestar/state-transition";
import {Epoch, RootHex, phase0} from "@lodestar/types";
import {Logger, MapDef, fromHex, sleep, toHex, toRootHex} from "@lodestar/utils";
import {Metrics} from "../../metrics/index.js";

View File

@@ -12,7 +12,6 @@ import {
} from "@lodestar/state-transition";
import {BlobIndex, Root, Slot, SubnetID, deneb, ssz} from "@lodestar/types";
import {toRootHex, verifyMerkleBranch} from "@lodestar/utils";
import {kzg} from "../../util/kzg.js";
import {BlobSidecarErrorCode, BlobSidecarGossipError, BlobSidecarValidationError} from "../errors/blobSidecarError.js";
import {GossipAction} from "../errors/gossipValidation.js";

View File

@@ -4,10 +4,9 @@ import {
KZG_COMMITMENTS_SUBTREE_INDEX,
NUMBER_OF_COLUMNS,
} from "@lodestar/params";
import {computeStartSlotAtEpoch, getBlockHeaderProposerSignatureSet} from "@lodestar/state-transition";
import {Root, Slot, SubnetID, fulu, ssz} from "@lodestar/types";
import {toRootHex, verifyMerkleBranch} from "@lodestar/utils";
import {computeStartSlotAtEpoch, getBlockHeaderProposerSignatureSet} from "@lodestar/state-transition";
import {Metrics} from "../../metrics/metrics.js";
import {kzg} from "../../util/kzg.js";
import {

View File

@@ -2,8 +2,8 @@ export * from "./aggregateAndProof.js";
export * from "./attestation.js";
export * from "./attesterSlashing.js";
export * from "./block.js";
export * from "./blsToExecutionChange.js";
export * from "./proposerSlashing.js";
export * from "./syncCommittee.js";
export * from "./syncCommitteeContributionAndProof.js";
export * from "./voluntaryExit.js";
export * from "./blsToExecutionChange.js";

View File

@@ -7,8 +7,7 @@ import {
computeStartSlotAtEpoch,
createSingleSignatureSetFromComponents,
} from "@lodestar/state-transition";
import {SignedAggregateAndProof, ssz} from "@lodestar/types";
import {Epoch} from "@lodestar/types";
import {Epoch, SignedAggregateAndProof, ssz} from "@lodestar/types";
export function getAggregateAndProofSigningRoot(
config: BeaconConfig,

View File

@@ -11,9 +11,18 @@ import {
parseAttesterFlags,
parseParticipationFlags,
} from "@lodestar/state-transition";
import {BeaconBlock, RootHex, SubnetID, altair, deneb} from "@lodestar/types";
import {Epoch, Slot, ValidatorIndex} from "@lodestar/types";
import {IndexedAttestation, SignedAggregateAndProof} from "@lodestar/types";
import {
BeaconBlock,
Epoch,
IndexedAttestation,
RootHex,
SignedAggregateAndProof,
Slot,
SubnetID,
ValidatorIndex,
altair,
deneb,
} from "@lodestar/types";
import {LogData, LogHandler, LogLevel, Logger, MapDef, MapDefMax, toRootHex} from "@lodestar/utils";
import {GENESIS_SLOT} from "../constants/constants.js";
import {RegistryMetricCreator} from "../metrics/index.js";

View File

@@ -1,2 +1,2 @@
export type {IBeaconDb} from "./interface.js";
export {BeaconDb} from "./beacon.js";
export type {IBeaconDb} from "./interface.js";

View File

@@ -2,7 +2,6 @@ import {ContainerType, ValueOf} from "@chainsafe/ssz";
import {ChainForkConfig} from "@lodestar/config";
import {Db, Repository} from "@lodestar/db";
import {ssz} from "@lodestar/types";
import {Bucket, getBucketNameByValue} from "../buckets.js";
export const blobSidecarsWrapperSsz = new ContainerType(

View File

@@ -1,12 +1,18 @@
import all from "it-all";
import {ChainForkConfig} from "@lodestar/config";
import {Db, FilterOptions, KeyValue, Repository} from "@lodestar/db";
import {Root, SignedBeaconBlock, Slot, ssz} from "@lodestar/types";
import {bytesToInt} from "@lodestar/utils";
import all from "it-all";
import {getSignedBlockTypeFromBytes} from "../../util/multifork.js";
import {Bucket, getBucketNameByValue} from "../buckets.js";
import {getParentRootIndex, getRootIndex} from "./blockArchiveIndex.js";
import {deleteParentRootIndex, deleteRootIndex, storeParentRootIndex, storeRootIndex} from "./blockArchiveIndex.js";
import {
deleteParentRootIndex,
deleteRootIndex,
getParentRootIndex,
getRootIndex,
storeParentRootIndex,
storeRootIndex,
} from "./blockArchiveIndex.js";
export interface BlockFilterOptions extends FilterOptions<Slot> {
step?: number;

View File

@@ -1,5 +1,5 @@
import {ChainForkConfig} from "@lodestar/config";
import {Db, decodeNumberForDbKey, encodeNumberForDbKey, PrefixedRepository} from "@lodestar/db";
import {Db, PrefixedRepository, decodeNumberForDbKey, encodeNumberForDbKey} from "@lodestar/db";
import {NUMBER_OF_COLUMNS} from "@lodestar/params";
import {ColumnIndex, Root, fulu, ssz} from "@lodestar/types";
import {Bucket, getBucketNameByValue} from "../buckets.js";

View File

@@ -1,5 +1,5 @@
import {ChainForkConfig} from "@lodestar/config";
import {Db, decodeNumberForDbKey, encodeNumberForDbKey, PrefixedRepository} from "@lodestar/db";
import {Db, PrefixedRepository, decodeNumberForDbKey, encodeNumberForDbKey} from "@lodestar/db";
import {NUMBER_OF_COLUMNS} from "@lodestar/params";
import {ColumnIndex, Slot, fulu, ssz} from "@lodestar/types";
import {Bucket, getBucketNameByValue} from "../buckets.js";

View File

@@ -1,24 +1,20 @@
export {AttesterSlashingRepository} from "./attesterSlashing.js";
export {BackfilledRanges} from "./backfilledRanges.js";
export {BlobSidecarsRepository} from "./blobSidecars.js";
export {BlobSidecarsArchiveRepository} from "./blobSidecarsArchive.js";
export {BlockRepository} from "./block.js";
export type {BlockArchiveBatchPutBinaryItem, BlockFilterOptions} from "./blockArchive.js";
export {BlockArchiveRepository} from "./blockArchive.js";
export {BLSToExecutionChangeRepository} from "./blsToExecutionChange.js";
export {DataColumnSidecarRepository} from "./dataColumnSidecar.js";
export {DataColumnSidecarArchiveRepository} from "./dataColumnSidecarArchive.js";
export {BlockRepository} from "./block.js";
export {BlockArchiveRepository} from "./blockArchive.js";
export type {BlockArchiveBatchPutBinaryItem, BlockFilterOptions} from "./blockArchive.js";
export {StateArchiveRepository} from "./stateArchive.js";
export {AttesterSlashingRepository} from "./attesterSlashing.js";
export {ProposerSlashingRepository} from "./proposerSlashing.js";
export {VoluntaryExitRepository} from "./voluntaryExit.js";
export {DepositEventRepository} from "./depositEvent.js";
export {DepositDataRootRepository} from "./depositDataRoot.js";
export {DepositEventRepository} from "./depositEvent.js";
export {Eth1DataRepository} from "./eth1Data.js";
export {BestLightClientUpdateRepository} from "./lightclientBestUpdate.js";
export {CheckpointHeaderRepository} from "./lightclientCheckpointHeader.js";
export {SyncCommitteeRepository} from "./lightclientSyncCommittee.js";
export {SyncCommitteeWitnessRepository} from "./lightclientSyncCommitteeWitness.js";
export {BackfilledRanges} from "./backfilledRanges.js";
export {BLSToExecutionChangeRepository} from "./blsToExecutionChange.js";
export {ProposerSlashingRepository} from "./proposerSlashing.js";
export {StateArchiveRepository} from "./stateArchive.js";
export {VoluntaryExitRepository} from "./voluntaryExit.js";

View File

@@ -7,7 +7,6 @@ import {
} from "@lodestar/state-transition";
import {phase0, ssz} from "@lodestar/types";
import {ErrorAborted, Logger, TimeoutError, fromHex, isErrorAborted, sleep} from "@lodestar/utils";
import {IBeaconDb} from "../db/index.js";
import {Metrics} from "../metrics/index.js";
import {Eth1DataCache} from "./eth1DataCache.js";

View File

@@ -2,7 +2,6 @@ import {byteArrayEquals} from "@chainsafe/ssz";
import {ChainForkConfig} from "@lodestar/config";
import {FilterOptions} from "@lodestar/db";
import {phase0, ssz} from "@lodestar/types";
import {IBeaconDb} from "../db/index.js";
import {Eth1Error, Eth1ErrorCode} from "./errors.js";
import {Eth1Block} from "./interface.js";

View File

@@ -10,12 +10,10 @@ import {
toHex,
toPrintableUrl,
} from "@lodestar/utils";
import {HTTP_CONNECTION_ERROR_CODES, HTTP_FATAL_ERROR_CODES} from "../../execution/engine/utils.js";
import {isValidAddress} from "../../util/address.js";
import {linspace} from "../../util/numpy.js";
import {Eth1Block, Eth1ProviderState, IEth1Provider} from "../interface.js";
import {EthJsonRpcBlockRaw} from "../interface.js";
import {Eth1Block, Eth1ProviderState, EthJsonRpcBlockRaw, IEth1Provider} from "../interface.js";
import {DEFAULT_PROVIDER_URLS, Eth1Options} from "../options.js";
import {depositEventTopics, parseDepositLog} from "../utils/depositContract.js";
import {

View File

@@ -1,6 +1,6 @@
import {EventEmitter} from "node:events";
import {ErrorAborted, Gauge, Histogram, TimeoutError, fetch, isValidHttpUrl, retry} from "@lodestar/utils";
import {StrictEventEmitter} from "strict-event-emitter-types";
import {ErrorAborted, Gauge, Histogram, TimeoutError, fetch, isValidHttpUrl, retry} from "@lodestar/utils";
import {IJson, RpcPayload} from "../interface.js";
import {JwtClaim, encodeJwtToken} from "./jwt.js";

View File

@@ -1,5 +1,6 @@
import type {TAlgorithm} from "jwt-simple";
// TODO: fix jwt-simple types
import type {TAlgorithm} from "jwt-simple";
import jwt from "jwt-simple";
const {encode, decode} = jwt;

View File

@@ -1,7 +1,6 @@
import {Tree, toGindex} from "@chainsafe/persistent-merkle-tree";
import {FilterOptions} from "@lodestar/db";
import {CachedBeaconStateAllForks} from "@lodestar/state-transition";
import {getEth1DepositCount} from "@lodestar/state-transition";
import {CachedBeaconStateAllForks, getEth1DepositCount} from "@lodestar/state-transition";
import {phase0, ssz} from "@lodestar/types";
import {toRootHex} from "@lodestar/utils";
import {DepositTree} from "../../db/repositories/depositDataRoot.js";

View File

@@ -2,6 +2,7 @@ import {ChainForkConfig} from "@lodestar/config";
import {Logger} from "@lodestar/logger";
import {Metrics} from "../../metrics/metrics.js";
import {IExecutionBuilder} from "./interface.js";
export {getExpectedGasLimit} from "./utils.js";
import {ExecutionBuilderHttp, ExecutionBuilderHttpOpts, defaultExecutionBuilderHttpOpts} from "./http.js";

View File

@@ -9,7 +9,6 @@ import {
import {BlobsBundle, ExecutionPayload, ExecutionRequests, Root, RootHex, Wei, capella} from "@lodestar/types";
import {BlobAndProof} from "@lodestar/types/deneb";
import {BlobAndProofV2} from "@lodestar/types/fulu";
import {DATA} from "../../eth1/provider/utils.js";
import {PayloadId, PayloadIdCache, WithdrawalV1} from "./payloadIdCache.js";
import {ExecutionPayloadBody} from "./types.js";

View File

@@ -23,7 +23,6 @@ import {
} from "@lodestar/types";
import {BlobAndProof} from "@lodestar/types/deneb";
import {BlobAndProofV2} from "@lodestar/types/fulu";
import {
DATA,
QUANTITY,

View File

@@ -1,5 +1,4 @@
import {isFetchError} from "@lodestar/utils";
import {isErrorAborted} from "@lodestar/utils";
import {isErrorAborted, isFetchError} from "@lodestar/utils";
import {IJson, RpcPayload} from "../../eth1/interface.js";
import {
ErrorJsonRpcResponse,

View File

@@ -1,4 +1,4 @@
export * from "./engine/index.js";
export * from "./engine/interface.js";
export * from "./builder/index.js";
export * from "./builder/interface.js";
export * from "./engine/index.js";
export * from "./engine/interface.js";

View File

@@ -1,23 +1,20 @@
// Export generic RestApi server for CLI
export type {RestApiServerMetrics, RestApiServerModules, RestApiServerOpts} from "./api/rest/base.js";
export {RestApiServer} from "./api/rest/base.js";
export {checkAndPersistAnchorState, initStateFromDb, initStateFromEth1} from "./chain/index.js";
export {BeaconDb, type IBeaconDb} from "./db/index.js";
export {Eth1Provider, type IEth1Provider} from "./eth1/index.js";
export {createNodeJsLibp2p, type NodeJsLibp2pOpts} from "./network/index.js";
export * from "./node/index.js";
// Export metrics utilities to de-duplicate validator metrics
export {
type HttpMetricsServer,
RegistryMetricCreator,
collectNodeJSMetrics,
type HttpMetricsServer,
getHttpMetricsServer,
} from "./metrics/index.js";
// Export monitoring service to make it usable by validator
export {MonitoringService} from "./monitoring/index.js";
// Export generic RestApi server for CLI
export {RestApiServer} from "./api/rest/base.js";
export type {RestApiServerOpts, RestApiServerModules, RestApiServerMetrics} from "./api/rest/base.js";
export {type NodeJsLibp2pOpts, createNodeJsLibp2p} from "./network/index.js";
export * from "./node/index.js";
// Export type util for CLI - TEMP move to lodestar-types eventually
export {getStateTypeFromBytes, getStateSlotFromBytes} from "./util/multifork.js";
export {getStateSlotFromBytes, getStateTypeFromBytes} from "./util/multifork.js";

View File

@@ -1,4 +1,4 @@
export * from "./metrics.js";
export * from "./server/index.js";
export * from "./nodeJsMetrics.js";
export * from "./server/index.js";
export {RegistryMetricCreator} from "./utils/registryMetricCreator.js";

View File

@@ -1,6 +1,6 @@
import {Metric, Registry} from "prom-client";
import {ForkChoiceMetrics, getForkChoiceMetrics} from "@lodestar/fork-choice";
import {BeaconStateTransitionMetrics, getMetrics} from "@lodestar/state-transition";
import {Metric, Registry} from "prom-client";
import {BeaconMetrics, createBeaconMetrics} from "./metrics/beacon.js";
import {LodestarMetrics, createLodestarMetrics} from "./metrics/lodestar.js";
import {collectNodeJSMetrics} from "./nodeJsMetrics.js";

View File

@@ -21,9 +21,9 @@ import {PendingBlockType} from "../../sync/types.js";
import {PeerSyncType, RangeSyncType} from "../../sync/utils/remoteSyncType.js";
import {AllocSource} from "../../util/bufferPool.js";
import {DataColumnReconstructionCode} from "../../util/dataColumns.js";
import {DataColumnEngineResult} from "../../util/execution.js";
import {LodestarMetadata} from "../options.js";
import {RegistryMetricCreator} from "../utils/registryMetricCreator.js";
import {DataColumnEngineResult} from "../../util/execution.js";
export type LodestarMetrics = ReturnType<typeof createLodestarMetrics>;

View File

@@ -1,5 +1,5 @@
import {gcStats} from "#prometheus-gc-stats-wrapper";
import {Registry, collectDefaultMetrics} from "prom-client";
import {gcStats} from "#prometheus-gc-stats-wrapper";
export function collectNodeJSMetrics(register: Registry, prefix?: string): () => void {
collectDefaultMetrics({

View File

@@ -1,7 +1,7 @@
import http from "node:http";
import {AddressInfo} from "node:net";
import {Logger} from "@lodestar/utils";
import {Registry} from "prom-client";
import {Logger} from "@lodestar/utils";
import {HttpActiveSocketsTracker} from "../../api/rest/activeSockets.js";
import {wrapError} from "../../util/wrapError.js";
import {RegistryMetricCreator} from "../utils/registryMetricCreator.js";

View File

@@ -1,5 +1,5 @@
import {AvgMinMax as IAvgMinMax, LabelKeys, LabelsGeneric} from "@lodestar/utils";
import {GaugeConfiguration} from "prom-client";
import {AvgMinMax as IAvgMinMax, LabelKeys, LabelsGeneric} from "@lodestar/utils";
import {GaugeExtra} from "./gauge.js";
type GetValuesFn = () => number[];

View File

@@ -1,5 +1,5 @@
import {CollectFn, Gauge as IGauge, LabelKeys, LabelsGeneric} from "@lodestar/utils";
import {Gauge} from "prom-client";
import {CollectFn, Gauge as IGauge, LabelKeys, LabelsGeneric} from "@lodestar/utils";
/**
* Extends the prom-client Gauge to be able to add multiple collect functions after instantiation

View File

@@ -1,3 +1,4 @@
import {Counter, Gauge, Histogram, Registry} from "prom-client";
import {
AvgMinMaxConfig,
CounterConfig,
@@ -13,7 +14,6 @@ import {
NoLabels,
StaticConfig,
} from "@lodestar/utils";
import {Counter, Gauge, Histogram, Registry} from "prom-client";
import {AvgMinMax} from "./avgMinMax.js";
import {GaugeExtra} from "./gauge.js";

View File

@@ -1,5 +1,5 @@
import {ErrorAborted, Histogram, Logger, TimeoutError, fetch} from "@lodestar/utils";
import {Registry} from "prom-client";
import {ErrorAborted, Histogram, Logger, TimeoutError, fetch} from "@lodestar/utils";
import {RegistryMetricCreator} from "../metrics/index.js";
import {createClientStats} from "./clientStats.js";
import {MonitoringOptions, defaultMonitoringOptions} from "./options.js";

View File

@@ -1,9 +1,9 @@
// We want to keep `system` export to be used as namespace
import os from "node:os";
import path from "node:path";
import {Logger} from "@lodestar/utils";
// We want to keep `system` export as it's more readable and easier to understand
import system from "systeminformation";
import {Logger} from "@lodestar/utils";
type MiscOs = "lin" | "win" | "mac" | "unk";

View File

@@ -1,14 +1,14 @@
import {PeerScoreStatsDump} from "@chainsafe/libp2p-gossipsub/score";
import {PublishOpts} from "@chainsafe/libp2p-gossipsub/types";
import {Connection, PrivateKey} from "@libp2p/interface";
import {peerIdFromPrivateKey} from "@libp2p/peer-id";
import {multiaddr} from "@multiformats/multiaddr";
import {PeerScoreStatsDump} from "@chainsafe/libp2p-gossipsub/score";
import {PublishOpts} from "@chainsafe/libp2p-gossipsub/types";
import {routes} from "@lodestar/api";
import {BeaconConfig, ForkBoundary} from "@lodestar/config";
import type {LoggerNode} from "@lodestar/logger/node";
import {isForkPostFulu} from "@lodestar/params";
import {ResponseIncoming} from "@lodestar/reqresp";
import {Epoch, Status, fulu, sszTypesFor} from "@lodestar/types";
import {multiaddr} from "@multiformats/multiaddr";
import {formatNodePeer} from "../../api/impl/node/utils.js";
import {RegistryMetricCreator} from "../../metrics/index.js";
import {ClockEvent, IClock} from "../../util/clock.js";

View File

@@ -1,10 +1,10 @@
import fs from "node:fs";
import path from "node:path";
import worker from "node:worker_threads";
import type {ModuleThread} from "@chainsafe/threads";
import {expose} from "@chainsafe/threads/worker";
import {privateKeyFromProtobuf} from "@libp2p/crypto/keys";
import {peerIdFromPrivateKey} from "@libp2p/peer-id";
import type {ModuleThread} from "@chainsafe/threads";
import {expose} from "@chainsafe/threads/worker";
import {chainConfigFromJson, createBeaconConfig} from "@lodestar/config";
import {getNodeLogger} from "@lodestar/logger/node";
import {RegistryMetricCreator, collectNodeJSMetrics} from "../../metrics/index.js";

View File

@@ -1,10 +1,10 @@
import path from "node:path";
import workerThreads from "node:worker_threads";
import {privateKeyToProtobuf} from "@libp2p/crypto/keys";
import {PrivateKey} from "@libp2p/interface";
import {PeerScoreStatsDump} from "@chainsafe/libp2p-gossipsub/score";
import {PublishOpts} from "@chainsafe/libp2p-gossipsub/types";
import {ModuleThread, Thread, Worker, spawn} from "@chainsafe/threads";
import {privateKeyToProtobuf} from "@libp2p/crypto/keys";
import {PrivateKey} from "@libp2p/interface";
import {routes} from "@lodestar/api";
import {BeaconConfig, chainConfigToJson} from "@lodestar/config";
import type {LoggerNode} from "@lodestar/logger/node";

View File

@@ -1,11 +1,11 @@
import EventEmitter from "node:events";
import {ENR, ENRData, SignableENR} from "@chainsafe/enr";
import {Thread, Worker, spawn} from "@chainsafe/threads";
import {privateKeyToProtobuf} from "@libp2p/crypto/keys";
import {PrivateKey} from "@libp2p/interface";
import {StrictEventEmitter} from "strict-event-emitter-types";
import {ENR, ENRData, SignableENR} from "@chainsafe/enr";
import {Thread, Worker, spawn} from "@chainsafe/threads";
import {BeaconConfig, chainConfigFromJson, chainConfigToJson} from "@lodestar/config";
import {LoggerNode} from "@lodestar/logger/node";
import {StrictEventEmitter} from "strict-event-emitter-types";
import {NetworkCoreMetrics} from "../core/metrics.js";
import {Discv5WorkerApi, Discv5WorkerData, LodestarDiscv5Opts} from "./types.js";

Some files were not shown because too many files have changed in this diff Show More