diff --git a/package.json b/package.json index a5b0f47b10e2..ae0d75e5cf2b 100644 --- a/package.json +++ b/package.json @@ -35,22 +35,22 @@ "devDependencies": { "@chainsafe/eslint-plugin-node": "^11.2.3", "@dapplion/benchmark": "^0.2.2", - "@types/chai": "^4.3.3", + "@types/chai": "^4.3.4", "@types/chai-as-promised": "^7.1.5", - "@types/mocha": "^10.0.0", - "@types/node": "^18.11.9", + "@types/mocha": "^10.0.1", + "@types/node": "^18.15.11", "@types/sinon": "^10.0.13", - "@types/sinon-chai": "^3.2.8", - "@typescript-eslint/eslint-plugin": "5.26.0", - "@typescript-eslint/parser": "5.26.0", - "chai": "^4.3.6", + "@types/sinon-chai": "^3.2.9", + "@typescript-eslint/eslint-plugin": "5.57.1", + "@typescript-eslint/parser": "5.57.1", + "chai": "^4.3.7", "chai-as-promised": "^7.1.1", "codecov": "^3.8.3", "crypto-browserify": "^3.12.0", "electron": "^21.0.1", - "eslint": "^8.16.0", - "eslint-plugin-import": "^2.26.0", - "eslint-plugin-prettier": "^4.0.0", + "eslint": "^8.37.0", + "eslint-plugin-import": "^2.27.5", + "eslint-plugin-prettier": "^4.2.1", "eslint-plugin-chai-expect": "^3.0.0", "eslint-plugin-mocha": "^10.1.0", "https-browserify": "^1.0.0", @@ -61,26 +61,26 @@ "karma-electron": "^7.3.0", "karma-firefox-launcher": "^2.1.2", "karma-mocha": "^2.0.1", - "karma-spec-reporter": "^0.0.34", + "karma-spec-reporter": "^0.0.36", "karma-webpack": "^5.0.0", "lerna": "^5.5.2", - "mocha": "^10.0.0", - "node-gyp": "^9.0.0", + "mocha": "^10.2.0", + "node-gyp": "^9.3.1", "npm-run-all": "^4.1.5", "nyc": "^15.1.0", "path-browserify": "^1.0.1", - "prettier": "^2.0.5", + "prettier": "^2.8.7", "process": "^0.11.10", - "resolve-typescript-plugin": "^1.2.0", - "sinon": "^14.0.0", + "resolve-typescript-plugin": "^2.0.1", + "sinon": "^15.0.3", "sinon-chai": "^3.7.0", "stream-browserify": "^3.0.0", "stream-http": "^3.2.0", - "supertest": "^6.2.4", - "ts-loader": "^9.3.1", + "supertest": "^6.3.3", + "ts-loader": "^9.4.2", "ts-node": "^10.9.1", - "typescript": "4.9.3", - "typescript-docs-verifier": "^2.3.0", - "webpack": "^5.74.0" + "typescript": "^5.0.3", + "typescript-docs-verifier": "^2.4.0", + "webpack": "^5.77.0" } } diff --git a/packages/api/package.json b/packages/api/package.json index 9f4e96136526..cd99dbc5cdc0 100644 --- a/packages/api/package.json +++ b/packages/api/package.json @@ -79,7 +79,7 @@ "qs": "^6.11.1" }, "devDependencies": { - "@types/eventsource": "^1.1.5", + "@types/eventsource": "^1.1.11", "@types/qs": "^6.9.7", "ajv": "^8.11.0", "fastify": "3.29.4" diff --git a/packages/api/src/beacon/client/events.ts b/packages/api/src/beacon/client/events.ts index b8ccc772560b..19252c8a7c9e 100644 --- a/packages/api/src/beacon/client/events.ts +++ b/packages/api/src/beacon/client/events.ts @@ -32,7 +32,7 @@ export function getClient(config: ChainForkConfig, baseUrl: string): Api { // `eventSource.onerror` events are informative but don't indicate the EventSource closed // The only way to abort the connection from the client is via eventSource.close() eventSource.onerror = function onerror(err) { - const errEs = (err as unknown) as EventSourceError; + const errEs = err as unknown as EventSourceError; // Consider 400 and 500 status errors unrecoverable, close the eventsource if (errEs.status === 400) { reject(Error(`400 Invalid topics: ${errEs.message}`)); diff --git a/packages/api/src/beacon/routes/beacon/block.ts b/packages/api/src/beacon/routes/beacon/block.ts index 3e8cd18df0db..ee1a028397fe 100644 --- a/packages/api/src/beacon/routes/beacon/block.ts +++ b/packages/api/src/beacon/routes/beacon/block.ts @@ -53,9 +53,7 @@ export type Api = { * @param blockId Block identifier. * Can be one of: "head" (canonical head in node's view), "genesis", "finalized", \, \. */ - getBlockV2( - blockId: BlockId - ): Promise< + getBlockV2(blockId: BlockId): Promise< ApiClientResponse< { [HttpStatusCode.OK]: { @@ -74,9 +72,7 @@ export type Api = { * @param blockId Block identifier. * Can be one of: "head" (canonical head in node's view), "genesis", "finalized", \, \. */ - getBlockAttestations( - blockId: BlockId - ): Promise< + getBlockAttestations(blockId: BlockId): Promise< ApiClientResponse< { [HttpStatusCode.OK]: { @@ -94,9 +90,7 @@ export type Api = { * @param blockId Block identifier. * Can be one of: "head" (canonical head in node's view), "genesis", "finalized", \, \. */ - getBlockHeader( - blockId: BlockId - ): Promise< + getBlockHeader(blockId: BlockId): Promise< ApiClientResponse< { [HttpStatusCode.OK]: { @@ -114,9 +108,7 @@ export type Api = { * @param slot * @param parentRoot */ - getBlockHeaders( - filters: Partial<{slot: Slot; parentRoot: string}> - ): Promise< + getBlockHeaders(filters: Partial<{slot: Slot; parentRoot: string}>): Promise< ApiClientResponse< { [HttpStatusCode.OK]: { @@ -134,9 +126,7 @@ export type Api = { * @param blockId Block identifier. * Can be one of: "head" (canonical head in node's view), "genesis", "finalized", \, \. */ - getBlockRoot( - blockId: BlockId - ): Promise< + getBlockRoot(blockId: BlockId): Promise< ApiClientResponse< { [HttpStatusCode.OK]: { @@ -160,9 +150,7 @@ export type Api = { * @param requestBody The `SignedBeaconBlock` object composed of `BeaconBlock` object (produced by beacon node) and validator signature. * @returns any The block was validated successfully and has been broadcast. It has also been integrated into the beacon node's database. */ - publishBlock( - block: allForks.SignedBeaconBlock - ): Promise< + publishBlock(block: allForks.SignedBeaconBlock): Promise< ApiClientResponse< { [HttpStatusCode.OK]: void; @@ -175,9 +163,7 @@ export type Api = { * Publish a signed blinded block by submitting it to the mev relay and patching in the block * transactions beacon node gets in response. */ - publishBlindedBlock( - block: allForks.SignedBlindedBeaconBlock - ): Promise< + publishBlindedBlock(block: allForks.SignedBlindedBeaconBlock): Promise< ApiClientResponse< { [HttpStatusCode.OK]: void; @@ -192,9 +178,7 @@ export type Api = { * @param blockId Block identifier. * Can be one of: "head" (canonical head in node's view), "genesis", "finalized", \, \. */ - getBlobsSidecar( - blockId: BlockId - ): Promise< + getBlobsSidecar(blockId: BlockId): Promise< ApiClientResponse<{ [HttpStatusCode.OK]: {executionOptimistic: ExecutionOptimistic; data: deneb.BlobsSidecar}; }> @@ -245,7 +229,7 @@ export function getReqSerializers(config: ChainForkConfig): ReqSerializers = { toJson: (data) => getSignedBeaconBlockType(data).toJson(data), - fromJson: (data) => getSignedBeaconBlockType((data as unknown) as allForks.SignedBeaconBlock).fromJson(data), + fromJson: (data) => getSignedBeaconBlockType(data as unknown as allForks.SignedBeaconBlock).fromJson(data), }; const getSignedBlindedBeaconBlockType = ( @@ -256,7 +240,7 @@ export function getReqSerializers(config: ChainForkConfig): ReqSerializers = { toJson: (data) => getSignedBlindedBeaconBlockType(data).toJson(data), fromJson: (data) => - getSignedBlindedBeaconBlockType((data as unknown) as allForks.SignedBlindedBeaconBlock).fromJson(data), + getSignedBlindedBeaconBlockType(data as unknown as allForks.SignedBlindedBeaconBlock).fromJson(data), }; return { diff --git a/packages/api/src/beacon/routes/events.ts b/packages/api/src/beacon/routes/events.ts index 0f504e3f5af9..65f43bd8087e 100644 --- a/packages/api/src/beacon/routes/events.ts +++ b/packages/api/src/beacon/routes/events.ts @@ -193,35 +193,35 @@ export function getTypeByEvent(config: ChainForkConfig): {[K in EventType]: Type [EventType.lightClientOptimisticUpdate]: { toJson: (data) => - getLightClientTypeFromHeader(((data as unknown) as allForks.LightClientOptimisticUpdate).attestedHeader)[ + getLightClientTypeFromHeader((data as unknown as allForks.LightClientOptimisticUpdate).attestedHeader)[ "LightClientOptimisticUpdate" ].toJson(data), fromJson: (data) => getLightClientTypeFromHeader( // eslint-disable-next-line @typescript-eslint/naming-convention - ((data as unknown) as {attested_header: allForks.LightClientHeader}).attested_header + (data as unknown as {attested_header: allForks.LightClientHeader}).attested_header )["LightClientOptimisticUpdate"].fromJson(data), }, [EventType.lightClientFinalityUpdate]: { toJson: (data) => - getLightClientTypeFromHeader(((data as unknown) as allForks.LightClientFinalityUpdate).attestedHeader)[ + getLightClientTypeFromHeader((data as unknown as allForks.LightClientFinalityUpdate).attestedHeader)[ "LightClientFinalityUpdate" ].toJson(data), fromJson: (data) => getLightClientTypeFromHeader( // eslint-disable-next-line @typescript-eslint/naming-convention - ((data as unknown) as {attested_header: allForks.LightClientHeader}).attested_header + (data as unknown as {attested_header: allForks.LightClientHeader}).attested_header )["LightClientFinalityUpdate"].fromJson(data), }, [EventType.lightClientUpdate]: { toJson: (data) => - getLightClientTypeFromHeader(((data as unknown) as allForks.LightClientUpdate).attestedHeader)[ + getLightClientTypeFromHeader((data as unknown as allForks.LightClientUpdate).attestedHeader)[ "LightClientUpdate" ].toJson(data), fromJson: (data) => getLightClientTypeFromHeader( // eslint-disable-next-line @typescript-eslint/naming-convention - ((data as unknown) as {attested_header: allForks.LightClientHeader}).attested_header + (data as unknown as {attested_header: allForks.LightClientHeader}).attested_header )["LightClientUpdate"].fromJson(data), }, }; diff --git a/packages/api/src/beacon/routes/lightclient.ts b/packages/api/src/beacon/routes/lightclient.ts index e3defa3dec1a..bbd7e9ff3864 100644 --- a/packages/api/src/beacon/routes/lightclient.ts +++ b/packages/api/src/beacon/routes/lightclient.ts @@ -60,9 +60,7 @@ export type Api = { * The trusted block root should be fetched with similar means to a weak subjectivity checkpoint. * Only block roots for checkpoints are guaranteed to be available. */ - getBootstrap( - blockRoot: string - ): Promise< + getBootstrap(blockRoot: string): Promise< ApiClientResponse<{ [HttpStatusCode.OK]: { version: ForkName; diff --git a/packages/api/src/keymanager/routes.ts b/packages/api/src/keymanager/routes.ts index 7f93a03ed799..29959f871a5a 100644 --- a/packages/api/src/keymanager/routes.ts +++ b/packages/api/src/keymanager/routes.ts @@ -164,9 +164,7 @@ export type Api = { * * https://github.com/ethereum/keymanager-APIs/blob/0c975dae2ac6053c8245ebdb6a9f27c2f114f407/keymanager-oapi.yaml */ - deleteKeys( - pubkeysHex: string[] - ): Promise< + deleteKeys(pubkeysHex: string[]): Promise< ApiClientResponse<{ [HttpStatusCode.OK]: {data: ResponseStatus[]; slashingProtection: SlashingProtectionData}; }> diff --git a/packages/api/src/utils/client/client.ts b/packages/api/src/utils/client/client.ts index 44c87c4dbbd9..0efebc737c54 100644 --- a/packages/api/src/utils/client/client.ts +++ b/packages/api/src/utils/client/client.ts @@ -59,7 +59,7 @@ export function generateGenericJsonClient< returnTypes: ReturnTypes, fetchFn: IHttpClient ): Api { - return (mapValues(routesData, (routeDef, routeId) => { + return mapValues(routesData, (routeDef, routeId) => { const fetchOptsSerializer = getFetchOptsSerializer(routeDef, reqSerializers[routeId], routeId as string); const returnType = returnTypes[routeId as keyof ReturnTypes] as TypeJson | null; @@ -94,5 +94,5 @@ export function generateGenericJsonClient< throw err; } }; - }) as unknown) as Api; + }) as unknown as Api; } diff --git a/packages/api/src/utils/client/eventSource.ts b/packages/api/src/utils/client/eventSource.ts index 427ed9472410..6b5b75124034 100644 --- a/packages/api/src/utils/client/eventSource.ts +++ b/packages/api/src/utils/client/eventSource.ts @@ -4,6 +4,6 @@ export async function getEventSource(): Promise { if (globalThis.EventSource) { return EventSource; } else { - return ((await import("eventsource")).default as unknown) as typeof EventSource; + return (await import("eventsource")).default as unknown as typeof EventSource; } } diff --git a/packages/api/src/utils/types.ts b/packages/api/src/utils/types.ts index 08e02028a193..44e22f12d9df 100644 --- a/packages/api/src/utils/types.ts +++ b/packages/api/src/utils/types.ts @@ -85,9 +85,9 @@ export const reqOnlyBody = ( /** SSZ factory helper + typed. limit = 1e6 as a big enough random number */ export function ArrayOf(elementType: Type): ArrayType, unknown, unknown> { if (isCompositeType(elementType)) { - return (new ListCompositeType(elementType, Infinity) as unknown) as ArrayType, unknown, unknown>; + return new ListCompositeType(elementType, Infinity) as unknown as ArrayType, unknown, unknown>; } else if (isBasicType(elementType)) { - return (new ListBasicType(elementType, Infinity) as unknown) as ArrayType, unknown, unknown>; + return new ListBasicType(elementType, Infinity) as unknown as ArrayType, unknown, unknown>; } else { throw Error(`Unknown type ${elementType.typeName}`); } @@ -142,7 +142,7 @@ export function ContainerDataExecutionOptimistic( export function WithVersion(getType: (fork: ForkName) => TypeJson): TypeJson<{data: T; version: ForkName}> { return { toJson: ({data, version}) => ({ - data: getType(version || ForkName.phase0).toJson(data), + data: getType(version ?? ForkName.phase0).toJson(data), version, }), fromJson: ({data, version}: {data: unknown; version: string}) => { @@ -150,7 +150,7 @@ export function WithVersion(getType: (fork: ForkName) => TypeJson): TypeJs version = version.toLowerCase(); // Un-safe external data, validate version is known ForkName value - if (!ForkName[version as ForkName]) throw Error(`Invalid version ${version}`); + if (!(version in ForkName)) throw Error(`Invalid version ${version}`); return { data: getType(version as ForkName).fromJson(data), @@ -168,7 +168,7 @@ export function WithExecutionOptimistic( ): TypeJson { return { toJson: ({executionOptimistic, ...data}) => ({ - ...(type.toJson((data as unknown) as T) as Record), + ...(type.toJson(data as unknown as T) as Record), execution_optimistic: executionOptimistic, }), fromJson: ({execution_optimistic, ...data}: T & {execution_optimistic: boolean}) => ({ @@ -184,7 +184,7 @@ export function WithExecutionOptimistic( export function WithBlockValue(type: TypeJson): TypeJson { return { toJson: ({blockValue, ...data}) => ({ - ...(type.toJson((data as unknown) as T) as Record), + ...(type.toJson(data as unknown as T) as Record), block_value: blockValue.toString(), }), fromJson: ({block_value, ...data}: T & {block_value: string}) => ({ @@ -211,7 +211,7 @@ export function jsonType | Record(): TypeJson { return { toJson: (val) => val as unknown, - fromJson: (json) => (json as unknown) as T, + fromJson: (json) => json as unknown as T, }; } diff --git a/packages/beacon-node/package.json b/packages/beacon-node/package.json index b152e923944b..c9d1086bc68b 100644 --- a/packages/beacon-node/package.json +++ b/packages/beacon-node/package.json @@ -162,7 +162,7 @@ }, "devDependencies": { "@types/bl": "^5.0.1", - "@types/eventsource": "^1.1.5", + "@types/eventsource": "^1.1.11", "@types/leveldown": "^4.0.2", "@types/prometheus-gc-stats": "^0.6.1", "@types/qs": "^6.9.7", diff --git a/packages/beacon-node/src/api/impl/validator/index.ts b/packages/beacon-node/src/api/impl/validator/index.ts index 53441c898a81..fa7c27864e49 100644 --- a/packages/beacon-node/src/api/impl/validator/index.ts +++ b/packages/beacon-node/src/api/impl/validator/index.ts @@ -185,50 +185,47 @@ export function getValidatorApi({ ); } - const produceBlindedBlock: ServerApi["produceBlindedBlock"] = async function produceBlindedBlock( - slot, - randaoReveal, - graffiti - ) { - const source = BlockSource.builder; - let timer; - metrics?.blockProductionRequests.inc({source}); - try { - notWhileSyncing(); - await waitForSlot(slot); // Must never request for a future slot > currentSlot - - // Error early for builder if builder flow not active - if (!chain.executionBuilder) { - throw Error("Execution builder not set"); - } - if (!chain.executionBuilder.status) { - throw Error("Execution builder disabled"); - } + const produceBlindedBlock: ServerApi["produceBlindedBlock"] = + async function produceBlindedBlock(slot, randaoReveal, graffiti) { + const source = BlockSource.builder; + let timer; + metrics?.blockProductionRequests.inc({source}); + try { + notWhileSyncing(); + await waitForSlot(slot); // Must never request for a future slot > currentSlot + + // Error early for builder if builder flow not active + if (!chain.executionBuilder) { + throw Error("Execution builder not set"); + } + if (!chain.executionBuilder.status) { + throw Error("Execution builder disabled"); + } - // Process the queued attestations in the forkchoice for correct head estimation - // forkChoice.updateTime() might have already been called by the onSlot clock - // handler, in which case this should just return. - chain.forkChoice.updateTime(slot); - chain.forkChoice.updateHead(); + // Process the queued attestations in the forkchoice for correct head estimation + // forkChoice.updateTime() might have already been called by the onSlot clock + // handler, in which case this should just return. + chain.forkChoice.updateTime(slot); + chain.forkChoice.updateHead(); - timer = metrics?.blockProductionTime.startTimer(); - const {block, blockValue} = await chain.produceBlindedBlock({ - slot, - randaoReveal, - graffiti: toGraffitiBuffer(graffiti || ""), - }); - metrics?.blockProductionSuccess.inc({source}); - metrics?.blockProductionNumAggregated.observe({source}, block.body.attestations.length); - logger.verbose("Produced blinded block", { - slot, - blockValue, - root: toHexString(config.getBlindedForkTypes(slot).BeaconBlock.hashTreeRoot(block)), - }); - return {data: block, version: config.getForkName(block.slot), blockValue}; - } finally { - if (timer) timer({source}); - } - }; + timer = metrics?.blockProductionTime.startTimer(); + const {block, blockValue} = await chain.produceBlindedBlock({ + slot, + randaoReveal, + graffiti: toGraffitiBuffer(graffiti || ""), + }); + metrics?.blockProductionSuccess.inc({source}); + metrics?.blockProductionNumAggregated.observe({source}, block.body.attestations.length); + logger.verbose("Produced blinded block", { + slot, + blockValue, + root: toHexString(config.getBlindedForkTypes(slot).BeaconBlock.hashTreeRoot(block)), + }); + return {data: block, version: config.getForkName(block.slot), blockValue}; + } finally { + if (timer) timer({source}); + } + }; const produceBlock: ServerApi["produceBlockV2"] = async function produceBlock( slot, diff --git a/packages/beacon-node/src/chain/bls/multithread/index.ts b/packages/beacon-node/src/chain/bls/multithread/index.ts index 484c29accf09..bc67ff0a2e1f 100644 --- a/packages/beacon-node/src/chain/bls/multithread/index.ts +++ b/packages/beacon-node/src/chain/bls/multithread/index.ts @@ -189,7 +189,7 @@ export class BlsMultiThreadWorkerPool implements IBlsVerifier { Array.from(this.workers.entries()).map(([id, worker]) => // NOTE: 'threads' has not yet updated types, and NodeJS complains with // [DEP0132] DeprecationWarning: Passing a callback to worker.terminate() is deprecated. It returns a Promise instead. - ((worker.worker.terminate() as unknown) as Promise).catch((e: Error) => { + (worker.worker.terminate() as unknown as Promise).catch((e: Error) => { this.logger.error("Error terminating worker", {id}, e); }) ) diff --git a/packages/beacon-node/src/chain/produceBlock/produceBlockBody.ts b/packages/beacon-node/src/chain/produceBlock/produceBlockBody.ts index 7541c2a19062..794f1c8d7b8c 100644 --- a/packages/beacon-node/src/chain/produceBlock/produceBlockBody.ts +++ b/packages/beacon-node/src/chain/produceBlock/produceBlockBody.ts @@ -109,12 +109,8 @@ export async function produceBlockBody( // } // } - const [ - attesterSlashings, - proposerSlashings, - voluntaryExits, - blsToExecutionChanges, - ] = this.opPool.getSlashingsAndExits(currentState); + const [attesterSlashings, proposerSlashings, voluntaryExits, blsToExecutionChanges] = + this.opPool.getSlashingsAndExits(currentState); const attestations = this.aggregatedAttestationPool.getAttestationsForBlock(this.forkChoice, currentState); const {eth1Data, deposits} = await this.eth1.getEth1DataAndDeposits(currentState); @@ -207,9 +203,8 @@ export async function produceBlockBody( ); if (prepareRes.isPremerge) { - (blockBody as allForks.ExecutionBlockBody).executionPayload = ssz.allForksExecution[ - fork - ].ExecutionPayload.defaultValue(); + (blockBody as allForks.ExecutionBlockBody).executionPayload = + ssz.allForksExecution[fork].ExecutionPayload.defaultValue(); blobsResult = {type: BlobsResultType.preDeneb}; blockValue = BigInt(0); } else { @@ -276,9 +271,8 @@ export async function produceBlockBody( {}, e as Error ); - (blockBody as allForks.ExecutionBlockBody).executionPayload = ssz.allForksExecution[ - fork - ].ExecutionPayload.defaultValue(); + (blockBody as allForks.ExecutionBlockBody).executionPayload = + ssz.allForksExecution[fork].ExecutionPayload.defaultValue(); blobsResult = {type: BlobsResultType.preDeneb}; blockValue = BigInt(0); } else { diff --git a/packages/beacon-node/src/db/repositories/backfilledRanges.ts b/packages/beacon-node/src/db/repositories/backfilledRanges.ts index c0c33da34112..ccd75188d135 100644 --- a/packages/beacon-node/src/db/repositories/backfilledRanges.ts +++ b/packages/beacon-node/src/db/repositories/backfilledRanges.ts @@ -18,7 +18,7 @@ export class BackfilledRanges extends Repository { } decodeKey(data: Buffer): number { - return bytesToInt((super.decodeKey(data) as unknown) as Uint8Array, "be"); + return bytesToInt(super.decodeKey(data) as unknown as Uint8Array, "be"); } // eslint-disable-next-line @typescript-eslint/no-unused-vars diff --git a/packages/beacon-node/src/db/repositories/blobsSidecarArchive.ts b/packages/beacon-node/src/db/repositories/blobsSidecarArchive.ts index 64c86dc9ef58..6d283ee0e366 100644 --- a/packages/beacon-node/src/db/repositories/blobsSidecarArchive.ts +++ b/packages/beacon-node/src/db/repositories/blobsSidecarArchive.ts @@ -28,6 +28,6 @@ export class BlobsSidecarArchiveRepository extends Repository { const firstSlot = this.getFirstSlot(opts); const valuesStream = super.valuesStream(opts); - const step = (opts && opts.step) || 1; + const step = (opts && opts.step) ?? 1; for await (const value of valuesStream) { if ((value.message.slot - firstSlot) % step === 0) { diff --git a/packages/beacon-node/src/db/repositories/depositDataRoot.ts b/packages/beacon-node/src/db/repositories/depositDataRoot.ts index 6a56e0e95175..571144ed07b1 100644 --- a/packages/beacon-node/src/db/repositories/depositDataRoot.ts +++ b/packages/beacon-node/src/db/repositories/depositDataRoot.ts @@ -15,7 +15,7 @@ export class DepositDataRootRepository extends Repository { } decodeKey(data: Buffer): number { - return bytesToInt((super.decodeKey(data) as unknown) as Uint8Array, "be"); + return bytesToInt(super.decodeKey(data) as unknown as Uint8Array, "be"); } // depositDataRoots stored by depositData index diff --git a/packages/beacon-node/src/db/repositories/eth1Data.ts b/packages/beacon-node/src/db/repositories/eth1Data.ts index fab6c6f14fa5..4358cb81e219 100644 --- a/packages/beacon-node/src/db/repositories/eth1Data.ts +++ b/packages/beacon-node/src/db/repositories/eth1Data.ts @@ -9,7 +9,7 @@ export class Eth1DataRepository extends Repository Slot diff --git a/packages/beacon-node/src/eth1/provider/jwt.ts b/packages/beacon-node/src/eth1/provider/jwt.ts index bc844755634f..91d2e063fba2 100644 --- a/packages/beacon-node/src/eth1/provider/jwt.ts +++ b/packages/beacon-node/src/eth1/provider/jwt.ts @@ -16,7 +16,7 @@ export function encodeJwtToken( claim, // Note: This type casting is required as even though jwt-simple accepts a buffer as a // secret types definitions exposed by @types/jwt-simple only takes a string - (jwtSecret as unknown) as string, + jwtSecret as unknown as string, algorithm ); return token; @@ -27,6 +27,6 @@ export function decodeJwtToken( jwtSecret: Buffer | Uint8Array | string, algorithm: TAlgorithm = "HS256" ): JwtClaim { - const claim = decode(token, (jwtSecret as never) as string, false, algorithm) as JwtClaim; + const claim = decode(token, jwtSecret as never as string, false, algorithm) as JwtClaim; return claim; } diff --git a/packages/beacon-node/src/execution/engine/http.ts b/packages/beacon-node/src/execution/engine/http.ts index 4626c5f2b9ed..ce9956212842 100644 --- a/packages/beacon-node/src/execution/engine/http.ts +++ b/packages/beacon-node/src/execution/engine/http.ts @@ -142,11 +142,13 @@ export class ExecutionEngineHttp implements IExecutionEngine { ? "engine_newPayloadV2" : "engine_newPayloadV1"; const serializedExecutionPayload = serializeExecutionPayload(fork, executionPayload); - const {status, latestValidHash, validationError} = await (this.rpcFetchQueue.push({ - method, - params: [serializedExecutionPayload], - methodOpts: notifyNewPayloadOpts, - }) as Promise) + const {status, latestValidHash, validationError} = await ( + this.rpcFetchQueue.push({ + method, + params: [serializedExecutionPayload], + methodOpts: notifyNewPayloadOpts, + }) as Promise + ) // If there are errors by EL like connection refused, internal error, they need to be // treated separate from being INVALID. For now, just pass the error upstream. .catch((e: Error): EngineApiRpcReturnTypes[typeof method] => { diff --git a/packages/beacon-node/src/metrics/metrics.ts b/packages/beacon-node/src/metrics/metrics.ts index 0b9f9c05d76d..8c38fae72c82 100644 --- a/packages/beacon-node/src/metrics/metrics.ts +++ b/packages/beacon-node/src/metrics/metrics.ts @@ -38,7 +38,7 @@ export function createMetrics( // Merge external registries for (const externalRegister of externalRegistries) { for (const metric of externalRegister.getMetricsAsArray()) { - register.registerMetric((metric as unknown) as Metric); + register.registerMetric(metric as unknown as Metric); } } diff --git a/packages/beacon-node/src/metrics/metrics/lodestar.ts b/packages/beacon-node/src/metrics/metrics/lodestar.ts index 62bd4c3f1db7..83600bcc090b 100644 --- a/packages/beacon-node/src/metrics/metrics/lodestar.ts +++ b/packages/beacon-node/src/metrics/metrics/lodestar.ts @@ -837,8 +837,7 @@ export function createLodestarMetrics( }), prevEpochOnChainSourceAttesterMiss: register.gauge({ name: "validator_monitor_prev_epoch_on_chain_source_attester_miss_total", - help: - "Incremented if the validator is not flagged as a previous epoch source attester during per epoch processing", + help: "Incremented if the validator is not flagged as a previous epoch source attester during per epoch processing", }), prevEpochOnChainHeadAttesterHit: register.gauge({ name: "validator_monitor_prev_epoch_on_chain_head_attester_hit_total", @@ -846,8 +845,7 @@ export function createLodestarMetrics( }), prevEpochOnChainHeadAttesterMiss: register.gauge({ name: "validator_monitor_prev_epoch_on_chain_head_attester_miss_total", - help: - "Incremented if the validator is not flagged as a previous epoch head attester during per epoch processing", + help: "Incremented if the validator is not flagged as a previous epoch head attester during per epoch processing", }), prevOnChainAttesterCorrectHead: register.gauge({ name: "validator_monitor_prev_epoch_on_chain_attester_correct_head_total", @@ -863,8 +861,7 @@ export function createLodestarMetrics( }), prevEpochOnChainTargetAttesterMiss: register.gauge({ name: "validator_monitor_prev_epoch_on_chain_target_attester_miss_total", - help: - "Incremented if the validator is not flagged as a previous epoch target attester during per epoch processing", + help: "Incremented if the validator is not flagged as a previous epoch target attester during per epoch processing", }), prevEpochOnChainInclusionDistance: register.histogram({ name: "validator_monitor_prev_epoch_on_chain_inclusion_distance", diff --git a/packages/beacon-node/src/network/discv5/index.ts b/packages/beacon-node/src/network/discv5/index.ts index 3a5b6a8e62f0..0d079c25456f 100644 --- a/packages/beacon-node/src/network/discv5/index.ts +++ b/packages/beacon-node/src/network/discv5/index.ts @@ -79,7 +79,7 @@ export class Discv5Worker extends (EventEmitter as {new (): StrictEventEmitter[0]["config"]; +type Discv5Config = Parameters<(typeof Discv5)["create"]>[0]["config"]; /** discv5 worker constructor data */ export interface Discv5WorkerData { diff --git a/packages/beacon-node/src/network/gossip/gossipsub.ts b/packages/beacon-node/src/network/gossip/gossipsub.ts index bd66d4952c07..f08975ab716d 100644 --- a/packages/beacon-node/src/network/gossip/gossipsub.ts +++ b/packages/beacon-node/src/network/gossip/gossipsub.ts @@ -127,7 +127,7 @@ export class Eth2Gossipsub extends GossipSub implements GossipBeaconNode { dataTransform: new DataTransformSnappy( isFinite(config.BELLATRIX_FORK_EPOCH) ? GOSSIP_MAX_SIZE_BELLATRIX : GOSSIP_MAX_SIZE ), - metricsRegister: modules.metrics ? ((modules.metrics.register as unknown) as MetricsRegister) : null, + metricsRegister: modules.metrics ? (modules.metrics.register as unknown as MetricsRegister) : null, metricsTopicStrToLabel: modules.metrics ? getMetricsTopicStrToLabel(modules.config) : undefined, asyncValidation: true, diff --git a/packages/beacon-node/src/network/gossip/scoringParameters.ts b/packages/beacon-node/src/network/gossip/scoringParameters.ts index 2f1365af2757..afde2060a917 100644 --- a/packages/beacon-node/src/network/gossip/scoringParameters.ts +++ b/packages/beacon-node/src/network/gossip/scoringParameters.ts @@ -300,9 +300,7 @@ function scoreParameterDecayWithBase(decayTimeMs: number, decayIntervalMs: numbe return Math.pow(decayToZero, 1 / ticks); } -function expectedAggregatorCountPerSlot( - activeValidatorCount: number -): { +function expectedAggregatorCountPerSlot(activeValidatorCount: number): { aggregatorsPerslot: number; committeesPerSlot: number; } { diff --git a/packages/beacon-node/src/network/gossip/validation/index.ts b/packages/beacon-node/src/network/gossip/validation/index.ts index 4bc07d9405ac..3f1a5f20742c 100644 --- a/packages/beacon-node/src/network/gossip/validation/index.ts +++ b/packages/beacon-node/src/network/gossip/validation/index.ts @@ -35,14 +35,11 @@ export function createValidatorFnsByType( const jobQueues = createValidationQueues(gossipValidatorFns, modules.signal, modules.metrics); - const validatorFnsByType = mapValues( - jobQueues, - (jobQueue): GossipValidatorFn => { - return async function gossipValidatorFnWithQueue(topic, gossipMsg, propagationSource, seenTimestampSec) { - return jobQueue.push(topic, gossipMsg, propagationSource, seenTimestampSec); - }; - } - ); + const validatorFnsByType = mapValues(jobQueues, (jobQueue): GossipValidatorFn => { + return async function gossipValidatorFnWithQueue(topic, gossipMsg, propagationSource, seenTimestampSec) { + return jobQueue.push(topic, gossipMsg, propagationSource, seenTimestampSec); + }; + }); return {jobQueues, validatorFnsByType}; } diff --git a/packages/beacon-node/src/network/network.ts b/packages/beacon-node/src/network/network.ts index f7d8ce534c7c..4b69e324d819 100644 --- a/packages/beacon-node/src/network/network.ts +++ b/packages/beacon-node/src/network/network.ts @@ -484,7 +484,7 @@ export class Network implements INetwork { const activeForks = getActiveForks(this.config, epoch); for (let i = 0; i < activeForks.length; i++) { // Only when a new fork is scheduled post this one - if (activeForks[i + 1]) { + if (activeForks[i + 1] !== undefined) { const prevFork = activeForks[i]; const nextFork = activeForks[i + 1]; const forkEpoch = this.config.forks[nextFork].epoch; diff --git a/packages/beacon-node/src/network/peers/datastore.ts b/packages/beacon-node/src/network/peers/datastore.ts index a999cd1c5a31..45093a8e085d 100644 --- a/packages/beacon-node/src/network/peers/datastore.ts +++ b/packages/beacon-node/src/network/peers/datastore.ts @@ -113,7 +113,7 @@ export class Eth2PeerDataStore extends BaseDatastore { } catch (err) { // this is the same to how js-datastore-level handles notFound error // https://github.com/ipfs/js-datastore-level/blob/38f44058dd6be858e757a1c90b8edb31590ec0bc/src/index.js#L121 - if (((err as unknown) as {notFound: boolean}).notFound) return false; + if ((err as unknown as {notFound: boolean}).notFound) return false; throw err; } return true; diff --git a/packages/beacon-node/src/network/util.ts b/packages/beacon-node/src/network/util.ts index 6e142026aeda..ece96941b240 100644 --- a/packages/beacon-node/src/network/util.ts +++ b/packages/beacon-node/src/network/util.ts @@ -71,7 +71,7 @@ export function prettyPrintPeerId(peerId: PeerId): string { */ // Compat function for type mismatch reasons export function getConnectionsMap(connectionManager: ConnectionManager): Map { - return ((connectionManager as unknown) as DefaultConnectionManager)["connections"] as Map; + return (connectionManager as unknown as DefaultConnectionManager)["connections"] as Map; } export function getConnection(connectionManager: ConnectionManager, peerIdStr: string): Connection | undefined { @@ -84,5 +84,5 @@ export function isPublishToZeroPeersError(e: Error): boolean { } export function getDefaultDialer(libp2p: Libp2p): DefaultDialer { - return ((libp2p as unknown) as {components: Components}).components.dialer as DefaultDialer; + return (libp2p as unknown as {components: Components}).components.dialer as DefaultDialer; } diff --git a/packages/beacon-node/test/e2e/api/impl/config.test.ts b/packages/beacon-node/test/e2e/api/impl/config.test.ts index e1d66d76fe3b..7229f7cee3e8 100644 --- a/packages/beacon-node/test/e2e/api/impl/config.test.ts +++ b/packages/beacon-node/test/e2e/api/impl/config.test.ts @@ -52,9 +52,9 @@ async function downloadRemoteConstants(commit: string): Promise { // If some future fork does not specify one of this docs, refactor to fetch some docs only on some forks for (const docName of ["beacon-chain.md", "validator.md"]) { downloadedSpecs.push( - fetch( - `https://raw.githubusercontent.com/ethereum/consensus-specs/${commit}/specs/${forkName}/${docName}` - ).then((res) => res.text()) + fetch(`https://raw.githubusercontent.com/ethereum/consensus-specs/${commit}/specs/${forkName}/${docName}`).then( + (res) => res.text() + ) ); } } diff --git a/packages/beacon-node/test/e2e/eth1/eth1MergeBlockTracker.test.ts b/packages/beacon-node/test/e2e/eth1/eth1MergeBlockTracker.test.ts index 7a5a71cce210..b0e4819a4f3a 100644 --- a/packages/beacon-node/test/e2e/eth1/eth1MergeBlockTracker.test.ts +++ b/packages/beacon-node/test/e2e/eth1/eth1MergeBlockTracker.test.ts @@ -21,14 +21,14 @@ describe.skip("eth1 / Eth1MergeBlockTracker", function () { const logger = testLogger(); function getConfig(ttd: bigint): ChainConfig { - return ({ + return { // Set time units to 1s to make the test faster SECONDS_PER_ETH1_BLOCK: 1, SECONDS_PER_SLOT: 1, DEPOSIT_CONTRACT_ADDRESS: Buffer.alloc(32, 0), TERMINAL_TOTAL_DIFFICULTY: ttd, TERMINAL_BLOCK_HASH: ZERO_HASH, - } as Partial) as ChainConfig; + } as Partial as ChainConfig; } const eth1Config = {DEPOSIT_CONTRACT_ADDRESS: ZERO_HASH}; diff --git a/packages/beacon-node/test/e2e/network/peers/peerManager.test.ts b/packages/beacon-node/test/e2e/network/peers/peerManager.test.ts index 6a15f56f92cd..bb6cf63caadb 100644 --- a/packages/beacon-node/test/e2e/network/peers/peerManager.test.ts +++ b/packages/beacon-node/test/e2e/network/peers/peerManager.test.ts @@ -84,7 +84,7 @@ describe("network / peers / PeerManager", function () { networkEventBus, attnetsService: mockSubnetsService, syncnetsService: mockSubnetsService, - gossip: ({getScore: () => 0, scoreParams: {decayInterval: 1000}} as unknown) as Eth2Gossipsub, + gossip: {getScore: () => 0, scoreParams: {decayInterval: 1000}} as unknown as Eth2Gossipsub, peersData: new PeersData(), }, { diff --git a/packages/beacon-node/test/e2e/network/reqresp.test.ts b/packages/beacon-node/test/e2e/network/reqresp.test.ts index 62d462b13918..33f6a645b63b 100644 --- a/packages/beacon-node/test/e2e/network/reqresp.test.ts +++ b/packages/beacon-node/test/e2e/network/reqresp.test.ts @@ -290,10 +290,12 @@ describe("network / ReqResp", function () { expect( ssz.altair.LightClientUpdate.equals( returnedUpdate, - (lightClientUpdates[i] as { - type: EncodedPayloadType.ssz; - data: altair.LightClientUpdate; - }).data + ( + lightClientUpdates[i] as { + type: EncodedPayloadType.ssz; + data: altair.LightClientUpdate; + } + ).data ) ).to.equal(true, `Wrong returnedUpdate[${i}]`); } diff --git a/packages/beacon-node/test/perf/eth1/pickEth1Vote.test.ts b/packages/beacon-node/test/perf/eth1/pickEth1Vote.test.ts index 56f88eb15de3..80ff464edd71 100644 --- a/packages/beacon-node/test/perf/eth1/pickEth1Vote.test.ts +++ b/packages/beacon-node/test/perf/eth1/pickEth1Vote.test.ts @@ -39,11 +39,11 @@ describe("eth1 / pickEth1Vote", () => { })); itBench("pickEth1Vote - no votes", () => { - pickEth1Vote((stateNoVotes as unknown) as BeaconStateAllForks, votesToConsider); + pickEth1Vote(stateNoVotes as unknown as BeaconStateAllForks, votesToConsider); }); itBench("pickEth1Vote - max votes", () => { - pickEth1Vote((stateMaxVotes as unknown) as BeaconStateAllForks, votesToConsider); + pickEth1Vote(stateMaxVotes as unknown as BeaconStateAllForks, votesToConsider); }); }); diff --git a/packages/beacon-node/test/spec/general/ssz_generic.ts b/packages/beacon-node/test/spec/general/ssz_generic.ts index 64263353dc79..cbcd4fc754d9 100644 --- a/packages/beacon-node/test/spec/general/ssz_generic.ts +++ b/packages/beacon-node/test/spec/general/ssz_generic.ts @@ -13,54 +13,51 @@ import {getTestType} from "./ssz_generic_types.js"; // tests / general / phase0 / ssz_generic / basic_vector / valid / vec_bool_1_max/meta.yaml // -export const sszGeneric = (skippedTypes: string[]): TestRunnerCustom => ( - fork, - typeName, - testSuite, - testSuiteDirpath -) => { - if (testSuite === "invalid") { - for (const testCase of fs.readdirSync(testSuiteDirpath)) { - it(testCase, () => { - // TODO: Strong type errors and assert that the entire it() throws known errors - if (testCase.endsWith("_0")) { - expect(() => getTestType(typeName, testSuite), "Must throw constructing type").to.throw(); - return; - } +export const sszGeneric = + (skippedTypes: string[]): TestRunnerCustom => + (fork, typeName, testSuite, testSuiteDirpath) => { + if (testSuite === "invalid") { + for (const testCase of fs.readdirSync(testSuiteDirpath)) { + it(testCase, () => { + // TODO: Strong type errors and assert that the entire it() throws known errors + if (testCase.endsWith("_0")) { + expect(() => getTestType(typeName, testSuite), "Must throw constructing type").to.throw(); + return; + } - const type = getTestType(typeName, testCase); - const testData = parseSszGenericInvalidTestcase(path.join(testSuiteDirpath, testCase)); + const type = getTestType(typeName, testCase); + const testData = parseSszGenericInvalidTestcase(path.join(testSuiteDirpath, testCase)); - /* eslint-disable no-console */ - if (process.env.DEBUG) { - console.log({serialized: Buffer.from(testData.serialized).toString("hex")}); - } + /* eslint-disable no-console */ + if (process.env.DEBUG) { + console.log({serialized: Buffer.from(testData.serialized).toString("hex")}); + } - // Unlike the valid suite, invalid encodings do not have any value or hash tree root. The serialized data - // should simply not be decoded without raising an error. - // Note that for some type declarations in the invalid suite, the type itself may technically be invalid. - // This is a valid way of detecting invalid data too. E.g. a 0-length basic vector. - expect(() => type.deserialize(testData.serialized), "Must throw on deserialize").to.throw(); - }); - } - } else if (testSuite === "valid") { - for (const testCase of fs.readdirSync(testSuiteDirpath)) { - // Do not manually skip tests here, do it in packages/beacon-node/test/spec/general/index.test.ts - if (skippedTypes.some((skippedType) => testCase.startsWith(skippedType))) { - continue; + // Unlike the valid suite, invalid encodings do not have any value or hash tree root. The serialized data + // should simply not be decoded without raising an error. + // Note that for some type declarations in the invalid suite, the type itself may technically be invalid. + // This is a valid way of detecting invalid data too. E.g. a 0-length basic vector. + expect(() => type.deserialize(testData.serialized), "Must throw on deserialize").to.throw(); + }); } + } else if (testSuite === "valid") { + for (const testCase of fs.readdirSync(testSuiteDirpath)) { + // Do not manually skip tests here, do it in packages/beacon-node/test/spec/general/index.test.ts + if (skippedTypes.some((skippedType) => testCase.startsWith(skippedType))) { + continue; + } - it(testCase, () => { - const type = getTestType(typeName, testCase); - const testData = parseSszGenericValidTestcase(path.join(testSuiteDirpath, testCase)); - runValidSszTest(type, { - root: testData.root, - serialized: testData.serialized, - jsonValue: testData.jsonValue, + it(testCase, () => { + const type = getTestType(typeName, testCase); + const testData = parseSszGenericValidTestcase(path.join(testSuiteDirpath, testCase)); + runValidSszTest(type, { + root: testData.root, + serialized: testData.serialized, + jsonValue: testData.jsonValue, + }); }); - }); + } + } else { + throw Error(`Unknown ssz_generic testSuite ${testSuite}`); } - } else { - throw Error(`Unknown ssz_generic testSuite ${testSuite}`); - } -}; + }; diff --git a/packages/beacon-node/test/spec/presets/epoch_processing.ts b/packages/beacon-node/test/spec/presets/epoch_processing.ts index 4b00be893994..4ddd279569bc 100644 --- a/packages/beacon-node/test/spec/presets/epoch_processing.ts +++ b/packages/beacon-node/test/spec/presets/epoch_processing.ts @@ -47,48 +47,48 @@ type EpochProcessingTestCase = { * @param fork * @param epochProcessFns Describe with which function to run each directory of tests */ -export const epochProcessing = ( - skipTestNames?: string[] -): TestRunnerFn => (fork, testName) => { - const config = getConfig(fork); +export const epochProcessing = + (skipTestNames?: string[]): TestRunnerFn => + (fork, testName) => { + const config = getConfig(fork); - const epochProcessFn = epochProcessFns[testName]; - if (epochProcessFn === undefined) { - throw Error(`No epochProcessFn for ${testName}`); - } + const epochProcessFn = epochProcessFns[testName]; + if (epochProcessFn === undefined) { + throw Error(`No epochProcessFn for ${testName}`); + } - return { - testFunction: (testcase) => { - const stateTB = testcase.pre.clone(); - const state = createCachedBeaconStateTest(stateTB, config); + return { + testFunction: (testcase) => { + const stateTB = testcase.pre.clone(); + const state = createCachedBeaconStateTest(stateTB, config); - const epochProcess = beforeProcessEpoch(state, {assertCorrectProgressiveBalances}); + const epochProcess = beforeProcessEpoch(state, {assertCorrectProgressiveBalances}); - if (testcase.post === undefined) { - // If post.ssz_snappy is not value, the sub-transition processing is aborted - // https://github.com/ethereum/consensus-specs/blob/dev/tests/formats/epoch_processing/README.md#postssz_snappy - expect(() => epochProcessFn(state, epochProcess)).to.throw(); - } else { - epochProcessFn(state, epochProcess); - } + if (testcase.post === undefined) { + // If post.ssz_snappy is not value, the sub-transition processing is aborted + // https://github.com/ethereum/consensus-specs/blob/dev/tests/formats/epoch_processing/README.md#postssz_snappy + expect(() => epochProcessFn(state, epochProcess)).to.throw(); + } else { + epochProcessFn(state, epochProcess); + } - state.commit(); + state.commit(); - return state; - }, - options: { - inputTypes: inputTypeSszTreeViewDU, - sszTypes: { - pre: ssz[fork].BeaconState, - post: ssz[fork].BeaconState, + return state; }, - getExpected: (testCase) => testCase.post, - expectFunc: (testCase, expected, actual) => { - expectEqualBeaconState(fork, expected, actual); + options: { + inputTypes: inputTypeSszTreeViewDU, + sszTypes: { + pre: ssz[fork].BeaconState, + post: ssz[fork].BeaconState, + }, + getExpected: (testCase) => testCase.post, + expectFunc: (testCase, expected, actual) => { + expectEqualBeaconState(fork, expected, actual); + }, + // Do not manually skip tests here, do it in packages/beacon-node/test/spec/presets/index.test.ts + shouldSkip: (_testcase, name, _index) => + skipTestNames !== undefined && skipTestNames.some((skipTestName) => name.includes(skipTestName)), }, - // Do not manually skip tests here, do it in packages/beacon-node/test/spec/presets/index.test.ts - shouldSkip: (_testcase, name, _index) => - skipTestNames !== undefined && skipTestNames.some((skipTestName) => name.includes(skipTestName)), - }, + }; }; -}; diff --git a/packages/beacon-node/test/spec/presets/finality.ts b/packages/beacon-node/test/spec/presets/finality.ts index d488ec115d19..132318083f3d 100644 --- a/packages/beacon-node/test/spec/presets/finality.ts +++ b/packages/beacon-node/test/spec/presets/finality.ts @@ -54,7 +54,7 @@ export const finality: TestRunnerFn = (fo }; }; -type BlocksSZZTypeMapping = Record; +type BlocksSZZTypeMapping = Record; export function generateBlocksSZZTypeMapping(fork: ForkName, n: number): BlocksSZZTypeMapping { const blocksMapping: BlocksSZZTypeMapping = {}; diff --git a/packages/beacon-node/test/spec/presets/fork_choice.ts b/packages/beacon-node/test/spec/presets/fork_choice.ts index 02d3ea55fd9a..d8be41ffe703 100644 --- a/packages/beacon-node/test/spec/presets/fork_choice.ts +++ b/packages/beacon-node/test/spec/presets/fork_choice.ts @@ -37,281 +37,281 @@ const ATTESTER_SLASHING_FILE_NAME = "^(attester_slashing)_([0-9a-zA-Z])+$"; const logger = testLogger("spec-test"); -export const forkChoiceTest = (opts: {onlyPredefinedResponses: boolean}): TestRunnerFn => ( - fork -) => { - return { - testFunction: async (testcase) => { - if (isForkBlobs(fork)) { - await initCKZG(); - loadEthereumTrustedSetup(); - } - - const {steps, anchorState} = testcase; - const currentSlot = anchorState.slot; - const config = getConfig(fork); - const state = createCachedBeaconStateTest(anchorState, config); - - /** This is to track test's tickTime to be used in proposer boost */ - let tickTime = 0; - const clock = new ClockStopped(currentSlot); - const eth1 = new Eth1ForBlockProductionMock(); - const executionEngineBackend = new ExecutionEngineMockBackend({ - onlyPredefinedResponses: opts.onlyPredefinedResponses, - genesisBlockHash: isExecutionStateType(anchorState) - ? toHexString(anchorState.latestExecutionPayloadHeader.blockHash) - : ZERO_HASH_HEX, - }); - - const controller = new AbortController(); - const executionEngine = getExecutionEngineFromBackend(executionEngineBackend, {signal: controller.signal}); - - const chain = new BeaconChain( - { - ...defaultChainOptions, - // Do not start workers - blsVerifyAllMainThread: true, - // Do not run any archiver tasks - disableArchiveOnCheckpoint: true, - // Since the tests have deep-reorgs attested data is not available often printing lots of error logs. - // While this function is only called for head blocks, best to disable. - disableLightClientServerOnImportBlockHead: true, - // No need to log BlockErrors, the spec test runner will only log them if not not expected - // Otherwise spec tests logs get cluttered with expected errors - disableOnBlockError: true, - // PrepareNextSlot scheduler is used to precompute epoch transition and prepare for the next payload - // we don't use these in fork choice spec tests - disablePrepareNextSlot: true, - assertCorrectProgressiveBalances, - }, - { - config: createBeaconConfig(config, state.genesisValidatorsRoot), - db: getStubbedBeaconDb(), - logger, - // eslint-disable-next-line @typescript-eslint/no-empty-function - processShutdownCallback: () => {}, - clock, - metrics: null, - anchorState, - eth1, - executionEngine, - executionBuilder: undefined, +export const forkChoiceTest = + (opts: {onlyPredefinedResponses: boolean}): TestRunnerFn => + (fork) => { + return { + testFunction: async (testcase) => { + if (isForkBlobs(fork)) { + await initCKZG(); + loadEthereumTrustedSetup(); } - ); - - const stepsLen = steps.length; - logger.debug("Fork choice test", {steps: stepsLen}); - - try { - for (const [i, step] of steps.entries()) { - if (isTick(step)) { - tickTime = bnToNum(step.tick); - const currentSlot = Math.floor(tickTime / config.SECONDS_PER_SLOT); - logger.debug(`Step ${i}/${stepsLen} tick`, {currentSlot, valid: Boolean(step.valid), time: tickTime}); - chain.emitter.emit(ChainEvent.clockSlot, currentSlot); - clock.setSlot(currentSlot); - } - - // attestation step - else if (isAttestation(step)) { - logger.debug(`Step ${i}/${stepsLen} attestation`, {root: step.attestation, valid: Boolean(step.valid)}); - const attestation = testcase.attestations.get(step.attestation); - if (!attestation) throw Error(`No attestation ${step.attestation}`); - const headState = chain.getHeadState(); - chain.forkChoice.onAttestation(headState.epochCtx.getIndexedAttestation(attestation)); - } - // attester slashing step - else if (isAttesterSlashing(step)) { - logger.debug(`Step ${i}/${stepsLen} attester slashing`, { - root: step.attester_slashing, - valid: Boolean(step.valid), - }); - const attesterSlashing = testcase.attesterSlashings.get(step.attester_slashing); - if (!attesterSlashing) throw Error(`No attester slashing ${step.attester_slashing}`); - chain.forkChoice.onAttesterSlashing(attesterSlashing); + const {steps, anchorState} = testcase; + const currentSlot = anchorState.slot; + const config = getConfig(fork); + const state = createCachedBeaconStateTest(anchorState, config); + + /** This is to track test's tickTime to be used in proposer boost */ + let tickTime = 0; + const clock = new ClockStopped(currentSlot); + const eth1 = new Eth1ForBlockProductionMock(); + const executionEngineBackend = new ExecutionEngineMockBackend({ + onlyPredefinedResponses: opts.onlyPredefinedResponses, + genesisBlockHash: isExecutionStateType(anchorState) + ? toHexString(anchorState.latestExecutionPayloadHeader.blockHash) + : ZERO_HASH_HEX, + }); + + const controller = new AbortController(); + const executionEngine = getExecutionEngineFromBackend(executionEngineBackend, {signal: controller.signal}); + + const chain = new BeaconChain( + { + ...defaultChainOptions, + // Do not start workers + blsVerifyAllMainThread: true, + // Do not run any archiver tasks + disableArchiveOnCheckpoint: true, + // Since the tests have deep-reorgs attested data is not available often printing lots of error logs. + // While this function is only called for head blocks, best to disable. + disableLightClientServerOnImportBlockHead: true, + // No need to log BlockErrors, the spec test runner will only log them if not not expected + // Otherwise spec tests logs get cluttered with expected errors + disableOnBlockError: true, + // PrepareNextSlot scheduler is used to precompute epoch transition and prepare for the next payload + // we don't use these in fork choice spec tests + disablePrepareNextSlot: true, + assertCorrectProgressiveBalances, + }, + { + config: createBeaconConfig(config, state.genesisValidatorsRoot), + db: getStubbedBeaconDb(), + logger, + // eslint-disable-next-line @typescript-eslint/no-empty-function + processShutdownCallback: () => {}, + clock, + metrics: null, + anchorState, + eth1, + executionEngine, + executionBuilder: undefined, } + ); + + const stepsLen = steps.length; + logger.debug("Fork choice test", {steps: stepsLen}); + + try { + for (const [i, step] of steps.entries()) { + if (isTick(step)) { + tickTime = bnToNum(step.tick); + const currentSlot = Math.floor(tickTime / config.SECONDS_PER_SLOT); + logger.debug(`Step ${i}/${stepsLen} tick`, {currentSlot, valid: Boolean(step.valid), time: tickTime}); + chain.emitter.emit(ChainEvent.clockSlot, currentSlot); + clock.setSlot(currentSlot); + } - // block step - else if (isBlock(step)) { - const isValid = Boolean(step.valid ?? true); - const signedBlock = testcase.blocks.get(step.block); - if (!signedBlock) { - throw Error(`No block ${step.block}`); + // attestation step + else if (isAttestation(step)) { + logger.debug(`Step ${i}/${stepsLen} attestation`, {root: step.attestation, valid: Boolean(step.valid)}); + const attestation = testcase.attestations.get(step.attestation); + if (!attestation) throw Error(`No attestation ${step.attestation}`); + const headState = chain.getHeadState(); + chain.forkChoice.onAttestation(headState.epochCtx.getIndexedAttestation(attestation)); } - const {slot} = signedBlock.message; - // Log the BeaconBlock root instead of the SignedBeaconBlock root, forkchoice references BeaconBlock roots - const blockRoot = config - .getForkTypes(signedBlock.message.slot) - .BeaconBlock.hashTreeRoot(signedBlock.message); - logger.debug(`Step ${i}/${stepsLen} block`, { - slot, - id: step.block, - root: toHexString(blockRoot), - parentRoot: toHexString(signedBlock.message.parentRoot), - isValid, - }); - - const blockImport = - config.getForkSeq(slot) < ForkSeq.deneb - ? getBlockInput.preDeneb(config, signedBlock) - : getBlockInput.postDeneb( - config, - signedBlock, - getEmptyBlobsSidecar(config, signedBlock as deneb.SignedBeaconBlock) - ); - - try { - await chain.processBlock(blockImport, { - seenTimestampSec: tickTime, - validBlobsSidecar: true, - importAttestations: AttestationImportOpt.Force, + // attester slashing step + else if (isAttesterSlashing(step)) { + logger.debug(`Step ${i}/${stepsLen} attester slashing`, { + root: step.attester_slashing, + valid: Boolean(step.valid), }); - if (!isValid) throw Error("Expect error since this is a negative test"); - } catch (e) { - if (isValid) throw e; + const attesterSlashing = testcase.attesterSlashings.get(step.attester_slashing); + if (!attesterSlashing) throw Error(`No attester slashing ${step.attester_slashing}`); + chain.forkChoice.onAttesterSlashing(attesterSlashing); } - } - // **on_merge_block execution** - // Adds PowBlock data which is required for executing on_block(store, block). - // The file is located in the same folder (see below). PowBlocks should be used as return values for - // get_pow_block(hash: Hash32) -> PowBlock function if hashes match. - else if (isPowBlock(step)) { - const powBlock = testcase.powBlocks.get(step.pow_block); - if (!powBlock) throw Error(`pow_block ${step.pow_block} not found`); - logger.debug(`Step ${i}/${stepsLen} pow_block`, { - blockHash: toHexString(powBlock.blockHash), - parentHash: toHexString(powBlock.parentHash), - }); - // Register PowBlock for `get_pow_block(hash: Hash32)` calls in verifyBlock - eth1.addPowBlock(powBlock); - // Register PowBlock to allow validation in execution engine - executionEngineBackend.addPowBlock(powBlock); - } + // block step + else if (isBlock(step)) { + const isValid = Boolean(step.valid ?? true); + const signedBlock = testcase.blocks.get(step.block); + if (!signedBlock) { + throw Error(`No block ${step.block}`); + } + + const {slot} = signedBlock.message; + // Log the BeaconBlock root instead of the SignedBeaconBlock root, forkchoice references BeaconBlock roots + const blockRoot = config + .getForkTypes(signedBlock.message.slot) + .BeaconBlock.hashTreeRoot(signedBlock.message); + logger.debug(`Step ${i}/${stepsLen} block`, { + slot, + id: step.block, + root: toHexString(blockRoot), + parentRoot: toHexString(signedBlock.message.parentRoot), + isValid, + }); - // Optional step for optimistic sync tests. - else if (isOnPayloadInfoStep(step)) { - logger.debug(`Step ${i}/${stepsLen} payload_status`, {blockHash: step.block_hash}); - const status = ExecutePayloadStatus[step.payload_status.status]; - if (status === undefined) { - throw Error(`Unknown payload_status.status: ${step.payload_status.status}`); + const blockImport = + config.getForkSeq(slot) < ForkSeq.deneb + ? getBlockInput.preDeneb(config, signedBlock) + : getBlockInput.postDeneb( + config, + signedBlock, + getEmptyBlobsSidecar(config, signedBlock as deneb.SignedBeaconBlock) + ); + + try { + await chain.processBlock(blockImport, { + seenTimestampSec: tickTime, + validBlobsSidecar: true, + importAttestations: AttestationImportOpt.Force, + }); + if (!isValid) throw Error("Expect error since this is a negative test"); + } catch (e) { + if (isValid) throw e; + } } - executionEngineBackend.addPredefinedPayloadStatus(step.block_hash, { - status, - latestValidHash: step.payload_status.latest_valid_hash, - validationError: step.payload_status.validation_error, - }); - } - - // checks step - else if (isCheck(step)) { - logger.debug(`Step ${i}/${stepsLen} check`); - // Forkchoice head is computed lazily only on request - const head = chain.forkChoice.updateHead(); - const proposerBootRoot = (chain.forkChoice as ForkChoice).getProposerBoostRoot(); - - if (step.checks.head !== undefined) { - expect({slot: head.slot, root: head.blockRoot}).deep.equals( - {slot: bnToNum(step.checks.head.slot), root: step.checks.head.root}, - `Invalid head at step ${i}` - ); - } - if (step.checks.proposer_boost_root !== undefined) { - expect(proposerBootRoot).to.be.equal( - step.checks.proposer_boost_root, - `Invalid proposer boost root at step ${i}` - ); + // **on_merge_block execution** + // Adds PowBlock data which is required for executing on_block(store, block). + // The file is located in the same folder (see below). PowBlocks should be used as return values for + // get_pow_block(hash: Hash32) -> PowBlock function if hashes match. + else if (isPowBlock(step)) { + const powBlock = testcase.powBlocks.get(step.pow_block); + if (!powBlock) throw Error(`pow_block ${step.pow_block} not found`); + logger.debug(`Step ${i}/${stepsLen} pow_block`, { + blockHash: toHexString(powBlock.blockHash), + parentHash: toHexString(powBlock.parentHash), + }); + // Register PowBlock for `get_pow_block(hash: Hash32)` calls in verifyBlock + eth1.addPowBlock(powBlock); + // Register PowBlock to allow validation in execution engine + executionEngineBackend.addPowBlock(powBlock); } - // time in spec mapped to Slot in our forkchoice implementation. - // Compare in slots because proposer boost steps doesn't always come on - // slot boundary. - if (step.checks.time !== undefined && step.checks.time > 0) - expect(chain.forkChoice.getTime()).to.be.equal( - Math.floor(bnToNum(step.checks.time) / config.SECONDS_PER_SLOT), - `Invalid forkchoice time at step ${i}` - ); - if (step.checks.justified_checkpoint) { - expect(toSpecTestCheckpoint(chain.forkChoice.getJustifiedCheckpoint())).to.be.deep.equal( - step.checks.justified_checkpoint, - `Invalid justified checkpoint at step ${i}` - ); + + // Optional step for optimistic sync tests. + else if (isOnPayloadInfoStep(step)) { + logger.debug(`Step ${i}/${stepsLen} payload_status`, {blockHash: step.block_hash}); + const status = ExecutePayloadStatus[step.payload_status.status]; + if (status === undefined) { + throw Error(`Unknown payload_status.status: ${step.payload_status.status}`); + } + executionEngineBackend.addPredefinedPayloadStatus(step.block_hash, { + status, + latestValidHash: step.payload_status.latest_valid_hash, + validationError: step.payload_status.validation_error, + }); } - if (step.checks.finalized_checkpoint) { - expect(toSpecTestCheckpoint(chain.forkChoice.getFinalizedCheckpoint())).to.be.deep.equal( - step.checks.finalized_checkpoint, - `Invalid finalized checkpoint at step ${i}` - ); + + // checks step + else if (isCheck(step)) { + logger.debug(`Step ${i}/${stepsLen} check`); + + // Forkchoice head is computed lazily only on request + const head = chain.forkChoice.updateHead(); + const proposerBootRoot = (chain.forkChoice as ForkChoice).getProposerBoostRoot(); + + if (step.checks.head !== undefined) { + expect({slot: head.slot, root: head.blockRoot}).deep.equals( + {slot: bnToNum(step.checks.head.slot), root: step.checks.head.root}, + `Invalid head at step ${i}` + ); + } + if (step.checks.proposer_boost_root !== undefined) { + expect(proposerBootRoot).to.be.equal( + step.checks.proposer_boost_root, + `Invalid proposer boost root at step ${i}` + ); + } + // time in spec mapped to Slot in our forkchoice implementation. + // Compare in slots because proposer boost steps doesn't always come on + // slot boundary. + if (step.checks.time !== undefined && step.checks.time > 0) + expect(chain.forkChoice.getTime()).to.be.equal( + Math.floor(bnToNum(step.checks.time) / config.SECONDS_PER_SLOT), + `Invalid forkchoice time at step ${i}` + ); + if (step.checks.justified_checkpoint) { + expect(toSpecTestCheckpoint(chain.forkChoice.getJustifiedCheckpoint())).to.be.deep.equal( + step.checks.justified_checkpoint, + `Invalid justified checkpoint at step ${i}` + ); + } + if (step.checks.finalized_checkpoint) { + expect(toSpecTestCheckpoint(chain.forkChoice.getFinalizedCheckpoint())).to.be.deep.equal( + step.checks.finalized_checkpoint, + `Invalid finalized checkpoint at step ${i}` + ); + } } - } - // None of the above - else { - throw Error(`Unknown step ${i}/${stepsLen}: ${JSON.stringify(Object.keys(step))}`); + // None of the above + else { + throw Error(`Unknown step ${i}/${stepsLen}: ${JSON.stringify(Object.keys(step))}`); + } } + } finally { + await chain.close(); } - } finally { - await chain.close(); - } - }, - - options: { - inputTypes: { - meta: InputType.YAML, - steps: InputType.YAML, - }, - sszTypes: { - [ANCHOR_STATE_FILE_NAME]: ssz[fork].BeaconState, - [ANCHOR_BLOCK_FILE_NAME]: ssz[fork].BeaconBlock, - [BLOCK_FILE_NAME]: ssz[fork].SignedBeaconBlock, - [POW_BLOCK_FILE_NAME]: ssz.bellatrix.PowBlock, - [ATTESTATION_FILE_NAME]: ssz.phase0.Attestation, - [ATTESTER_SLASHING_FILE_NAME]: ssz.phase0.AttesterSlashing, }, - mapToTestCase: (t: Record) => { - // t has input file name as key - const blocks = new Map(); - const powBlocks = new Map(); - const attestations = new Map(); - const attesterSlashings = new Map(); - for (const key in t) { - const blockMatch = key.match(BLOCK_FILE_NAME); - if (blockMatch) { - blocks.set(key, t[key]); - } - const powBlockMatch = key.match(POW_BLOCK_FILE_NAME); - if (powBlockMatch) { - powBlocks.set(key, t[key]); - } - const attMatch = key.match(ATTESTATION_FILE_NAME); - if (attMatch) { - attestations.set(key, t[key]); - } - const attesterSlashingMatch = key.match(ATTESTER_SLASHING_FILE_NAME); - if (attesterSlashingMatch) { - attesterSlashings.set(key, t[key]); + + options: { + inputTypes: { + meta: InputType.YAML, + steps: InputType.YAML, + }, + sszTypes: { + [ANCHOR_STATE_FILE_NAME]: ssz[fork].BeaconState, + [ANCHOR_BLOCK_FILE_NAME]: ssz[fork].BeaconBlock, + [BLOCK_FILE_NAME]: ssz[fork].SignedBeaconBlock, + [POW_BLOCK_FILE_NAME]: ssz.bellatrix.PowBlock, + [ATTESTATION_FILE_NAME]: ssz.phase0.Attestation, + [ATTESTER_SLASHING_FILE_NAME]: ssz.phase0.AttesterSlashing, + }, + mapToTestCase: (t: Record) => { + // t has input file name as key + const blocks = new Map(); + const powBlocks = new Map(); + const attestations = new Map(); + const attesterSlashings = new Map(); + for (const key in t) { + const blockMatch = key.match(BLOCK_FILE_NAME); + if (blockMatch) { + blocks.set(key, t[key]); + } + const powBlockMatch = key.match(POW_BLOCK_FILE_NAME); + if (powBlockMatch) { + powBlocks.set(key, t[key]); + } + const attMatch = key.match(ATTESTATION_FILE_NAME); + if (attMatch) { + attestations.set(key, t[key]); + } + const attesterSlashingMatch = key.match(ATTESTER_SLASHING_FILE_NAME); + if (attesterSlashingMatch) { + attesterSlashings.set(key, t[key]); + } } - } - return { - meta: t["meta"] as ForkChoiceTestCase["meta"], - anchorState: t[ANCHOR_STATE_FILE_NAME] as ForkChoiceTestCase["anchorState"], - anchorBlock: t[ANCHOR_BLOCK_FILE_NAME] as ForkChoiceTestCase["anchorBlock"], - steps: t["steps"] as ForkChoiceTestCase["steps"], - blocks, - powBlocks, - attestations, - attesterSlashings, - }; + return { + meta: t["meta"] as ForkChoiceTestCase["meta"], + anchorState: t[ANCHOR_STATE_FILE_NAME] as ForkChoiceTestCase["anchorState"], + anchorBlock: t[ANCHOR_BLOCK_FILE_NAME] as ForkChoiceTestCase["anchorBlock"], + steps: t["steps"] as ForkChoiceTestCase["steps"], + blocks, + powBlocks, + attestations, + attesterSlashings, + }; + }, + timeout: 10000, + // eslint-disable-next-line @typescript-eslint/no-empty-function + expectFunc: () => {}, + // Do not manually skip tests here, do it in packages/beacon-node/test/spec/presets/index.test.ts }, - timeout: 10000, - // eslint-disable-next-line @typescript-eslint/no-empty-function - expectFunc: () => {}, - // Do not manually skip tests here, do it in packages/beacon-node/test/spec/presets/index.test.ts - }, + }; }; -}; function toSpecTestCheckpoint(checkpoint: CheckpointWithHex): SpecTestCheckpoint { return { diff --git a/packages/beacon-node/test/spec/presets/light_client/update_ranking.ts b/packages/beacon-node/test/spec/presets/light_client/update_ranking.ts index 366da1b4bd29..2a319b88cc7c 100644 --- a/packages/beacon-node/test/spec/presets/light_client/update_ranking.ts +++ b/packages/beacon-node/test/spec/presets/light_client/update_ranking.ts @@ -25,7 +25,7 @@ export const updateRanking: TestRunnerFn = (fork) = const updates: allForks.LightClientUpdate[] = []; for (let i = 0; i < updatesCount; i++) { - const update = ((testcase as unknown) as Record)[`updates_${i}`]; + const update = (testcase as unknown as Record)[`updates_${i}`]; if (update === undefined) { throw Error(`no update for index ${i}`); } diff --git a/packages/beacon-node/test/spec/presets/operations.ts b/packages/beacon-node/test/spec/presets/operations.ts index 6f4d6cbf9b69..be70deb9b301 100644 --- a/packages/beacon-node/test/spec/presets/operations.ts +++ b/packages/beacon-node/test/spec/presets/operations.ts @@ -73,7 +73,7 @@ const operationFns: Record> = const fork = state.config.getForkSeq(state.slot); blockFns.processExecutionPayload( fork, - (state as CachedBeaconStateAllForks) as CachedBeaconStateBellatrix, + state as CachedBeaconStateAllForks as CachedBeaconStateBellatrix, testCase.execution_payload, { executionPayloadStatus: testCase.execution.execution_valid diff --git a/packages/beacon-node/test/spec/presets/sanity.ts b/packages/beacon-node/test/spec/presets/sanity.ts index eb10f3e8de85..b57f509211b9 100644 --- a/packages/beacon-node/test/spec/presets/sanity.ts +++ b/packages/beacon-node/test/spec/presets/sanity.ts @@ -93,7 +93,7 @@ export const sanityBlocks: TestRunnerFn; +type BlocksSZZTypeMapping = Record; export function generateBlocksSZZTypeMapping(fork: ForkName, n: number): BlocksSZZTypeMapping { const blocksMapping: BlocksSZZTypeMapping = {}; diff --git a/packages/beacon-node/test/spec/presets/ssz_static.ts b/packages/beacon-node/test/spec/presets/ssz_static.ts index 86fc1268cc20..8bcf8f01959b 100644 --- a/packages/beacon-node/test/spec/presets/ssz_static.ts +++ b/packages/beacon-node/test/spec/presets/ssz_static.ts @@ -26,43 +26,40 @@ type Types = Record>; // tests / mainnet / altair / ssz_static / Validator / ssz_random / case_0/roots.yaml // -export const sszStatic = (skippedTypes?: string[]) => ( - fork: ForkName, - typeName: string, - testSuite: string, - testSuiteDirpath: string -): void => { - // Do not manually skip tests here, do it in packages/beacon-node/test/spec/presets/index.test.ts - if (skippedTypes?.includes(typeName)) { - return; - } +export const sszStatic = + (skippedTypes?: string[]) => + (fork: ForkName, typeName: string, testSuite: string, testSuiteDirpath: string): void => { + // Do not manually skip tests here, do it in packages/beacon-node/test/spec/presets/index.test.ts + if (skippedTypes?.includes(typeName)) { + return; + } - /* eslint-disable @typescript-eslint/strict-boolean-expressions */ - const sszType = - // Since lightclient types are not updated/declared at all forks, this allForksLightClient - // will help us get the right type for lightclient objects - ((ssz.allForksLightClient[fork as ForkLightClient] || {}) as Types)[typeName] || - (ssz[fork] as Types)[typeName] || - (ssz.capella as Types)[typeName] || - (ssz.bellatrix as Types)[typeName] || - (ssz.altair as Types)[typeName] || - (ssz.phase0 as Types)[typeName]; - if (!sszType) { - throw Error(`No type for ${typeName}`); - } + /* eslint-disable @typescript-eslint/strict-boolean-expressions */ + const sszType = + // Since lightclient types are not updated/declared at all forks, this allForksLightClient + // will help us get the right type for lightclient objects + ((ssz.allForksLightClient[fork as ForkLightClient] || {}) as Types)[typeName] || + (ssz[fork] as Types)[typeName] || + (ssz.capella as Types)[typeName] || + (ssz.bellatrix as Types)[typeName] || + (ssz.altair as Types)[typeName] || + (ssz.phase0 as Types)[typeName]; + if (!sszType) { + throw Error(`No type for ${typeName}`); + } - const sszTypeNoUint = replaceUintTypeWithUintBigintType(sszType); + const sszTypeNoUint = replaceUintTypeWithUintBigintType(sszType); - for (const testCase of fs.readdirSync(testSuiteDirpath)) { - // Do not manually skip tests here, do it in packages/beacon-node/test/spec/presets/index.test.ts - it(testCase, function () { - // Mainnet must deal with big full states and hash each one multiple times - if (ACTIVE_PRESET === "mainnet") { - this.timeout(30 * 1000); - } + for (const testCase of fs.readdirSync(testSuiteDirpath)) { + // Do not manually skip tests here, do it in packages/beacon-node/test/spec/presets/index.test.ts + it(testCase, function () { + // Mainnet must deal with big full states and hash each one multiple times + if (ACTIVE_PRESET === "mainnet") { + this.timeout(30 * 1000); + } - const testData = parseSszStaticTestcase(path.join(testSuiteDirpath, testCase)); - runValidSszTest(sszTypeNoUint, testData); - }); - } -}; + const testData = parseSszStaticTestcase(path.join(testSuiteDirpath, testCase)); + runValidSszTest(sszTypeNoUint, testData); + }); + } + }; diff --git a/packages/beacon-node/test/spec/presets/transition.ts b/packages/beacon-node/test/spec/presets/transition.ts index 07b02e0da658..323b8bea7a5b 100644 --- a/packages/beacon-node/test/spec/presets/transition.ts +++ b/packages/beacon-node/test/spec/presets/transition.ts @@ -15,75 +15,75 @@ import {TestRunnerFn} from "../utils/types.js"; import {assertCorrectProgressiveBalances} from "../config.js"; import {getPreviousFork} from "./fork.js"; -export const transition = (skipTestNames?: string[]): TestRunnerFn => ( - forkNext -) => { - if (forkNext === ForkName.phase0) { - throw Error("fork phase0 not supported"); - } +export const transition = + (skipTestNames?: string[]): TestRunnerFn => + (forkNext) => { + if (forkNext === ForkName.phase0) { + throw Error("fork phase0 not supported"); + } - const forkPrev = getPreviousFork(config, forkNext); + const forkPrev = getPreviousFork(config, forkNext); - /** - * https://github.com/ethereum/eth2.0-specs/tree/v1.1.0-alpha.5/tests/formats/transition - */ - function generateBlocksSZZTypeMapping(meta: TransitionTestCase["meta"]): BlocksSZZTypeMapping { - if (meta === undefined) { - throw new Error("No meta data found"); - } - const blocksMapping: BlocksSZZTypeMapping = {}; - // The fork_block is the index in the test data of the last block of the initial fork. - for (let i = 0; i < meta.blocks_count; i++) { - blocksMapping[`blocks_${i}`] = - i <= meta.fork_block ? ssz[forkPrev].SignedBeaconBlock : ssz[forkNext].SignedBeaconBlock; + /** + * https://github.com/ethereum/eth2.0-specs/tree/v1.1.0-alpha.5/tests/formats/transition + */ + function generateBlocksSZZTypeMapping(meta: TransitionTestCase["meta"]): BlocksSZZTypeMapping { + if (meta === undefined) { + throw new Error("No meta data found"); + } + const blocksMapping: BlocksSZZTypeMapping = {}; + // The fork_block is the index in the test data of the last block of the initial fork. + for (let i = 0; i < meta.blocks_count; i++) { + blocksMapping[`blocks_${i}`] = + i <= meta.fork_block ? ssz[forkPrev].SignedBeaconBlock : ssz[forkNext].SignedBeaconBlock; + } + return blocksMapping; } - return blocksMapping; - } - return { - testFunction: (testcase) => { - const meta = testcase.meta; + return { + testFunction: (testcase) => { + const meta = testcase.meta; - // testConfig is used here to load forkEpoch from meta.yaml - const forkEpoch = bnToNum(meta.fork_epoch); - const testConfig = createChainForkConfig(getTransitionConfig(forkNext, forkEpoch)); + // testConfig is used here to load forkEpoch from meta.yaml + const forkEpoch = bnToNum(meta.fork_epoch); + const testConfig = createChainForkConfig(getTransitionConfig(forkNext, forkEpoch)); - let state = createCachedBeaconStateTest(testcase.pre, testConfig); - for (let i = 0; i < meta.blocks_count; i++) { - const signedBlock = testcase[`blocks_${i}`] as allForks.SignedBeaconBlock; - state = stateTransition(state, signedBlock, { - // TODO DENEB: Should assume valid and available for this test? - executionPayloadStatus: ExecutionPayloadStatus.valid, - dataAvailableStatus: DataAvailableStatus.available, - verifyStateRoot: true, - verifyProposer: false, - verifySignatures: false, - assertCorrectProgressiveBalances, - }); - } - return state; - }, - options: { - inputTypes: inputTypeSszTreeViewDU, - getSszTypes: (meta: TransitionTestCase["meta"]) => { - return { - pre: ssz[forkPrev].BeaconState, - post: ssz[forkNext].BeaconState, - ...generateBlocksSZZTypeMapping(meta), - }; + let state = createCachedBeaconStateTest(testcase.pre, testConfig); + for (let i = 0; i < meta.blocks_count; i++) { + const signedBlock = testcase[`blocks_${i}`] as allForks.SignedBeaconBlock; + state = stateTransition(state, signedBlock, { + // TODO DENEB: Should assume valid and available for this test? + executionPayloadStatus: ExecutionPayloadStatus.valid, + dataAvailableStatus: DataAvailableStatus.available, + verifyStateRoot: true, + verifyProposer: false, + verifySignatures: false, + assertCorrectProgressiveBalances, + }); + } + return state; }, - shouldError: (testCase) => testCase.post === undefined, - timeout: 10000, - getExpected: (testCase) => testCase.post, - expectFunc: (testCase, expected, actual) => { - expectEqualBeaconState(forkNext, expected, actual); + options: { + inputTypes: inputTypeSszTreeViewDU, + getSszTypes: (meta: TransitionTestCase["meta"]) => { + return { + pre: ssz[forkPrev].BeaconState, + post: ssz[forkNext].BeaconState, + ...generateBlocksSZZTypeMapping(meta), + }; + }, + shouldError: (testCase) => testCase.post === undefined, + timeout: 10000, + getExpected: (testCase) => testCase.post, + expectFunc: (testCase, expected, actual) => { + expectEqualBeaconState(forkNext, expected, actual); + }, + // Do not manually skip tests here, do it in packages/beacon-node/test/spec/presets/index.test.ts + shouldSkip: (_testcase, name, _index) => + skipTestNames !== undefined && skipTestNames.some((skipTestName) => name.includes(skipTestName)), }, - // Do not manually skip tests here, do it in packages/beacon-node/test/spec/presets/index.test.ts - shouldSkip: (_testcase, name, _index) => - skipTestNames !== undefined && skipTestNames.some((skipTestName) => name.includes(skipTestName)), - }, + }; }; -}; /* eslint-disable @typescript-eslint/naming-convention */ @@ -102,7 +102,7 @@ function getTransitionConfig(fork: ForkName, forkEpoch: number): Partial; +type BlocksSZZTypeMapping = Record; type TransitionTestCase = { [k: string]: allForks.SignedBeaconBlock | unknown | null | undefined; diff --git a/packages/beacon-node/test/spec/utils/replaceUintTypeWithUintBigintType.ts b/packages/beacon-node/test/spec/utils/replaceUintTypeWithUintBigintType.ts index a2617f7cca14..8e0063291d98 100644 --- a/packages/beacon-node/test/spec/utils/replaceUintTypeWithUintBigintType.ts +++ b/packages/beacon-node/test/spec/utils/replaceUintTypeWithUintBigintType.ts @@ -18,7 +18,7 @@ import { */ export function replaceUintTypeWithUintBigintType>(type: T): T { if (type instanceof UintNumberType && type.byteLength === 8) { - return (new UintBigintType(type.byteLength) as unknown) as T; + return new UintBigintType(type.byteLength) as unknown as T; } // For Container iterate and replace all sub properties @@ -27,21 +27,21 @@ export function replaceUintTypeWithUintBigintType>(type: T): for (const key of Object.keys(fields) as (keyof typeof fields)[]) { fields[key] = replaceUintTypeWithUintBigintType(fields[key]); } - return (new ContainerType(fields, type.opts) as unknown) as T; + return new ContainerType(fields, type.opts) as unknown as T; } // For List or vectors replace the subType if (type instanceof ListBasicType) { - return (new ListBasicType(replaceUintTypeWithUintBigintType(type.elementType), type.limit) as unknown) as T; + return new ListBasicType(replaceUintTypeWithUintBigintType(type.elementType), type.limit) as unknown as T; } if (type instanceof VectorBasicType) { - return (new VectorBasicType(replaceUintTypeWithUintBigintType(type.elementType), type.length) as unknown) as T; + return new VectorBasicType(replaceUintTypeWithUintBigintType(type.elementType), type.length) as unknown as T; } if (type instanceof ListCompositeType) { - return (new ListCompositeType(replaceUintTypeWithUintBigintType(type.elementType), type.limit) as unknown) as T; + return new ListCompositeType(replaceUintTypeWithUintBigintType(type.elementType), type.limit) as unknown as T; } if (type instanceof VectorCompositeType) { - return (new VectorCompositeType(replaceUintTypeWithUintBigintType(type.elementType), type.length) as unknown) as T; + return new VectorCompositeType(replaceUintTypeWithUintBigintType(type.elementType), type.length) as unknown as T; } return type; diff --git a/packages/beacon-node/test/unit/api/impl/beacon/state/fork.test.ts b/packages/beacon-node/test/unit/api/impl/beacon/state/fork.test.ts index 3907e440891a..c49677d9a1aa 100644 --- a/packages/beacon-node/test/unit/api/impl/beacon/state/fork.test.ts +++ b/packages/beacon-node/test/unit/api/impl/beacon/state/fork.test.ts @@ -9,7 +9,7 @@ import {setupApiImplTestServer, ApiImplTestModules} from "../../index.test.js"; // TODO remove stub describe.skip("beacon api impl - state - get fork", function () { let api: ReturnType; - let resolveStateIdStub: SinonStubbedMember; + let resolveStateIdStub: SinonStubbedMember<(typeof stateApiUtils)["resolveStateId"]>; let server: ApiImplTestModules; before(function () { diff --git a/packages/beacon-node/test/unit/api/impl/beacon/state/utils.test.ts b/packages/beacon-node/test/unit/api/impl/beacon/state/utils.test.ts index ce9506de3623..7f681f0f2369 100644 --- a/packages/beacon-node/test/unit/api/impl/beacon/state/utils.test.ts +++ b/packages/beacon-node/test/unit/api/impl/beacon/state/utils.test.ts @@ -25,10 +25,10 @@ describe("beacon state api utils", function () { it("resolve head state id - success", async function () { const getHead = sinon.stub().returns(generateProtoBlock({stateRoot: otherRoot})); const get = sinon.stub().returns(generateCachedState()); - const chainStub = ({ + const chainStub = { forkChoice: {getHead}, stateCache: {get}, - } as unknown) as IBeaconChain; + } as unknown as IBeaconChain; const state = await resolveStateId(config, chainStub, dbStub, "head"); expect(state).to.not.be.null; @@ -39,10 +39,10 @@ describe("beacon state api utils", function () { it("resolve finalized state id - success", async function () { const getFinalizedBlock = sinon.stub().returns(generateProtoBlock()); const get = sinon.stub().returns(generateCachedState()); - const chainStub = ({ + const chainStub = { forkChoice: {getFinalizedBlock}, stateCache: {get}, - } as unknown) as IBeaconChain; + } as unknown as IBeaconChain; const state = await resolveStateId(config, chainStub, dbStub, "finalized"); expect(state).to.not.be.null; @@ -53,10 +53,10 @@ describe("beacon state api utils", function () { it("resolve justified state id - success", async function () { const getJustifiedBlock = sinon.stub().returns(generateProtoBlock()); const get = sinon.stub().returns(generateCachedState()); - const chainStub = ({ + const chainStub = { forkChoice: {getJustifiedBlock}, stateCache: {get}, - } as unknown) as IBeaconChain; + } as unknown as IBeaconChain; const state = await resolveStateId(config, chainStub, dbStub, "justified"); expect(state).to.not.be.null; @@ -66,7 +66,7 @@ describe("beacon state api utils", function () { it("resolve state by root", async function () { const get = sinon.stub().returns(generateCachedState()); - const chainStub = ({stateCache: {get}, forkChoice: {getBlock: sinon.stub()}} as unknown) as IBeaconChain; + const chainStub = {stateCache: {get}, forkChoice: {getBlock: sinon.stub()}} as unknown as IBeaconChain; const state = await resolveStateId(config, chainStub, dbStub, otherRoot); expect(state).to.not.be.null; @@ -79,10 +79,10 @@ describe("beacon state api utils", function () { .withArgs(123) .returns(generateProtoBlock({stateRoot: otherRoot})); const get = sinon.stub().returns(generateCachedState()); - const chainStub = ({ + const chainStub = { forkChoice: {getCanonicalBlockAtSlot}, stateCache: {get}, - } as unknown) as IBeaconChain; + } as unknown as IBeaconChain; const state = await resolveStateId(config, chainStub, dbStub, "123"); expect(state).to.not.be.null; @@ -99,9 +99,9 @@ describe("beacon state api utils", function () { .stub() .onSecondCall() .returns(generateProtoBlock({stateRoot: otherRoot})); - const chainStub = ({ + const chainStub = { forkChoice: {getCanonicalBlockAtSlot, getFinalizedCheckpoint}, - } as unknown) as IBeaconChain; + } as unknown as IBeaconChain; const nearestState = generateState({slot: nearestArchiveSlot}); // eslint-disable-next-line @typescript-eslint/no-empty-function const blockArchiveValuesStream = sinon.stub().returns({async *[Symbol.asyncIterator]() {}}); diff --git a/packages/beacon-node/test/unit/api/impl/events/events.test.ts b/packages/beacon-node/test/unit/api/impl/events/events.test.ts index 4e4eb3130701..cc05a061e03d 100644 --- a/packages/beacon-node/test/unit/api/impl/events/events.test.ts +++ b/packages/beacon-node/test/unit/api/impl/events/events.test.ts @@ -21,7 +21,7 @@ describe("Events api impl", function () { beforeEach(function () { chainStub = sinon.createStubInstance(BeaconChain); stateCacheStub = sinon.createStubInstance(StateContextCache); - chainStub.stateCache = (stateCacheStub as unknown) as StateContextCache; + chainStub.stateCache = stateCacheStub as unknown as StateContextCache; chainEventEmmitter = new ChainEventEmitter(); chainStub.emitter = chainEventEmmitter; api = getEventsApi({config, chain: chainStub}); diff --git a/packages/beacon-node/test/unit/chain/blocks/verifyBlocksSanityChecks.test.ts b/packages/beacon-node/test/unit/chain/blocks/verifyBlocksSanityChecks.test.ts index be8b418bd2ff..b2f9dfa267ae 100644 --- a/packages/beacon-node/test/unit/chain/blocks/verifyBlocksSanityChecks.test.ts +++ b/packages/beacon-node/test/unit/chain/blocks/verifyBlocksSanityChecks.test.ts @@ -162,7 +162,7 @@ function getForkChoice(knownBlocks: allForks.SignedBeaconBlock[], finalizedEpoch blocks.set(protoBlock.blockRoot, protoBlock); } - return ({ + return { getBlockHex(blockRoot) { return blocks.get(blockRoot) ?? null; }, @@ -172,16 +172,16 @@ function getForkChoice(knownBlocks: allForks.SignedBeaconBlock[], finalizedEpoch getFinalizedCheckpoint() { return {epoch: finalizedEpoch, root: Buffer.alloc(32), rootHex: ""}; }, - } as Partial) as IForkChoice; + } as Partial as IForkChoice; } function toProtoBlock(block: allForks.SignedBeaconBlock): ProtoBlock { - return ({ + return { slot: block.message.slot, blockRoot: toHex(ssz.phase0.BeaconBlock.hashTreeRoot((block as allForks.SignedBeaconBlock).message)), parentRoot: toHex(block.message.parentRoot), stateRoot: toHex(block.message.stateRoot), - } as Partial) as ProtoBlock; + } as Partial as ProtoBlock; } function slots(blocks: allForks.SignedBeaconBlock[]): Slot[] { diff --git a/packages/beacon-node/test/unit/chain/prepareNextSlot.test.ts b/packages/beacon-node/test/unit/chain/prepareNextSlot.test.ts index 0a03aceddba1..e77103969c62 100644 --- a/packages/beacon-node/test/unit/chain/prepareNextSlot.test.ts +++ b/packages/beacon-node/test/unit/chain/prepareNextSlot.test.ts @@ -33,7 +33,7 @@ describe("PrepareNextSlot scheduler", () => { let regenStub: SinonStubbedInstance & StateRegenerator; let loggerStub: SinonStubbedInstance & WinstonLogger; let beaconProposerCacheStub: SinonStubbedInstance & BeaconProposerCache; - let getForkStub: SinonStubFn; + let getForkStub: SinonStubFn<(typeof config)["getForkName"]>; let updateBuilderStatus: SinonStubFn; let executionEngineStub: SinonStubbedInstance & ExecutionEngineHttp; const emitPayloadAttributes = true; @@ -55,14 +55,13 @@ describe("PrepareNextSlot scheduler", () => { beaconProposerCacheStub = sandbox.createStubInstance( BeaconProposerCache ) as SinonStubbedInstance & BeaconProposerCache; - ((chainStub as unknown) as {beaconProposerCache: BeaconProposerCache})[ - "beaconProposerCache" - ] = beaconProposerCacheStub; + (chainStub as unknown as {beaconProposerCache: BeaconProposerCache})["beaconProposerCache"] = + beaconProposerCacheStub; getForkStub = sandbox.stub(config, "getForkName"); executionEngineStub = sandbox.createStubInstance(ExecutionEngineHttp) as SinonStubbedInstance & ExecutionEngineHttp; - ((chainStub as unknown) as {executionEngine: IExecutionEngine}).executionEngine = executionEngineStub; - ((chainStub as unknown) as {config: ChainForkConfig}).config = (config as unknown) as ChainForkConfig; + (chainStub as unknown as {executionEngine: IExecutionEngine}).executionEngine = executionEngineStub; + (chainStub as unknown as {config: ChainForkConfig}).config = config as unknown as ChainForkConfig; chainStub.opts = {emitPayloadAttributes} as IChainOptions; scheduler = new PrepareNextSlotScheduler(chainStub, config, null, loggerStub, abortController.signal); @@ -151,7 +150,7 @@ describe("PrepareNextSlot scheduler", () => { sinon.stub(state.epochCtx, "getBeaconProposer").returns(proposerIndex); regenStub.getBlockSlotState.resolves(state); beaconProposerCacheStub.get.returns("0x fee recipient address"); - ((executionEngineStub as unknown) as {payloadIdCache: PayloadIdCache}).payloadIdCache = new PayloadIdCache(); + (executionEngineStub as unknown as {payloadIdCache: PayloadIdCache}).payloadIdCache = new PayloadIdCache(); await Promise.all([ scheduler.prepareForNextSlot(SLOTS_PER_EPOCH - 2), diff --git a/packages/beacon-node/test/unit/chain/validation/aggregateAndProof.test.ts b/packages/beacon-node/test/unit/chain/validation/aggregateAndProof.test.ts index d0449477b1d4..994e11a34d3c 100644 --- a/packages/beacon-node/test/unit/chain/validation/aggregateAndProof.test.ts +++ b/packages/beacon-node/test/unit/chain/validation/aggregateAndProof.test.ts @@ -118,9 +118,9 @@ describe("chain / validation / aggregateAndProof", () => { getState(), signedAggregateAndProof.message.aggregate.data.slot + 2 * SLOTS_PER_EPOCH ); - (chain as {regen: IStateRegenerator}).regen = ({ + (chain as {regen: IStateRegenerator}).regen = { getState: async () => committeeState, - } as Partial) as IStateRegenerator; + } as Partial as IStateRegenerator; await expectError(chain, signedAggregateAndProof, AttestationErrorCode.NO_COMMITTEE_FOR_SLOT_AND_INDEX); }); diff --git a/packages/beacon-node/test/unit/chain/validation/attestation.test.ts b/packages/beacon-node/test/unit/chain/validation/attestation.test.ts index 646df2f3db9c..b457a589a7c0 100644 --- a/packages/beacon-node/test/unit/chain/validation/attestation.test.ts +++ b/packages/beacon-node/test/unit/chain/validation/attestation.test.ts @@ -104,9 +104,9 @@ describe("chain / validation / attestation", () => { // simulate https://github.com/ChainSafe/lodestar/issues/4396 // this way we cannot get committeeIndices const committeeState = processSlots(getState(), attestation.data.slot + 2 * SLOTS_PER_EPOCH); - (chain as {regen: IStateRegenerator}).regen = ({ + (chain as {regen: IStateRegenerator}).regen = { getState: async () => committeeState, - } as Partial) as IStateRegenerator; + } as Partial as IStateRegenerator; await expectError(chain, attestation, subnet, AttestationErrorCode.NO_COMMITTEE_FOR_SLOT_AND_INDEX); }); diff --git a/packages/beacon-node/test/unit/chain/validation/block.test.ts b/packages/beacon-node/test/unit/chain/validation/block.test.ts index edcd321a8e88..4bf1223e70f4 100644 --- a/packages/beacon-node/test/unit/chain/validation/block.test.ts +++ b/packages/beacon-node/test/unit/chain/validation/block.test.ts @@ -49,9 +49,11 @@ describe("gossip block validation", function () { forkChoice.getFinalizedCheckpoint.returns({epoch: 0, root: ZERO_HASH, rootHex: ""}); // Reset seen cache - (chain as { - seenBlockProposers: SeenBlockProposers; - }).seenBlockProposers = new SeenBlockProposers(); + ( + chain as { + seenBlockProposers: SeenBlockProposers; + } + ).seenBlockProposers = new SeenBlockProposers(); job = {signature, message: block}; }); diff --git a/packages/beacon-node/test/unit/chain/validation/lightClientFinalityUpdate.test.ts b/packages/beacon-node/test/unit/chain/validation/lightClientFinalityUpdate.test.ts index 0200e3c14911..0493b9d5faac 100644 --- a/packages/beacon-node/test/unit/chain/validation/lightClientFinalityUpdate.test.ts +++ b/packages/beacon-node/test/unit/chain/validation/lightClientFinalityUpdate.test.ts @@ -58,7 +58,8 @@ describe("Light Client Finality Update validation", function () { } it("should return invalid - finality update already forwarded", async () => { - const lightclientFinalityUpdate: altair.LightClientFinalityUpdate = ssz.altair.LightClientFinalityUpdate.defaultValue(); + const lightclientFinalityUpdate: altair.LightClientFinalityUpdate = + ssz.altair.LightClientFinalityUpdate.defaultValue(); lightclientFinalityUpdate.finalizedHeader.beacon.slot = 2; const chain = mockChain(); @@ -79,7 +80,8 @@ describe("Light Client Finality Update validation", function () { it("should return invalid - finality update received too early", async () => { //No other optimistic_update with a lower or equal attested_header.beacon.slot was already forwarded on the network - const lightClientFinalityUpdate: altair.LightClientFinalityUpdate = ssz.altair.LightClientFinalityUpdate.defaultValue(); + const lightClientFinalityUpdate: altair.LightClientFinalityUpdate = + ssz.altair.LightClientFinalityUpdate.defaultValue(); lightClientFinalityUpdate.finalizedHeader.beacon.slot = 2; lightClientFinalityUpdate.signatureSlot = 4; @@ -99,7 +101,8 @@ describe("Light Client Finality Update validation", function () { }); it("should return invalid - finality update not matching local", async () => { - const lightClientFinalityUpdate: altair.LightClientFinalityUpdate = ssz.altair.LightClientFinalityUpdate.defaultValue(); + const lightClientFinalityUpdate: altair.LightClientFinalityUpdate = + ssz.altair.LightClientFinalityUpdate.defaultValue(); lightClientFinalityUpdate.finalizedHeader.beacon.slot = 42; lightClientFinalityUpdate.attestedHeader.beacon.slot = lightClientFinalityUpdate.finalizedHeader.beacon.slot + 1; @@ -126,7 +129,8 @@ describe("Light Client Finality Update validation", function () { }); it("should return invalid - not matching local when no local finality update yet", async () => { - const lightClientFinalityUpdate: altair.LightClientFinalityUpdate = ssz.altair.LightClientFinalityUpdate.defaultValue(); + const lightClientFinalityUpdate: altair.LightClientFinalityUpdate = + ssz.altair.LightClientFinalityUpdate.defaultValue(); lightClientFinalityUpdate.finalizedHeader.beacon.slot = 42; lightClientFinalityUpdate.attestedHeader.beacon.slot = lightClientFinalityUpdate.finalizedHeader.beacon.slot + 1; @@ -150,7 +154,8 @@ describe("Light Client Finality Update validation", function () { }); it("should not throw for valid update", async () => { - const lightClientFinalityUpdate: altair.LightClientFinalityUpdate = ssz.altair.LightClientFinalityUpdate.defaultValue(); + const lightClientFinalityUpdate: altair.LightClientFinalityUpdate = + ssz.altair.LightClientFinalityUpdate.defaultValue(); const chain = mockChain(); // satisfy: diff --git a/packages/beacon-node/test/unit/chain/validation/lightClientOptimisticUpdate.test.ts b/packages/beacon-node/test/unit/chain/validation/lightClientOptimisticUpdate.test.ts index 9c8238cde1eb..2ede8d75691f 100644 --- a/packages/beacon-node/test/unit/chain/validation/lightClientOptimisticUpdate.test.ts +++ b/packages/beacon-node/test/unit/chain/validation/lightClientOptimisticUpdate.test.ts @@ -59,7 +59,8 @@ describe("Light Client Optimistic Update validation", function () { } it("should return invalid - optimistic update already forwarded", async () => { - const lightclientOptimisticUpdate: altair.LightClientOptimisticUpdate = ssz.altair.LightClientOptimisticUpdate.defaultValue(); + const lightclientOptimisticUpdate: altair.LightClientOptimisticUpdate = + ssz.altair.LightClientOptimisticUpdate.defaultValue(); lightclientOptimisticUpdate.attestedHeader.beacon.slot = 2; @@ -80,7 +81,8 @@ describe("Light Client Optimistic Update validation", function () { }); it("should return invalid - optimistic update received too early", async () => { - const lightclientOptimisticUpdate: altair.LightClientOptimisticUpdate = ssz.altair.LightClientOptimisticUpdate.defaultValue(); + const lightclientOptimisticUpdate: altair.LightClientOptimisticUpdate = + ssz.altair.LightClientOptimisticUpdate.defaultValue(); lightclientOptimisticUpdate.attestedHeader.beacon.slot = 2; lightclientOptimisticUpdate.signatureSlot = 4; @@ -100,7 +102,8 @@ describe("Light Client Optimistic Update validation", function () { }); it("should return invalid - optimistic update not matching local", async () => { - const lightclientOptimisticUpdate: altair.LightClientOptimisticUpdate = ssz.altair.LightClientOptimisticUpdate.defaultValue(); + const lightclientOptimisticUpdate: altair.LightClientOptimisticUpdate = + ssz.altair.LightClientOptimisticUpdate.defaultValue(); lightclientOptimisticUpdate.attestedHeader.beacon.slot = 42; const chain = mockChain(); @@ -125,7 +128,8 @@ describe("Light Client Optimistic Update validation", function () { }); it("should return invalid - not matching local when no local optimistic update yet", async () => { - const lightclientOptimisticUpdate: altair.LightClientOptimisticUpdate = ssz.altair.LightClientOptimisticUpdate.defaultValue(); + const lightclientOptimisticUpdate: altair.LightClientOptimisticUpdate = + ssz.altair.LightClientOptimisticUpdate.defaultValue(); lightclientOptimisticUpdate.attestedHeader.beacon.slot = 42; const chain = mockChain(); @@ -146,7 +150,8 @@ describe("Light Client Optimistic Update validation", function () { }); it("should not throw for valid update", async () => { - const lightclientOptimisticUpdate: altair.LightClientOptimisticUpdate = ssz.altair.LightClientOptimisticUpdate.defaultValue(); + const lightclientOptimisticUpdate: altair.LightClientOptimisticUpdate = + ssz.altair.LightClientOptimisticUpdate.defaultValue(); const chain = mockChain(); // satisfy: diff --git a/packages/beacon-node/test/unit/chain/validation/syncCommittee.test.ts b/packages/beacon-node/test/unit/chain/validation/syncCommittee.test.ts index cabee7dbfa44..3b5e3d8d220a 100644 --- a/packages/beacon-node/test/unit/chain/validation/syncCommittee.test.ts +++ b/packages/beacon-node/test/unit/chain/validation/syncCommittee.test.ts @@ -41,9 +41,11 @@ describe("Sync Committee Signature validation", function () { beforeEach(function () { chain = sandbox.createStubInstance(BeaconChain); - (chain as { - seenSyncCommitteeMessages: SeenSyncCommitteeMessages; - }).seenSyncCommitteeMessages = new SeenSyncCommitteeMessages(); + ( + chain as { + seenSyncCommitteeMessages: SeenSyncCommitteeMessages; + } + ).seenSyncCommitteeMessages = new SeenSyncCommitteeMessages(); clockStub = sandbox.createStubInstance(LocalClock); chain.clock = clockStub; clockStub.isCurrentSlotGivenGossipDisparity.returns(true); diff --git a/packages/beacon-node/test/unit/eth1/eth1DepositDataTracker.test.ts b/packages/beacon-node/test/unit/eth1/eth1DepositDataTracker.test.ts index 5a721b944c00..33a8dbaadf45 100644 --- a/packages/beacon-node/test/unit/eth1/eth1DepositDataTracker.test.ts +++ b/packages/beacon-node/test/unit/eth1/eth1DepositDataTracker.test.ts @@ -26,8 +26,8 @@ describe("Eth1DepositDataTracker", function () { ); sinon .stub( - (eth1DepositDataTracker as never) as { - getLastProcessedDepositBlockNumber: typeof eth1DepositDataTracker["getLastProcessedDepositBlockNumber"]; + eth1DepositDataTracker as never as { + getLastProcessedDepositBlockNumber: (typeof eth1DepositDataTracker)["getLastProcessedDepositBlockNumber"]; }, "getLastProcessedDepositBlockNumber" ) diff --git a/packages/beacon-node/test/unit/eth1/eth1MergeBlockTracker.test.ts b/packages/beacon-node/test/unit/eth1/eth1MergeBlockTracker.test.ts index b170a92d03dd..212b1506eff4 100644 --- a/packages/beacon-node/test/unit/eth1/eth1MergeBlockTracker.test.ts +++ b/packages/beacon-node/test/unit/eth1/eth1MergeBlockTracker.test.ts @@ -19,14 +19,14 @@ describe("eth1 / Eth1MergeBlockTracker", () => { beforeEach(() => (controller = new AbortController())); afterEach(() => controller.abort()); beforeEach(() => { - config = ({ + config = { // Set time units to 0 to make the test as fast as possible SECONDS_PER_ETH1_BLOCK: 0, SECONDS_PER_SLOT: 0, // Hardcode TTD to a low value TERMINAL_TOTAL_DIFFICULTY: BigInt(terminalTotalDifficulty), TERMINAL_BLOCK_HASH: ZERO_HASH, - } as Partial) as ChainConfig; + } as Partial as ChainConfig; }); it("Should find terminal pow block through TERMINAL_BLOCK_HASH", async () => { diff --git a/packages/beacon-node/test/unit/eth1/utils/eth1Data.test.ts b/packages/beacon-node/test/unit/eth1/utils/eth1Data.test.ts index f23dab4172c3..922acede85d8 100644 --- a/packages/beacon-node/test/unit/eth1/utils/eth1Data.test.ts +++ b/packages/beacon-node/test/unit/eth1/utils/eth1Data.test.ts @@ -94,15 +94,8 @@ describe("eth1 / util / getEth1DataForBlocks", function () { ]; for (const testCase of testCases) { - const { - id, - blocks, - deposits, - depositRootTree, - lastProcessedDepositBlockNumber, - expectedEth1Data, - error, - } = testCase(); + const {id, blocks, deposits, depositRootTree, lastProcessedDepositBlockNumber, expectedEth1Data, error} = + testCase(); it(id, async function () { const eth1DatasPromise = getEth1DataForBlocks( blocks, diff --git a/packages/beacon-node/test/unit/metrics/utils.test.ts b/packages/beacon-node/test/unit/metrics/utils.test.ts index 1a62a6238a97..7023e535d919 100644 --- a/packages/beacon-node/test/unit/metrics/utils.test.ts +++ b/packages/beacon-node/test/unit/metrics/utils.test.ts @@ -15,7 +15,7 @@ describe("Metrics Gauge collect fn", () => { const metrics = await register.getMetricsAsJSON(); const metric = metrics.find((m) => m.name === name); if (!metric) throw Error(`Metric ${name} not found`); - return ((metric as unknown) as {values: MetricValue[]}).values; + return (metric as unknown as {values: MetricValue[]}).values; } it("Use no collect function", async () => { diff --git a/packages/beacon-node/test/unit/network/peers/priorization.test.ts b/packages/beacon-node/test/unit/network/peers/priorization.test.ts index 85c3e9d6973b..d32f488b6671 100644 --- a/packages/beacon-node/test/unit/network/peers/priorization.test.ts +++ b/packages/beacon-node/test/unit/network/peers/priorization.test.ts @@ -284,7 +284,7 @@ describe("sortPeersToPrune", async function () { syncnetsTrueBitIndices: p.syncnets?.getTrueBitIndexes() ?? [], })); - const dutiesByPeer = new Map([ + const dutiesByPeer = new Map<(typeof connectedPeers)[0], number>([ [connectedPeers[0], 2], [connectedPeers[1], 0], [connectedPeers[2], 0], diff --git a/packages/beacon-node/test/unit/network/peers/utils/assertPeerRelevance.test.ts b/packages/beacon-node/test/unit/network/peers/utils/assertPeerRelevance.test.ts index 0853fa3dd3a5..92e12fc866f4 100644 --- a/packages/beacon-node/test/unit/network/peers/utils/assertPeerRelevance.test.ts +++ b/packages/beacon-node/test/unit/network/peers/utils/assertPeerRelevance.test.ts @@ -82,7 +82,7 @@ describe("network / peers / utils / assertPeerRelevance", () => { for (const {id, remote, currentSlot, irrelevantType} of testCases) { it(id, async () => { // Partial instance with only the methods needed for the test - const chain = ({ + const chain = { getStatus: () => ({ forkDigest: correctForkDigest, finalizedRoot: ZERO_HASH, @@ -93,7 +93,7 @@ describe("network / peers / utils / assertPeerRelevance", () => { clock: { currentSlot: currentSlot ?? 0, } as Partial, - } as Partial) as MockBeaconChain; + } as Partial as MockBeaconChain; expect(assertPeerRelevance(remote, chain)).to.deep.equal(irrelevantType); }); diff --git a/packages/beacon-node/test/utils/runEl.ts b/packages/beacon-node/test/utils/runEl.ts index 7eb7540c339d..48aebc305eda 100644 --- a/packages/beacon-node/test/utils/runEl.ts +++ b/packages/beacon-node/test/utils/runEl.ts @@ -95,7 +95,7 @@ async function getGenesisBlockHash( signal: AbortSignal ): Promise { const eth1Provider = new Eth1Provider( - ({DEPOSIT_CONTRACT_ADDRESS: ZERO_HASH} as Partial) as ChainConfig, + {DEPOSIT_CONTRACT_ADDRESS: ZERO_HASH} as Partial as ChainConfig, {providerUrls: [providerUrl], jwtSecretHex}, signal ); @@ -197,7 +197,7 @@ async function isPortInUse(port: number): Promise { return new Promise((resolve, reject) => { const server = net.createServer(); server.once("error", function (err) { - if (((err as unknown) as {code: string}).code === "EADDRINUSE") { + if ((err as unknown as {code: string}).code === "EADDRINUSE") { resolve(true); } else { reject(err); @@ -227,6 +227,6 @@ export async function getBalance(url: string, account: string): Promise const response: string = await shell( `curl -X POST -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"eth_getBalance","params":["${account}","latest"],"id":67}' ${url}` ); - const {result} = (JSON.parse(response) as unknown) as Record; + const {result} = JSON.parse(response) as unknown as Record; return result; } diff --git a/packages/beacon-node/test/utils/testnet.ts b/packages/beacon-node/test/utils/testnet.ts index ac569335fd7f..d3b1ceb694aa 100644 --- a/packages/beacon-node/test/utils/testnet.ts +++ b/packages/beacon-node/test/utils/testnet.ts @@ -28,8 +28,7 @@ export const goerliTestnetLogs = [ blockNumber: 3124930, txHash: "0x9662b35ea4128fafe8185f8b4b0b890f72009d31e9d65a8f2ad5712f74910644", topics: ["0x649bbc62d0e31342afea4e5cd82d4049e7e1ee912fc0889aa790803be39038c5"], - data: - "0x00000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000180000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000308214eabc827a4deaed78c0bf3f91d81b57968041b5d7c975c716641ccfac7aa4e11e3354a357b1f40637e282fd66403500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000bb991061d2545c75e788b93f3425b03b05f0d2aae8e97da30d7d04886b9eb700000000000000000000000000000000000000000000000000000000000000080040597307000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006099cb82bc69b4111d1a828963f0316ec9aa38c4e9e041a8afec86cd20dfe9a590999845bf01d4689f3bbe3df54e48695e081f1216027b577c7fccf6ab0a4fcc75faf8009c6b55e518478139f604f542d138ae3bc34bad01ee6002006d64c4ff820000000000000000000000000000000000000000000000000000000000000008b11a000000000000000000000000000000000000000000000000000000000000", + data: "0x00000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000180000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000308214eabc827a4deaed78c0bf3f91d81b57968041b5d7c975c716641ccfac7aa4e11e3354a357b1f40637e282fd66403500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000bb991061d2545c75e788b93f3425b03b05f0d2aae8e97da30d7d04886b9eb700000000000000000000000000000000000000000000000000000000000000080040597307000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006099cb82bc69b4111d1a828963f0316ec9aa38c4e9e041a8afec86cd20dfe9a590999845bf01d4689f3bbe3df54e48695e081f1216027b577c7fccf6ab0a4fcc75faf8009c6b55e518478139f604f542d138ae3bc34bad01ee6002006d64c4ff820000000000000000000000000000000000000000000000000000000000000008b11a000000000000000000000000000000000000000000000000000000000000", }, ]; diff --git a/packages/beacon-node/test/utils/validationData/aggregateAndProof.ts b/packages/beacon-node/test/utils/validationData/aggregateAndProof.ts index 981933702dbf..b90a8c422e71 100644 --- a/packages/beacon-node/test/utils/validationData/aggregateAndProof.ts +++ b/packages/beacon-node/test/utils/validationData/aggregateAndProof.ts @@ -12,9 +12,7 @@ export type AggregateAndProofValidDataOpts = AttestationValidDataOpts; /** * Generate a valid gossip SignedAggregateAndProof object. Common logic for unit and perf tests */ -export function getAggregateAndProofValidData( - opts: AggregateAndProofValidDataOpts -): { +export function getAggregateAndProofValidData(opts: AggregateAndProofValidDataOpts): { chain: IBeaconChain; signedAggregateAndProof: phase0.SignedAggregateAndProof; validatorIndex: number; diff --git a/packages/beacon-node/test/utils/validationData/attestation.ts b/packages/beacon-node/test/utils/validationData/attestation.ts index f87db6e763b5..91a1b9e23070 100644 --- a/packages/beacon-node/test/utils/validationData/attestation.ts +++ b/packages/beacon-node/test/utils/validationData/attestation.ts @@ -31,9 +31,7 @@ export type AttestationValidDataOpts = { /** * Generate a valid gossip Attestation object. Common logic for unit and perf tests */ -export function getAttestationValidData( - opts: AttestationValidDataOpts -): { +export function getAttestationValidData(opts: AttestationValidDataOpts): { chain: IBeaconChain; attestation: phase0.Attestation; subnet: number; @@ -69,7 +67,7 @@ export function getAttestationValidData( ...{executionPayloadBlockHash: null, executionStatus: ExecutionStatus.PreMerge}, }; - const forkChoice = ({ + const forkChoice = { getBlock: (root) => { if (!ssz.Root.equals(root, beaconBlockRoot)) return null; return headBlock; @@ -78,7 +76,7 @@ export function getAttestationValidData( if (rootHex !== toHexString(beaconBlockRoot)) return null; return headBlock; }, - } as Partial) as IForkChoice; + } as Partial as IForkChoice; const committeeIndices = state.epochCtx.getBeaconCommittee(attSlot, attIndex); const validatorIndex = committeeIndices[bitIndex]; @@ -111,11 +109,11 @@ export function getAttestationValidData( const subnet = state.epochCtx.computeSubnetForSlot(attSlot, attIndex); // Add state to regen - const regen = ({ + const regen = { getState: async () => state, - } as Partial) as IStateRegenerator; + } as Partial as IStateRegenerator; - const chain = ({ + const chain = { clock, config: config as BeaconConfig, forkChoice, @@ -124,7 +122,7 @@ export function getAttestationValidData( seenAggregatedAttestations: new SeenAggregatedAttestations(null), bls: new BlsSingleThreadVerifier({metrics: null}), waitForBlock: () => Promise.resolve(false), - } as Partial) as IBeaconChain; + } as Partial as IBeaconChain; return {chain, attestation, subnet, validatorIndex}; } diff --git a/packages/cli/package.json b/packages/cli/package.json index db3a917a08ea..819dc2f85417 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -86,7 +86,7 @@ "prom-client": "^14.2.0", "rimraf": "^3.0.0", "source-map-support": "^0.5.19", - "uint8arrays": "^3.1.0", + "uint8arrays": "^4.0.3", "uuidv4": "^6.1.1", "winston": "^3.3.3", "winston-daily-rotate-file": "^4.5.5", diff --git a/packages/cli/src/cmds/beacon/handler.ts b/packages/cli/src/cmds/beacon/handler.ts index cd640822c32b..4ca181a7a3e8 100644 --- a/packages/cli/src/cmds/beacon/handler.ts +++ b/packages/cli/src/cmds/beacon/handler.ts @@ -79,7 +79,7 @@ export async function beaconHandler(args: BeaconArgs & GlobalArgs): Promise { if (args.persistNetworkIdentity) { diff --git a/packages/cli/src/cmds/validator/handler.ts b/packages/cli/src/cmds/validator/handler.ts index 96c1a95fc388..81fe7aaec699 100644 --- a/packages/cli/src/cmds/validator/handler.ts +++ b/packages/cli/src/cmds/validator/handler.ts @@ -112,7 +112,7 @@ export async function validatorHandler(args: IValidatorCliArgs & GlobalArgs): Pr // Send version and network data for static registries const register = args["metrics"] || args["monitoring.endpoint"] ? new RegistryMetricCreator() : null; - const metrics = register && getMetrics((register as unknown) as MetricsRegister, {version, commit, network}); + const metrics = register && getMetrics(register as unknown as MetricsRegister, {version, commit, network}); // Start metrics server if metrics are enabled. // Collect NodeJS metrics defined in the Lodestar repo diff --git a/packages/cli/src/cmds/validator/keymanager/impl.ts b/packages/cli/src/cmds/validator/keymanager/impl.ts index 577f0250c242..d2bb302df1dd 100644 --- a/packages/cli/src/cmds/validator/keymanager/impl.ts +++ b/packages/cli/src/cmds/validator/keymanager/impl.ts @@ -278,39 +278,37 @@ export class KeymanagerApi implements Api { async importRemoteKeys( remoteSigners: Pick[] ): ReturnType { - const results = remoteSigners.map( - ({pubkey, url}): ResponseStatus => { - try { - if (!isValidatePubkeyHex(pubkey)) { - throw Error(`Invalid pubkey ${pubkey}`); - } - if (!isValidHttpUrl(url)) { - throw Error(`Invalid URL ${url}`); - } - - // Check if key exists - if (this.validator.validatorStore.hasVotingPubkey(pubkey)) { - return {status: ImportRemoteKeyStatus.duplicate}; - } - - // Else try to add it - - this.validator.validatorStore.addSigner({type: SignerType.Remote, pubkey, url}); - - this.persistedKeysBackend.writeRemoteKey({ - pubkey, - url, - // Always write, even if it's already persisted for consistency. - // The in-memory validatorStore is the ground truth to decide duplicates - persistIfDuplicate: true, - }); - - return {status: ImportRemoteKeyStatus.imported}; - } catch (e) { - return {status: ImportRemoteKeyStatus.error, message: (e as Error).message}; + const results = remoteSigners.map(({pubkey, url}): ResponseStatus => { + try { + if (!isValidatePubkeyHex(pubkey)) { + throw Error(`Invalid pubkey ${pubkey}`); + } + if (!isValidHttpUrl(url)) { + throw Error(`Invalid URL ${url}`); + } + + // Check if key exists + if (this.validator.validatorStore.hasVotingPubkey(pubkey)) { + return {status: ImportRemoteKeyStatus.duplicate}; } + + // Else try to add it + + this.validator.validatorStore.addSigner({type: SignerType.Remote, pubkey, url}); + + this.persistedKeysBackend.writeRemoteKey({ + pubkey, + url, + // Always write, even if it's already persisted for consistency. + // The in-memory validatorStore is the ground truth to decide duplicates + persistIfDuplicate: true, + }); + + return {status: ImportRemoteKeyStatus.imported}; + } catch (e) { + return {status: ImportRemoteKeyStatus.error, message: (e as Error).message}; } - ); + }); return { data: results, @@ -323,34 +321,30 @@ export class KeymanagerApi implements Api { * DELETE should never return a 404 response, even if all pubkeys from request.pubkeys have no existing keystores. */ async deleteRemoteKeys(pubkeys: PubkeyHex[]): ReturnType { - const results = pubkeys.map( - (pubkeyHex): ResponseStatus => { - try { - if (!isValidatePubkeyHex(pubkeyHex)) { - throw Error(`Invalid pubkey ${pubkeyHex}`); - } + const results = pubkeys.map((pubkeyHex): ResponseStatus => { + try { + if (!isValidatePubkeyHex(pubkeyHex)) { + throw Error(`Invalid pubkey ${pubkeyHex}`); + } - const signer = this.validator.validatorStore.getSigner(pubkeyHex); + const signer = this.validator.validatorStore.getSigner(pubkeyHex); - // Remove key from live local signer - const deletedFromMemory = - signer && signer?.type === SignerType.Remote - ? this.validator.validatorStore.removeSigner(pubkeyHex) - : false; + // Remove key from live local signer + const deletedFromMemory = + signer && signer?.type === SignerType.Remote ? this.validator.validatorStore.removeSigner(pubkeyHex) : false; - // TODO: Remove duties + // TODO: Remove duties - const deletedFromDisk = this.persistedKeysBackend.deleteRemoteKey(pubkeyHex); + const deletedFromDisk = this.persistedKeysBackend.deleteRemoteKey(pubkeyHex); - return { - status: - deletedFromMemory || deletedFromDisk ? DeleteRemoteKeyStatus.deleted : DeleteRemoteKeyStatus.not_found, - }; - } catch (e) { - return {status: DeleteRemoteKeyStatus.error, message: (e as Error).message}; - } + return { + status: + deletedFromMemory || deletedFromDisk ? DeleteRemoteKeyStatus.deleted : DeleteRemoteKeyStatus.not_found, + }; + } catch (e) { + return {status: DeleteRemoteKeyStatus.error, message: (e as Error).message}; } - ); + }); return { data: results, diff --git a/packages/cli/src/cmds/validator/keymanager/persistedKeys.ts b/packages/cli/src/cmds/validator/keymanager/persistedKeys.ts index a1133d57eff5..8cb1c8595316 100644 --- a/packages/cli/src/cmds/validator/keymanager/persistedKeys.ts +++ b/packages/cli/src/cmds/validator/keymanager/persistedKeys.ts @@ -226,9 +226,7 @@ export class PersistedKeysBackend implements IPersistedKeysBackend { }; } - private getValidatorPaths( - pubkey: PubkeyHex - ): { + private getValidatorPaths(pubkey: PubkeyHex): { dirpath: string; keystoreFilepath: string; passphraseFilepath: string; diff --git a/packages/cli/src/cmds/validator/slashingProtection/export.ts b/packages/cli/src/cmds/validator/slashingProtection/export.ts index 200adceea930..b80479a81da8 100644 --- a/packages/cli/src/cmds/validator/slashingProtection/export.ts +++ b/packages/cli/src/cmds/validator/slashingProtection/export.ts @@ -13,66 +13,65 @@ type ExportArgs = { file: string; }; -export const exportCmd: CliCommand< - ExportArgs, - ISlashingProtectionArgs & AccountValidatorArgs & GlobalArgs & LogArgs -> = { - command: "export", +export const exportCmd: CliCommand = + { + command: "export", - describe: "Export an interchange file.", + describe: "Export an interchange file.", - examples: [ - { - command: "validator slashing-protection export --network goerli --file interchange.json", - description: "Export an interchange JSON file for all validators in the slashing protection DB", - }, - ], + examples: [ + { + command: "validator slashing-protection export --network goerli --file interchange.json", + description: "Export an interchange JSON file for all validators in the slashing protection DB", + }, + ], - options: { - file: { - description: "The slashing protection interchange file to export to (.json).", - demandOption: true, - type: "string", + options: { + file: { + description: "The slashing protection interchange file to export to (.json).", + demandOption: true, + type: "string", + }, }, - }, - handler: async (args) => { - const {config, network} = getBeaconConfigFromArgs(args); - const validatorPaths = getValidatorPaths(args, network); - // slashingProtection commands are fast so do not require logFile feature - const {logger} = getCliLogger( - args, - {defaultLogFilepath: path.join(validatorPaths.dataDir, "validator.log")}, - config - ); + handler: async (args) => { + const {config, network} = getBeaconConfigFromArgs(args); + const validatorPaths = getValidatorPaths(args, network); + // slashingProtection commands are fast so do not require logFile feature + const {logger} = getCliLogger( + args, + {defaultLogFilepath: path.join(validatorPaths.dataDir, "validator.log")}, + config + ); - const {validatorsDbDir: dbPath} = getValidatorPaths(args, network); + const {validatorsDbDir: dbPath} = getValidatorPaths(args, network); - // TODO: Allow format version and pubkeys to be customized with CLI args - const formatVersion: InterchangeFormatVersion = {version: "4", format: "complete"}; - logger.info("Exporting the slashing protection logs", {...formatVersion, dbPath}); + // TODO: Allow format version and pubkeys to be customized with CLI args + const formatVersion: InterchangeFormatVersion = {version: "4", format: "complete"}; + logger.info("Exporting the slashing protection logs", {...formatVersion, dbPath}); - const {slashingProtection, metadata} = getSlashingProtection(args, network, logger); + const {slashingProtection, metadata} = getSlashingProtection(args, network, logger); - // When exporting validator DB should already have genesisValidatorsRoot persisted. - // For legacy node and general fallback, fetch from: - // - known genesis data from existing network - // - else fetch from beacon node - const genesisValidatorsRoot = (await metadata.getGenesisValidatorsRoot()) ?? (await getGenesisValidatorsRoot(args)); + // When exporting validator DB should already have genesisValidatorsRoot persisted. + // For legacy node and general fallback, fetch from: + // - known genesis data from existing network + // - else fetch from beacon node + const genesisValidatorsRoot = + (await metadata.getGenesisValidatorsRoot()) ?? (await getGenesisValidatorsRoot(args)); - logger.verbose("Fetching the pubkeys from the slashingProtection db"); - const pubkeys = await slashingProtection.listPubkeys(); + logger.verbose("Fetching the pubkeys from the slashingProtection db"); + const pubkeys = await slashingProtection.listPubkeys(); - logger.info("Starting export for pubkeys found", {pubkeys: pubkeys.length}); - const interchange = await slashingProtection.exportInterchange( - genesisValidatorsRoot, - pubkeys, - formatVersion, - logger - ); + logger.info("Starting export for pubkeys found", {pubkeys: pubkeys.length}); + const interchange = await slashingProtection.exportInterchange( + genesisValidatorsRoot, + pubkeys, + formatVersion, + logger + ); - logger.info("Writing the slashing protection logs", {file: args.file}); - writeFile600Perm(args.file, interchange); - logger.verbose("Export completed successfully"); - }, -}; + logger.info("Writing the slashing protection logs", {file: args.file}); + writeFile600Perm(args.file, interchange); + logger.verbose("Export completed successfully"); + }, + }; diff --git a/packages/cli/src/cmds/validator/slashingProtection/import.ts b/packages/cli/src/cmds/validator/slashingProtection/import.ts index 43e603c37114..a207d5eab627 100644 --- a/packages/cli/src/cmds/validator/slashingProtection/import.ts +++ b/packages/cli/src/cmds/validator/slashingProtection/import.ts @@ -14,56 +14,55 @@ type ImportArgs = { file: string; }; -export const importCmd: CliCommand< - ImportArgs, - ISlashingProtectionArgs & AccountValidatorArgs & GlobalArgs & LogArgs -> = { - command: "import", +export const importCmd: CliCommand = + { + command: "import", - describe: "Import an interchange file.", + describe: "Import an interchange file.", - examples: [ - { - command: "validator slashing-protection import --network goerli --file interchange.json", - description: "Import an interchange file to the slashing protection DB", - }, - ], + examples: [ + { + command: "validator slashing-protection import --network goerli --file interchange.json", + description: "Import an interchange file to the slashing protection DB", + }, + ], - options: { - file: { - description: "The slashing protection interchange file to import (.json).", - demandOption: true, - type: "string", + options: { + file: { + description: "The slashing protection interchange file to import (.json).", + demandOption: true, + type: "string", + }, }, - }, - handler: async (args) => { - const {config, network} = getBeaconConfigFromArgs(args); - const validatorPaths = getValidatorPaths(args, network); - // slashingProtection commands are fast so do not require logFile feature - const {logger} = getCliLogger( - args, - {defaultLogFilepath: path.join(validatorPaths.dataDir, "validator.log")}, - config - ); + handler: async (args) => { + const {config, network} = getBeaconConfigFromArgs(args); + const validatorPaths = getValidatorPaths(args, network); + // slashingProtection commands are fast so do not require logFile feature + const {logger} = getCliLogger( + args, + {defaultLogFilepath: path.join(validatorPaths.dataDir, "validator.log")}, + config + ); - const {validatorsDbDir: dbPath} = getValidatorPaths(args, network); + const {validatorsDbDir: dbPath} = getValidatorPaths(args, network); - logger.info("Importing the slashing protection logs", {dbPath}); + logger.info("Importing the slashing protection logs", {dbPath}); - const {slashingProtection, metadata} = getSlashingProtection(args, network, logger); + const {slashingProtection, metadata} = getSlashingProtection(args, network, logger); - // Fetch genesisValidatorsRoot from: - // - existing cached in validator DB - // - known genesis data from existing network - // - else fetch from beacon node - const genesisValidatorsRoot = (await metadata.getGenesisValidatorsRoot()) ?? (await getGenesisValidatorsRoot(args)); + // Fetch genesisValidatorsRoot from: + // - existing cached in validator DB + // - known genesis data from existing network + // - else fetch from beacon node + const genesisValidatorsRoot = + (await metadata.getGenesisValidatorsRoot()) ?? (await getGenesisValidatorsRoot(args)); - logger.verbose("Reading the slashing protection logs", {file: args.file}); - const interchangeStr = await fs.promises.readFile(args.file, "utf8"); - const interchangeJson = JSON.parse(interchangeStr) as Interchange; + logger.verbose("Reading the slashing protection logs", {file: args.file}); + const interchangeStr = await fs.promises.readFile(args.file, "utf8"); + const interchangeJson = JSON.parse(interchangeStr) as Interchange; - await slashingProtection.importInterchange(interchangeJson, genesisValidatorsRoot, logger); - logger.info("Import completed successfully"); - }, -}; + await slashingProtection.importInterchange(interchangeJson, genesisValidatorsRoot, logger); + logger.info("Import completed successfully"); + }, + }; diff --git a/packages/cli/src/networks/index.ts b/packages/cli/src/networks/index.ts index 8e5e9c460a81..fb4b8dbe72ee 100644 --- a/packages/cli/src/networks/index.ts +++ b/packages/cli/src/networks/index.ts @@ -44,9 +44,7 @@ export type WeakSubjectivityFetchOptions = { // log to screen every 30s when downloading state from a lodestar node const GET_STATE_LOG_INTERVAL = 30 * 1000; -export function getNetworkData( - network: NetworkName -): { +export function getNetworkData(network: NetworkName): { chainConfig: ChainConfig; depositContractDeployBlock: number; genesisFileUrl: string | null; diff --git a/packages/cli/src/util/file.ts b/packages/cli/src/util/file.ts index acb52249a7df..c7d698789b57 100644 --- a/packages/cli/src/util/file.ts +++ b/packages/cli/src/util/file.ts @@ -39,7 +39,7 @@ export function parse(contents: string, fileFormat: FileFormat): T { case FileFormat.yml: return load(contents, {schema: yamlSchema}) as T; default: - return (contents as unknown) as T; + return contents as unknown as T; } } @@ -57,7 +57,7 @@ export function stringify(obj: unknown, fileFormat: FileFormat): string { contents = dump(obj, {schema: yamlSchema}); break; default: - contents = (obj as unknown) as string; + contents = obj as unknown as string; } return contents; } diff --git a/packages/cli/test/unit/util/format.test.ts b/packages/cli/test/unit/util/format.test.ts index 89a01c02ecda..9c51a2af8a4c 100644 --- a/packages/cli/test/unit/util/format.test.ts +++ b/packages/cli/test/unit/util/format.test.ts @@ -17,7 +17,8 @@ describe("util / format / parseRange", () => { describe("util / format / isValidatePubkeyHex", () => { const testCases: Record = { - "../../malicious_link/0x933ad9491b62059dd065b560d256d8957a8c402cc6e8d8ee7290ae11e8f7329267a8811c397529dac52ae1342ba58c95": false, + "../../malicious_link/0x933ad9491b62059dd065b560d256d8957a8c402cc6e8d8ee7290ae11e8f7329267a8811c397529dac52ae1342ba58c95": + false, "0x933ad9491b62059dd065b560d256d8957a8c402cc6e8d8ee7290ae11e8f7329267a8811c397529dac52ae1342ba58c95": true, "0x933ad9491b62059dd065b560d256d8957a8c402cc6e8d8ee7290ae11e8f7329267a8811c397529dac52ae1342ba58c9": false, "0x933ad9491b62059dd065b560d256d8957a8c402cc6e8d8ee7290ae11e8f7329267a8811c397529dac52ae1342ba58c95f": false, diff --git a/packages/cli/test/utils/simulation/assertions/matchers.ts b/packages/cli/test/utils/simulation/assertions/matchers.ts index d0aa548797ee..816d682ed4cc 100644 --- a/packages/cli/test/utils/simulation/assertions/matchers.ts +++ b/packages/cli/test/utils/simulation/assertions/matchers.ts @@ -3,6 +3,8 @@ import {AssertionMatcher} from "../interfaces.js"; export const everySlotMatcher: AssertionMatcher = ({slot}) => slot >= 0; export const everyEpochMatcher: AssertionMatcher = ({slot, clock}) => clock.isLastSlotOfEpoch(slot); export const neverMatcher: AssertionMatcher = () => false; -export const onceOnSlotMatcher = (userSlot: number): AssertionMatcher => ({slot}) => - slot === userSlot ? {remove: true, match: true} : false; +export const onceOnSlotMatcher = + (userSlot: number): AssertionMatcher => + ({slot}) => + slot === userSlot ? {remove: true, match: true} : false; export const onceOnStartupMatcher = onceOnSlotMatcher(1); diff --git a/packages/cli/test/utils/simulation/assertions/mergeAssertion.ts b/packages/cli/test/utils/simulation/assertions/mergeAssertion.ts index e08a4001c9e8..cf23b9367424 100644 --- a/packages/cli/test/utils/simulation/assertions/mergeAssertion.ts +++ b/packages/cli/test/utils/simulation/assertions/mergeAssertion.ts @@ -13,7 +13,7 @@ export const mergeAssertion: SimulationAssertion<"merge", string> = { for (const node of nodes) { const res = await node.cl.api.debug.getStateV2("head"); ApiError.assert(res); - const state = (res.response.data as unknown) as BeaconStateAllForks; + const state = res.response.data as unknown as BeaconStateAllForks; if (!(isExecutionStateType(state) && isMergeTransitionComplete(state))) { errors.push( diff --git a/packages/cli/test/utils/simulation/assertions/nodeAssertion.ts b/packages/cli/test/utils/simulation/assertions/nodeAssertion.ts index 3a691fc56376..6370cdc4c941 100644 --- a/packages/cli/test/utils/simulation/assertions/nodeAssertion.ts +++ b/packages/cli/test/utils/simulation/assertions/nodeAssertion.ts @@ -16,8 +16,8 @@ export const nodeAssertion: SimulationAssertion<"node", string> = { const {status: health} = await node.cl.api.node.getHealth(); if ( - ((health as unknown) as routes.node.NodeHealth) !== routes.node.NodeHealth.SYNCING && - ((health as unknown) as routes.node.NodeHealth) !== routes.node.NodeHealth.READY + (health as unknown as routes.node.NodeHealth) !== routes.node.NodeHealth.SYNCING && + (health as unknown as routes.node.NodeHealth) !== routes.node.NodeHealth.READY ) { errors.push(`node health is neither READY or SYNCING. ${JSON.stringify({id: node.cl.id})}`); } diff --git a/packages/cli/test/utils/simulation/cl_clients/lighthouse.ts b/packages/cli/test/utils/simulation/cl_clients/lighthouse.ts index bab6561a8bc2..ff49a79209a7 100644 --- a/packages/cli/test/utils/simulation/cl_clients/lighthouse.ts +++ b/packages/cli/test/utils/simulation/cl_clients/lighthouse.ts @@ -127,7 +127,7 @@ export const generateLighthouseBeaconNode: CLClientGenerator = const rcConfigPath = path.join(rootDir, "rc_config.json"); const paramsPath = path.join(rootDir, "params.json"); - const rcConfig = ({ + const rcConfig = { network: "dev", preset: "minimal", dataDir: rootDir, @@ -49,7 +49,7 @@ export const generateLodestarBeaconNode: CLClientGenerator = "jwt-secret": jwtsecretFilePath, paramsFile: paramsPath, ...clientOptions, - } as unknown) as BeaconArgs & GlobalArgs; + } as unknown as BeaconArgs & GlobalArgs; if (engineMock) { rcConfig["eth1"] = false; @@ -125,7 +125,7 @@ export const generateLodestarValidatorJobs = (opts: CLClientGeneratorOptions): J throw Error("Attempting to run a vc with keys.type == 'no-keys'"); } - const rcConfig = ({ + const rcConfig = { network: "dev", preset: "minimal", dataDir: rootDir, @@ -140,7 +140,7 @@ export const generateLodestarValidatorJobs = (opts: CLClientGeneratorOptions): J logFile: "none", importKeystores: keystoresDir, importKeystoresPassword: keystoresSecretFilePath, - } as unknown) as IValidatorCliArgs & GlobalArgs; + } as unknown as IValidatorCliArgs & GlobalArgs; return { id, diff --git a/packages/cli/test/utils/simulation/interfaces.ts b/packages/cli/test/utils/simulation/interfaces.ts index 8b88da298b03..ccd6e234732e 100644 --- a/packages/cli/test/utils/simulation/interfaces.ts +++ b/packages/cli/test/utils/simulation/interfaces.ts @@ -331,7 +331,6 @@ export interface ELPaths { logFilePath: string; } -export type MountedPaths = T & - { - [P in keyof T as `${string & P}Mounted`]: T[P]; - }; +export type MountedPaths = T & { + [P in keyof T as `${string & P}Mounted`]: T[P]; +}; diff --git a/packages/fork-choice/test/unit/protoArray/executionStatusUpdates.test.ts b/packages/fork-choice/test/unit/protoArray/executionStatusUpdates.test.ts index 76905700c1b5..0a7fa5e13856 100644 --- a/packages/fork-choice/test/unit/protoArray/executionStatusUpdates.test.ts +++ b/packages/fork-choice/test/unit/protoArray/executionStatusUpdates.test.ts @@ -79,9 +79,11 @@ function setupForkChoice(): ProtoArray { ); for (const block of blocks) { - const executionData = (block.executionStatus === ExecutionStatus.PreMerge - ? {executionPayloadBlockHash: null, executionStatus: ExecutionStatus.PreMerge} - : {executionPayloadBlockHash: block.root, executionStatus: block.executionStatus}) as BlockExecution; + const executionData = ( + block.executionStatus === ExecutionStatus.PreMerge + ? {executionPayloadBlockHash: null, executionStatus: ExecutionStatus.PreMerge} + : {executionPayloadBlockHash: block.root, executionStatus: block.executionStatus} + ) as BlockExecution; fc.onBlock( { slot: block.slot, diff --git a/packages/light-client/src/spec/utils.ts b/packages/light-client/src/spec/utils.ts index 08c2da166369..96572a904994 100644 --- a/packages/light-client/src/spec/utils.ts +++ b/packages/light-client/src/spec/utils.ts @@ -80,26 +80,29 @@ export function upgradeLightClientHeader( `Invalid startUpgradeFromFork=${startUpgradeFromFork} for headerFork=${headerFork} in upgradeLightClientHeader to targetFork=${targetFork}` ); + // eslint-disable-next-line no-fallthrough case ForkName.altair: case ForkName.bellatrix: // Break if no further upgradation is required else fall through if (ForkSeq[targetFork] <= ForkSeq.bellatrix) break; - // eslint-disable-next-line no-fallthrough + // eslint-disable-next-line no-fallthrough case ForkName.capella: - (upgradedHeader as capella.LightClientHeader).execution = ssz.capella.LightClientHeader.fields.execution.defaultValue(); - (upgradedHeader as capella.LightClientHeader).executionBranch = ssz.capella.LightClientHeader.fields.executionBranch.defaultValue(); + (upgradedHeader as capella.LightClientHeader).execution = + ssz.capella.LightClientHeader.fields.execution.defaultValue(); + (upgradedHeader as capella.LightClientHeader).executionBranch = + ssz.capella.LightClientHeader.fields.executionBranch.defaultValue(); // Break if no further upgradation is required else fall through if (ForkSeq[targetFork] <= ForkSeq.capella) break; - // eslint-disable-next-line no-fallthrough + // eslint-disable-next-line no-fallthrough case ForkName.deneb: - (upgradedHeader as deneb.LightClientHeader).execution.excessDataGas = ssz.deneb.LightClientHeader.fields.execution.fields.excessDataGas.defaultValue(); + (upgradedHeader as deneb.LightClientHeader).execution.excessDataGas = + ssz.deneb.LightClientHeader.fields.execution.fields.excessDataGas.defaultValue(); // Break if no further upgradation is required else fall through if (ForkSeq[targetFork] <= ForkSeq.deneb) break; - // eslint-disable-next-line no-fallthrough } return upgradedHeader; } diff --git a/packages/light-client/test/unit/sync.node.test.ts b/packages/light-client/test/unit/sync.node.test.ts index 91e3da59cf94..316305d3c883 100644 --- a/packages/light-client/test/unit/sync.node.test.ts +++ b/packages/light-client/test/unit/sync.node.test.ts @@ -64,11 +64,11 @@ describe("sync", () => { const proofServerApi = new ProofServerApiMock(); // Start server const opts: ServerOpts = {host: "127.0.0.1", port: 15000}; - await startServer(opts, config, ({ + await startServer(opts, config, { lightclient: lightclientServerApi, events: eventsServerApi, proof: proofServerApi, - } as Partial<{[K in keyof Api]: ServerApi}>) as {[K in keyof Api]: ServerApi}); + } as Partial<{[K in keyof Api]: ServerApi}> as {[K in keyof Api]: ServerApi}); // Populate initial snapshot const {snapshot, checkpointRoot} = computeLightClientSnapshot(initialPeriod); @@ -141,7 +141,7 @@ describe("sync", () => { // Provide the state to the lightclient server impl. Only the last one to test proof fetching if (slot === targetSlot) { - proofServerApi.states.set(toHexString(stateRoot), (state as BeaconStateAllForks) as BeaconStateAltair); + proofServerApi.states.set(toHexString(stateRoot), state as BeaconStateAllForks as BeaconStateAltair); } // Emit a new head update with the custom state root diff --git a/packages/light-client/test/utils/utils.ts b/packages/light-client/test/utils/utils.ts index e55f3af3dfd8..c5f5b78afe42 100644 --- a/packages/light-client/test/utils/utils.ts +++ b/packages/light-client/test/utils/utils.ts @@ -155,9 +155,7 @@ export function computeLightclientUpdate(config: BeaconConfig, period: SyncPerio /** * Creates a LightClientBootstrap that passes validation */ -export function computeLightClientSnapshot( - period: SyncPeriod -): { +export function computeLightClientSnapshot(period: SyncPeriod): { snapshot: allForks.LightClientBootstrap; checkpointRoot: Uint8Array; } { diff --git a/packages/params/src/index.ts b/packages/params/src/index.ts index 2a8742e83e95..29ac446d6390 100644 --- a/packages/params/src/index.ts +++ b/packages/params/src/index.ts @@ -38,7 +38,7 @@ presetStatus.frozen = true; * The active preset can be manually overridden with `setActivePreset` */ export const ACTIVE_PRESET = - userSelectedPreset || PresetName[process?.env?.LODESTAR_PRESET as PresetName] || PresetName.mainnet; + userSelectedPreset ?? PresetName[process?.env?.LODESTAR_PRESET as PresetName] ?? PresetName.mainnet; export const activePreset = presets[ACTIVE_PRESET]; // These variables must be exported individually and explicitly diff --git a/packages/params/test/e2e/ensure-config-is-synced.test.ts b/packages/params/test/e2e/ensure-config-is-synced.test.ts index 3e969d6e4f06..7d7f15c988d9 100644 --- a/packages/params/test/e2e/ensure-config-is-synced.test.ts +++ b/packages/params/test/e2e/ensure-config-is-synced.test.ts @@ -46,7 +46,7 @@ async function downloadRemoteConfig(preset: "mainnet" | "minimal", commit: strin // Merge all the fetched yamls for the different forks // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment const beaconPresetRaw: Record = Object.assign( - ...((downloadedParams as unknown) as [input: Record]) + ...(downloadedParams as unknown as [input: Record]) ); // As of December 2021 the presets don't include any hex strings diff --git a/packages/prover/src/web3_proxy.ts b/packages/prover/src/web3_proxy.ts index 8e1a8434f886..afffdbd73217 100644 --- a/packages/prover/src/web3_proxy.ts +++ b/packages/prover/src/web3_proxy.ts @@ -19,9 +19,10 @@ export type VerifiedProxyOptions = { } & LogOptions & ConsensusNodeOptions; -export function createVerifiedExecutionProxy( - opts: VerifiedProxyOptions -): {server: http.Server; proofProvider: ProofProvider} { +export function createVerifiedExecutionProxy(opts: VerifiedProxyOptions): { + server: http.Server; + proofProvider: ProofProvider; +} { const {executionRpcUrl, network} = opts; const signal = opts.signal ?? new AbortController().signal; const logger = getLogger(opts); diff --git a/packages/reqresp/src/encoders/requestDecode.ts b/packages/reqresp/src/encoders/requestDecode.ts index 82d5c9114370..3c8968aee893 100644 --- a/packages/reqresp/src/encoders/requestDecode.ts +++ b/packages/reqresp/src/encoders/requestDecode.ts @@ -17,7 +17,7 @@ export function requestDecode( const type = protocol.requestType(ForkName.phase0); if (type === null) { // method has no body - return (null as unknown) as Req; + return null as unknown as Req; } // Request has a single payload, so return immediately diff --git a/packages/reqresp/src/protocols/LightClientOptimisticUpdate.ts b/packages/reqresp/src/protocols/LightClientOptimisticUpdate.ts index 2ef8fd5b28c5..563dcabf1bf6 100644 --- a/packages/reqresp/src/protocols/LightClientOptimisticUpdate.ts +++ b/packages/reqresp/src/protocols/LightClientOptimisticUpdate.ts @@ -4,31 +4,29 @@ import {DialOnlyProtocolDefinition, Encoding, MixedProtocolDefinitionGenerator} import {getContextBytesLightclient} from "./utils.js"; // eslint-disable-next-line @typescript-eslint/naming-convention -export const LightClientOptimisticUpdate: MixedProtocolDefinitionGenerator< - null, - allForks.LightClientOptimisticUpdate -> = ((modules, handler) => { - const dialProtocol: DialOnlyProtocolDefinition = { - method: "light_client_optimistic_update", - version: 1, - encoding: Encoding.SSZ_SNAPPY, - requestType: () => null, - responseType: (forkName) => - isForkLightClient(forkName) - ? ssz.allForksLightClient[forkName].LightClientOptimisticUpdate - : ssz.altair.LightClientOptimisticUpdate, - contextBytes: getContextBytesLightclient((update) => modules.config.getForkName(update.signatureSlot), modules), - }; +export const LightClientOptimisticUpdate: MixedProtocolDefinitionGenerator = + ((modules, handler) => { + const dialProtocol: DialOnlyProtocolDefinition = { + method: "light_client_optimistic_update", + version: 1, + encoding: Encoding.SSZ_SNAPPY, + requestType: () => null, + responseType: (forkName) => + isForkLightClient(forkName) + ? ssz.allForksLightClient[forkName].LightClientOptimisticUpdate + : ssz.altair.LightClientOptimisticUpdate, + contextBytes: getContextBytesLightclient((update) => modules.config.getForkName(update.signatureSlot), modules), + }; - if (!handler) return dialProtocol; + if (!handler) return dialProtocol; - return { - ...dialProtocol, - handler, - inboundRateLimits: { - // Optimistic updates should not be requested more than once per slot. - // Allow 2 per slot and a very safe bound until there's more testing of real usage. - byPeer: {quota: 2, quotaTimeMs: 12_000}, - }, - }; -}) as MixedProtocolDefinitionGenerator; + return { + ...dialProtocol, + handler, + inboundRateLimits: { + // Optimistic updates should not be requested more than once per slot. + // Allow 2 per slot and a very safe bound until there's more testing of real usage. + byPeer: {quota: 2, quotaTimeMs: 12_000}, + }, + }; + }) as MixedProtocolDefinitionGenerator; diff --git a/packages/reqresp/test/fixtures/protocols.ts b/packages/reqresp/test/fixtures/protocols.ts index 099d34ca8e17..c82bf4e2e4ca 100644 --- a/packages/reqresp/test/fixtures/protocols.ts +++ b/packages/reqresp/test/fixtures/protocols.ts @@ -53,14 +53,10 @@ export const numberToStringProtocol: MixedProtocolDefinitionGenerator; -export const numberToStringProtocolHandler: ReqRespHandler< - NumToStrReqType, - NumToStrRespType -> = async function* numberToStringProtocolHandler( - req: NumToStrReqType -): AsyncIterable> { - yield { - type: EncodedPayloadType.ssz, - data: {value: [...Buffer.from(req.value.toString(), "utf-8")]}, +export const numberToStringProtocolHandler: ReqRespHandler = + async function* numberToStringProtocolHandler(req: NumToStrReqType): AsyncIterable> { + yield { + type: EncodedPayloadType.ssz, + data: {value: [...Buffer.from(req.value.toString(), "utf-8")]}, + }; }; -}; diff --git a/packages/reqresp/test/unit/ReqResp.test.ts b/packages/reqresp/test/unit/ReqResp.test.ts index 7dfe9d780cf1..5434ac7fe8ef 100644 --- a/packages/reqresp/test/unit/ReqResp.test.ts +++ b/packages/reqresp/test/unit/ReqResp.test.ts @@ -18,7 +18,7 @@ describe("ResResp", () => { let logger: Logger; beforeEach(() => { - libp2p = ({ + libp2p = { dialProtocol: sinon .stub() .resolves( @@ -31,7 +31,7 @@ describe("ResResp", () => { ) ), handle: sinon.spy(), - } as unknown) as Libp2p; + } as unknown as Libp2p; logger = createStubbedLogger(); diff --git a/packages/reqresp/test/unit/request/index.test.ts b/packages/reqresp/test/unit/request/index.test.ts index 5e6a07b95243..b9631f5ba3ba 100644 --- a/packages/reqresp/test/unit/request/index.test.ts +++ b/packages/reqresp/test/unit/request/index.test.ts @@ -58,7 +58,7 @@ describe("request / sendRequest", () => { for (const {id, protocols, expectedReturn, requestBody} of testCases) { it(id, async () => { - libp2p = ({ + libp2p = { dialProtocol: sinon .stub() .resolves( @@ -70,7 +70,7 @@ describe("request / sendRequest", () => { protocols[0].method ) ), - } as unknown) as Libp2p; + } as unknown as Libp2p; const responses = await pipe( sendRequest( @@ -143,9 +143,9 @@ describe("request / sendRequest", () => { for (const {id, source, opts, error} of timeoutTestCases) { it(id, async () => { - libp2p = ({ + libp2p = { dialProtocol: sinon.stub().resolves(new MockLibP2pStream(source(), messages.ping.method)), - } as unknown) as Libp2p; + } as unknown as Libp2p; await expectRejectedWithLodestarError( pipe( diff --git a/packages/spec-test-util/src/single.ts b/packages/spec-test-util/src/single.ts index 36a52c777f4a..7951cd61a87d 100644 --- a/packages/spec-test-util/src/single.ts +++ b/packages/spec-test-util/src/single.ts @@ -29,7 +29,7 @@ type SszTypeGeneric = { }; export function toExpandedInputType(inputType: InputType | ExpandedInputType): ExpandedInputType { - if ((inputType as ExpandedInputType).type) { + if ((inputType as ExpandedInputType).type !== undefined) { return inputType as ExpandedInputType; } return { diff --git a/packages/state-transition/src/block/processExecutionPayload.ts b/packages/state-transition/src/block/processExecutionPayload.ts index 4d2ccb88516f..f60f0f33f4f1 100644 --- a/packages/state-transition/src/block/processExecutionPayload.ts +++ b/packages/state-transition/src/block/processExecutionPayload.ts @@ -101,9 +101,9 @@ export function executionPayloadToPayloadHeader( if (fork >= ForkSeq.deneb) { // https://github.com/ethereum/consensus-specs/blob/dev/specs/eip4844/beacon-chain.md#process_execution_payload - (bellatrixPayloadFields as deneb.ExecutionPayloadHeader).excessDataGas = (payload as - | deneb.ExecutionPayloadHeader - | deneb.ExecutionPayload).excessDataGas; + (bellatrixPayloadFields as deneb.ExecutionPayloadHeader).excessDataGas = ( + payload as deneb.ExecutionPayloadHeader | deneb.ExecutionPayload + ).excessDataGas; } return bellatrixPayloadFields; diff --git a/packages/state-transition/src/block/processWithdrawals.ts b/packages/state-transition/src/block/processWithdrawals.ts index c4482f47815f..19858748c18c 100644 --- a/packages/state-transition/src/block/processWithdrawals.ts +++ b/packages/state-transition/src/block/processWithdrawals.ts @@ -62,9 +62,10 @@ export function processWithdrawals( } } -export function getExpectedWithdrawals( - state: CachedBeaconStateCapella -): {withdrawals: capella.Withdrawal[]; sampledValidators: number} { +export function getExpectedWithdrawals(state: CachedBeaconStateCapella): { + withdrawals: capella.Withdrawal[]; + sampledValidators: number; +} { const epoch = state.epochCtx.epoch; let withdrawalIndex = state.nextWithdrawalIndex; const {validators, balances, nextWithdrawalValidatorIndex} = state; diff --git a/packages/state-transition/src/epoch/computeUnrealizedCheckpoints.ts b/packages/state-transition/src/epoch/computeUnrealizedCheckpoints.ts index e4bcd228ed04..6c45b49456a1 100644 --- a/packages/state-transition/src/epoch/computeUnrealizedCheckpoints.ts +++ b/packages/state-transition/src/epoch/computeUnrealizedCheckpoints.ts @@ -12,9 +12,10 @@ import { * - For phase0, we need to create the cache through beforeProcessEpoch * - For other forks, use the progressive balances inside EpochContext */ -export function computeUnrealizedCheckpoints( - state: CachedBeaconStateAllForks -): {justifiedCheckpoint: phase0.Checkpoint; finalizedCheckpoint: phase0.Checkpoint} { +export function computeUnrealizedCheckpoints(state: CachedBeaconStateAllForks): { + justifiedCheckpoint: phase0.Checkpoint; + finalizedCheckpoint: phase0.Checkpoint; +} { let stateRealizedCheckpoints: CachedBeaconStateAllForks; // For phase0, we need to create the cache through beforeProcessEpoch diff --git a/packages/state-transition/src/epoch/getRewardsAndPenalties.ts b/packages/state-transition/src/epoch/getRewardsAndPenalties.ts index d776af0c980e..16f6cfe3b1cc 100644 --- a/packages/state-transition/src/epoch/getRewardsAndPenalties.ts +++ b/packages/state-transition/src/epoch/getRewardsAndPenalties.ts @@ -94,13 +94,8 @@ export function getRewardsAndPenaltiesAltair( rewardPenaltyItemCache.set(effectiveBalanceIncrement, rewardPenaltyItem); } - const { - timelySourceReward, - timelySourcePenalty, - timelyTargetReward, - timelyTargetPenalty, - timelyHeadReward, - } = rewardPenaltyItem; + const {timelySourceReward, timelySourcePenalty, timelyTargetReward, timelyTargetPenalty, timelyHeadReward} = + rewardPenaltyItem; // same logic to getFlagIndexDeltas if (hasMarkers(status.flags, FLAG_PREV_SOURCE_ATTESTER_UNSLASHED)) { diff --git a/packages/state-transition/src/signatureSets/proposerSlashings.ts b/packages/state-transition/src/signatureSets/proposerSlashings.ts index 003e4a845b66..46be30c0636e 100644 --- a/packages/state-transition/src/signatureSets/proposerSlashings.ts +++ b/packages/state-transition/src/signatureSets/proposerSlashings.ts @@ -15,22 +15,20 @@ export function getProposerSlashingSignatureSets( // In state transition, ProposerSlashing headers are only partially validated. Their slot could be higher than the // clock and the slashing would still be valid. Must use bigint variants to hash correctly to all possible values - return [proposerSlashing.signedHeader1, proposerSlashing.signedHeader2].map( - (signedHeader): ISignatureSet => { - const domain = state.config.getDomain( - state.slot, - DOMAIN_BEACON_PROPOSER, - Number(signedHeader.message.slot as bigint) - ); + return [proposerSlashing.signedHeader1, proposerSlashing.signedHeader2].map((signedHeader): ISignatureSet => { + const domain = state.config.getDomain( + state.slot, + DOMAIN_BEACON_PROPOSER, + Number(signedHeader.message.slot as bigint) + ); - return { - type: SignatureSetType.single, - pubkey, - signingRoot: computeSigningRoot(ssz.phase0.BeaconBlockHeaderBigint, signedHeader.message, domain), - signature: signedHeader.signature, - }; - } - ); + return { + type: SignatureSetType.single, + pubkey, + signingRoot: computeSigningRoot(ssz.phase0.BeaconBlockHeaderBigint, signedHeader.message, domain), + signature: signedHeader.signature, + }; + }); } export function getProposerSlashingsSignatureSets( diff --git a/packages/state-transition/test/perf/epoch/processSlashingsAllForks.test.ts b/packages/state-transition/test/perf/epoch/processSlashingsAllForks.test.ts index f1fbef47eb35..fe3c890216df 100644 --- a/packages/state-transition/test/perf/epoch/processSlashingsAllForks.test.ts +++ b/packages/state-transition/test/perf/epoch/processSlashingsAllForks.test.ts @@ -42,9 +42,7 @@ describe("phase0 processSlashings", () => { /** * Create a state that causes `changeRatio` fraction (0,1) of validators to change their effective balance. */ -function getProcessSlashingsTestData( - indicesToSlashLen: number -): { +function getProcessSlashingsTestData(indicesToSlashLen: number): { state: CachedBeaconStateAllForks; epochProcess: EpochProcess; } { diff --git a/packages/state-transition/test/perf/misc/proxy.test.ts b/packages/state-transition/test/perf/misc/proxy.test.ts index 28ab5728e516..6a3536a12de5 100644 --- a/packages/state-transition/test/perf/misc/proxy.test.ts +++ b/packages/state-transition/test/perf/misc/proxy.test.ts @@ -13,7 +13,7 @@ describe("Proxy cost", () => { if (p === "length") { return target.length; } else { - return target[(p as unknown) as number]; + return target[p as unknown as number]; } }, }); diff --git a/packages/state-transition/test/perf/shuffle/shuffle.test.ts b/packages/state-transition/test/perf/shuffle/shuffle.test.ts index fd52e319aa20..9822c5291792 100644 --- a/packages/state-transition/test/perf/shuffle/shuffle.test.ts +++ b/packages/state-transition/test/perf/shuffle/shuffle.test.ts @@ -10,8 +10,7 @@ describe("shuffle list", () => { const seed = new Uint8Array([42, 32]); for (const listSize of [ - 16384, - 250000, + 16384, 250000, // Don't run 4_000_000 since it's very slow and not testnet has gotten there yet // 4e6, ]) { diff --git a/packages/state-transition/test/perf/util.ts b/packages/state-transition/test/perf/util.ts index 28ab0a508fa9..88c3abdb8a2a 100644 --- a/packages/state-transition/test/perf/util.ts +++ b/packages/state-transition/test/perf/util.ts @@ -254,7 +254,7 @@ export function generatePerformanceStateAltair(pubkeysArg?: Uint8Array[]): Beaco if (!altairState) { const pubkeys = pubkeysArg || getPubkeys().pubkeys; const statePhase0 = buildPerformanceStatePhase0(); - const state = (statePhase0 as allForks.BeaconState) as altair.BeaconState; + const state = statePhase0 as allForks.BeaconState as altair.BeaconState; state.previousEpochParticipation = newFilledArray(pubkeys.length, 0b111); state.currentEpochParticipation = state.previousEpochParticipation; diff --git a/packages/state-transition/test/utils/beforeValue.ts b/packages/state-transition/test/utils/beforeValue.ts index 34ee59b9fd9f..0d5f8f77d203 100644 --- a/packages/state-transition/test/utils/beforeValue.ts +++ b/packages/state-transition/test/utils/beforeValue.ts @@ -10,7 +10,7 @@ export type LazyValue = {value: T}; * ``` */ export function beforeValue(fn: () => T | Promise, timeout?: number): LazyValue { - let value: T = (null as unknown) as T; + let value: T = null as unknown as T; before(async function () { this.timeout(timeout ?? 300_000); diff --git a/packages/types/test/unit/constants.test.ts b/packages/types/test/unit/constants.test.ts index d637eb72232c..09cbec8bf1b5 100644 --- a/packages/types/test/unit/constants.test.ts +++ b/packages/types/test/unit/constants.test.ts @@ -26,7 +26,7 @@ describe("Lightclient pre-computed constants", () => { for (const [key, expectedValue] of Object.entries(correctConstants)) { it(key, () => { - expect(((constants as unknown) as Record)[key]).to.equal(expectedValue); + expect((constants as unknown as Record)[key]).to.equal(expectedValue); }); } }); diff --git a/packages/utils/src/logger/format.ts b/packages/utils/src/logger/format.ts index fef0f799e1c2..4f9aff995f3c 100644 --- a/packages/utils/src/logger/format.ts +++ b/packages/utils/src/logger/format.ts @@ -61,7 +61,7 @@ function jsonLogFormat(opts: LoggerOptions): Format { format((_info) => { const info = _info as WinstonInfoArg; info.context = logCtxToJson(info.context); - info.error = (logCtxToJson(info.error) as unknown) as Error; + info.error = logCtxToJson(info.error) as unknown as Error; return info; })(), format.json() diff --git a/packages/utils/src/objects.ts b/packages/utils/src/objects.ts index c343bbe6468e..7e500c560a54 100644 --- a/packages/utils/src/objects.ts +++ b/packages/utils/src/objects.ts @@ -78,9 +78,9 @@ export function objectToExpectedCase | Record< if (Array.isArray(obj)) { const newArr: unknown[] = []; for (let i = 0; i < obj.length; i++) { - newArr[i] = objectToExpectedCase(obj[i], expectedCase); + newArr[i] = objectToExpectedCase(obj[i] as T, expectedCase); } - return (newArr as unknown) as T; + return newArr as unknown as T; } if (Object(obj) === obj) { diff --git a/packages/validator/src/services/prepareBeaconProposer.ts b/packages/validator/src/services/prepareBeaconProposer.ts index 473af87b21e3..65c34e478efd 100644 --- a/packages/validator/src/services/prepareBeaconProposer.ts +++ b/packages/validator/src/services/prepareBeaconProposer.ts @@ -94,18 +94,16 @@ export function pollBuilderValidatorRegistration( for (const pubkeyHexes of pubkeyHexesChunks) { try { const registrations = await Promise.all( - pubkeyHexes.map( - (pubkeyHex): Promise => { - // Just to make typescript happy as it can't figure out we have filtered - // undefined pubkeys above - if (pubkeyHex === undefined) { - throw Error("All undefined pubkeys should have been filtered out"); - } - const feeRecipient = validatorStore.getFeeRecipient(pubkeyHex); - const gasLimit = validatorStore.getGasLimit(pubkeyHex); - return validatorStore.getValidatorRegistration(pubkeyHex, {feeRecipient, gasLimit}, slot); + pubkeyHexes.map((pubkeyHex): Promise => { + // Just to make typescript happy as it can't figure out we have filtered + // undefined pubkeys above + if (pubkeyHex === undefined) { + throw Error("All undefined pubkeys should have been filtered out"); } - ) + const feeRecipient = validatorStore.getFeeRecipient(pubkeyHex); + const gasLimit = validatorStore.getGasLimit(pubkeyHex); + return validatorStore.getValidatorRegistration(pubkeyHex, {feeRecipient, gasLimit}, slot); + }) ); ApiError.assert(await api.validator.registerValidator(registrations)); } catch (e) { diff --git a/packages/validator/src/validator.ts b/packages/validator/src/validator.ts index 267e9242d52e..d52e02a5bf82 100644 --- a/packages/validator/src/validator.ts +++ b/packages/validator/src/validator.ts @@ -259,11 +259,10 @@ export class Validator { const {status: healthCode} = await this.api.node.getHealth(); // API always returns http status codes // Need to find a way to return a custom enum type - if (((healthCode as unknown) as routes.node.NodeHealth) === routes.node.NodeHealth.READY) - return BeaconHealth.READY; - if (((healthCode as unknown) as routes.node.NodeHealth) === routes.node.NodeHealth.SYNCING) + if ((healthCode as unknown as routes.node.NodeHealth) === routes.node.NodeHealth.READY) return BeaconHealth.READY; + if ((healthCode as unknown as routes.node.NodeHealth) === routes.node.NodeHealth.SYNCING) return BeaconHealth.SYNCING; - if (((healthCode as unknown) as routes.node.NodeHealth) === routes.node.NodeHealth.NOT_INITIALIZED_OR_ISSUES) + if ((healthCode as unknown as routes.node.NodeHealth) === routes.node.NodeHealth.NOT_INITIALIZED_OR_ISSUES) return BeaconHealth.NOT_INITIALIZED_OR_ISSUES; else return BeaconHealth.UNKNOWN; } catch (e) { diff --git a/packages/validator/test/unit/services/doppleganger.test.ts b/packages/validator/test/unit/services/doppleganger.test.ts index 79161c09ecb0..98e7e617c1df 100644 --- a/packages/validator/test/unit/services/doppleganger.test.ts +++ b/packages/validator/test/unit/services/doppleganger.test.ts @@ -143,7 +143,7 @@ class MapDef extends Map { type LivenessMap = Map>; function getMockBeaconApi(livenessMap: LivenessMap): Api { - return ({ + return { validator: { async getLiveness(indices, epoch) { return { @@ -161,7 +161,7 @@ function getMockBeaconApi(livenessMap: LivenessMap): Api { }; }, } as Partial, - } as Partial) as Api; + } as Partial as Api; } class ClockMockMsToSlot extends ClockMock { diff --git a/packages/validator/test/unit/services/produceBlockwrapper.test.ts b/packages/validator/test/unit/services/produceBlockwrapper.test.ts index fb71e9311f70..575deae4bb78 100644 --- a/packages/validator/test/unit/services/produceBlockwrapper.test.ts +++ b/packages/validator/test/unit/services/produceBlockwrapper.test.ts @@ -89,7 +89,7 @@ describe("Produce Block with BuilderSelection", function () { }; const { debugLogCtx: {source}, - } = ((await produceBlockWrapper(144897, randaoReveal, "", produceBlockOpts)) as unknown) as { + } = (await produceBlockWrapper(144897, randaoReveal, "", produceBlockOpts)) as unknown as { debugLogCtx: {source: string}; }; expect(source).to.equal(finalSelection, "blindedBlock must be returned"); diff --git a/yarn.lock b/yarn.lock index 063261b063a9..9a01b87d963d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -694,21 +694,38 @@ global-agent "^3.0.0" global-tunnel-ng "^2.7.1" -"@eslint/eslintrc@^1.3.0": - version "1.3.0" - resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-1.3.0.tgz#29f92c30bb3e771e4a2048c95fa6855392dfac4f" - integrity sha512-UWW0TMTmk2d7hLcWD1/e2g5HDM/HQ3csaLSqXCfqwh4uNDuNqlaKWXmEsL4Cs41Z0KnILNvwbHAah3C2yt06kw== +"@eslint-community/eslint-utils@^4.2.0": + version "4.4.0" + resolved "https://registry.yarnpkg.com/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz#a23514e8fb9af1269d5f7788aa556798d61c6b59" + integrity sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA== + dependencies: + eslint-visitor-keys "^3.3.0" + +"@eslint-community/regexpp@^4.4.0": + version "4.5.0" + resolved "https://registry.yarnpkg.com/@eslint-community/regexpp/-/regexpp-4.5.0.tgz#f6f729b02feee2c749f57e334b7a1b5f40a81724" + integrity sha512-vITaYzIcNmjn5tF5uxcZ/ft7/RXGrMUIS9HalWckEOF6ESiwXKoMzAQf2UW0aVd6rnOeExTJVd5hmWXucBKGXQ== + +"@eslint/eslintrc@^2.0.2": + version "2.0.2" + resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-2.0.2.tgz#01575e38707add677cf73ca1589abba8da899a02" + integrity sha512-3W4f5tDUra+pA+FzgugqL2pRimUTDJWKr7BINqOpkZrC0uYI0NIc0/JFgBROCU07HR6GieA5m3/rsPIhDmCXTQ== dependencies: ajv "^6.12.4" debug "^4.3.2" - espree "^9.3.2" - globals "^13.15.0" + espree "^9.5.1" + globals "^13.19.0" ignore "^5.2.0" import-fresh "^3.2.1" js-yaml "^4.1.0" minimatch "^3.1.2" strip-json-comments "^3.1.1" +"@eslint/js@8.37.0": + version "8.37.0" + resolved "https://registry.yarnpkg.com/@eslint/js/-/js-8.37.0.tgz#cf1b5fa24217fe007f6487a26d765274925efa7d" + integrity sha512-x5vzdtOOGgFVDCUs81QRB2+liax8rFg3+7hqM+QhBG0/G3F1ZsoYl97UrqgHgQ9KKT7G6c4V+aTUCgu/n22v1A== + "@ethereumjs/common@2.5.0": version "2.5.0" resolved "https://registry.yarnpkg.com/@ethereumjs/common/-/common-2.5.0.tgz#ec61551b31bef7a69d1dc634d8932468866a4268" @@ -1290,14 +1307,19 @@ resolved "https://registry.npmjs.org/@gar/promisify/-/promisify-1.1.3.tgz" integrity sha512-k2Ty1JcVojjJFwrg/ThKi2ujJ7XNLYaFGNB/bWT9wGR+oSMJHMa5w+CUq6p/pVrKeNNgA7pCqEcjSnHVoqJQFw== -"@humanwhocodes/config-array@^0.9.2": - version "0.9.5" - resolved "https://registry.yarnpkg.com/@humanwhocodes/config-array/-/config-array-0.9.5.tgz#2cbaf9a89460da24b5ca6531b8bbfc23e1df50c7" - integrity sha512-ObyMyWxZiCu/yTisA7uzx81s40xR2fD5Cg/2Kq7G02ajkNubJf6BopgDTmDyc3U7sXpNKM8cYOw7s7Tyr+DnCw== +"@humanwhocodes/config-array@^0.11.8": + version "0.11.8" + resolved "https://registry.yarnpkg.com/@humanwhocodes/config-array/-/config-array-0.11.8.tgz#03595ac2075a4dc0f191cc2131de14fbd7d410b9" + integrity sha512-UybHIJzJnR5Qc/MsD9Kr+RpO2h+/P1GhOwdiLPXK5TWk5sgTdu88bTD9UP+CKbPPh5Rni1u0GjAdYQLemG8g+g== dependencies: "@humanwhocodes/object-schema" "^1.2.1" debug "^4.1.1" - minimatch "^3.0.4" + minimatch "^3.0.5" + +"@humanwhocodes/module-importer@^1.0.1": + version "1.0.1" + resolved "https://registry.yarnpkg.com/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz#af5b2691a22b44be847b0ca81641c5fb6ad0172c" + integrity sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA== "@humanwhocodes/object-schema@^1.2.1": version "1.2.1" @@ -2677,7 +2699,7 @@ resolved "https://registry.yarnpkg.com/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz#5bd262af94e9d25bd1e71b05deed44876a222e8b" integrity sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A== -"@nodelib/fs.walk@^1.2.3": +"@nodelib/fs.walk@^1.2.3", "@nodelib/fs.walk@^1.2.8": version "1.2.8" resolved "https://registry.yarnpkg.com/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz#e95737e8bb6746ddedf69c556953494f196fe69a" integrity sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg== @@ -3169,26 +3191,33 @@ resolved "https://registry.yarnpkg.com/@sindresorhus/is/-/is-4.6.0.tgz#3c7c9c46e678feefe7a2e5bb609d3dbd665ffb3f" integrity sha512-t09vSN3MdfsyCHoFcTRCH/iUtG7OJ0CsjzB8cjAmKc/va/kIgeDI/TxsigdncE/4be734m0cvIYwNaV4i2XqAw== -"@sinonjs/commons@^1.6.0", "@sinonjs/commons@^1.7.0", "@sinonjs/commons@^1.8.3": - version "1.8.3" - resolved "https://registry.npmjs.org/@sinonjs/commons/-/commons-1.8.3.tgz" - integrity sha512-xkNcLAn/wZaX14RPlwizcKicDk9G3F8m2nU3L7Ukm5zBgTwiT0wsoFAHx9Jq56fJA1z/7uKGtCRu16sOUCLIHQ== +"@sinonjs/commons@^2.0.0": + version "2.0.0" + resolved "https://registry.yarnpkg.com/@sinonjs/commons/-/commons-2.0.0.tgz#fd4ca5b063554307e8327b4564bd56d3b73924a3" + integrity sha512-uLa0j859mMrg2slwQYdO/AkrOfmH+X6LTVmNTS9CqexuE2IvVORIkSpJLqePAbEnKJ77aMmCwr1NUZ57120Xcg== dependencies: type-detect "4.0.8" -"@sinonjs/fake-timers@>=5", "@sinonjs/fake-timers@^9.1.2": - version "9.1.2" - resolved "https://registry.yarnpkg.com/@sinonjs/fake-timers/-/fake-timers-9.1.2.tgz#4eaab737fab77332ab132d396a3c0d364bd0ea8c" - integrity sha512-BPS4ynJW/o92PUR4wgriz2Ud5gpST5vz6GQfMixEDK0Z8ZCUv2M7SkBLykH56T++Xs+8ln9zTGbOvNGIe02/jw== +"@sinonjs/commons@^3.0.0": + version "3.0.0" + resolved "https://registry.yarnpkg.com/@sinonjs/commons/-/commons-3.0.0.tgz#beb434fe875d965265e04722ccfc21df7f755d72" + integrity sha512-jXBtWAF4vmdNmZgD5FoKsVLv3rPgDnLgPbU84LIJ3otV44vJlDRokVng5v8NFJdCf/da9legHcKaRuZs4L7faA== dependencies: - "@sinonjs/commons" "^1.7.0" + type-detect "4.0.8" -"@sinonjs/samsam@^6.1.1": - version "6.1.1" - resolved "https://registry.yarnpkg.com/@sinonjs/samsam/-/samsam-6.1.1.tgz#627f7f4cbdb56e6419fa2c1a3e4751ce4f6a00b1" - integrity sha512-cZ7rKJTLiE7u7Wi/v9Hc2fs3Ucc3jrWeMgPHbbTCeVAB2S0wOBbYlkJVeNSL04i7fdhT8wIbDq1zhC/PXTD2SA== +"@sinonjs/fake-timers@^10.0.2": + version "10.0.2" + resolved "https://registry.yarnpkg.com/@sinonjs/fake-timers/-/fake-timers-10.0.2.tgz#d10549ed1f423d80639c528b6c7f5a1017747d0c" + integrity sha512-SwUDyjWnah1AaNl7kxsa7cfLhlTYoiyhDAIgyh+El30YvXs/o7OLXpYH88Zdhyx9JExKrmHDJ+10bwIcY80Jmw== dependencies: - "@sinonjs/commons" "^1.6.0" + "@sinonjs/commons" "^2.0.0" + +"@sinonjs/samsam@^8.0.0": + version "8.0.0" + resolved "https://registry.yarnpkg.com/@sinonjs/samsam/-/samsam-8.0.0.tgz#0d488c91efb3fa1442e26abea81759dfc8b5ac60" + integrity sha512-Bp8KUVlLp8ibJZrnvq2foVhP0IVX2CIprMJPK0vqGqgrDa0OHVKeZyBykqskkrdxV6yKBPmGasO8LVjAKR3Gew== + dependencies: + "@sinonjs/commons" "^2.0.0" lodash.get "^4.4.2" type-detect "^4.0.8" @@ -3437,10 +3466,10 @@ resolved "https://registry.npmjs.org/@types/chai/-/chai-4.2.17.tgz" integrity sha512-LaiwWNnYuL8xJlQcE91QB2JoswWZckq9A4b+nMPq8dt8AP96727Nb3X4e74u+E3tm4NLTILNI9MYFsyVc30wSA== -"@types/chai@^4.3.3": - version "4.3.3" - resolved "https://registry.yarnpkg.com/@types/chai/-/chai-4.3.3.tgz#3c90752792660c4b562ad73b3fbd68bf3bc7ae07" - integrity sha512-hC7OMnszpxhZPduX+m+nrx+uFoLkWOMiR4oa/AZF3MuSETYTZmFfJAHqZEM8MVlvfG7BEUcgvtwoCTxBp6hm3g== +"@types/chai@^4.3.4": + version "4.3.4" + resolved "https://registry.yarnpkg.com/@types/chai/-/chai-4.3.4.tgz#e913e8175db8307d78b4e8fa690408ba6b65dee4" + integrity sha512-KnRanxnpfpjUTqTCXslZSEdLfXExwgNxYPdiO2WGUj8+HDjFi8R3k5RVKPeSCzLjCcshCAtVO2QBbVuAV4kTnw== "@types/component-emitter@^1.2.10": version "1.2.11" @@ -3518,10 +3547,10 @@ resolved "https://registry.yarnpkg.com/@types/estree/-/estree-0.0.51.tgz#cfd70924a25a3fd32b218e5e420e6897e1ac4f40" integrity sha512-CuPgU6f3eT/XgKKPqKd/gLZV1Xmvf1a2R5POBOGQa6uv82xpls89HU5zKeVoyR8XzHd1RGNOlQlvUe3CFkjWNQ== -"@types/eventsource@^1.1.5": - version "1.1.5" - resolved "https://registry.npmjs.org/@types/eventsource/-/eventsource-1.1.5.tgz" - integrity sha512-BA9q9uC2PAMkUS7DunHTxWZZaVpeNzDG8lkBxcKwzKJClfDQ4Z59/Csx7HSH/SIqFN2JWh0tAKAM6k/wRR0OZg== +"@types/eventsource@^1.1.11": + version "1.1.11" + resolved "https://registry.yarnpkg.com/@types/eventsource/-/eventsource-1.1.11.tgz#a2c0bfd0436b7db42ed1b2b2117f7ec2e8478dc7" + integrity sha512-L7wLDZlWm5mROzv87W0ofIYeQP5K2UhoFnnUyEWLKM6UBb0ZNRgAqp98qE5DkgfBXdWfc2kYmw9KZm4NLjRbsw== "@types/expand-tilde@^2.0.0": version "2.0.0" @@ -3650,10 +3679,10 @@ resolved "https://registry.yarnpkg.com/@types/minimist/-/minimist-1.2.2.tgz#ee771e2ba4b3dc5b372935d549fd9617bf345b8c" integrity sha512-jhuKLIRrhvCPLqwPcx6INqmKeiA5EWrsCOPhrlFSrbrmU4ZMPjj5Ul/oLCMDO98XRUIwVm78xICz4EPCektzeQ== -"@types/mocha@^10.0.0": - version "10.0.0" - resolved "https://registry.yarnpkg.com/@types/mocha/-/mocha-10.0.0.tgz#3d9018c575f0e3f7386c1de80ee66cc21fbb7a52" - integrity sha512-rADY+HtTOA52l9VZWtgQfn4p+UDVM2eDVkMZT1I6syp0YKxW2F9v+0pbRZLsvskhQv/vMb6ZfCay81GHbz5SHg== +"@types/mocha@^10.0.1": + version "10.0.1" + resolved "https://registry.yarnpkg.com/@types/mocha/-/mocha-10.0.1.tgz#2f4f65bb08bc368ac39c96da7b2f09140b26851b" + integrity sha512-/fvYntiO1GeICvqbQ3doGDIP97vWmvFt83GKguJ6prmQM2iXZfFcq6YE8KteFyRtX2/h5Hf91BYvPodJKFYv5Q== "@types/mockery@^1.4.29": version "1.4.29" @@ -3706,10 +3735,10 @@ resolved "https://registry.yarnpkg.com/@types/node/-/node-16.11.45.tgz#155b13a33c665ef2b136f7f245fa525da419e810" integrity sha512-3rKg/L5x0rofKuuUt5zlXzOnKyIHXmIu5R8A0TuNDMF2062/AOIDBciFIjToLEJ/9F9DzkHNot+BpNsMI1OLdQ== -"@types/node@^18.11.9": - version "18.11.9" - resolved "https://registry.yarnpkg.com/@types/node/-/node-18.11.9.tgz#02d013de7058cea16d36168ef2fc653464cfbad4" - integrity sha512-CRpX21/kGdzjOpFsZSkcrXMGIBWMGNIHXXBVFSH+ggkftxg+XYP20TESbh+zFvFj3EQOl5byk0HTRn1IL6hbqg== +"@types/node@^18.15.11": + version "18.15.11" + resolved "https://registry.yarnpkg.com/@types/node/-/node-18.15.11.tgz#b3b790f09cb1696cffcec605de025b088fa4225f" + integrity sha512-E5Kwq2n4SbMzQOn6wnmBjuK9ouqlURrcZDVfbo9ftDDTFt3nk7ZKK4GMOzoYgnpQJKcxwQw+lGaBvvlMo0qN/Q== "@types/normalize-package-data@^2.4.0": version "2.4.1" @@ -3781,10 +3810,15 @@ dependencies: "@types/node" "*" -"@types/sinon-chai@^3.2.8": - version "3.2.8" - resolved "https://registry.yarnpkg.com/@types/sinon-chai/-/sinon-chai-3.2.8.tgz#5871d09ab50d671d8e6dd72e9073f8e738ac61dc" - integrity sha512-d4ImIQbT/rKMG8+AXpmcan5T2/PNeSjrYhvkwet6z0p8kzYtfgA32xzOBlbU0yqJfq+/0Ml805iFoODO0LP5/g== +"@types/semver@^7.3.12": + version "7.3.13" + resolved "https://registry.yarnpkg.com/@types/semver/-/semver-7.3.13.tgz#da4bfd73f49bd541d28920ab0e2bf0ee80f71c91" + integrity sha512-21cFJr9z3g5dW8B0CVI9g2O9beqaThGQ6ZFBqHfwhzLDKUxaqTIy3vnfah/UPkfOiF2pLq+tGz+W8RyCskuslw== + +"@types/sinon-chai@^3.2.9": + version "3.2.9" + resolved "https://registry.yarnpkg.com/@types/sinon-chai/-/sinon-chai-3.2.9.tgz#71feb938574bbadcb176c68e5ff1a6014c5e69d4" + integrity sha512-/19t63pFYU0ikrdbXKBWj9PCdnKyTd0Qkz0X91Ta081cYsq90OxYdcWwK/dwEoDa6dtXgj2HJfmzgq+QZTHdmQ== dependencies: "@types/chai" "*" "@types/sinon" "*" @@ -3916,84 +3950,88 @@ dependencies: "@types/node" "*" -"@typescript-eslint/eslint-plugin@5.26.0": - version "5.26.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.26.0.tgz#c1f98ccba9d345e38992975d3ca56ed6260643c2" - integrity sha512-oGCmo0PqnRZZndr+KwvvAUvD3kNE4AfyoGCwOZpoCncSh4MVD06JTE8XQa2u9u+NX5CsyZMBTEc2C72zx38eYA== +"@typescript-eslint/eslint-plugin@5.57.1": + version "5.57.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.57.1.tgz#d1ab162a3cd2671b8a1c9ddf6e2db73b14439735" + integrity sha512-1MeobQkQ9tztuleT3v72XmY0XuKXVXusAhryoLuU5YZ+mXoYKZP9SQ7Flulh1NX4DTjpGTc2b/eMu4u7M7dhnQ== dependencies: - "@typescript-eslint/scope-manager" "5.26.0" - "@typescript-eslint/type-utils" "5.26.0" - "@typescript-eslint/utils" "5.26.0" + "@eslint-community/regexpp" "^4.4.0" + "@typescript-eslint/scope-manager" "5.57.1" + "@typescript-eslint/type-utils" "5.57.1" + "@typescript-eslint/utils" "5.57.1" debug "^4.3.4" - functional-red-black-tree "^1.0.1" + grapheme-splitter "^1.0.4" ignore "^5.2.0" - regexpp "^3.2.0" + natural-compare-lite "^1.4.0" semver "^7.3.7" tsutils "^3.21.0" -"@typescript-eslint/parser@5.26.0": - version "5.26.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.26.0.tgz#a61b14205fe2ab7533deb4d35e604add9a4ceee2" - integrity sha512-n/IzU87ttzIdnAH5vQ4BBDnLPly7rC5VnjN3m0xBG82HK6rhRxnCb3w/GyWbNDghPd+NktJqB/wl6+YkzZ5T5Q== +"@typescript-eslint/parser@5.57.1": + version "5.57.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.57.1.tgz#af911234bd4401d09668c5faf708a0570a17a748" + integrity sha512-hlA0BLeVSA/wBPKdPGxoVr9Pp6GutGoY380FEhbVi0Ph4WNe8kLvqIRx76RSQt1lynZKfrXKs0/XeEk4zZycuA== dependencies: - "@typescript-eslint/scope-manager" "5.26.0" - "@typescript-eslint/types" "5.26.0" - "@typescript-eslint/typescript-estree" "5.26.0" + "@typescript-eslint/scope-manager" "5.57.1" + "@typescript-eslint/types" "5.57.1" + "@typescript-eslint/typescript-estree" "5.57.1" debug "^4.3.4" -"@typescript-eslint/scope-manager@5.26.0": - version "5.26.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.26.0.tgz#44209c7f649d1a120f0717e0e82da856e9871339" - integrity sha512-gVzTJUESuTwiju/7NiTb4c5oqod8xt5GhMbExKsCTp6adU3mya6AGJ4Pl9xC7x2DX9UYFsjImC0mA62BCY22Iw== +"@typescript-eslint/scope-manager@5.57.1": + version "5.57.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.57.1.tgz#5d28799c0fc8b501a29ba1749d827800ef22d710" + integrity sha512-N/RrBwEUKMIYxSKl0oDK5sFVHd6VI7p9K5MyUlVYAY6dyNb/wHUqndkTd3XhpGlXgnQsBkRZuu4f9kAHghvgPw== dependencies: - "@typescript-eslint/types" "5.26.0" - "@typescript-eslint/visitor-keys" "5.26.0" + "@typescript-eslint/types" "5.57.1" + "@typescript-eslint/visitor-keys" "5.57.1" -"@typescript-eslint/type-utils@5.26.0": - version "5.26.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-5.26.0.tgz#937dee97702361744a3815c58991acf078230013" - integrity sha512-7ccbUVWGLmcRDSA1+ADkDBl5fP87EJt0fnijsMFTVHXKGduYMgienC/i3QwoVhDADUAPoytgjbZbCOMj4TY55A== +"@typescript-eslint/type-utils@5.57.1": + version "5.57.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-5.57.1.tgz#235daba621d3f882b8488040597b33777c74bbe9" + integrity sha512-/RIPQyx60Pt6ga86hKXesXkJ2WOS4UemFrmmq/7eOyiYjYv/MUSHPlkhU6k9T9W1ytnTJueqASW+wOmW4KrViw== dependencies: - "@typescript-eslint/utils" "5.26.0" + "@typescript-eslint/typescript-estree" "5.57.1" + "@typescript-eslint/utils" "5.57.1" debug "^4.3.4" tsutils "^3.21.0" -"@typescript-eslint/types@5.26.0": - version "5.26.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.26.0.tgz#cb204bb154d3c103d9cc4d225f311b08219469f3" - integrity sha512-8794JZFE1RN4XaExLWLI2oSXsVImNkl79PzTOOWt9h0UHROwJedNOD2IJyfL0NbddFllcktGIO2aOu10avQQyA== +"@typescript-eslint/types@5.57.1": + version "5.57.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.57.1.tgz#d9989c7a9025897ea6f0550b7036027f69e8a603" + integrity sha512-bSs4LOgyV3bJ08F5RDqO2KXqg3WAdwHCu06zOqcQ6vqbTJizyBhuh1o1ImC69X4bV2g1OJxbH71PJqiO7Y1RuA== -"@typescript-eslint/typescript-estree@5.26.0": - version "5.26.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.26.0.tgz#16cbceedb0011c2ed4f607255f3ee1e6e43b88c3" - integrity sha512-EyGpw6eQDsfD6jIqmXP3rU5oHScZ51tL/cZgFbFBvWuCwrIptl+oueUZzSmLtxFuSOQ9vDcJIs+279gnJkfd1w== +"@typescript-eslint/typescript-estree@5.57.1": + version "5.57.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.57.1.tgz#10d9643e503afc1ca4f5553d9bbe672ea4050b71" + integrity sha512-A2MZqD8gNT0qHKbk2wRspg7cHbCDCk2tcqt6ScCFLr5Ru8cn+TCfM786DjPhqwseiS+PrYwcXht5ztpEQ6TFTw== dependencies: - "@typescript-eslint/types" "5.26.0" - "@typescript-eslint/visitor-keys" "5.26.0" + "@typescript-eslint/types" "5.57.1" + "@typescript-eslint/visitor-keys" "5.57.1" debug "^4.3.4" globby "^11.1.0" is-glob "^4.0.3" semver "^7.3.7" tsutils "^3.21.0" -"@typescript-eslint/utils@5.26.0": - version "5.26.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.26.0.tgz#896b8480eb124096e99c8b240460bb4298afcfb4" - integrity sha512-PJFwcTq2Pt4AMOKfe3zQOdez6InIDOjUJJD3v3LyEtxHGVVRK3Vo7Dd923t/4M9hSH2q2CLvcTdxlLPjcIk3eg== +"@typescript-eslint/utils@5.57.1": + version "5.57.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.57.1.tgz#0f97b0bbd88c2d5e2036869f26466be5f4c69475" + integrity sha512-kN6vzzf9NkEtawECqze6v99LtmDiUJCVpvieTFA1uL7/jDghiJGubGZ5csicYHU1Xoqb3oH/R5cN5df6W41Nfg== dependencies: + "@eslint-community/eslint-utils" "^4.2.0" "@types/json-schema" "^7.0.9" - "@typescript-eslint/scope-manager" "5.26.0" - "@typescript-eslint/types" "5.26.0" - "@typescript-eslint/typescript-estree" "5.26.0" + "@types/semver" "^7.3.12" + "@typescript-eslint/scope-manager" "5.57.1" + "@typescript-eslint/types" "5.57.1" + "@typescript-eslint/typescript-estree" "5.57.1" eslint-scope "^5.1.1" - eslint-utils "^3.0.0" + semver "^7.3.7" -"@typescript-eslint/visitor-keys@5.26.0": - version "5.26.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.26.0.tgz#7195f756e367f789c0e83035297c45b417b57f57" - integrity sha512-wei+ffqHanYDOQgg/fS6Hcar6wAWv0CUPQ3TZzOWd2BLfgP539rb49bwua8WRAs7R6kOSLn82rfEu2ro6Llt8Q== +"@typescript-eslint/visitor-keys@5.57.1": + version "5.57.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.57.1.tgz#585e5fa42a9bbcd9065f334fd7c8a4ddfa7d905e" + integrity sha512-RjQrAniDU0CEk5r7iphkm731zKlFiUjvcBS2yHAg8WWqFMCaCrD0rKEVOMUyMMcbGPZ0bPp56srkGWrgfZqLRA== dependencies: - "@typescript-eslint/types" "5.26.0" + "@typescript-eslint/types" "5.57.1" eslint-visitor-keys "^3.3.0" "@ungap/promise-all-settled@1.1.2": @@ -4160,7 +4198,7 @@ JSONStream@^1.0.4: jsonparse "^1.2.0" through ">=2.2.7 <3" -abbrev@1: +abbrev@1, abbrev@^1.0.0: version "1.1.1" resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.1.1.tgz#f8f2c887ad10bf67f634f005b6987fed3179aac8" integrity sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q== @@ -4248,6 +4286,11 @@ acorn@^8.5.0: resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.8.0.tgz#88c0187620435c7f6015803f5539dae05a9dbea8" integrity sha512-QOxyigPVrpZ2GXT+PFyZTl6TtOFc5egxHIP9IlQ+RbupQuX4RkT/Bee4/kQuC02Xkzg84JcT7oLYtDIQxp+v7w== +acorn@^8.8.0: + version "8.8.2" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.8.2.tgz#1b2f25db02af965399b9776b0c2c391276d37c4a" + integrity sha512-xjIYgE8HBrkpd/sJqOGNspf8uHG+NOHGOw6a/Urj8taM2EXfdNAH2oFcPeIFfsv3+kz/mJrS5VuMqbNLjCa2vw== + add-stream@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/add-stream/-/add-stream-1.0.0.tgz#6a7990437ca736d5e1288db92bd3266d5f5cb2aa" @@ -4369,6 +4412,11 @@ ansi-regex@^5.0.1: resolved "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz" integrity sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ== +ansi-regex@^6.0.1: + version "6.0.1" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-6.0.1.tgz#3183e38fae9a65d7cb5e53945cd5897d0260a06a" + integrity sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA== + ansi-styles@^3.2.1: version "3.2.1" resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" @@ -4493,6 +4541,14 @@ argv@0.0.2: resolved "https://registry.npmjs.org/argv/-/argv-0.0.2.tgz" integrity sha1-7L0W+JSbFXGDcRsb2jNPN4QBhas= +array-buffer-byte-length@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/array-buffer-byte-length/-/array-buffer-byte-length-1.0.0.tgz#fabe8bc193fea865f317fe7807085ee0dee5aead" + integrity sha512-LPuwb2P+NrQw3XhxGc36+XSvuBPopovXYTR9Ew++Du9Yb/bx5AzBfrIsBoj0EZUifjQU+sHL21sseZ3jerWO/A== + dependencies: + call-bind "^1.0.2" + is-array-buffer "^3.0.1" + array-differ@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/array-differ/-/array-differ-3.0.0.tgz#3cbb3d0f316810eafcc47624734237d6aee4ae6b" @@ -4513,15 +4569,15 @@ array-ify@^1.0.0: resolved "https://registry.yarnpkg.com/array-ify/-/array-ify-1.0.0.tgz#9e528762b4a9066ad163a6962a364418e9626ece" integrity sha512-c5AMf34bKdvPhQ7tBGhqkgKNUzMr4WUs+WDtC2ZUGOUncbxKMTvqxYctiseW3+L4bA8ec+GcZ6/A/FW4m8ukng== -array-includes@^3.1.4: - version "3.1.5" - resolved "https://registry.yarnpkg.com/array-includes/-/array-includes-3.1.5.tgz#2c320010db8d31031fd2a5f6b3bbd4b1aad31bdb" - integrity sha512-iSDYZMMyTPkiFasVqfuAQnWAYcvO/SeBSCGKePoEthjp4LEMTe4uLc7b025o4jAZpHhihh8xPo99TNWUWWkGDQ== +array-includes@^3.1.6: + version "3.1.6" + resolved "https://registry.yarnpkg.com/array-includes/-/array-includes-3.1.6.tgz#9e9e720e194f198266ba9e18c29e6a9b0e4b225f" + integrity sha512-sgTbLvL6cNnw24FnbaDyjmvddQ2ML8arZsgaJhoABMoplz/4QRhtrYS+alr1BUM1Bwp6dhx8vVCBSLG+StwOFw== dependencies: call-bind "^1.0.2" define-properties "^1.1.4" - es-abstract "^1.19.5" - get-intrinsic "^1.1.1" + es-abstract "^1.20.4" + get-intrinsic "^1.1.3" is-string "^1.0.7" array-union@^2.1.0: @@ -4529,14 +4585,24 @@ array-union@^2.1.0: resolved "https://registry.yarnpkg.com/array-union/-/array-union-2.1.0.tgz#b798420adbeb1de828d84acd8a2e23d3efe85e8d" integrity sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw== -array.prototype.flat@^1.2.5: - version "1.3.0" - resolved "https://registry.yarnpkg.com/array.prototype.flat/-/array.prototype.flat-1.3.0.tgz#0b0c1567bf57b38b56b4c97b8aa72ab45e4adc7b" - integrity sha512-12IUEkHsAhA4DY5s0FPgNXIdc8VRSqD9Zp78a5au9abH/SOBrsp082JOWFNTjkMozh8mqcdiKuaLGhPeYztxSw== +array.prototype.flat@^1.3.1: + version "1.3.1" + resolved "https://registry.yarnpkg.com/array.prototype.flat/-/array.prototype.flat-1.3.1.tgz#ffc6576a7ca3efc2f46a143b9d1dda9b4b3cf5e2" + integrity sha512-roTU0KWIOmJ4DRLmwKd19Otg0/mT3qPNt0Qb3GWW8iObuZXxrjB/pzn0R3hqpRSWg4HCwqx+0vwOnWnvlOyeIA== dependencies: call-bind "^1.0.2" - define-properties "^1.1.3" - es-abstract "^1.19.2" + define-properties "^1.1.4" + es-abstract "^1.20.4" + es-shim-unscopables "^1.0.0" + +array.prototype.flatmap@^1.3.1: + version "1.3.1" + resolved "https://registry.yarnpkg.com/array.prototype.flatmap/-/array.prototype.flatmap-1.3.1.tgz#1aae7903c2100433cb8261cd4ed310aab5c4a183" + integrity sha512-8UGn9O1FDVvMNB0UlLv4voxRMze7+FpHyF5mSMRjWHUMlpoDViniy05870VlxhfgTnLbpuwTzvD76MTtWxB/mQ== + dependencies: + call-bind "^1.0.2" + define-properties "^1.1.4" + es-abstract "^1.20.4" es-shim-unscopables "^1.0.0" arrify@^1.0.1: @@ -4638,6 +4704,11 @@ available-typed-arrays@^1.0.2: dependencies: array-filter "^1.0.0" +available-typed-arrays@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/available-typed-arrays/-/available-typed-arrays-1.0.5.tgz#92f95616501069d07d10edb2fc37d3e1c65123b7" + integrity sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw== + avvio@^7.1.2: version "7.2.2" resolved "https://registry.npmjs.org/avvio/-/avvio-7.2.2.tgz" @@ -5379,6 +5450,19 @@ chai@^4.3.6: pathval "^1.1.1" type-detect "^4.0.5" +chai@^4.3.7: + version "4.3.7" + resolved "https://registry.yarnpkg.com/chai/-/chai-4.3.7.tgz#ec63f6df01829088e8bf55fca839bcd464a8ec51" + integrity sha512-HLnAzZ2iupm25PlN0xFreAlBA5zaBSv3og0DdeGA4Ar6h6rJ3A0rolRUKJhSF2V10GZKDgWF/VmAEsNWjCRB+A== + dependencies: + assertion-error "^1.1.0" + check-error "^1.0.2" + deep-eql "^4.1.2" + get-func-name "^2.0.0" + loupe "^2.3.1" + pathval "^1.1.1" + type-detect "^4.0.5" + chalk@4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.0.tgz#4e14870a618d9e2edd97dd8345fd9d9dc315646a" @@ -5537,6 +5621,15 @@ cliui@^7.0.2: strip-ansi "^6.0.0" wrap-ansi "^7.0.0" +cliui@^8.0.1: + version "8.0.1" + resolved "https://registry.yarnpkg.com/cliui/-/cliui-8.0.1.tgz#0c04b075db02cbfe60dc8e6cf2f5486b1a3608aa" + integrity sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ== + dependencies: + string-width "^4.2.0" + strip-ansi "^6.0.1" + wrap-ansi "^7.0.0" + clone-deep@^4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/clone-deep/-/clone-deep-4.0.1.tgz#c19fd9bdbbf85942b4fd979c84dcf7d5f07c2387" @@ -5914,7 +6007,7 @@ cookie@~0.4.1: resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.4.2.tgz#0e41f24de5ecf317947c82fc789e06a884824432" integrity sha512-aSWTXFzaKWkvHO1Ny/s+ePFpvKsPnjc551iI41v3ny/ow6tBG5Vd+FuqGNhh1LxOmVzOlGUriIlOaokOvhaStA== -cookiejar@^2.1.3: +cookiejar@^2.1.4: version "2.1.4" resolved "https://registry.yarnpkg.com/cookiejar/-/cookiejar-2.1.4.tgz#ee669c1fea2cf42dc31585469d193fef0d65771b" integrity sha512-LDx6oHrK+PhzLKJU9j5S7/Y3jM/mUHvD/DeI1WQmJn652iPC5Y4TBzC9l+5OMOXlyTTA+SmVUPm0HQUwpD5Jqw== @@ -6131,7 +6224,7 @@ dateformat@^3.0.0: resolved "https://registry.yarnpkg.com/dateformat/-/dateformat-3.0.3.tgz#a6e37499a4d9a9cf85ef5872044d62901c9889ae" integrity sha512-jyCETtSl3VMZMWeRo7iY1FL19ges1t55hMo5yaam4Jrsm5EPL89UQkoQRyiI+Yf4k8r2ZpdngkV8hr1lIdjb3Q== -debug@2.6.9, debug@^2.2.0, debug@^2.6.9: +debug@2.6.9, debug@^2.2.0: version "2.6.9" resolved "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz" integrity sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA== @@ -6213,6 +6306,13 @@ deep-eql@^3.0.1: dependencies: type-detect "^4.0.0" +deep-eql@^4.1.2: + version "4.1.3" + resolved "https://registry.yarnpkg.com/deep-eql/-/deep-eql-4.1.3.tgz#7c7775513092f7df98d8df9996dd085eb668cc6d" + integrity sha512-WaEtAOpRA1MQ0eohqZjpGD8zdI0Ovsm8mmFhaDN8dvDZzyoUMcYDnf5Y6iu7HTXxf8JDS23qWa4a+hKCDyOPzw== + dependencies: + type-detect "^4.0.0" + deep-extend@^0.6.0: version "0.6.0" resolved "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz" @@ -6340,15 +6440,7 @@ detect-node@^2.0.4: resolved "https://registry.yarnpkg.com/detect-node/-/detect-node-2.1.0.tgz#c9c70775a49c3d03bc2c06d9a73be550f978f8b1" integrity sha512-T0NIuQpnTvFDATNuHN5roPwSBG83rFsuO+MXXH9/3N1eFbn4wcPjttvjMLEPWJ0RGUYgQE7cGgS3tNxbqCGM7g== -dezalgo@1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/dezalgo/-/dezalgo-1.0.3.tgz#7f742de066fc748bc8db820569dddce49bf0d456" - integrity sha512-K7i4zNfT2kgQz3GylDw40ot9GAE47sFZ9EXHFSPP6zONLgH6kWXE0KWJchkbQJLBkRazq4APwZ4OwiFFlT95OQ== - dependencies: - asap "^2.0.0" - wrappy "1" - -dezalgo@^1.0.0: +dezalgo@^1.0.0, dezalgo@^1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/dezalgo/-/dezalgo-1.0.4.tgz#751235260469084c132157dfa857f386d4c33d81" integrity sha512-rXSP0bf+5n0Qonsb+SVVfNfIsimO4HEtmnIpPHY8Q1UCzKlQrDMfdobr8nJOOsRgWCyMRqeSBQzmWUMq7zvVig== @@ -6376,7 +6468,7 @@ diff@^4.0.1: resolved "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz" integrity sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A== -diff@^5.0.0: +diff@^5.1.0: version "5.1.0" resolved "https://registry.yarnpkg.com/diff/-/diff-5.1.0.tgz#bc52d298c5ea8df9194800224445ed43ffc87e40" integrity sha512-D+mk+qE8VC/PAUrlAU34N+VfXev0ghe5ywmpqrawphmVZc1bEfn56uo9qpyGp1p4xpzOHkSW4ztBd6L7Xx4ACw== @@ -6692,7 +6784,7 @@ es-abstract@^1.18.0-next.2: string.prototype.trimstart "^1.0.5" unbox-primitive "^1.0.2" -es-abstract@^1.19.0, es-abstract@^1.19.1, es-abstract@^1.19.2, es-abstract@^1.19.5: +es-abstract@^1.19.0, es-abstract@^1.19.5: version "1.20.1" resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.20.1.tgz#027292cd6ef44bd12b1913b828116f54787d1814" integrity sha512-WEm2oBhfoI2sImeM4OF2zE2V3BYdSF+KnSi9Sidz51fQHd7+JuF8Xgcj9/0o+OWeIeIS/MiuNnlruQrJf16GQA== @@ -6721,11 +6813,60 @@ es-abstract@^1.19.0, es-abstract@^1.19.1, es-abstract@^1.19.2, es-abstract@^1.19 string.prototype.trimstart "^1.0.5" unbox-primitive "^1.0.2" +es-abstract@^1.20.4: + version "1.21.2" + resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.21.2.tgz#a56b9695322c8a185dc25975aa3b8ec31d0e7eff" + integrity sha512-y/B5POM2iBnIxCiernH1G7rC9qQoM77lLIMQLuob0zhp8C56Po81+2Nj0WFKnd0pNReDTnkYryc+zhOzpEIROg== + dependencies: + array-buffer-byte-length "^1.0.0" + available-typed-arrays "^1.0.5" + call-bind "^1.0.2" + es-set-tostringtag "^2.0.1" + es-to-primitive "^1.2.1" + function.prototype.name "^1.1.5" + get-intrinsic "^1.2.0" + get-symbol-description "^1.0.0" + globalthis "^1.0.3" + gopd "^1.0.1" + has "^1.0.3" + has-property-descriptors "^1.0.0" + has-proto "^1.0.1" + has-symbols "^1.0.3" + internal-slot "^1.0.5" + is-array-buffer "^3.0.2" + is-callable "^1.2.7" + is-negative-zero "^2.0.2" + is-regex "^1.1.4" + is-shared-array-buffer "^1.0.2" + is-string "^1.0.7" + is-typed-array "^1.1.10" + is-weakref "^1.0.2" + object-inspect "^1.12.3" + object-keys "^1.1.1" + object.assign "^4.1.4" + regexp.prototype.flags "^1.4.3" + safe-regex-test "^1.0.0" + string.prototype.trim "^1.2.7" + string.prototype.trimend "^1.0.6" + string.prototype.trimstart "^1.0.6" + typed-array-length "^1.0.4" + unbox-primitive "^1.0.2" + which-typed-array "^1.1.9" + es-module-lexer@^0.9.0: version "0.9.3" resolved "https://registry.yarnpkg.com/es-module-lexer/-/es-module-lexer-0.9.3.tgz#6f13db00cc38417137daf74366f535c8eb438f19" integrity sha512-1HQ2M2sPtxwnvOvT1ZClHyQDiggdNjURWpY2we6aMKCQiUVxTmVs2UYPLIrD84sS+kMdUwfBSylbJPwNnBrnHQ== +es-set-tostringtag@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/es-set-tostringtag/-/es-set-tostringtag-2.0.1.tgz#338d502f6f674301d710b80c8592de8a15f09cd8" + integrity sha512-g3OMbtlwY3QewlqAiMLI47KywjWZoEytKr8pf6iTC8uJq5bIAH52Z9pnQ8pVL6whrCto53JZDuUIsifGeLorTg== + dependencies: + get-intrinsic "^1.1.3" + has "^1.0.3" + has-tostringtag "^1.0.0" + es-shim-unscopables@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/es-shim-unscopables/-/es-shim-unscopables-1.0.0.tgz#702e632193201e3edf8713635d083d378e510241" @@ -6803,21 +6944,21 @@ escape-string-regexp@^1.0.5: resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" integrity sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg== -eslint-import-resolver-node@^0.3.6: - version "0.3.6" - resolved "https://registry.yarnpkg.com/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.6.tgz#4048b958395da89668252001dbd9eca6b83bacbd" - integrity sha512-0En0w03NRVMn9Uiyn8YRPDKvWjxCWkslUEhGNTdGx15RvPJYQ+lbOlqrlNI2vEAs4pDYK4f/HN2TbDmk5TP0iw== +eslint-import-resolver-node@^0.3.7: + version "0.3.7" + resolved "https://registry.yarnpkg.com/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.7.tgz#83b375187d412324a1963d84fa664377a23eb4d7" + integrity sha512-gozW2blMLJCeFpBwugLTGyvVjNoeo1knonXAcatC6bjPBZitotxdWf7Gimr25N4c0AAOo4eOUfaG82IJPDpqCA== dependencies: debug "^3.2.7" - resolve "^1.20.0" + is-core-module "^2.11.0" + resolve "^1.22.1" -eslint-module-utils@^2.7.3: - version "2.7.3" - resolved "https://registry.yarnpkg.com/eslint-module-utils/-/eslint-module-utils-2.7.3.tgz#ad7e3a10552fdd0642e1e55292781bd6e34876ee" - integrity sha512-088JEC7O3lDZM9xGe0RerkOMd0EjFl+Yvd1jPWIkMT5u3H9+HC34mWWPnqPrN13gieT9pBOO+Qt07Nb/6TresQ== +eslint-module-utils@^2.7.4: + version "2.7.4" + resolved "https://registry.yarnpkg.com/eslint-module-utils/-/eslint-module-utils-2.7.4.tgz#4f3e41116aaf13a20792261e61d3a2e7e0583974" + integrity sha512-j4GT+rqzCoRKHwURX7pddtIPGySnX9Si/cgMI5ztrcqOPtk5dDEeZ34CQVPphnqkJytlc97Vuk05Um2mJ3gEQA== dependencies: debug "^3.2.7" - find-up "^2.1.0" eslint-plugin-chai-expect@^3.0.0: version "3.0.0" @@ -6832,23 +6973,25 @@ eslint-plugin-es@^4.1.0: eslint-utils "^2.0.0" regexpp "^3.0.0" -eslint-plugin-import@^2.26.0: - version "2.26.0" - resolved "https://registry.yarnpkg.com/eslint-plugin-import/-/eslint-plugin-import-2.26.0.tgz#f812dc47be4f2b72b478a021605a59fc6fe8b88b" - integrity sha512-hYfi3FXaM8WPLf4S1cikh/r4IxnO6zrhZbEGz2b660EJRbuxgpDS5gkCuYgGWg2xxh2rBuIr4Pvhve/7c31koA== +eslint-plugin-import@^2.27.5: + version "2.27.5" + resolved "https://registry.yarnpkg.com/eslint-plugin-import/-/eslint-plugin-import-2.27.5.tgz#876a6d03f52608a3e5bb439c2550588e51dd6c65" + integrity sha512-LmEt3GVofgiGuiE+ORpnvP+kAm3h6MLZJ4Q5HCyHADofsb4VzXFsRiWj3c0OFiV+3DWFh0qg3v9gcPlfc3zRow== dependencies: - array-includes "^3.1.4" - array.prototype.flat "^1.2.5" - debug "^2.6.9" + array-includes "^3.1.6" + array.prototype.flat "^1.3.1" + array.prototype.flatmap "^1.3.1" + debug "^3.2.7" doctrine "^2.1.0" - eslint-import-resolver-node "^0.3.6" - eslint-module-utils "^2.7.3" + eslint-import-resolver-node "^0.3.7" + eslint-module-utils "^2.7.4" has "^1.0.3" - is-core-module "^2.8.1" + is-core-module "^2.11.0" is-glob "^4.0.3" minimatch "^3.1.2" - object.values "^1.1.5" - resolve "^1.22.0" + object.values "^1.1.6" + resolve "^1.22.1" + semver "^6.3.0" tsconfig-paths "^3.14.1" eslint-plugin-mocha@^10.1.0: @@ -6859,10 +7002,10 @@ eslint-plugin-mocha@^10.1.0: eslint-utils "^3.0.0" rambda "^7.1.0" -eslint-plugin-prettier@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-4.0.0.tgz#8b99d1e4b8b24a762472b4567992023619cb98e0" - integrity sha512-98MqmCJ7vJodoQK359bqQWaxOE0CS8paAz/GgjaZLyex4TTk3g9HugoO89EqWCrFiOqn9EVvcoo7gZzONCWVwQ== +eslint-plugin-prettier@^4.2.1: + version "4.2.1" + resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-4.2.1.tgz#651cbb88b1dab98bfd42f017a12fa6b2d993f94b" + integrity sha512-f/0rXLXUt0oFYs8ra4w49wYZBG5GKZpAYsJSm6rnYL5uVDjd+zowwMwVZHnAjf4edNrKpCDYfXDgmRE/Ak7QyQ== dependencies: prettier-linter-helpers "^1.0.0" @@ -6911,13 +7054,23 @@ eslint-visitor-keys@^3.3.0: resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-3.3.0.tgz#f6480fa6b1f30efe2d1968aa8ac745b862469826" integrity sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA== -eslint@^8.16.0: - version "8.16.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.16.0.tgz#6d936e2d524599f2a86c708483b4c372c5d3bbae" - integrity sha512-MBndsoXY/PeVTDJeWsYj7kLZ5hQpJOfMYLsF6LicLHQWbRDG19lK5jOix4DPl8yY4SUFcE3txy86OzFLWT+yoA== - dependencies: - "@eslint/eslintrc" "^1.3.0" - "@humanwhocodes/config-array" "^0.9.2" +eslint-visitor-keys@^3.4.0: + version "3.4.0" + resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-3.4.0.tgz#c7f0f956124ce677047ddbc192a68f999454dedc" + integrity sha512-HPpKPUBQcAsZOsHAFwTtIKcYlCje62XB7SEAcxjtmW6TD1WVpkS6i6/hOVtTZIl4zGj/mBqpFVGvaDneik+VoQ== + +eslint@^8.37.0: + version "8.37.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.37.0.tgz#1f660ef2ce49a0bfdec0b0d698e0b8b627287412" + integrity sha512-NU3Ps9nI05GUoVMxcZx1J8CNR6xOvUT4jAUMH5+z8lpp3aEdPVCImKw6PWG4PY+Vfkpr+jvMpxs/qoE7wq0sPw== + dependencies: + "@eslint-community/eslint-utils" "^4.2.0" + "@eslint-community/regexpp" "^4.4.0" + "@eslint/eslintrc" "^2.0.2" + "@eslint/js" "8.37.0" + "@humanwhocodes/config-array" "^0.11.8" + "@humanwhocodes/module-importer" "^1.0.1" + "@nodelib/fs.walk" "^1.2.8" ajv "^6.10.0" chalk "^4.0.0" cross-spawn "^7.0.2" @@ -6925,20 +7078,22 @@ eslint@^8.16.0: doctrine "^3.0.0" escape-string-regexp "^4.0.0" eslint-scope "^7.1.1" - eslint-utils "^3.0.0" - eslint-visitor-keys "^3.3.0" - espree "^9.3.2" - esquery "^1.4.0" + eslint-visitor-keys "^3.4.0" + espree "^9.5.1" + esquery "^1.4.2" esutils "^2.0.2" fast-deep-equal "^3.1.3" file-entry-cache "^6.0.1" - functional-red-black-tree "^1.0.1" - glob-parent "^6.0.1" - globals "^13.15.0" + find-up "^5.0.0" + glob-parent "^6.0.2" + globals "^13.19.0" + grapheme-splitter "^1.0.4" ignore "^5.2.0" import-fresh "^3.0.0" imurmurhash "^0.1.4" is-glob "^4.0.0" + is-path-inside "^3.0.3" + js-sdsl "^4.1.4" js-yaml "^4.1.0" json-stable-stringify-without-jsonify "^1.0.1" levn "^0.4.1" @@ -6946,35 +7101,33 @@ eslint@^8.16.0: minimatch "^3.1.2" natural-compare "^1.4.0" optionator "^0.9.1" - regexpp "^3.2.0" strip-ansi "^6.0.1" strip-json-comments "^3.1.0" text-table "^0.2.0" - v8-compile-cache "^2.0.3" esm@^3.2.25: version "3.2.25" resolved "https://registry.npmjs.org/esm/-/esm-3.2.25.tgz" integrity sha512-U1suiZ2oDVWv4zPO56S0NcR5QriEahGtdN2OR6FiOG4WJvcjBVFB0qI4+eKoWFH483PKGuLuu6V8Z4T5g63UVA== -espree@^9.3.2: - version "9.3.2" - resolved "https://registry.yarnpkg.com/espree/-/espree-9.3.2.tgz#f58f77bd334731182801ced3380a8cc859091596" - integrity sha512-D211tC7ZwouTIuY5x9XnS0E9sWNChB7IYKX/Xp5eQj3nFXhqmiUDB9q27y76oFl8jTg3pXcQx/bpxMfs3CIZbA== +espree@^9.5.1: + version "9.5.1" + resolved "https://registry.yarnpkg.com/espree/-/espree-9.5.1.tgz#4f26a4d5f18905bf4f2e0bd99002aab807e96dd4" + integrity sha512-5yxtHSZXRSW5pvv3hAlXM5+/Oswi1AUFqBmbibKb5s6bp3rGIDkyXU6xCoyuuLhijr4SFwPrXRoZjz0AZDN9tg== dependencies: - acorn "^8.7.1" + acorn "^8.8.0" acorn-jsx "^5.3.2" - eslint-visitor-keys "^3.3.0" + eslint-visitor-keys "^3.4.0" esprima@^4.0.0: version "4.0.1" resolved "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz" integrity sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A== -esquery@^1.4.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/esquery/-/esquery-1.4.0.tgz#2148ffc38b82e8c7057dfed48425b3e61f0f24a5" - integrity sha512-cCDispWt5vHHtwMY2YrAQ4ibFkAL8RbH5YGBnZBc90MolvvfkkQcJro/aZiAQUlQ3qgrYS6D6v8Gc5G5CQsc9w== +esquery@^1.4.2: + version "1.5.0" + resolved "https://registry.yarnpkg.com/esquery/-/esquery-1.5.0.tgz#6ce17738de8577694edd7361c57182ac8cb0db0b" + integrity sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg== dependencies: estraverse "^5.1.0" @@ -7536,7 +7689,7 @@ find-up@5.0.0, find-up@^5.0.0: locate-path "^6.0.0" path-exists "^4.0.0" -find-up@^2.0.0, find-up@^2.1.0: +find-up@^2.0.0: version "2.1.0" resolved "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz" integrity sha1-RdG35QbHF93UgndaK3eSCjwMV6c= @@ -7594,6 +7747,13 @@ follow-redirects@^1.14.0: resolved "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.7.tgz" integrity sha512-+hbxoLbFMbRKDwohX8GkTataGqO6Jb7jGwpAlwgy2bIz25XtRm7KEzJM76R1WiNT5SwZkX4Y75SwBolkpmE7iQ== +for-each@^0.3.3: + version "0.3.3" + resolved "https://registry.yarnpkg.com/for-each/-/for-each-0.3.3.tgz#69b447e88a0a5d32c3e7084f3f1710034b21376e" + integrity sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw== + dependencies: + is-callable "^1.1.3" + foreach@^2.0.5: version "2.0.5" resolved "https://registry.npmjs.org/foreach/-/foreach-2.0.5.tgz" @@ -7653,15 +7813,15 @@ form-data@~2.3.2: combined-stream "^1.0.6" mime-types "^2.1.12" -formidable@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/formidable/-/formidable-2.0.1.tgz#4310bc7965d185536f9565184dee74fbb75557ff" - integrity sha512-rjTMNbp2BpfQShhFbR3Ruk3qk2y9jKpvMW78nJgx8QKtxjDVrwbZG+wvDOmVbifHyOUOQJXxqEy6r0faRrPzTQ== +formidable@^2.1.2: + version "2.1.2" + resolved "https://registry.yarnpkg.com/formidable/-/formidable-2.1.2.tgz#fa973a2bec150e4ce7cac15589d7a25fc30ebd89" + integrity sha512-CM3GuJ57US06mlpQ47YcunuUZ9jpm8Vx+P2CGt2j7HpgkKZO/DJYQ0Bobim8G6PFQmK5lOqOOdUXboU+h73A4g== dependencies: - dezalgo "1.0.3" - hexoid "1.0.0" - once "1.4.0" - qs "6.9.3" + dezalgo "^1.0.4" + hexoid "^1.0.0" + once "^1.4.0" + qs "^6.11.0" forwarded@0.2.0: version "0.2.0" @@ -7764,11 +7924,6 @@ function.prototype.name@^1.1.5: es-abstract "^1.19.0" functions-have-names "^1.2.2" -functional-red-black-tree@^1.0.1: - version "1.0.1" - resolved "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz" - integrity sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc= - functions-have-names@^1.2.2: version "1.2.3" resolved "https://registry.yarnpkg.com/functions-have-names/-/functions-have-names-1.2.3.tgz#0404fe4ee2ba2f607f0e0ec3c80bae994133b834" @@ -7858,6 +8013,15 @@ get-intrinsic@^1.1.0: has "^1.0.3" has-symbols "^1.0.1" +get-intrinsic@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/get-intrinsic/-/get-intrinsic-1.2.0.tgz#7ad1dc0535f3a2904bba075772763e5051f6d05f" + integrity sha512-L049y6nFOuom5wGyRc3/gdTLO94dySVKRACj1RmJZBQXlbTMhtNIgkWkUHq+jYmZvKf14EW1EoJnnjbmoHij0Q== + dependencies: + function-bind "^1.1.1" + has "^1.0.3" + has-symbols "^1.0.3" + get-iterator@^1.0.2: version "1.0.2" resolved "https://registry.npmjs.org/get-iterator/-/get-iterator-1.0.2.tgz" @@ -7983,7 +8147,7 @@ glob-parent@^5.1.1, glob-parent@^5.1.2, glob-parent@~5.1.2: dependencies: is-glob "^4.0.1" -glob-parent@^6.0.1: +glob-parent@^6.0.2: version "6.0.2" resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-6.0.2.tgz#6d237d99083950c79290f24c7642a3de9a28f9e3" integrity sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A== @@ -8077,14 +8241,14 @@ globals@^11.1.0: resolved "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz" integrity sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA== -globals@^13.15.0: - version "13.15.0" - resolved "https://registry.yarnpkg.com/globals/-/globals-13.15.0.tgz#38113218c907d2f7e98658af246cef8b77e90bac" - integrity sha512-bpzcOlgDhMG070Av0Vy5Owklpv1I6+j96GhUI7Rh7IzDCKLzboflLrrfqMu8NquDbiR4EOQk7XzJwqVJxicxog== +globals@^13.19.0: + version "13.20.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-13.20.0.tgz#ea276a1e508ffd4f1612888f9d1bad1e2717bf82" + integrity sha512-Qg5QtVkCy/kv3FUSlu4ukeZDVf9ee0iXLAUYX13gbR17bnejFTzr4iS9bY7kwCf1NztRNm1t91fjOiyx4CSwPQ== dependencies: type-fest "^0.20.2" -globalthis@^1.0.1: +globalthis@^1.0.1, globalthis@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/globalthis/-/globalthis-1.0.3.tgz#5852882a52b80dc301b0660273e1ed082f0b6ccf" integrity sha512-sFdI5LyBiNTHjRd7cGPWapiHWMOXKyuBNX/cWJ3NfzrZQVa8GI/8cofCl74AOVqq9W5kNmguTIzJ/1s2gyI9wA== @@ -8103,6 +8267,13 @@ globby@^11.0.2, globby@^11.1.0: merge2 "^1.4.1" slash "^3.0.0" +gopd@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/gopd/-/gopd-1.0.1.tgz#29ff76de69dac7489b7c0918a5788e56477c332c" + integrity sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA== + dependencies: + get-intrinsic "^1.1.3" + got@12.1.0, got@^12.1.0: version "12.1.0" resolved "https://registry.yarnpkg.com/got/-/got-12.1.0.tgz#099f3815305c682be4fd6b0ee0726d8e4c6b0af4" @@ -8171,6 +8342,11 @@ graceful-fs@^4.2.6: resolved "https://registry.yarnpkg.com/graceful-readlink/-/graceful-readlink-1.0.1.tgz#4cafad76bc62f02fa039b2f94e9a3dd3a391a725" integrity sha512-8tLu60LgxF6XpdbK8OW3FA+IfTNBn1ZHGHKF4KQbEeSkajYw5PlYJcKluntgegDPTg8UkHjpet1T82vk6TQ68w== +grapheme-splitter@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/grapheme-splitter/-/grapheme-splitter-1.0.4.tgz#9cf3a665c6247479896834af35cf1dbb4400767e" + integrity sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ== + handlebars@^4.7.7: version "4.7.7" resolved "https://registry.yarnpkg.com/handlebars/-/handlebars-4.7.7.tgz#9ce33416aad02dbd6c8fafa8240d5d98004945a1" @@ -8223,6 +8399,11 @@ has-property-descriptors@^1.0.0: dependencies: get-intrinsic "^1.1.1" +has-proto@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/has-proto/-/has-proto-1.0.1.tgz#1885c1305538958aff469fef37937c22795408e0" + integrity sha512-7qE+iP+O+bgF9clE5+UoBFzE65mlBiVj3tKCrlNQ0Ogwm0BjpT/gK4SlLYDMybDh5I3TCTKnPPa0oMG7JDYrhg== + has-symbols@^1.0.1, has-symbols@^1.0.2, has-symbols@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.3.tgz#bb7b2c4349251dce87b125f7bdf874aa7c8b39f8" @@ -8290,7 +8471,7 @@ he@1.2.0: resolved "https://registry.npmjs.org/he/-/he-1.2.0.tgz" integrity sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw== -hexoid@1.0.0: +hexoid@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/hexoid/-/hexoid-1.0.0.tgz#ad10c6573fb907de23d9ec63a711267d9dc9bc18" integrity sha512-QFLV0taWQOZtvIRIAdBChesmogZrtuXvVWsFHZTk2SU+anspqZ2vMnoLg7IE1+Uk16N19APic1BuF8bC8c2m5g== @@ -8616,18 +8797,18 @@ inquirer@^8.2.4: wrap-ansi "^7.0.0" interface-datastore@^7.0.0: - version "7.0.0" - resolved "https://registry.yarnpkg.com/interface-datastore/-/interface-datastore-7.0.0.tgz#d89ff1faf0ae775e2b64fb0ef0c801470ef5b959" - integrity sha512-q9OveOhexQ3Fx8h4YbuR4mZtUHwvlOynKnIwTm6x8oBTWfIyAKtlYtrOYdlHfqQztbYpdzRFcapopNJBMx36NQ== + version "7.0.4" + resolved "https://registry.yarnpkg.com/interface-datastore/-/interface-datastore-7.0.4.tgz#f09ae4e2896f57f876d5d742a59e982fb3f42891" + integrity sha512-Q8LZS/jfFFHz6XyZazLTAc078SSCoa27ZPBOfobWdpDiFO7FqPA2yskitUJIhaCgxNK8C+/lMBUTBNfVIDvLiw== dependencies: interface-store "^3.0.0" - nanoid "^3.0.2" - uint8arrays "^3.0.0" + nanoid "^4.0.0" + uint8arrays "^4.0.2" interface-store@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/interface-store/-/interface-store-3.0.0.tgz#63649bb679397060331fd16ecf305541768783a4" - integrity sha512-IBJn3hE6hYutwdDcStR76mcwfV98vZc49LkEN9ANHHpsxcm6YbGMJxowO2G3FITU4U5ZH4KJPlHOT6Oe2vzTWA== + version "3.0.4" + resolved "https://registry.yarnpkg.com/interface-store/-/interface-store-3.0.4.tgz#670d95ef45f3b7061d154c3cbfaf39a538167ad7" + integrity sha512-OjHUuGXbH4eXSBx1TF1tTySvjLldPLzRSYYXJwrEQI+XfH5JWYZofr0gVMV4F8XTwC+4V7jomDYkvGRmDSRKqQ== internal-slot@^1.0.3: version "1.0.3" @@ -8638,6 +8819,15 @@ internal-slot@^1.0.3: has "^1.0.3" side-channel "^1.0.4" +internal-slot@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/internal-slot/-/internal-slot-1.0.5.tgz#f2a2ee21f668f8627a4667f309dc0f4fb6674986" + integrity sha512-Y+R5hJrzs52QCG2laLn4udYVnxsfny9CpOhNhUvk/SSSVyF6T27FzRbF0sroPidSu3X8oEAkOn2K804mjpt6UQ== + dependencies: + get-intrinsic "^1.2.0" + has "^1.0.3" + side-channel "^1.0.4" + ip-regex@^2.1.0: version "2.1.0" resolved "https://registry.npmjs.org/ip-regex/-/ip-regex-2.1.0.tgz" @@ -8675,6 +8865,15 @@ is-arguments@^1.0.4: dependencies: call-bind "^1.0.0" +is-array-buffer@^3.0.1, is-array-buffer@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/is-array-buffer/-/is-array-buffer-3.0.2.tgz#f2653ced8412081638ecb0ebbd0c41c6e0aecbbe" + integrity sha512-y+FyyR/w8vfIRq4eQcM1EYgSTnmHXPqaF+IgzgraytCFq5Xh8lllDVmAZolPJiZttZLeFSINPYMaEJ7/vWUa1w== + dependencies: + call-bind "^1.0.2" + get-intrinsic "^1.2.0" + is-typed-array "^1.1.10" + is-arrayish@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d" @@ -8712,7 +8911,7 @@ is-buffer@^2.0.5: resolved "https://registry.npmjs.org/is-buffer/-/is-buffer-2.0.5.tgz" integrity sha512-i2R6zNFDwgEHJyQUtJEk0XFi1i0dPFn/oqjK3/vPCcDeJvW5NQ83V8QbicfF1SupOaB0h8ntgBC2YiE7dfyctQ== -is-callable@^1.1.4, is-callable@^1.2.3, is-callable@^1.2.6: +is-callable@^1.1.3, is-callable@^1.1.4, is-callable@^1.2.3, is-callable@^1.2.6, is-callable@^1.2.7: version "1.2.7" resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.2.7.tgz#3bc2a85ea742d9e36205dcacdd72ca1fdc51b055" integrity sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA== @@ -8729,6 +8928,13 @@ is-ci@^2.0.0: dependencies: ci-info "^2.0.0" +is-core-module@^2.11.0: + version "2.11.0" + resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.11.0.tgz#ad4cb3e3863e814523c96f3f58d26cc570ff0144" + integrity sha512-RRjxlvLDkD1YJwDbroBHMb+cukurkDWNyHx7D3oNB5x9rb5ogcksMC5wHCadcXoo67gVr/+3GFySh3134zi6rw== + dependencies: + has "^1.0.3" + is-core-module@^2.2.0, is-core-module@^2.5.0: version "2.10.0" resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.10.0.tgz#9012ede0a91c69587e647514e1d5277019e728ed" @@ -8870,6 +9076,11 @@ is-observable@^2.1.0: resolved "https://registry.npmjs.org/is-observable/-/is-observable-2.1.0.tgz" integrity sha512-DailKdLb0WU+xX8K5w7VsJhapwHLZ9jjmazqCJq4X12CTgqq73TKnbRcnSLuXYPOoLQgV5IrD7ePiX/h1vnkBw== +is-path-inside@^3.0.3: + version "3.0.3" + resolved "https://registry.yarnpkg.com/is-path-inside/-/is-path-inside-3.0.3.tgz#d231362e53a07ff2b0e0ea7fed049161ffd16283" + integrity sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ== + is-plain-obj@^1.0.0, is-plain-obj@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/is-plain-obj/-/is-plain-obj-1.1.0.tgz#71a50c8429dfca773c92a390a4a03b39fcd51d3e" @@ -8940,6 +9151,17 @@ is-text-path@^1.0.1: dependencies: text-extensions "^1.0.0" +is-typed-array@^1.1.10, is-typed-array@^1.1.9: + version "1.1.10" + resolved "https://registry.yarnpkg.com/is-typed-array/-/is-typed-array-1.1.10.tgz#36a5b5cb4189b575d1a3e4b08536bfb485801e3f" + integrity sha512-PJqgEHiWZvMpaFZ3uTc8kHPM4+4ADTlDniuQL7cU/UDA0Ql7F70yGfHph3cLNe+c9toaigv+DFzTJKhc2CtO6A== + dependencies: + available-typed-arrays "^1.0.5" + call-bind "^1.0.2" + for-each "^0.3.3" + gopd "^1.0.1" + has-tostringtag "^1.0.0" + is-typed-array@^1.1.3: version "1.1.5" resolved "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.5.tgz" @@ -9215,6 +9437,11 @@ jmespath@0.15.0: resolved "https://registry.npmjs.org/jmespath/-/jmespath-0.15.0.tgz" integrity sha1-o/Iiqarp+Wb10nx5ZRDigJF2Qhc= +js-sdsl@^4.1.4: + version "4.4.0" + resolved "https://registry.yarnpkg.com/js-sdsl/-/js-sdsl-4.4.0.tgz#8b437dbe642daa95760400b602378ed8ffea8430" + integrity sha512-FfVSdx6pJ41Oa+CF7RDaFmTnCaFhua+SNYQX74riGOpl96x+2jQCqEfQ2bnXu/5DPCqlRuiqyvTJM0Qjz26IVg== + js-sha3@0.5.7, js-sha3@^0.5.7: version "0.5.7" resolved "https://registry.npmjs.org/js-sha3/-/js-sha3-0.5.7.tgz" @@ -9432,10 +9659,10 @@ karma-mocha@^2.0.1: dependencies: minimist "^1.2.3" -karma-spec-reporter@^0.0.34: - version "0.0.34" - resolved "https://registry.yarnpkg.com/karma-spec-reporter/-/karma-spec-reporter-0.0.34.tgz#7dc79cdc76b0e37f17006921439600ae3c648669" - integrity sha512-l5H/Nh9q4g2Ysx2CDU2m+NIPyLQpCVbk9c4V02BTZHw3NM6RO1dq3eRpKXCSSdPt4RGfhHk8jDt3XYkGp+5PWg== +karma-spec-reporter@^0.0.36: + version "0.0.36" + resolved "https://registry.yarnpkg.com/karma-spec-reporter/-/karma-spec-reporter-0.0.36.tgz#c54dc155dec2ded1f92ea68dbbdd67fcedbef350" + integrity sha512-11bvOl1x6ryKZph7kmbmMpbi8vsngEGxGOoeTlIcDaH3ab3j8aPJnZ+r+K/SS0sBSGy5VGkGYO2+hLct7hw/6w== dependencies: colors "1.4.0" @@ -10202,7 +10429,7 @@ minimatch@5.0.1: dependencies: brace-expansion "^2.0.1" -minimatch@^3.0.4, minimatch@^3.1.1, minimatch@^3.1.2: +minimatch@^3.0.4, minimatch@^3.0.5, minimatch@^3.1.1, minimatch@^3.1.2: version "3.1.2" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.1.2.tgz#19cd194bfd3e428f049a70817c038d89ab4be35b" integrity sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw== @@ -10410,6 +10637,33 @@ mocha@^10.0.0: yargs-parser "20.2.4" yargs-unparser "2.0.0" +mocha@^10.2.0: + version "10.2.0" + resolved "https://registry.yarnpkg.com/mocha/-/mocha-10.2.0.tgz#1fd4a7c32ba5ac372e03a17eef435bd00e5c68b8" + integrity sha512-IDY7fl/BecMwFHzoqF2sg/SHHANeBoMMXFlS9r0OXKDssYE1M5O43wUY/9BVPeIvfH2zmEbBfseqN9gBQZzXkg== + dependencies: + ansi-colors "4.1.1" + browser-stdout "1.3.1" + chokidar "3.5.3" + debug "4.3.4" + diff "5.0.0" + escape-string-regexp "4.0.0" + find-up "5.0.0" + glob "7.2.0" + he "1.2.0" + js-yaml "4.1.0" + log-symbols "4.1.0" + minimatch "5.0.1" + ms "2.1.3" + nanoid "3.3.3" + serialize-javascript "6.0.0" + strip-json-comments "3.1.1" + supports-color "8.1.1" + workerpool "6.2.1" + yargs "16.2.0" + yargs-parser "20.2.4" + yargs-unparser "2.0.0" + mock-fs@^4.1.0: version "4.14.0" resolved "https://registry.yarnpkg.com/mock-fs/-/mock-fs-4.14.0.tgz#ce5124d2c601421255985e6e94da80a7357b1b18" @@ -10509,11 +10763,6 @@ multiformats@^11.0.0: resolved "https://registry.yarnpkg.com/multiformats/-/multiformats-11.0.1.tgz#ba58c3f69f032ab67dab4b48cc70f01ac2ca07fe" integrity sha512-atWruyH34YiknSdL5yeIir00EDlJRpHzELYQxG7Iy29eCyL+VrZHpPrX5yqlik3jnuqpLpRKVZ0SGVb9UzKaSA== -multiformats@^9.4.2: - version "9.9.0" - resolved "https://registry.yarnpkg.com/multiformats/-/multiformats-9.9.0.tgz#c68354e7d21037a8f1f8833c8ccd68618e8f1d37" - integrity sha512-HoMUjhH9T8DDBNT+6xzkrd9ga/XiBI4xLr58LJACwK6G3HTOPeMz4nB4KJs33L2BelrIJa7P0VuNaVF3hMYfjg== - multihashes@^0.4.15, multihashes@~0.4.15: version "0.4.21" resolved "https://registry.yarnpkg.com/multihashes/-/multihashes-0.4.21.tgz#dc02d525579f334a7909ade8a122dabb58ccfcb5" @@ -10559,11 +10808,16 @@ nano-json-stream-parser@^0.1.2: resolved "https://registry.yarnpkg.com/nano-json-stream-parser/-/nano-json-stream-parser-0.1.2.tgz#0cc8f6d0e2b622b479c40d499c46d64b755c6f5f" integrity sha512-9MqxMH/BSJC7dnLsEMPyfN5Dvoo49IsPFYMcHw3Bcfc2kN0lpHRBSzlMSVx4HGyJ7s9B31CyBTVehWJoQ8Ctew== -nanoid@3.3.3, nanoid@^3.0.2, nanoid@^3.1.20: +nanoid@3.3.3, nanoid@^3.1.20: version "3.3.3" resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.3.3.tgz#fd8e8b7aa761fe807dba2d1b98fb7241bb724a25" integrity sha512-p1sjXuopFs0xg+fPASzQ28agW1oHD7xDsd9Xkf3T15H3c/cifrFHVwrh74PdoklAPi+i7MdRsE47vm2r6JoB+w== +nanoid@^4.0.0: + version "4.0.2" + resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-4.0.2.tgz#140b3c5003959adbebf521c170f282c5e7f9fb9e" + integrity sha512-7ZtY5KTCNheRGfEFxnedV5zFiORN1+Y1N6zvPTnHQd8ENUvfaDBeuJDZb2bN/oXwXxu3qkTXDzy57W5vAmDTBw== + napi-build-utils@^1.0.1: version "1.0.2" resolved "https://registry.npmjs.org/napi-build-utils/-/napi-build-utils-1.0.2.tgz" @@ -10584,6 +10838,11 @@ native-fetch@^4.0.2: resolved "https://registry.yarnpkg.com/native-fetch/-/native-fetch-4.0.2.tgz#75c8a44c5f3bb021713e5e24f2846750883e49af" integrity sha512-4QcVlKFtv2EYVS5MBgsGX5+NWKtbDbIECdUXDBGDMAZXq3Jkv9zf+y8iS7Ub8fEdga3GpYeazp9gauNqXHJOCg== +natural-compare-lite@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/natural-compare-lite/-/natural-compare-lite-1.4.0.tgz#17b09581988979fddafe0201e931ba933c96cbb4" + integrity sha512-Tj+HTDSJJKaZnfiuw+iaF9skdPpTo2GtEly5JHnWV/hfv2Qj/9RKsGISQtLh2ox3l5EAGw487hnBee0sIJ6v2g== + natural-compare@^1.4.0: version "1.4.0" resolved "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz" @@ -10623,13 +10882,13 @@ nice-try@^1.0.4: resolved "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz" integrity sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ== -nise@^5.1.1: - version "5.1.1" - resolved "https://registry.yarnpkg.com/nise/-/nise-5.1.1.tgz#ac4237e0d785ecfcb83e20f389185975da5c31f3" - integrity sha512-yr5kW2THW1AkxVmCnKEh4nbYkJdB3I7LUkiUgOvEkOp414mc2UMaHMA7pjq1nYowhdoJZGwEKGaQVbxfpWj10A== +nise@^5.1.4: + version "5.1.4" + resolved "https://registry.yarnpkg.com/nise/-/nise-5.1.4.tgz#491ce7e7307d4ec546f5a659b2efe94a18b4bbc0" + integrity sha512-8+Ib8rRJ4L0o3kfmyVCL7gzrohyDe0cMFTBa2d364yIrEGMEoetznKJx899YxjybU6bL9SQkYPSBBs1gyYs8Xg== dependencies: - "@sinonjs/commons" "^1.8.3" - "@sinonjs/fake-timers" ">=5" + "@sinonjs/commons" "^2.0.0" + "@sinonjs/fake-timers" "^10.0.2" "@sinonjs/text-encoding" "^0.7.1" just-extend "^4.0.2" path-to-regexp "^1.7.0" @@ -10708,6 +10967,22 @@ node-gyp@^9.0.0: tar "^6.1.2" which "^2.0.2" +node-gyp@^9.3.1: + version "9.3.1" + resolved "https://registry.yarnpkg.com/node-gyp/-/node-gyp-9.3.1.tgz#1e19f5f290afcc9c46973d68700cbd21a96192e4" + integrity sha512-4Q16ZCqq3g8awk6UplT7AuxQ35XN4R/yf/+wSAwcBUAjg7l58RTactWaP8fIDTi0FzI7YcVLujwExakZlfWkXg== + dependencies: + env-paths "^2.2.0" + glob "^7.1.4" + graceful-fs "^4.2.6" + make-fetch-happen "^10.0.3" + nopt "^6.0.0" + npmlog "^6.0.0" + rimraf "^3.0.2" + semver "^7.3.5" + tar "^6.1.2" + which "^2.0.2" + node-libs-browser@^2.1.0: version "2.2.1" resolved "https://registry.npmjs.org/node-libs-browser/-/node-libs-browser-2.2.1.tgz" @@ -10785,6 +11060,13 @@ nopt@^5.0.0: dependencies: abbrev "1" +nopt@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/nopt/-/nopt-6.0.0.tgz#245801d8ebf409c6df22ab9d95b65e1309cdb16d" + integrity sha512-ZwLpbTgdhuZUnZzjd7nb1ZV+4DoiC6/sfiVKok72ym/4Tlf+DFdlHYmT2JPmcNNWV6Pi3SDf1kT+A4r9RTuT9g== + dependencies: + abbrev "^1.0.0" + normalize-package-data@^2.3.2, normalize-package-data@^2.5.0: version "2.5.0" resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-2.5.0.tgz#e66db1838b200c1dfc233225d12cb36520e234a8" @@ -11093,6 +11375,11 @@ object-inspect@^1.12.2, object-inspect@^1.9.0: resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.12.2.tgz#c0641f26394532f28ab8d796ab954e43c009a8ea" integrity sha512-z+cPxW0QGUp0mcqcsgQyLVRDoXFQbXOwBaqyF7VIgI4TWNQsDHrBpUQslRmIfAoYWdYzs6UlKJtB2XJpTaNSpQ== +object-inspect@^1.12.3: + version "1.12.3" + resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.12.3.tgz#ba62dffd67ee256c8c086dfae69e016cd1f198b9" + integrity sha512-geUvdk7c+eizMNUDkRpW1wJwgfOiOeHbxBR/hLXK1aT6zmVSO0jsQcs7fj6MGw89jC/cjGfLcNOrtMYtGqm81g== + object-is@^1.0.1: version "1.1.5" resolved "https://registry.npmjs.org/object-is/-/object-is-1.1.5.tgz" @@ -11116,14 +11403,14 @@ object.assign@^4.1.2, object.assign@^4.1.4: has-symbols "^1.0.3" object-keys "^1.1.1" -object.values@^1.1.5: - version "1.1.5" - resolved "https://registry.yarnpkg.com/object.values/-/object.values-1.1.5.tgz#959f63e3ce9ef108720333082131e4a459b716ac" - integrity sha512-QUZRW0ilQ3PnPpbNtgdNV1PDbEqLIiSFB3l+EnGtBQ/8SUTLj1PZwtQHABZtLgwpJZTSZhuGLOGk57Drx2IvYg== +object.values@^1.1.6: + version "1.1.6" + resolved "https://registry.yarnpkg.com/object.values/-/object.values-1.1.6.tgz#4abbaa71eba47d63589d402856f908243eea9b1d" + integrity sha512-FVVTkD1vENCsAcwNs9k6jea2uHC/X0+JcjG8YA60FN5CMaJmG95wT9jek/xX9nornqGRrBkKtzuAu2wuHpKqvw== dependencies: call-bind "^1.0.2" - define-properties "^1.1.3" - es-abstract "^1.19.1" + define-properties "^1.1.4" + es-abstract "^1.20.4" oboe@2.1.5: version "2.1.5" @@ -11156,7 +11443,7 @@ on-finished@~2.3.0: dependencies: ee-first "1.1.1" -once@1.4.0, once@^1.3.0, once@^1.3.1, once@^1.4.0: +once@^1.3.0, once@^1.3.1, once@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" integrity sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w== @@ -11738,10 +12025,10 @@ prettier-linter-helpers@^1.0.0: dependencies: fast-diff "^1.1.2" -prettier@^2.0.5: - version "2.2.1" - resolved "https://registry.npmjs.org/prettier/-/prettier-2.2.1.tgz" - integrity sha512-PqyhM2yCjg/oKkFPtTGUojv7gnZAoG80ttl45O6x2Ug/rMJw4wcc9k6aaf2hibP7BGVCCM33gZoGjyvt9mm16Q== +prettier@^2.8.7: + version "2.8.7" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.8.7.tgz#bb79fc8729308549d28fe3a98fce73d2c0656450" + integrity sha512-yPngTo3aXUUmyuTjeTUT75txrf+aMh9FiD7q9ZE/i6r0bPb22g4FsE6Y338PQX1bmfy08i9QQCB7/rcUAVntfw== private-ip@^2.1.1: version "2.3.4" @@ -11995,19 +12282,14 @@ qs@6.10.3: dependencies: side-channel "^1.0.4" -qs@6.11.0, qs@^6.10.3: +qs@6.11.0: version "6.11.0" resolved "https://registry.yarnpkg.com/qs/-/qs-6.11.0.tgz#fd0d963446f7a65e1367e01abd85429453f0c37a" integrity sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q== dependencies: side-channel "^1.0.4" -qs@6.9.3: - version "6.9.3" - resolved "https://registry.yarnpkg.com/qs/-/qs-6.9.3.tgz#bfadcd296c2d549f1dffa560619132c977f5008e" - integrity sha512-EbZYNarm6138UKKq46tdx08Yo/q9ZhFoAXAI1meAFd2GtbRDhbZY2WQSICskT0c5q99aFzLG1D4nvTk9tqfXIw== - -qs@^6.11.1: +qs@^6.11.0, qs@^6.11.1: version "6.11.1" resolved "https://registry.yarnpkg.com/qs/-/qs-6.11.1.tgz#6c29dff97f0c0060765911ba65cbc9764186109f" integrity sha512-0wsrzgTz/kAVIeuxSjnpGC56rzYtr6JT/2BwEvMaPhFIoYa1aGO8LbzuU1R0uUYQkLpWBTOj0l/CLAJB64J6nQ== @@ -12269,11 +12551,6 @@ regexpp@^3.0.0: resolved "https://registry.npmjs.org/regexpp/-/regexpp-3.1.0.tgz" integrity sha512-ZOIzd8yVsQQA7j8GCSlPGXwg5PfmA1mrq0JP4nGhh54LaKN3xdai/vHUDu74pKwV8OxseMS65u2NImosQcSD0Q== -regexpp@^3.2.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-3.2.0.tgz#0425a2768d8f23bad70ca4b90461fa2f1213e1b2" - integrity sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg== - release-zalgo@^1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/release-zalgo/-/release-zalgo-1.0.0.tgz" @@ -12349,14 +12626,14 @@ resolve-from@^5.0.0: resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-5.0.0.tgz#c35225843df8f776df21c57557bc087e9dfdfc69" integrity sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw== -resolve-typescript-plugin@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/resolve-typescript-plugin/-/resolve-typescript-plugin-1.2.0.tgz#411271a1661b7ce050d2fff51d9ee66311ffa78f" - integrity sha512-f0tu3fDdKcSmbgpLDNBKiMYPPG7D19tYCnph9B7GIlMMIWnbiLjAqqPXZVeO3POQSNF7ZYK4Ox+Gmvo116ERWQ== +resolve-typescript-plugin@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/resolve-typescript-plugin/-/resolve-typescript-plugin-2.0.1.tgz#ae4a1a81372b1e3389239268ac774bcc2780f4e3" + integrity sha512-n0FdUHSo8vkT6omKdE+Gda7api6PzIwsoYH4RTH0tUpRq46hk8dOcWZpzBwpoJyjSz3OxHIC/hKGL8LB8B09GQ== dependencies: - tslib "2.3.1" + tslib "2.5.0" -resolve@^1.10.0, resolve@^1.20.0, resolve@^1.3.3: +resolve@^1.10.0, resolve@^1.22.1, resolve@^1.3.3: version "1.22.1" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.22.1.tgz#27cb2ebb53f91abb49470a928bba7558066ac177" integrity sha512-nBpuuYuY5jFsli/JIs1oldw6fOQCBioohqWZg/2hiaOybXOft4lonv85uDOKXdf8rhyK159cxU5cDcK/NKk8zw== @@ -12372,15 +12649,6 @@ resolve@^1.10.1: dependencies: path-parse "^1.0.6" -resolve@^1.22.0: - version "1.22.0" - resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.22.0.tgz#5e0b8c67c15df57a89bdbabe603a002f21731198" - integrity sha512-Hhtrw0nLeSrFQ7phPp4OOcVjLPIeMnRlr5mcnVuMe7M/7eBn98A3hmFRLoFo3DLZkivSYwhRUJTyPyWAk56WLw== - dependencies: - is-core-module "^2.8.1" - path-parse "^1.0.7" - supports-preserve-symlinks-flag "^1.0.0" - resolve@^1.3.2: version "1.20.0" resolved "https://registry.npmjs.org/resolve/-/resolve-1.20.0.tgz" @@ -12651,6 +12919,13 @@ semver@^7.0.0, semver@^7.1.1, semver@^7.3.2, semver@^7.3.4, semver@^7.3.5, semve dependencies: lru-cache "^6.0.0" +semver@^7.3.8: + version "7.3.8" + resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.8.tgz#07a78feafb3f7b32347d725e33de7e2a2df67798" + integrity sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A== + dependencies: + lru-cache "^6.0.0" + send@0.18.0: version "0.18.0" resolved "https://registry.yarnpkg.com/send/-/send-0.18.0.tgz#670167cc654b05f5aa4a767f9113bb371bc706be" @@ -12814,16 +13089,16 @@ sinon-chai@^3.7.0: resolved "https://registry.yarnpkg.com/sinon-chai/-/sinon-chai-3.7.0.tgz#cfb7dec1c50990ed18c153f1840721cf13139783" integrity sha512-mf5NURdUaSdnatJx3uhoBOrY9dtL19fiOtAdT1Azxg3+lNJFiuN0uzaU3xX1LeAfL17kHQhTAJgpsfhbMJMY2g== -sinon@^14.0.0: - version "14.0.0" - resolved "https://registry.yarnpkg.com/sinon/-/sinon-14.0.0.tgz#203731c116d3a2d58dc4e3cbe1f443ba9382a031" - integrity sha512-ugA6BFmE+WrJdh0owRZHToLd32Uw3Lxq6E6LtNRU+xTVBefx632h03Q7apXWRsRdZAJ41LB8aUfn2+O4jsDNMw== +sinon@^15.0.3: + version "15.0.3" + resolved "https://registry.yarnpkg.com/sinon/-/sinon-15.0.3.tgz#38005fcd80827177b6aa0245f82401d9ec88994b" + integrity sha512-si3geiRkeovP7Iel2O+qGL4NrO9vbMf3KsrJEi0ghP1l5aBkB5UxARea5j0FUsSqH3HLBh0dQPAyQ8fObRUqHw== dependencies: - "@sinonjs/commons" "^1.8.3" - "@sinonjs/fake-timers" "^9.1.2" - "@sinonjs/samsam" "^6.1.1" - diff "^5.0.0" - nise "^5.1.1" + "@sinonjs/commons" "^3.0.0" + "@sinonjs/fake-timers" "^10.0.2" + "@sinonjs/samsam" "^8.0.0" + diff "^5.1.0" + nise "^5.1.4" supports-color "^7.2.0" slash@^3.0.0: @@ -13182,6 +13457,15 @@ string.prototype.padend@^3.0.0: define-properties "^1.1.3" es-abstract "^1.18.0-next.2" +string.prototype.trim@^1.2.7: + version "1.2.7" + resolved "https://registry.yarnpkg.com/string.prototype.trim/-/string.prototype.trim-1.2.7.tgz#a68352740859f6893f14ce3ef1bb3037f7a90533" + integrity sha512-p6TmeT1T3411M8Cgg9wBTMRtY2q9+PNy9EV1i2lIXUN/btt763oIfxwN3RR8VU6wHX8j/1CFy0L+YuThm6bgOg== + dependencies: + call-bind "^1.0.2" + define-properties "^1.1.4" + es-abstract "^1.20.4" + string.prototype.trimend@^1.0.4, string.prototype.trimend@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/string.prototype.trimend/-/string.prototype.trimend-1.0.5.tgz#914a65baaab25fbdd4ee291ca7dde57e869cb8d0" @@ -13191,6 +13475,15 @@ string.prototype.trimend@^1.0.4, string.prototype.trimend@^1.0.5: define-properties "^1.1.4" es-abstract "^1.19.5" +string.prototype.trimend@^1.0.6: + version "1.0.6" + resolved "https://registry.yarnpkg.com/string.prototype.trimend/-/string.prototype.trimend-1.0.6.tgz#c4a27fa026d979d79c04f17397f250a462944533" + integrity sha512-JySq+4mrPf9EsDBEDYMOb/lM7XQLulwg5R/m1r0PXEFqrV0qHvl58sdTilSXtKOflCsK2E8jxf+GKC0T07RWwQ== + dependencies: + call-bind "^1.0.2" + define-properties "^1.1.4" + es-abstract "^1.20.4" + string.prototype.trimstart@^1.0.4, string.prototype.trimstart@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/string.prototype.trimstart/-/string.prototype.trimstart-1.0.5.tgz#5466d93ba58cfa2134839f81d7f42437e8c01fef" @@ -13200,6 +13493,15 @@ string.prototype.trimstart@^1.0.4, string.prototype.trimstart@^1.0.5: define-properties "^1.1.4" es-abstract "^1.19.5" +string.prototype.trimstart@^1.0.6: + version "1.0.6" + resolved "https://registry.yarnpkg.com/string.prototype.trimstart/-/string.prototype.trimstart-1.0.6.tgz#e90ab66aa8e4007d92ef591bbf3cd422c56bdcf4" + integrity sha512-omqjMDaY92pbn5HOX7f9IccLA+U1tA9GvtU4JrodiXFfYB7jPzzHpRzpglLAjtUV6bB557zwClJezTqnAiYnQA== + dependencies: + call-bind "^1.0.2" + define-properties "^1.1.4" + es-abstract "^1.20.4" + string_decoder@^1.0.0, string_decoder@^1.1.1: version "1.3.0" resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.3.0.tgz#42f114594a46cf1a8e30b0a84f56c78c3edac21e" @@ -13228,6 +13530,13 @@ strip-ansi@^6.0.0, strip-ansi@^6.0.1: dependencies: ansi-regex "^5.0.1" +strip-ansi@^7.0.1: + version "7.0.1" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-7.0.1.tgz#61740a08ce36b61e50e65653f07060d000975fb2" + integrity sha512-cXNxvT8dFNRVfhVME3JAe98mkXDYN2O1l7jmcwMnOslDeESg1rF/OZMtK0nRAhiari1unG5cD4jG3rapUAkLbw== + dependencies: + ansi-regex "^6.0.1" + strip-bom@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-3.0.0.tgz#2334c18e9c759f7bdd56fdef7e9ae3d588e68ed3" @@ -13288,30 +13597,29 @@ sumchecker@^3.0.1: dependencies: debug "^4.1.0" -superagent@^8.0.0: - version "8.0.0" - resolved "https://registry.yarnpkg.com/superagent/-/superagent-8.0.0.tgz#2ea4587df4b81ef023ec01ebc6e1bcb9e2344cb6" - integrity sha512-iudipXEel+SzlP9y29UBWGDjB+Zzag+eeA1iLosaR2YHBRr1Q1kC29iBrF2zIVD9fqVbpZnXkN/VJmwFMVyNWg== +superagent@^8.0.5: + version "8.0.9" + resolved "https://registry.yarnpkg.com/superagent/-/superagent-8.0.9.tgz#2c6fda6fadb40516515f93e9098c0eb1602e0535" + integrity sha512-4C7Bh5pyHTvU33KpZgwrNKh/VQnvgtCSqPRfJAUdmrtSYePVzVg4E4OzsrbkhJj9O7SO6Bnv75K/F8XVZT8YHA== dependencies: component-emitter "^1.3.0" - cookiejar "^2.1.3" + cookiejar "^2.1.4" debug "^4.3.4" fast-safe-stringify "^2.1.1" form-data "^4.0.0" - formidable "^2.0.1" + formidable "^2.1.2" methods "^1.1.2" mime "2.6.0" - qs "^6.10.3" - readable-stream "^3.6.0" - semver "^7.3.7" + qs "^6.11.0" + semver "^7.3.8" -supertest@^6.2.4: - version "6.2.4" - resolved "https://registry.yarnpkg.com/supertest/-/supertest-6.2.4.tgz#3dcebe42f7fd6f28dd7ac74c6cba881f7101b2f0" - integrity sha512-M8xVnCNv+q2T2WXVzxDECvL2695Uv2uUj2O0utxsld/HRyJvOU8W9f1gvsYxSNU4wmIe0/L/ItnpU4iKq0emDA== +supertest@^6.3.3: + version "6.3.3" + resolved "https://registry.yarnpkg.com/supertest/-/supertest-6.3.3.tgz#42f4da199fee656106fd422c094cf6c9578141db" + integrity sha512-EMCG6G8gDu5qEqRQ3JjjPs6+FYT1a7Hv5ApHvtSghmOFJYtsU5S+pSb6Y2EUeCEY3CmEL3mmQ8YWlPOzQomabA== dependencies: methods "^1.1.2" - superagent "^8.0.0" + superagent "^8.0.5" supports-color@8.1.1, supports-color@^8.0.0: version "8.1.1" @@ -13681,10 +13989,10 @@ truncate-utf8-bytes@^1.0.0: dependencies: utf8-byte-length "^1.0.1" -ts-loader@^9.3.1: - version "9.3.1" - resolved "https://registry.yarnpkg.com/ts-loader/-/ts-loader-9.3.1.tgz#fe25cca56e3e71c1087fe48dc67f4df8c59b22d4" - integrity sha512-OkyShkcZTsTwyS3Kt7a4rsT/t2qvEVQuKCTg4LJmpj9fhFR7ukGdZwV6Qq3tRUkqcXtfGpPR7+hFKHCG/0d3Lw== +ts-loader@^9.4.2: + version "9.4.2" + resolved "https://registry.yarnpkg.com/ts-loader/-/ts-loader-9.4.2.tgz#80a45eee92dd5170b900b3d00abcfa14949aeb78" + integrity sha512-OmlC4WVmFv5I0PpaxYb+qGeGOdm5giHU7HwDDUjw59emP2UYMHy9fFSDcYgSNoH8sXcj4hGCSEhlDZ9ULeDraA== dependencies: chalk "^4.1.0" enhanced-resolve "^5.0.0" @@ -13730,16 +14038,16 @@ tsconfig@^7.0.0: strip-bom "^3.0.0" strip-json-comments "^2.0.0" -tslib@2.3.1: - version "2.3.1" - resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.3.1.tgz#e8a335add5ceae51aa261d32a490158ef042ef01" - integrity sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw== - tslib@2.4.0, tslib@^2.3.0, tslib@^2.4.0: version "2.4.0" resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.4.0.tgz#7cecaa7f073ce680a05847aa77be941098f36dc3" integrity sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ== +tslib@2.5.0: + version "2.5.0" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.5.0.tgz#42bfed86f5787aeb41d031866c8f402429e0fddf" + integrity sha512-336iVw3rtn2BUK7ORdIAHTyxHGRIHVReokCR3XjbckJMK7ms8FysBfhLR8IXnAgy7T0PTPNBWKiH514FOW/WSg== + tslib@^1.10.0, tslib@^1.8.1: version "1.14.1" resolved "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz" @@ -13854,6 +14162,15 @@ type@^2.7.2: resolved "https://registry.yarnpkg.com/type/-/type-2.7.2.tgz#2376a15a3a28b1efa0f5350dcf72d24df6ef98d0" integrity sha512-dzlvlNlt6AXU7EBSfpAscydQ7gXB+pPGsPnfJnZpiNJBDj7IaJzQlBZYGdEi4R9HmPdBv2XmWJ6YUtoTa7lmCw== +typed-array-length@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/typed-array-length/-/typed-array-length-1.0.4.tgz#89d83785e5c4098bec72e08b319651f0eac9c1bb" + integrity sha512-KjZypGq+I/H7HI5HlOoGHkWUUGq+Q0TPhQurLbyrVrvnKTBgzLhIJ7j6J/XTQOi0d1RjyZ0wdas8bKs2p0x3Ng== + dependencies: + call-bind "^1.0.2" + for-each "^0.3.3" + is-typed-array "^1.1.9" + typedarray-to-buffer@^3.1.5: version "3.1.5" resolved "https://registry.yarnpkg.com/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz#a97ee7a9ff42691b9f783ff1bc5112fe3fca9080" @@ -13866,29 +14183,29 @@ typedarray@^0.0.6: resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" integrity sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA== -typescript-docs-verifier@^2.3.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/typescript-docs-verifier/-/typescript-docs-verifier-2.3.0.tgz#613d3d136c04a2dc1a617d5aff72560a5a1c73f6" - integrity sha512-Qs7fyLpqoobDXe5zrrohWvYZpPh36586UT+5wIivLX5AoHRfL9iSrPnRdxaGtLRorvPwPi38ModpwRwODONY1A== +typescript-docs-verifier@^2.4.0: + version "2.4.0" + resolved "https://registry.yarnpkg.com/typescript-docs-verifier/-/typescript-docs-verifier-2.4.0.tgz#2eede027b54e385b790656ee61b8f68673b3d6ad" + integrity sha512-1beOPxmO7M2XSRT06SRgotUmYZ21OTYeQfnS1nnAIxWxbJymwCGRMBLSDnIOIO+7g4AoxnCiSLahQ80EpqFyig== dependencies: chalk "^4.1.2" fs-extra "^10.0.0" ora "^5.4.1" - strip-ansi "^6.0.1" + strip-ansi "^7.0.1" ts-node "^10.8.1" tsconfig "^7.0.0" - yargs "^17.2.1" - -typescript@4.9.3: - version "4.9.3" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.9.3.tgz#3aea307c1746b8c384435d8ac36b8a2e580d85db" - integrity sha512-CIfGzTelbKNEnLpLdGFgdyKhG23CKdKgQPOBc+OUNrkJ2vr+KSzsSV5kq5iWhEQbok+quxgGzrAtGWCyU7tHnA== + yargs "^17.5.1" "typescript@^3 || ^4": version "4.8.3" resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.8.3.tgz#d59344522c4bc464a65a730ac695007fdb66dd88" integrity sha512-goMHfm00nWPa8UvR/CPSvykqf6dVV8x/dp0c5mFTMTIu0u0FlGWRioyy7Nn0PGAdHxpJZnuO/ut+PpQ8UiHAig== +typescript@^5.0.3: + version "5.0.3" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.0.3.tgz#fe976f0c826a88d0a382007681cbb2da44afdedf" + integrity sha512-xv8mOEDnigb/tN9PSMTwSEqAnUvkoXMQlicOb0IUVDBSQCgBSaAAROUZYy2IcUy5qU6XajK5jjjO7TMWqBTKZA== + ua-parser-js@^0.7.30: version "0.7.33" resolved "https://registry.yarnpkg.com/ua-parser-js/-/ua-parser-js-0.7.33.tgz#1d04acb4ccef9293df6f70f2c3d22f3030d8b532" @@ -13915,13 +14232,6 @@ uint8arraylist@^2.0.0, uint8arraylist@^2.1.0, uint8arraylist@^2.1.1, uint8arrayl dependencies: uint8arrays "^4.0.2" -uint8arrays@^3.0.0, uint8arrays@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/uint8arrays/-/uint8arrays-3.1.0.tgz#8186b8eafce68f28bd29bd29d683a311778901e2" - integrity sha512-ei5rfKtoRO8OyOIor2Rz5fhzjThwIHJZ3uyDPnDHTXbP0aMQ1RN/6AI5B5d9dBxJOU+BvOAk7ZQ1xphsX8Lrog== - dependencies: - multiformats "^9.4.2" - uint8arrays@^4.0.2: version "4.0.2" resolved "https://registry.yarnpkg.com/uint8arrays/-/uint8arrays-4.0.2.tgz#163bdbcf3f7403b0781754e0436c268548b237c2" @@ -13929,6 +14239,13 @@ uint8arrays@^4.0.2: dependencies: multiformats "^10.0.0" +uint8arrays@^4.0.3: + version "4.0.3" + resolved "https://registry.yarnpkg.com/uint8arrays/-/uint8arrays-4.0.3.tgz#43109c03c4c10d312e7f2e9f4d53e5cd2398c7fd" + integrity sha512-b+aKlI2oTnxnfeSQWV1sMacqSNxqhtXySaH6bflvONGxF8V/fT3ZlYH7z2qgGfydsvpVo4JUgM/Ylyfl2YouCg== + dependencies: + multiformats "^11.0.0" + ultron@~1.1.0: version "1.1.1" resolved "https://registry.yarnpkg.com/ultron/-/ultron-1.1.1.tgz#9fe1536a10a664a65266a1e3ccf85fd36302bc9c" @@ -14144,7 +14461,7 @@ v8-compile-cache-lib@^3.0.1: resolved "https://registry.yarnpkg.com/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz#6336e8d71965cb3d35a1bbb7868445a7c05264bf" integrity sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg== -v8-compile-cache@2.3.0, v8-compile-cache@^2.0.3: +v8-compile-cache@2.3.0: version "2.3.0" resolved "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz" integrity sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA== @@ -14466,10 +14783,10 @@ webpack-sources@^3.2.3: resolved "https://registry.yarnpkg.com/webpack-sources/-/webpack-sources-3.2.3.tgz#2d4daab8451fd4b240cc27055ff6a0c2ccea0cde" integrity sha512-/DyMEOrDgLKKIG0fmvtz+4dUX/3Ghozwgm6iPp8KRhvn+eQf9+Q7GWxVNMk3+uCPWfdXYC4ExGBckIXdFEfH1w== -webpack@^5.74.0: - version "5.74.0" - resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.74.0.tgz#02a5dac19a17e0bb47093f2be67c695102a55980" - integrity sha512-A2InDwnhhGN4LYctJj6M1JEaGL7Luj6LOmyBHjcI8529cm5p6VXiTIW2sn6ffvEAKmveLzvu4jrihwXtPojlAA== +webpack@^5.77.0: + version "5.77.0" + resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.77.0.tgz#dea3ad16d7ea6b84aa55fa42f4eac9f30e7eb9b4" + integrity sha512-sbGNjBr5Ya5ss91yzjeJTLKyfiwo5C628AFjEa6WSXcZa4E+F57om3Cc8xLb1Jh0b243AWuSYRf3dn7HVeFQ9Q== dependencies: "@types/eslint-scope" "^3.7.3" "@types/estree" "^0.0.51" @@ -14549,6 +14866,18 @@ which-typed-array@^1.1.2: has-symbols "^1.0.1" is-typed-array "^1.1.3" +which-typed-array@^1.1.9: + version "1.1.9" + resolved "https://registry.yarnpkg.com/which-typed-array/-/which-typed-array-1.1.9.tgz#307cf898025848cf995e795e8423c7f337efbde6" + integrity sha512-w9c4xkx6mPidwp7180ckYWfMmvxpjlZuIudNtDf4N/tTAUB8VJbX25qZoAsrtGuYNnGw3pa0AXgbGKRB8/EceA== + dependencies: + available-typed-arrays "^1.0.5" + call-bind "^1.0.2" + for-each "^0.3.3" + gopd "^1.0.1" + has-tostringtag "^1.0.0" + is-typed-array "^1.1.10" + which@^1.2.1, which@^1.2.9: version "1.3.1" resolved "https://registry.npmjs.org/which/-/which-1.3.1.tgz" @@ -14870,7 +15199,7 @@ yargs-parser@^20.2.2, yargs-parser@^20.2.3: resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.9.tgz#2eb7dc3b0289718fc295f362753845c41a0c94ee" integrity sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w== -yargs-parser@^21.0.0: +yargs-parser@^21.0.0, yargs-parser@^21.1.1: version "21.1.1" resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-21.1.1.tgz#9096bceebf990d21bb31fa9516e0ede294a77d35" integrity sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw== @@ -14928,7 +15257,7 @@ yargs@^17.1.1: y18n "^5.0.5" yargs-parser "^20.2.2" -yargs@^17.2.1, yargs@^17.4.0: +yargs@^17.4.0: version "17.5.1" resolved "https://registry.yarnpkg.com/yargs/-/yargs-17.5.1.tgz#e109900cab6fcb7fd44b1d8249166feb0b36e58e" integrity sha512-t6YAJcxDkNX7NFYiVtKvWUz8l+PaKTLiL63mJYWR2GnHq2gjEWISzsLp9wg3aY36dY1j+gfIEL3pIF+XlJJfbA== @@ -14941,6 +15270,19 @@ yargs@^17.2.1, yargs@^17.4.0: y18n "^5.0.5" yargs-parser "^21.0.0" +yargs@^17.5.1: + version "17.7.1" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-17.7.1.tgz#34a77645201d1a8fc5213ace787c220eabbd0967" + integrity sha512-cwiTb08Xuv5fqF4AovYacTFNxk62th7LKJ6BL9IGUpTJrWoU7/7WdQGTP2SjKf1dUNBGzDd28p/Yfs/GI6JrLw== + dependencies: + cliui "^8.0.1" + escalade "^3.1.1" + get-caller-file "^2.0.5" + require-directory "^2.1.1" + string-width "^4.2.3" + y18n "^5.0.5" + yargs-parser "^21.1.1" + yauzl@^2.10.0: version "2.10.0" resolved "https://registry.yarnpkg.com/yauzl/-/yauzl-2.10.0.tgz#c7eb17c93e112cb1086fa6d8e51fb0667b79a5f9"