From 245d63e5dc368b165107ce0ddc37209da440bfa7 Mon Sep 17 00:00:00 2001 From: Nazar Hussain Date: Wed, 16 Oct 2024 14:44:38 +0200 Subject: [PATCH] chore: cleanup overrides for the biomejs configuration (#7162) * Clean overrides for unused variables * Fix the naming conventions * Add comments in the biome * Fix code feedback --- biome.jsonc | 188 ++++++------------ packages/api/src/utils/client/httpClient.ts | 1 + packages/api/src/utils/codecs.ts | 3 + packages/api/src/utils/types.ts | 2 +- .../src/db/repositories/checkpointState.ts | 5 +- .../beacon-node/src/network/discv5/utils.ts | 1 + packages/beacon-node/src/util/kzg.ts | 4 + .../test/e2e/eth1/jsonRpcHttpClient.test.ts | 18 +- packages/beacon-node/test/spec/general/bls.ts | 26 +-- .../test/spec/presets/operations.test.ts | 6 +- .../test/spec/utils/runValidSszTest.ts | 1 - packages/beacon-node/test/utils/runEl.ts | 4 +- packages/logger/test/unit/node.node.test.ts | 1 + .../logger/test/unit/winston.node.test.ts | 1 + .../state-transition/test/perf/block/util.ts | 2 - packages/types/src/phase0/validator.ts | 1 + 16 files changed, 107 insertions(+), 157 deletions(-) diff --git a/biome.jsonc b/biome.jsonc index 62d67fb7575f..de0689f2d761 100644 --- a/biome.jsonc +++ b/biome.jsonc @@ -71,54 +71,32 @@ "useNumberNamespace": "off", // We prefer to auto-initialize enums "useEnumInitializers": "off", - "noVar": "error", - "useConst": "error", + // Namespaces are deprecated way to organize modules in TS + "noNamespace": "error", "useNamingConvention": { "level": "error", "options": { "strictCase": false, + "requireAscii": true, "conventions": [ + // Skip __dirname and any variable starting with _, for rest check next convention { "selector": { - "kind": "any" - }, - "formats": ["camelCase"] - }, - { - "selector": { - "kind": "classProperty" - }, - "formats": ["camelCase"] - }, - { - "selector": { - "kind": "objectLiteralProperty" - }, - "formats": ["camelCase"] - }, - { - "selector": { - "kind": "classMethod" - }, - "formats": ["camelCase"] - }, - { - "selector": { - "kind": "functionParameter" + "kind": "variable" }, - "formats": ["camelCase"] + "match": "(?:__dirname)|(?:_.*)|(.*)" }, { "selector": { "kind": "variable" }, - "formats": ["camelCase", "CONSTANT_CASE"] + "formats": ["camelCase", "PascalCase", "CONSTANT_CASE"] }, { "selector": { "kind": "typeLike" }, - "formats": ["PascalCase"] + "formats": ["camelCase", "snake_case", "PascalCase", "CONSTANT_CASE"] }, { "selector": { @@ -128,62 +106,62 @@ }, { "selector": { - "kind": "enumMember" + "kind": "objectLiteralProperty" }, - "formats": ["PascalCase", "camelCase", "CONSTANT_CASE"] + "formats": ["camelCase", "snake_case", "PascalCase", "CONSTANT_CASE"] }, { "selector": { - "kind": "classProperty" + "kind": "objectLiteralMethod" }, - "formats": ["PascalCase", "camelCase", "CONSTANT_CASE"] + "formats": ["camelCase", "snake_case", "PascalCase", "CONSTANT_CASE"] }, + // Skip any property starting with _ and then check for next convention { "selector": { - "kind": "typeProperty" + "kind": "classProperty" }, - "formats": ["PascalCase", "camelCase", "CONSTANT_CASE"] + "match": "(?:_.*)|(.*)" }, { "selector": { - "kind": "classMember" + "kind": "classProperty" }, - "formats": ["PascalCase", "camelCase", "CONSTANT_CASE"] + "formats": ["camelCase", "snake_case", "PascalCase", "CONSTANT_CASE"] }, { "selector": { - "kind": "objectLiteralMethod" + "kind": "typeProperty" }, - "formats": ["PascalCase", "camelCase", "CONSTANT_CASE"] + "formats": ["camelCase", "snake_case", "PascalCase", "CONSTANT_CASE"] }, { "selector": { "kind": "typeMethod" }, - "formats": ["PascalCase", "camelCase", "CONSTANT_CASE"] + "formats": ["camelCase", "snake_case", "PascalCase", "CONSTANT_CASE"] }, { "selector": { - "kind": "variable" + "kind": "enumMember" }, - "formats": ["PascalCase", "camelCase", "CONSTANT_CASE"] + "formats": ["camelCase", "snake_case", "PascalCase", "CONSTANT_CASE"] }, { "selector": { - "kind": "importAlias" + "kind": "indexParameter" }, - "formats": ["PascalCase", "camelCase"] + "formats": ["camelCase", "PascalCase"] }, { "selector": { - "kind": "importNamespace" + "kind": "function" }, - "formats": ["PascalCase", "camelCase"] + "formats": ["camelCase", "PascalCase"] } ] } - }, - "noNamespace": "error" + } }, "suspicious": { // `void` as type is useful in our case when used as generic constraint e.g. K extends number | void @@ -246,13 +224,7 @@ "globals": ["BigInt"] }, "overrides": [ - { - "include": ["packages/**/test/perf/**/*.test.ts", "packages/state-transition/test/utils/beforeValueMocha.ts"], - "javascript": { - // These are used by mocha - "globals": ["describe", "it", "before", "after"] - } - }, + // Code using console output { "include": ["packages/cli/src/", "packages/test-utils/src", "packages/flare/src"], "linter": { @@ -263,89 +235,57 @@ } } }, + // All test files { - "include": [ - "**/*.config.js", - "**/*.config.mjs", - "**/*.config.cjs", - "**/*.config.ts", - "scripts/vitest/**/*.ts", - "scripts/vite/**/*.ts", - "**/types/**/*.ts", - "packages/api/src/beacon/routes/*.ts", - "packages/api/src/**/routes.ts", - "packages/api/src/utils/server/handler.ts", - "packages/api/test/unit/client/urlFormat.test.ts", - "packages/beacon-node/src/api/impl/config/constants.ts", - "packages/beacon-node/src/eth1/provider/eth1Provider.ts", - "" - ], - "linter": { - "rules": { - "style": { - "useNamingConvention": { - "level": "off", - "options": { - "strictCase": false - } - } - } - } - } - }, - { - "include": [ - "**/test/**/*.ts", - "packages/*/test/**/*.js", - "packages/api/src/utils/**/*.ts", - "packages/beacon-node/src/db/repositories/checkpointState.ts", - "packages/spec-test-util/src/single.ts" - ], - "linter": { - "rules": { - "suspicious": { - "noExplicitAny": "off" - } - } - } - }, - { - "include": ["packages/beacon-node/test/e2e/eth1/jsonRpcHttpClient.test.ts"], - "linter": { - "rules": { - "correctness": { - "noUnusedVariables": "off" - } - } - } - }, - { - "include": ["**/test/**/*.ts", "packages/*/test/**/*.js"], + "include": ["**/test/**/*.ts", "packages/spec-test-util/src"], "linter": { "rules": { + "complexity": { + // During tests we often need to use private/protected attributes, which is only possible with literal keys + "useLiteralKeys": "off" + }, "suspicious": { + // During tests it's quicker to define variables with `let` without specifying types + "noImplicitAnyLet": "off", + // During testing we use `any` type for quick assignments + "noExplicitAny": "off", + // Console logging is often used in tests "noConsoleLog": "off" } } } }, + // Dependencies still using mocha { - "include": ["**/perf/**/*.ts"], - "linter": { - "rules": {} + "include": ["packages/**/test/perf/**/*.test.ts", "packages/state-transition/test/utils/beforeValueMocha.ts"], + "javascript": { + // These are used by mocha + "globals": ["describe", "it", "before", "after"] } }, { - "include": ["**/test/**/*.test.ts"], + "include": [ + // These files are using mix cases e.g. `engine_newPayloadV4` + // It's a mix of snake_case and camelCase, which can't validated by biome + "packages/beacon-node/src/db/buckets.ts", + "packages/beacon-node/src/execution/engine/mock.ts", + "packages/beacon-node/src/execution/engine/types.ts", + "packages/beacon-node/src/eth1/provider/eth1Provider.ts", + "packages/validator/src/buckets.ts", + "packages/prover/src/types.ts", + "prover/src/utils/process.ts", + "prover/src/verified_requests/**/*.ts", + "packages/types/src/utils/**/*.ts", + // This file is using snake_case function names + "packages/beacon-node/test/spec/bls/bls.ts" + ], "linter": { "rules": { - "complexity": { - // During tests we often need to use private/protected attributes, which is only possible with literal keys - "useLiteralKeys": "off" - }, - "suspicious": { - // During tests it's quicker to define variables with `let` without specifying types - "noImplicitAnyLet": "off" + "style": { + "useNamingConvention": { + "level": "off", + "options": {} + } } } } diff --git a/packages/api/src/utils/client/httpClient.ts b/packages/api/src/utils/client/httpClient.ts index 721a150f7fcd..33b93e3a9d41 100644 --- a/packages/api/src/utils/client/httpClient.ts +++ b/packages/api/src/utils/client/httpClient.ts @@ -196,6 +196,7 @@ export class HttpClient implements IHttpClient { this.logger?.debug("Requesting fallback URL", {routeId, baseUrl: printableUrl, score: this.urlsScore[i]}); } + // biome-ignore lint/style/useNamingConvention: Author preferred this format const i_ = i; // Keep local copy of i variable to index urlScore after requestWithBody() resolves const urlInit = this.urlsInits[i]; diff --git a/packages/api/src/utils/codecs.ts b/packages/api/src/utils/codecs.ts index db96daf0ce50..c075d8592a46 100644 --- a/packages/api/src/utils/codecs.ts +++ b/packages/api/src/utils/codecs.ts @@ -19,8 +19,11 @@ export type EmptyRequest = Record; export type EmptyResponseData = void; export type EmptyMeta = void; +// biome-ignore lint/suspicious/noExplicitAny: We can not use `unknown` type here export type AnyEndpoint = Endpoint; +// biome-ignore lint/suspicious/noExplicitAny: We can not use `unknown` type here export type EmptyRequestEndpoint = Endpoint; +// biome-ignore lint/suspicious/noExplicitAny: We can not use `unknown` type here export type EmptyResponseEndpoint = Endpoint; /** Shortcut for routes that have no params, query */ diff --git a/packages/api/src/utils/types.ts b/packages/api/src/utils/types.ts index abe2f358320d..aef18b47d940 100644 --- a/packages/api/src/utils/types.ts +++ b/packages/api/src/utils/types.ts @@ -6,7 +6,7 @@ import {WireFormat} from "./wireFormat.js"; export type HasOnlyOptionalProps = { [K in keyof T]-?: object extends Pick ? never : K; -} extends {[_ in keyof T]: never} +} extends {[K2 in keyof T]: never} ? true : false; diff --git a/packages/beacon-node/src/db/repositories/checkpointState.ts b/packages/beacon-node/src/db/repositories/checkpointState.ts index cb111a497f87..7bace3f3f3fc 100644 --- a/packages/beacon-node/src/db/repositories/checkpointState.ts +++ b/packages/beacon-node/src/db/repositories/checkpointState.ts @@ -11,9 +11,10 @@ import {Bucket, getBucketNameByValue} from "../buckets.js"; export class CheckpointStateRepository extends Repository { constructor(config: ChainForkConfig, db: Db) { // Pick some type but won't be used. Casted to any because no type can match `BeaconStateAllForks` - const type = ssz.phase0.BeaconState as any; + const type = ssz.phase0.BeaconState; const bucket = Bucket.allForks_checkpointState; - super(config, db, bucket, type, getBucketNameByValue(bucket)); + // biome-ignore lint/suspicious/noExplicitAny: The type is complex to specify a proper override + super(config, db, bucket, type as any, getBucketNameByValue(bucket)); } getId(): Uint8Array { diff --git a/packages/beacon-node/src/network/discv5/utils.ts b/packages/beacon-node/src/network/discv5/utils.ts index e5707b483281..699675dfbe38 100644 --- a/packages/beacon-node/src/network/discv5/utils.ts +++ b/packages/beacon-node/src/network/discv5/utils.ts @@ -5,6 +5,7 @@ import {ENRKey} from "../metadata.js"; export enum ENRRelevance { no_tcp = "no_tcp", no_eth2 = "no_eth2", + // biome-ignore lint/style/useNamingConvention: Need to use the this name for network convention unknown_forkDigest = "unknown_forkDigest", relevant = "relevant", } diff --git a/packages/beacon-node/src/util/kzg.ts b/packages/beacon-node/src/util/kzg.ts index e89d4e0dfc99..42224d1ebaa6 100644 --- a/packages/beacon-node/src/util/kzg.ts +++ b/packages/beacon-node/src/util/kzg.ts @@ -86,7 +86,9 @@ export function loadEthereumTrustedSetup(mode: TrustedFileMode = TrustedFileMode } export interface TrustedSetupJSON { + // biome-ignore lint/style/useNamingConvention: Need to be consistent with KZG pattern setup_G1: string[]; + // biome-ignore lint/style/useNamingConvention: Need to be consistent with KZG pattern setup_G2: string[]; } @@ -120,7 +122,9 @@ export function trustedSetupJsonToBin(data: TrustedSetupJSON): TrustedSetupBin { export function trustedSetupBinToJson(bytes: TrustedSetupBin): TrustedSetupJSON { const data: TrustedSetupJSON = { + // biome-ignore lint/style/useNamingConvention: Need to be consistent with KZG pattern setup_G1: [], + // biome-ignore lint/style/useNamingConvention: Need to be consistent with KZG pattern setup_G2: [], }; diff --git a/packages/beacon-node/test/e2e/eth1/jsonRpcHttpClient.test.ts b/packages/beacon-node/test/e2e/eth1/jsonRpcHttpClient.test.ts index bc41b5f1c546..91131a89f379 100644 --- a/packages/beacon-node/test/e2e/eth1/jsonRpcHttpClient.test.ts +++ b/packages/beacon-node/test/e2e/eth1/jsonRpcHttpClient.test.ts @@ -41,13 +41,13 @@ describe("eth1 / jsonRpcHttpClient", () => { { id: "Bad port", url: `http://localhost:${port + 1}`, - requestListener: (req, res) => res.end(), + requestListener: (_req, res) => res.end(), error: "", errorCode: "ECONNREFUSED", }, { id: "Not a JSON RPC endpoint", - requestListener: (req, res) => { + requestListener: (_req, res) => { res.setHeader("Content-Type", "text/html"); res.end(""); }, @@ -55,7 +55,7 @@ describe("eth1 / jsonRpcHttpClient", () => { }, { id: "Endpoint returns HTTP error", - requestListener: (req, res) => { + requestListener: (_req, res) => { res.statusCode = 404; res.end(); }, @@ -63,7 +63,7 @@ describe("eth1 / jsonRpcHttpClient", () => { }, { id: "RPC payload with error", - requestListener: (req, res) => { + requestListener: (_req, res) => { res.setHeader("Content-Type", "application/json"); res.end(JSON.stringify({jsonrpc: "2.0", id: 83, error: noMethodError})); }, @@ -71,7 +71,7 @@ describe("eth1 / jsonRpcHttpClient", () => { }, { id: "RPC payload with non-spec error: error has no message", - requestListener: (req, res) => { + requestListener: (_req, res) => { res.setHeader("Content-Type", "application/json"); res.end(JSON.stringify({jsonrpc: "2.0", id: 83, error: {code: noMethodError.code}})); }, @@ -79,7 +79,7 @@ describe("eth1 / jsonRpcHttpClient", () => { }, { id: "RPC payload with non-spec error: error is a string", - requestListener: (req, res) => { + requestListener: (_req, res) => { res.setHeader("Content-Type", "application/json"); res.end(JSON.stringify({jsonrpc: "2.0", id: 83, error: notInSpecError})); }, @@ -87,7 +87,7 @@ describe("eth1 / jsonRpcHttpClient", () => { }, { id: "RPC payload with no result", - requestListener: (req, res) => { + requestListener: (_req, res) => { res.setHeader("Content-Type", "application/json"); res.end(JSON.stringify({jsonrpc: "2.0", id: 83})); }, @@ -226,7 +226,7 @@ describe("eth1 / jsonRpcHttpClient - with retries", () => { it("should retry 404", async () => { let requestCount = 0; - const server = http.createServer((req, res) => { + const server = http.createServer((_req, res) => { requestCount++; res.statusCode = 404; res.end(); @@ -317,7 +317,7 @@ describe("eth1 / jsonRpcHttpClient - with retries", () => { it("should not retry payload error", async () => { let requestCount = 0; - const server = http.createServer((req, res) => { + const server = http.createServer((_req, res) => { requestCount++; res.setHeader("Content-Type", "application/json"); res.end(JSON.stringify({jsonrpc: "2.0", id: 83, error: noMethodError})); diff --git a/packages/beacon-node/test/spec/general/bls.ts b/packages/beacon-node/test/spec/general/bls.ts index dfebe945b069..128b5b4f5613 100644 --- a/packages/beacon-node/test/spec/general/bls.ts +++ b/packages/beacon-node/test/spec/general/bls.ts @@ -5,8 +5,8 @@ import { Signature, aggregateSerializedPublicKeys, aggregateSignatures, - aggregateVerify, - fastAggregateVerify, + aggregateVerify as BLSAggregateVerify, + fastAggregateVerify as BLSFastAggregateVerify, verify as _verify, } from "@chainsafe/blst"; import {InputType} from "@lodestar/spec-test-util"; @@ -14,10 +14,10 @@ import {TestRunnerFn} from "../utils/types.js"; const testFnByType: Record any> = { aggregate, - aggregate_verify, - eth_aggregate_pubkeys, - eth_fast_aggregate_verify, - fast_aggregate_verify, + aggregate_verify: aggregateVerify, + eth_aggregate_pubkeys: ethAggregatePubkeys, + eth_fast_aggregate_verify: ethFastAggregateVerify, + fast_aggregate_verify: fastAggregateVerify, sign, verify, }; @@ -86,10 +86,10 @@ function aggregate(input: string[]): string | null { * output: bool -- true (VALID) or false (INVALID) * ``` */ -function aggregate_verify(input: {pubkeys: string[]; messages: string[]; signature: string}): boolean { +function aggregateVerify(input: {pubkeys: string[]; messages: string[]; signature: string}): boolean { const {pubkeys, messages, signature} = input; try { - return aggregateVerify( + return BLSAggregateVerify( messages.map(fromHexString), pubkeys.map((pk) => PublicKey.fromHex(pk)), Signature.fromHex(signature) @@ -105,7 +105,7 @@ function aggregate_verify(input: {pubkeys: string[]; messages: string[]; signatu * output: BLS Signature -- expected output, single BLS signature or empty. * ``` */ -function eth_aggregate_pubkeys(input: string[]): string | null { +function ethAggregatePubkeys(input: string[]): string | null { // Don't add this checks in the source as beacon nodes check the pubkeys for inf when onboarding for (const pk of input) { if (pk === G1_POINT_AT_INFINITY) return null; @@ -127,7 +127,7 @@ function eth_aggregate_pubkeys(input: string[]): string | null { * output: bool -- true (VALID) or false (INVALID) * ``` */ -function eth_fast_aggregate_verify(input: {pubkeys: string[]; message: string; signature: string}): boolean { +function ethFastAggregateVerify(input: {pubkeys: string[]; message: string; signature: string}): boolean { const {pubkeys, message, signature} = input; if (pubkeys.length === 0 && signature === G2_POINT_AT_INFINITY) { @@ -140,7 +140,7 @@ function eth_fast_aggregate_verify(input: {pubkeys: string[]; message: string; s } try { - return fastAggregateVerify( + return BLSFastAggregateVerify( fromHexString(message), pubkeys.map((hex) => PublicKey.fromHex(hex)), Signature.fromHex(signature) @@ -159,10 +159,10 @@ function eth_fast_aggregate_verify(input: {pubkeys: string[]; message: string; s * output: bool -- true (VALID) or false (INVALID) * ``` */ -function fast_aggregate_verify(input: {pubkeys: string[]; message: string; signature: string}): boolean | null { +function fastAggregateVerify(input: {pubkeys: string[]; message: string; signature: string}): boolean | null { const {pubkeys, message, signature} = input; try { - return fastAggregateVerify( + return BLSFastAggregateVerify( fromHexString(message), pubkeys.map((hex) => PublicKey.fromHex(hex, true)), Signature.fromHex(signature, true) diff --git a/packages/beacon-node/test/spec/presets/operations.test.ts b/packages/beacon-node/test/spec/presets/operations.test.ts index 1ab8c19da5ef..b6a479ee3794 100644 --- a/packages/beacon-node/test/spec/presets/operations.test.ts +++ b/packages/beacon-node/test/spec/presets/operations.test.ts @@ -21,7 +21,7 @@ import {ethereumConsensusSpecsTests} from "../specTestVersioning.js"; import {specTestIterator} from "../utils/specTestIterator.js"; // Define above to re-use in sync_aggregate and sync_aggregate_random -const sync_aggregate: BlockProcessFn = ( +const syncAggregate: BlockProcessFn = ( state, testCase: {sync_aggregate: altair.SyncAggregate} ) => { @@ -60,8 +60,8 @@ const operationFns: Record> = blockFns.processProposerSlashing(fork, state, testCase.proposer_slashing); }, - sync_aggregate, - sync_aggregate_random: sync_aggregate, + sync_aggregate: syncAggregate, + sync_aggregate_random: syncAggregate, voluntary_exit: (state, testCase: {voluntary_exit: phase0.SignedVoluntaryExit}) => { const fork = state.config.getForkSeq(state.slot); diff --git a/packages/beacon-node/test/spec/utils/runValidSszTest.ts b/packages/beacon-node/test/spec/utils/runValidSszTest.ts index 748a7770b19c..a8d3060af08d 100644 --- a/packages/beacon-node/test/spec/utils/runValidSszTest.ts +++ b/packages/beacon-node/test/spec/utils/runValidSszTest.ts @@ -83,7 +83,6 @@ export function runValidSszTest(type: Type, testData: ValidTestCaseData if (type.isBasic) { console.log("ROOTS Basic", toHexString(type.serialize(testDataValue))); } else { - // biome-ignore lint/complexity/useLiteralKeys: The `getRoots` is a protected attribute const roots = (type as CompositeType)["getRoots"](testDataValue); console.log( "ROOTS Composite", diff --git a/packages/beacon-node/test/utils/runEl.ts b/packages/beacon-node/test/utils/runEl.ts index 8a2da7104510..9a407f91d414 100644 --- a/packages/beacon-node/test/utils/runEl.ts +++ b/packages/beacon-node/test/utils/runEl.ts @@ -179,8 +179,8 @@ async function startELProcess(args: { return tearDownCallBack; } -async function waitForELOffline(ENGINE_PORT: string): Promise { - const port = parseInt(ENGINE_PORT); +async function waitForELOffline(enginePort: string): Promise { + const port = parseInt(enginePort); for (let i = 0; i < 60; i++) { console.log("Waiting for EL offline..."); diff --git a/packages/logger/test/unit/node.node.test.ts b/packages/logger/test/unit/node.node.test.ts index da1245fa37f1..b7c882a1e3bd 100644 --- a/packages/logger/test/unit/node.node.test.ts +++ b/packages/logger/test/unit/node.node.test.ts @@ -6,6 +6,7 @@ import {formatsTestCases} from "../fixtures/loggerFormats.js"; // Node.js maps `process.stdout` to `console._stdout`. // spy does not work on `process.stdout` directly. +// biome-ignore lint/style/useNamingConvention: Need property name _stdout for testing type TestConsole = typeof console & {_stdout: {write: Mock}}; describe("node logger", () => { diff --git a/packages/logger/test/unit/winston.node.test.ts b/packages/logger/test/unit/winston.node.test.ts index 6763cc667afd..e4cfca2b041a 100644 --- a/packages/logger/test/unit/winston.node.test.ts +++ b/packages/logger/test/unit/winston.node.test.ts @@ -8,6 +8,7 @@ import {readFileWhenExists} from "../utils/files.js"; // Node.js maps `process.stdout` to `console._stdout`. // spy does not work on `process.stdout` directly. +// biome-ignore lint/style/useNamingConvention: Need property name _stdout for testing type TestConsole = typeof console & {_stdout: {write: Mock}}; describe("winston logger", () => { diff --git a/packages/state-transition/test/perf/block/util.ts b/packages/state-transition/test/perf/block/util.ts index 441c67deb198..baa86dcac6a5 100644 --- a/packages/state-transition/test/perf/block/util.ts +++ b/packages/state-transition/test/perf/block/util.ts @@ -206,9 +206,7 @@ function getDeposits(preState: CachedBeaconStateAllForks, count: number): phase0 // Fill depositRootViewDU up to depositCount // Instead of actually filling it, just mutate the length to allow .set() - // biome-ignore lint/complexity/useLiteralKeys: It is a protected attribute depositRootViewDU["_length"] = depositCount + count; - // biome-ignore lint/complexity/useLiteralKeys: It is a protected attribute depositRootViewDU["dirtyLength"] = true; for (let i = 0; i < count; i++) { diff --git a/packages/types/src/phase0/validator.ts b/packages/types/src/phase0/validator.ts index a6ec0fb18103..aaff2deaeb27 100644 --- a/packages/types/src/phase0/validator.ts +++ b/packages/types/src/phase0/validator.ts @@ -34,6 +34,7 @@ export class ValidatorNodeStructType extends ContainerNodeStructType