Skip to content

Commit

Permalink
Merge branch 'unstable' into ls/single_attestation
Browse files Browse the repository at this point in the history
  • Loading branch information
ensi321 committed Nov 3, 2024
2 parents 25ce2cc + 06b4c2d commit 9ad1e26
Show file tree
Hide file tree
Showing 1,068 changed files with 3,671 additions and 3,676 deletions.
5 changes: 1 addition & 4 deletions biome.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,7 @@
"ignore": ["**/lib", "**/.nyc_output", "./packages/*/spec-tests", "**/node_modules", "./packages/*/node_modules/**"]
},
"organizeImports": {
// TODO: We will enable this settings as soon mono-repo support is provided in biome.
// Currently it didn't recognize local packages in repo and sort those higher than npm packages
// https://github.com/biomejs/biome/issues/2228
"enabled": false
"enabled": true
},
"linter": {
"enabled": true,
Expand Down
2 changes: 1 addition & 1 deletion packages/api/src/beacon/client/debug.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {ChainForkConfig} from "@lodestar/config";
import {ApiClientMethods, createApiClientMethods, IHttpClient} from "../../utils/client/index.js";
import {ApiClientMethods, IHttpClient, createApiClientMethods} from "../../utils/client/index.js";
import {Endpoints, getDefinitions} from "../routes/debug.js";

export type ApiClient = ApiClientMethods<Endpoints>;
Expand Down
18 changes: 9 additions & 9 deletions packages/api/src/beacon/routes/beacon/block.ts
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
import {ContainerType, ListCompositeType, ValueOf} from "@chainsafe/ssz";
import {ChainForkConfig} from "@lodestar/config";
import {ForkName, ForkPreElectra, ForkPreExecution, isForkBlobs, isForkExecution} from "@lodestar/params";
import {
Slot,
ssz,
BeaconBlockBody,
RootHex,
deneb,
isSignedBlockContents,
SignedBeaconBlock,
BeaconBlockBody,
SignedBeaconBlockOrContents,
SignedBlindedBeaconBlock,
SignedBlockContents,
Slot,
deneb,
isSignedBlockContents,
ssz,
sszTypesFor,
} from "@lodestar/types";
import {ForkName, ForkPreElectra, ForkPreExecution, isForkBlobs, isForkExecution} from "@lodestar/params";
import {Endpoint, RequestCodec, RouteDefinitions, Schema} from "../../../utils/index.js";
import {EmptyMeta, EmptyResponseCodec, EmptyResponseData, WithVersion} from "../../../utils/codecs.js";
import {getExecutionForkTypes, toForkName} from "../../../utils/fork.js";
import {fromHeaders} from "../../../utils/headers.js";
import {Endpoint, RequestCodec, RouteDefinitions, Schema} from "../../../utils/index.js";
import {
ExecutionOptimisticAndFinalizedCodec,
ExecutionOptimisticAndFinalizedMeta,
ExecutionOptimisticFinalizedAndVersionCodec,
ExecutionOptimisticFinalizedAndVersionMeta,
MetaHeader,
} from "../../../utils/metadata.js";
import {getExecutionForkTypes, toForkName} from "../../../utils/fork.js";
import {fromHeaders} from "../../../utils/headers.js";
import {WireFormat} from "../../../utils/wireFormat.js";

// See /packages/api/src/routes/index.ts for reasoning and instructions to add new routes
Expand Down
4 changes: 2 additions & 2 deletions packages/api/src/beacon/routes/beacon/index.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import {ChainForkConfig} from "@lodestar/config";
import {phase0, ssz} from "@lodestar/types";
import {EmptyArgs, EmptyMeta, EmptyMetaCodec, EmptyRequest, EmptyRequestCodec} from "../../../utils/codecs.js";
import {Endpoint, RouteDefinitions} from "../../../utils/types.js";
import {EmptyArgs, EmptyRequestCodec, EmptyMeta, EmptyMetaCodec, EmptyRequest} from "../../../utils/codecs.js";
import * as block from "./block.js";
import * as pool from "./pool.js";
import * as state from "./state.js";
import * as rewards from "./rewards.js";
import * as state from "./state.js";

// See /packages/api/src/routes/index.ts for reasoning and instructions to add new routes

Expand Down
16 changes: 8 additions & 8 deletions packages/api/src/beacon/routes/beacon/pool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,30 @@ import {ValueOf} from "@chainsafe/ssz";
import {ChainForkConfig} from "@lodestar/config";
import {ForkPostElectra, ForkPreElectra, isForkPostElectra} from "@lodestar/params";
import {
phase0,
capella,
AttesterSlashing,
CommitteeIndex,
SingleAttestation,
Slot,
ssz,
capella,
electra,
AttesterSlashing,
SingleAttestation,
phase0,
ssz,
} from "@lodestar/types";
import {Schema, Endpoint, RouteDefinitions} from "../../../utils/index.js";
import {
ArrayOf,
EmptyArgs,
EmptyRequestCodec,
EmptyMeta,
EmptyMetaCodec,
EmptyRequest,
EmptyRequestCodec,
EmptyResponseCodec,
EmptyResponseData,
WithVersion,
} from "../../../utils/codecs.js";
import {MetaHeader, VersionCodec, VersionMeta} from "../../../utils/metadata.js";
import {toForkName} from "../../../utils/fork.js";
import {fromHeaders} from "../../../utils/headers.js";
import {Endpoint, RouteDefinitions, Schema} from "../../../utils/index.js";
import {MetaHeader, VersionCodec, VersionMeta} from "../../../utils/metadata.js";

// See /packages/api/src/routes/index.ts for reasoning and instructions to add new routes

Expand Down
4 changes: 2 additions & 2 deletions packages/api/src/beacon/routes/beacon/rewards.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ import {ContainerType, ValueOf} from "@chainsafe/ssz";
import {ChainForkConfig} from "@lodestar/config";
import {Epoch, ssz} from "@lodestar/types";

import {Schema, Endpoint, RouteDefinitions} from "../../../utils/index.js";
import {fromValidatorIdsStr, toValidatorIdsStr} from "../../../utils/serdes.js";
import {ArrayOf, JsonOnlyReq} from "../../../utils/codecs.js";
import {Endpoint, RouteDefinitions, Schema} from "../../../utils/index.js";
import {ExecutionOptimisticAndFinalizedCodec, ExecutionOptimisticAndFinalizedMeta} from "../../../utils/metadata.js";
import {fromValidatorIdsStr, toValidatorIdsStr} from "../../../utils/serdes.js";
import {BlockArgs} from "./block.js";
import {ValidatorId} from "./state.js";

Expand Down
4 changes: 2 additions & 2 deletions packages/api/src/beacon/routes/beacon/state.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import {ContainerType, ValueOf} from "@chainsafe/ssz";
import {ChainForkConfig} from "@lodestar/config";
import {MAX_VALIDATORS_PER_COMMITTEE} from "@lodestar/params";
import {phase0, CommitteeIndex, Slot, Epoch, ssz, RootHex, StringType, ValidatorStatus} from "@lodestar/types";
import {Endpoint, RequestCodec, RouteDefinitions, Schema} from "../../../utils/index.js";
import {CommitteeIndex, Epoch, RootHex, Slot, StringType, ValidatorStatus, phase0, ssz} from "@lodestar/types";
import {ArrayOf, JsonOnlyReq} from "../../../utils/codecs.js";
import {Endpoint, RequestCodec, RouteDefinitions, Schema} from "../../../utils/index.js";
import {ExecutionOptimisticAndFinalizedCodec, ExecutionOptimisticAndFinalizedMeta} from "../../../utils/metadata.js";
import {fromValidatorIdsStr, toValidatorIdsStr} from "../../../utils/serdes.js";
import {WireFormat} from "../../../utils/wireFormat.js";
Expand Down
2 changes: 1 addition & 1 deletion packages/api/src/beacon/routes/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ import {ssz} from "@lodestar/types";
import {
ArrayOf,
EmptyArgs,
EmptyRequestCodec,
EmptyMeta,
EmptyMetaCodec,
EmptyRequest,
EmptyRequestCodec,
JsonOnlyResp,
} from "../../utils/codecs.js";
import {Endpoint, RouteDefinitions} from "../../utils/index.js";
Expand Down
6 changes: 3 additions & 3 deletions packages/api/src/beacon/routes/debug.ts
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
import {ContainerType, Type, ValueOf} from "@chainsafe/ssz";
import {ChainForkConfig} from "@lodestar/config";
import {ssz, StringType, BeaconState} from "@lodestar/types";
import {BeaconState, StringType, ssz} from "@lodestar/types";
import {
ArrayOf,
EmptyArgs,
EmptyRequestCodec,
EmptyMeta,
EmptyMetaCodec,
EmptyRequest,
EmptyRequestCodec,
WithVersion,
} from "../../utils/codecs.js";
import {
ExecutionOptimisticFinalizedAndVersionCodec,
ExecutionOptimisticFinalizedAndVersionMeta,
} from "../../utils/metadata.js";
import {Schema} from "../../utils/schema.js";
import {Endpoint, RouteDefinitions} from "../../utils/types.js";
import {WireFormat} from "../../utils/wireFormat.js";
import {Schema} from "../../utils/schema.js";
import {StateArgs} from "./beacon/state.js";

// See /packages/api/src/routes/index.ts for reasoning and instructions to add new routes
Expand Down
26 changes: 13 additions & 13 deletions packages/api/src/beacon/routes/events.ts
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
import {ContainerType, ValueOf} from "@chainsafe/ssz";
import {ChainForkConfig} from "@lodestar/config";
import {ForkName} from "@lodestar/params";
import {
Attestation,
AttesterSlashing,
Epoch,
phase0,
capella,
electra,
LightClientFinalityUpdate,
LightClientOptimisticUpdate,
RootHex,
SSEPayloadAttributes,
Slot,
ssz,
StringType,
RootHex,
altair,
UintNum64,
LightClientOptimisticUpdate,
LightClientFinalityUpdate,
SSEPayloadAttributes,
Attestation,
AttesterSlashing,
altair,
capella,
electra,
phase0,
ssz,
sszTypesFor,
} from "@lodestar/types";
import {ForkName} from "@lodestar/params";

import {Endpoint, RouteDefinitions, Schema} from "../../utils/index.js";
import {EmptyMeta, EmptyResponseCodec, EmptyResponseData} from "../../utils/codecs.js";
import {getExecutionForkTypes, getLightClientForkTypes} from "../../utils/fork.js";
import {Endpoint, RouteDefinitions, Schema} from "../../utils/index.js";
import {VersionType} from "../../utils/metadata.js";

// See /packages/api/src/routes/index.ts for reasoning and instructions to add new routes
Expand Down
16 changes: 8 additions & 8 deletions packages/api/src/beacon/routes/lightclient.ts
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
import {ListCompositeType, ValueOf} from "@chainsafe/ssz";
import {BeaconConfig, ChainForkConfig, createBeaconConfig} from "@lodestar/config";
import {NetworkName, genesisData} from "@lodestar/config/networks";
import {ForkName, ZERO_HASH} from "@lodestar/params";
import {
LightClientBootstrap,
LightClientFinalityUpdate,
LightClientOptimisticUpdate,
LightClientUpdate,
ssz,
SyncPeriod,
ssz,
} from "@lodestar/types";
import {fromHex} from "@lodestar/utils";
import {ForkName, ZERO_HASH} from "@lodestar/params";
import {BeaconConfig, ChainForkConfig, createBeaconConfig} from "@lodestar/config";
import {genesisData, NetworkName} from "@lodestar/config/networks";
import {Endpoint, RouteDefinitions, Schema} from "../../utils/index.js";
import {MetaHeader, VersionCodec, VersionMeta} from "../../utils/metadata.js";
import {getLightClientForkTypes, toForkName} from "../../utils/fork.js";
import {
EmptyArgs,
EmptyRequestCodec,
EmptyMeta,
EmptyMetaCodec,
EmptyRequest,
EmptyRequestCodec,
WithVersion,
} from "../../utils/codecs.js";
import {getLightClientForkTypes, toForkName} from "../../utils/fork.js";
import {Endpoint, RouteDefinitions, Schema} from "../../utils/index.js";
import {MetaHeader, VersionCodec, VersionMeta} from "../../utils/metadata.js";

// See /packages/api/src/routes/index.ts for reasoning and instructions to add new routes

Expand Down
4 changes: 2 additions & 2 deletions packages/api/src/beacon/routes/lodestar.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import {ChainForkConfig} from "@lodestar/config";
import {Epoch, RootHex, Slot} from "@lodestar/types";
import {Schema, Endpoint, RouteDefinitions} from "../../utils/index.js";
import {
EmptyArgs,
EmptyRequestCodec,
EmptyMeta,
EmptyRequest,
EmptyRequestCodec,
EmptyResponseCodec,
EmptyResponseData,
JsonOnlyResponseCodec,
} from "../../utils/codecs.js";
import {Endpoint, RouteDefinitions, Schema} from "../../utils/index.js";
import {FilterGetPeers, NodePeer, PeerDirection, PeerState} from "./node.js";

// See /packages/api/src/routes/index.ts for reasoning and instructions to add new routes
Expand Down
4 changes: 2 additions & 2 deletions packages/api/src/beacon/routes/node.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
import {ContainerType, ValueOf} from "@chainsafe/ssz";
import {ChainForkConfig} from "@lodestar/config";
import {ssz, stringType} from "@lodestar/types";
import {Endpoint, RouteDefinitions, Schema} from "../../utils/index.js";
import {
ArrayOf,
EmptyArgs,
EmptyRequestCodec,
EmptyMeta,
EmptyMetaCodec,
EmptyRequest,
EmptyRequestCodec,
EmptyResponseCodec,
EmptyResponseData,
JsonOnlyResponseCodec,
} from "../../utils/codecs.js";
import {HttpStatusCode} from "../../utils/httpStatusCode.js";
import {Endpoint, RouteDefinitions, Schema} from "../../utils/index.js";
import {WireFormat} from "../../utils/wireFormat.js";

// See /packages/api/src/routes/index.ts for reasoning and instructions to add new routes
Expand Down
4 changes: 2 additions & 2 deletions packages/api/src/beacon/routes/proof.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import {CompactMultiProof, ProofType} from "@chainsafe/persistent-merkle-tree";
import {ByteListType, ContainerType} from "@chainsafe/ssz";
import {fromHex, toHex} from "@lodestar/utils";
import {ChainForkConfig} from "@lodestar/config";
import {ssz} from "@lodestar/types";
import {Endpoint, RouteDefinitions, Schema} from "../../utils/index.js";
import {fromHex, toHex} from "@lodestar/utils";
import {ArrayOf} from "../../utils/codecs.js";
import {Endpoint, RouteDefinitions, Schema} from "../../utils/index.js";
import {VersionCodec, VersionMeta} from "../../utils/metadata.js";

export const CompactMultiProofType = new ContainerType({
Expand Down
24 changes: 12 additions & 12 deletions packages/api/src/beacon/routes/validator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,24 @@ import {ContainerType, Type, ValueOf} from "@chainsafe/ssz";
import {ChainForkConfig} from "@lodestar/config";
import {isForkBlobs, isForkPostElectra} from "@lodestar/params";
import {
altair,
Attestation,
BLSSignature,
BeaconBlockOrContents,
BlindedBeaconBlock,
CommitteeIndex,
Epoch,
phase0,
ProducedBlockSource,
Root,
Slot,
ssz,
UintBn64,
ValidatorIndex,
ProducedBlockSource,
stringType,
BeaconBlockOrContents,
BlindedBeaconBlock,
Attestation,
altair,
phase0,
ssz,
sszTypesFor,
stringType,
} from "@lodestar/types";
import {fromHex, toHex, toRootHex} from "@lodestar/utils";
import {Endpoint, RouteDefinitions, Schema} from "../../utils/index.js";
import {fromGraffitiHex, toBoolean, toGraffitiHex} from "../../utils/serdes.js";
import {getExecutionForkTypes, toForkName} from "../../utils/fork.js";
import {
ArrayOf,
EmptyMeta,
Expand All @@ -33,6 +30,9 @@ import {
WithMeta,
WithVersion,
} from "../../utils/codecs.js";
import {getExecutionForkTypes, toForkName} from "../../utils/fork.js";
import {fromHeaders} from "../../utils/headers.js";
import {Endpoint, RouteDefinitions, Schema} from "../../utils/index.js";
import {
ExecutionOptimisticAndDependentRootCodec,
ExecutionOptimisticAndDependentRootMeta,
Expand All @@ -43,7 +43,7 @@ import {
VersionMeta,
VersionType,
} from "../../utils/metadata.js";
import {fromHeaders} from "../../utils/headers.js";
import {fromGraffitiHex, toBoolean, toGraffitiHex} from "../../utils/serdes.js";

// See /packages/api/src/routes/index.ts for reasoning and instructions to add new routes

Expand Down
2 changes: 1 addition & 1 deletion packages/api/src/beacon/server/events.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {ChainForkConfig} from "@lodestar/config";
import {ApiError, ApplicationMethods, FastifyRoutes, createFastifyRoutes} from "../../utils/server/index.js";
import {Endpoints, getDefinitions, eventTypes, getEventSerdes} from "../routes/events.js";
import {Endpoints, eventTypes, getDefinitions, getEventSerdes} from "../routes/events.js";

export function getRoutes(config: ChainForkConfig, methods: ApplicationMethods<Endpoints>): FastifyRoutes<Endpoints> {
const eventSerdes = getEventSerdes(config);
Expand Down
2 changes: 1 addition & 1 deletion packages/api/src/beacon/server/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type {FastifyInstance} from "fastify";
import {ChainForkConfig} from "@lodestar/config";
import type {FastifyInstance} from "fastify";
import {ApplicationMethods, FastifyRoute} from "../../utils/server/index.js";
import {Endpoints} from "../routes/index.js";

Expand Down
2 changes: 1 addition & 1 deletion packages/api/src/builder/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {ChainForkConfig} from "@lodestar/config";
import {HttpClient, HttpClientModules, HttpClientOptions, IHttpClient} from "../utils/client/httpClient.js";
import {Endpoints} from "./routes.js";
import type {ApiClient} from "./client.js";
import {Endpoints} from "./routes.js";

import * as builder from "./client.js";

Expand Down
Loading

0 comments on commit 9ad1e26

Please sign in to comment.