Skip to content

Commit

Permalink
chore: avoid fromHexString (#7080)
Browse files Browse the repository at this point in the history
* fix: fromHexString() to fromHex()

* fix: throw error for NodeJS fromHex() if malformed string

* fix: correct hex value in sim test
  • Loading branch information
twoeths committed Sep 13, 2024
1 parent 9f4bf50 commit d6e8c05
Show file tree
Hide file tree
Showing 40 changed files with 111 additions and 119 deletions.
8 changes: 4 additions & 4 deletions packages/api/src/beacon/routes/proof.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-disable @typescript-eslint/naming-convention */
import {CompactMultiProof, ProofType} from "@chainsafe/persistent-merkle-tree";
import {ByteListType, ContainerType, fromHexString} from "@chainsafe/ssz";
import {toHex} from "@lodestar/utils";
import {ByteListType, ContainerType} from "@chainsafe/ssz";
import {fromHex, toHex} from "@lodestar/utils";
import {ChainForkConfig} from "@lodestar/config";
import {ssz} from "@lodestar/types";
import {Endpoint, RouteDefinitions, Schema} from "../../utils/index.js";
Expand Down Expand Up @@ -47,7 +47,7 @@ export function getDefinitions(_config: ChainForkConfig): RouteDefinitions<Endpo
method: "GET",
req: {
writeReq: ({stateId, descriptor}) => ({params: {state_id: stateId}, query: {format: toHex(descriptor)}}),
parseReq: ({params, query}) => ({stateId: params.state_id, descriptor: fromHexString(query.format)}),
parseReq: ({params, query}) => ({stateId: params.state_id, descriptor: fromHex(query.format)}),
schema: {params: {state_id: Schema.StringRequired}, query: {format: Schema.StringRequired}},
},
resp: {
Expand All @@ -65,7 +65,7 @@ export function getDefinitions(_config: ChainForkConfig): RouteDefinitions<Endpo
method: "GET",
req: {
writeReq: ({blockId, descriptor}) => ({params: {block_id: blockId}, query: {format: toHex(descriptor)}}),
parseReq: ({params, query}) => ({blockId: params.block_id, descriptor: fromHexString(query.format)}),
parseReq: ({params, query}) => ({blockId: params.block_id, descriptor: fromHex(query.format)}),
schema: {params: {block_id: Schema.StringRequired}, query: {format: Schema.StringRequired}},
},
resp: {
Expand Down
16 changes: 8 additions & 8 deletions packages/api/src/beacon/routes/validator.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint-disable @typescript-eslint/naming-convention */
import {ContainerType, fromHexString, Type, ValueOf} from "@chainsafe/ssz";
import {ContainerType, Type, ValueOf} from "@chainsafe/ssz";
import {ChainForkConfig} from "@lodestar/config";
import {isForkBlobs, isForkPostElectra} from "@lodestar/params";
import {
Expand All @@ -20,7 +20,7 @@ import {
Attestation,
sszTypesFor,
} from "@lodestar/types";
import {toHex, toRootHex} from "@lodestar/utils";
import {fromHex, toHex, toRootHex} from "@lodestar/utils";
import {Endpoint, RouteDefinitions, Schema} from "../../utils/index.js";
import {fromGraffitiHex, toBoolean, toGraffitiHex} from "../../utils/serdes.js";
import {getExecutionForkTypes, toForkName} from "../../utils/fork.js";
Expand Down Expand Up @@ -633,7 +633,7 @@ export function getDefinitions(config: ChainForkConfig): RouteDefinitions<Endpoi
}),
parseReq: ({params, query}) => ({
slot: params.slot,
randaoReveal: fromHexString(query.randao_reveal),
randaoReveal: fromHex(query.randao_reveal),
graffiti: fromGraffitiHex(query.graffiti),
feeRecipient: query.fee_recipient,
builderSelection: query.builder_selection as BuilderSelection,
Expand Down Expand Up @@ -687,7 +687,7 @@ export function getDefinitions(config: ChainForkConfig): RouteDefinitions<Endpoi
}),
parseReq: ({params, query}) => ({
slot: params.slot,
randaoReveal: fromHexString(query.randao_reveal),
randaoReveal: fromHex(query.randao_reveal),
graffiti: fromGraffitiHex(query.graffiti),
skipRandaoVerification: parseSkipRandaoVerification(query.skip_randao_verification),
feeRecipient: query.fee_recipient,
Expand Down Expand Up @@ -770,7 +770,7 @@ export function getDefinitions(config: ChainForkConfig): RouteDefinitions<Endpoi
}),
parseReq: ({params, query}) => ({
slot: params.slot,
randaoReveal: fromHexString(query.randao_reveal),
randaoReveal: fromHex(query.randao_reveal),
graffiti: fromGraffitiHex(query.graffiti),
}),
schema: {
Expand Down Expand Up @@ -811,7 +811,7 @@ export function getDefinitions(config: ChainForkConfig): RouteDefinitions<Endpoi
parseReq: ({query}) => ({
slot: query.slot,
subcommitteeIndex: query.subcommittee_index,
beaconBlockRoot: fromHexString(query.beacon_block_root),
beaconBlockRoot: fromHex(query.beacon_block_root),
}),
schema: {
query: {
Expand All @@ -834,7 +834,7 @@ export function getDefinitions(config: ChainForkConfig): RouteDefinitions<Endpoi
query: {attestation_data_root: toRootHex(attestationDataRoot), slot},
}),
parseReq: ({query}) => ({
attestationDataRoot: fromHexString(query.attestation_data_root),
attestationDataRoot: fromHex(query.attestation_data_root),
slot: query.slot,
}),
schema: {
Expand All @@ -857,7 +857,7 @@ export function getDefinitions(config: ChainForkConfig): RouteDefinitions<Endpoi
query: {attestation_data_root: toHex(attestationDataRoot), slot, committee_index: committeeIndex},
}),
parseReq: ({query}) => ({
attestationDataRoot: fromHexString(query.attestation_data_root),
attestationDataRoot: fromHex(query.attestation_data_root),
slot: query.slot,
committeeIndex: query.committee_index,
}),
Expand Down
7 changes: 3 additions & 4 deletions packages/api/src/builder/routes.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/* eslint-disable @typescript-eslint/naming-convention */
import {fromHexString} from "@chainsafe/ssz";
import {
ssz,
bellatrix,
Expand All @@ -13,7 +12,7 @@ import {
} from "@lodestar/types";
import {ForkName, isForkBlobs} from "@lodestar/params";
import {ChainForkConfig} from "@lodestar/config";
import {toPubkeyHex, toRootHex} from "@lodestar/utils";
import {fromHex, toPubkeyHex, toRootHex} from "@lodestar/utils";

import {Endpoint, RouteDefinitions, Schema} from "../utils/index.js";
import {MetaHeader, VersionCodec, VersionMeta} from "../utils/metadata.js";
Expand Down Expand Up @@ -110,8 +109,8 @@ export function getDefinitions(config: ChainForkConfig): RouteDefinitions<Endpoi
}),
parseReq: ({params}) => ({
slot: params.slot,
parentHash: fromHexString(params.parent_hash),
proposerPubkey: fromHexString(params.pubkey),
parentHash: fromHex(params.parent_hash),
proposerPubkey: fromHex(params.pubkey),
}),
schema: {
params: {slot: Schema.UintRequired, parent_hash: Schema.StringRequired, pubkey: Schema.StringRequired},
Expand Down
6 changes: 3 additions & 3 deletions packages/api/src/utils/serdes.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {fromHexString, JsonPath} from "@chainsafe/ssz";
import {toHex} from "@lodestar/utils";
import {JsonPath} from "@chainsafe/ssz";
import {fromHex, toHex} from "@lodestar/utils";

/**
* Serialize proof path to JSON.
Expand Down Expand Up @@ -103,7 +103,7 @@ export function fromGraffitiHex(hex?: string): string | undefined {
return undefined;
}
try {
return new TextDecoder("utf8").decode(fromHexString(hex));
return new TextDecoder("utf8").decode(fromHex(hex));
} catch {
// allow malformed graffiti hex string
return hex;
Expand Down
9 changes: 4 additions & 5 deletions packages/beacon-node/src/chain/archiver/archiveBlocks.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import {fromHexString} from "@chainsafe/ssz";
import {Epoch, Slot, RootHex} from "@lodestar/types";
import {IForkChoice} from "@lodestar/fork-choice";
import {Logger, toRootHex} from "@lodestar/utils";
import {Logger, fromHex, toRootHex} from "@lodestar/utils";
import {ForkSeq, SLOTS_PER_EPOCH} from "@lodestar/params";
import {computeEpochAtSlot, computeStartSlotAtEpoch} from "@lodestar/state-transition";
import {KeyValue} from "@lodestar/db";
Expand Down Expand Up @@ -48,7 +47,7 @@ export async function archiveBlocks(

const finalizedCanonicalBlockRoots: BlockRootSlot[] = finalizedCanonicalBlocks.map((block) => ({
slot: block.slot,
root: fromHexString(block.blockRoot),
root: fromHex(block.blockRoot),
}));

if (finalizedCanonicalBlockRoots.length > 0) {
Expand All @@ -68,7 +67,7 @@ export async function archiveBlocks(
// deleteNonCanonicalBlocks
// loop through forkchoice single time

const nonCanonicalBlockRoots = finalizedNonCanonicalBlocks.map((summary) => fromHexString(summary.blockRoot));
const nonCanonicalBlockRoots = finalizedNonCanonicalBlocks.map((summary) => fromHex(summary.blockRoot));
if (nonCanonicalBlockRoots.length > 0) {
await db.block.batchDelete(nonCanonicalBlockRoots);
logger.verbose("Deleted non canonical blocks from hot DB", {
Expand Down Expand Up @@ -144,7 +143,7 @@ async function migrateBlocksFromHotToColdDb(db: IBeaconDb, blocks: BlockRootSlot
value: blockBuffer,
slot: block.slot,
blockRoot: block.root,
// TODO: Benchmark if faster to slice Buffer or fromHexString()
// TODO: Benchmark if faster to slice Buffer or fromHex()
parentRoot: getParentRootFromSignedBlock(blockBuffer),
};
})
Expand Down
16 changes: 8 additions & 8 deletions packages/beacon-node/src/chain/chain.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import path from "node:path";
import {CompositeTypeAny, fromHexString, TreeView, Type} from "@chainsafe/ssz";
import {CompositeTypeAny, TreeView, Type} from "@chainsafe/ssz";
import {
BeaconStateAllForks,
CachedBeaconStateAllForks,
Expand Down Expand Up @@ -35,7 +35,7 @@ import {
} from "@lodestar/types";
import {CheckpointWithHex, ExecutionStatus, IForkChoice, ProtoBlock, UpdateHeadOpt} from "@lodestar/fork-choice";
import {ProcessShutdownCallback} from "@lodestar/validator";
import {Logger, gweiToWei, isErrorAborted, pruneSetToMax, sleep, toRootHex} from "@lodestar/utils";
import {Logger, fromHex, gweiToWei, isErrorAborted, pruneSetToMax, sleep, toRootHex} from "@lodestar/utils";
import {ForkSeq, GENESIS_SLOT, SLOTS_PER_EPOCH} from "@lodestar/params";

import {GENESIS_EPOCH, ZERO_HASH} from "../constants/index.js";
Expand Down Expand Up @@ -521,7 +521,7 @@ export class BeaconChain implements IBeaconChain {
};
}

const data = await this.db.stateArchive.getByRoot(fromHexString(stateRoot));
const data = await this.db.stateArchive.getByRoot(fromHex(stateRoot));
return data && {state: data, executionOptimistic: false, finalized: true};
}

Expand Down Expand Up @@ -568,7 +568,7 @@ export class BeaconChain implements IBeaconChain {
// Unfinalized slot, attempt to find in fork-choice
const block = this.forkChoice.getCanonicalBlockAtSlot(slot);
if (block) {
const data = await this.db.block.get(fromHexString(block.blockRoot));
const data = await this.db.block.get(fromHex(block.blockRoot));
if (data) {
return {block: data, executionOptimistic: isOptimisticBlock(block), finalized: false};
}
Expand All @@ -587,15 +587,15 @@ export class BeaconChain implements IBeaconChain {
): Promise<{block: SignedBeaconBlock; executionOptimistic: boolean; finalized: boolean} | null> {
const block = this.forkChoice.getBlockHex(root);
if (block) {
const data = await this.db.block.get(fromHexString(root));
const data = await this.db.block.get(fromHex(root));
if (data) {
return {block: data, executionOptimistic: isOptimisticBlock(block), finalized: false};
}
// If block is not found in hot db, try cold db since there could be an archive cycle happening
// TODO: Add a lock to the archiver to have deterministic behavior on where are blocks
}

const data = await this.db.blockArchive.getByRoot(fromHexString(root));
const data = await this.db.blockArchive.getByRoot(fromHex(root));
return data && {block: data, executionOptimistic: false, finalized: true};
}

Expand Down Expand Up @@ -768,7 +768,7 @@ export class BeaconChain implements IBeaconChain {
finalizedRoot: finalizedCheckpoint.epoch === GENESIS_EPOCH ? ZERO_HASH : finalizedCheckpoint.root,
finalizedEpoch: finalizedCheckpoint.epoch,
// TODO: PERFORMANCE: Memoize to prevent re-computing every time
headRoot: fromHexString(head.blockRoot),
headRoot: fromHex(head.blockRoot),
headSlot: head.slot,
};
}
Expand Down Expand Up @@ -1120,7 +1120,7 @@ export class BeaconChain implements IBeaconChain {
// TODO: Improve using regen here
const {blockRoot, stateRoot, slot} = this.forkChoice.getHead();
const headState = this.regen.getStateSync(stateRoot);
const headBlock = await this.db.block.get(fromHexString(blockRoot));
const headBlock = await this.db.block.get(fromHex(blockRoot));
if (headBlock == null) {
throw Error(`Head block ${slot} ${headBlock} is not available in database`);
}
Expand Down
5 changes: 2 additions & 3 deletions packages/beacon-node/src/chain/opPools/opPool.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import {fromHexString} from "@chainsafe/ssz";
import {
CachedBeaconStateAllForks,
computeEpochAtSlot,
Expand All @@ -16,7 +15,7 @@ import {
ForkSeq,
MAX_ATTESTER_SLASHINGS_ELECTRA,
} from "@lodestar/params";
import {toHex, toRootHex} from "@lodestar/utils";
import {fromHex, toHex, toRootHex} from "@lodestar/utils";
import {Epoch, phase0, capella, ssz, ValidatorIndex, SignedBeaconBlock, AttesterSlashing} from "@lodestar/types";
import {IBeaconDb} from "../../db/index.js";
import {SignedBLSToExecutionChangeVersioned} from "../../util/types.js";
Expand Down Expand Up @@ -85,7 +84,7 @@ export class OpPool {
persistDiff(
db.attesterSlashing,
Array.from(this.attesterSlashings.entries()).map(([key, value]) => ({
key: fromHexString(key),
key: fromHex(key),
value: value.attesterSlashing,
})),
toHex
Expand Down
5 changes: 2 additions & 3 deletions packages/beacon-node/src/chain/regen/regen.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import {fromHexString} from "@chainsafe/ssz";
import {phase0, Slot, RootHex, BeaconBlock, SignedBeaconBlock} from "@lodestar/types";
import {
CachedBeaconStateAllForks,
Expand All @@ -11,7 +10,7 @@ import {
StateHashTreeRootSource,
} from "@lodestar/state-transition";
import {IForkChoice, ProtoBlock} from "@lodestar/fork-choice";
import {Logger, toRootHex} from "@lodestar/utils";
import {Logger, fromHex, toRootHex} from "@lodestar/utils";
import {SLOTS_PER_EPOCH} from "@lodestar/params";
import {ChainForkConfig} from "@lodestar/config";
import {Metrics} from "../../metrics/index.js";
Expand Down Expand Up @@ -216,7 +215,7 @@ export class StateRegenerator implements IStateRegeneratorInternal {
const protoBlocksAsc = blocksToReplay.reverse();
for (const [i, protoBlock] of protoBlocksAsc.entries()) {
replaySlots[i] = protoBlock.slot;
blockPromises[i] = this.modules.db.block.get(fromHexString(protoBlock.blockRoot));
blockPromises[i] = this.modules.db.block.get(fromHex(protoBlock.blockRoot));
}

const logCtx = {stateRoot, replaySlots: replaySlots.join(",")};
Expand Down
5 changes: 2 additions & 3 deletions packages/beacon-node/src/chain/stateCache/datastore/file.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import path from "node:path";
import {fromHexString} from "@chainsafe/ssz";
import {phase0, ssz} from "@lodestar/types";
import {toHex} from "@lodestar/utils";
import {fromHex, toHex} from "@lodestar/utils";
import {ensureDir, readFile, readFileNames, removeFile, writeIfNotExist} from "../../../util/file.js";
import {CPStateDatastore, DatastoreKey} from "./types.js";

Expand Down Expand Up @@ -48,6 +47,6 @@ export class FileCPStateDatastore implements CPStateDatastore {
const fileNames = await readFileNames(this.folderPath);
return fileNames
.filter((fileName) => fileName.startsWith("0x") && fileName.length === CHECKPOINT_FILE_NAME_LENGTH)
.map((fileName) => fromHexString(fileName));
.map((fileName) => fromHex(fileName));
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import {fromHexString} from "@chainsafe/ssz";
import {phase0, Epoch, RootHex} from "@lodestar/types";
import {CachedBeaconStateAllForks, computeStartSlotAtEpoch, getBlockRootAtSlot} from "@lodestar/state-transition";
import {Logger, MapDef, sleep, toHex, toRootHex} from "@lodestar/utils";
import {Logger, MapDef, fromHex, sleep, toHex, toRootHex} from "@lodestar/utils";
import {routes} from "@lodestar/api";
import {loadCachedBeaconState} from "@lodestar/state-transition";
import {INTERVALS_PER_SLOT} from "@lodestar/params";
Expand Down Expand Up @@ -657,7 +656,7 @@ export class PersistentCheckpointStateCache implements CheckpointStateCache {
let persistCount = 0;
const epochBoundarySlot = computeStartSlotAtEpoch(epoch);
const epochBoundaryRoot =
epochBoundarySlot === state.slot ? fromHexString(blockRootHex) : getBlockRootAtSlot(state, epochBoundarySlot);
epochBoundarySlot === state.slot ? fromHex(blockRootHex) : getBlockRootAtSlot(state, epochBoundarySlot);
const epochBoundaryHex = toRootHex(epochBoundaryRoot);
const prevEpochRoot = toRootHex(getBlockRootAtSlot(state, epochBoundarySlot - 1));

Expand Down Expand Up @@ -698,7 +697,7 @@ export class PersistentCheckpointStateCache implements CheckpointStateCache {
} else {
// persist and do not update epochIndex
this.metrics?.statePersistSecFromSlot.observe(this.clock?.secFromSlot(this.clock?.currentSlot ?? 0) ?? 0);
const cpPersist = {epoch: epoch, root: fromHexString(rootHex)};
const cpPersist = {epoch: epoch, root: fromHex(rootHex)};
// It's not sustainable to allocate ~240MB for each state every epoch, so we use buffer pool to reuse the memory.
// As monitored on holesky as of Jan 2024:
// - This does not increase heap allocation while gc time is the same
Expand Down
4 changes: 2 additions & 2 deletions packages/beacon-node/src/eth1/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {fromHexString} from "@chainsafe/ssz";
import {CachedBeaconStateAllForks} from "@lodestar/state-transition";
import {Root} from "@lodestar/types";
import {fromHex} from "@lodestar/utils";
import {IEth1ForBlockProduction, Eth1DataAndDeposits, IEth1Provider, PowMergeBlock, TDProgress} from "./interface.js";
import {Eth1DepositDataTracker, Eth1DepositDataTrackerModules} from "./eth1DepositDataTracker.js";
import {Eth1MergeBlockTracker, Eth1MergeBlockTrackerModules} from "./eth1MergeBlockTracker.js";
Expand Down Expand Up @@ -92,7 +92,7 @@ export class Eth1ForBlockProduction implements IEth1ForBlockProduction {

async getTerminalPowBlock(): Promise<Root | null> {
const block = await this.eth1MergeBlockTracker.getTerminalPowBlock();
return block && fromHexString(block.blockHash);
return block && fromHex(block.blockHash);
}

getPowBlock(powBlockHash: string): Promise<PowMergeBlock | null> {
Expand Down
5 changes: 2 additions & 3 deletions packages/beacon-node/src/eth1/provider/utils.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import {fromHexString} from "@chainsafe/ssz";
import {RootHex} from "@lodestar/types";
import {bytesToBigInt, bigIntToBytes, toHex} from "@lodestar/utils";
import {bytesToBigInt, bigIntToBytes, toHex, fromHex} from "@lodestar/utils";
import {ErrorParseJson} from "./jsonRpcHttpClient.js";

/** QUANTITY as defined in ethereum execution layer JSON RPC https://eth.wiki/json-rpc/API */
Expand Down Expand Up @@ -108,7 +107,7 @@ export function bytesToData(bytes: Uint8Array): DATA {
*/
export function dataToBytes(hex: DATA, fixedLength: number | null): Uint8Array {
try {
const bytes = fromHexString(hex);
const bytes = fromHex(hex);
if (fixedLength != null && bytes.length !== fixedLength) {
throw Error(`Wrong data length ${bytes.length} expected ${fixedLength}`);
}
Expand Down
10 changes: 5 additions & 5 deletions packages/beacon-node/src/eth1/utils/depositContract.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {Interface} from "@ethersproject/abi";
import {fromHexString} from "@chainsafe/ssz";
import {phase0, ssz} from "@lodestar/types";
import {fromHex} from "@lodestar/utils";

const depositEventFragment =
"event DepositEvent(bytes pubkey, bytes withdrawal_credentials, bytes amount, bytes signature, bytes index)";
Expand All @@ -23,15 +23,15 @@ export function parseDepositLog(log: {blockNumber: number; data: string; topics:
blockNumber: log.blockNumber,
index: parseHexNumLittleEndian(values.index),
depositData: {
pubkey: fromHexString(values.pubkey),
withdrawalCredentials: fromHexString(values.withdrawal_credentials),
pubkey: fromHex(values.pubkey),
withdrawalCredentials: fromHex(values.withdrawal_credentials),
amount: parseHexNumLittleEndian(values.amount),
signature: fromHexString(values.signature),
signature: fromHex(values.signature),
},
};
}

function parseHexNumLittleEndian(hex: string): number {
// Can't use parseInt() because amount is a hex string in little endian
return ssz.UintNum64.deserialize(fromHexString(hex));
return ssz.UintNum64.deserialize(fromHex(hex));
}
Loading

1 comment on commit d6e8c05

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Performance Alert ⚠️

Possible performance regression was detected for some benchmarks.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold.

Benchmark suite Current: d6e8c05 Previous: 9f4bf50 Ratio
getUint32 - manual 489.00 ns/op 162.00 ns/op 3.02
Full benchmark results
Benchmark suite Current: d6e8c05 Previous: 9f4bf50 Ratio
getPubkeys - index2pubkey - req 1000 vs - 250000 vc 2.3492 ms/op 1.9364 ms/op 1.21
getPubkeys - validatorsArr - req 1000 vs - 250000 vc 54.530 us/op 48.960 us/op 1.11
BLS verify - blst 980.96 us/op 805.45 us/op 1.22
BLS verifyMultipleSignatures 3 - blst 1.3224 ms/op 1.1810 ms/op 1.12
BLS verifyMultipleSignatures 8 - blst 2.2246 ms/op 1.6455 ms/op 1.35
BLS verifyMultipleSignatures 32 - blst 6.2633 ms/op 5.0024 ms/op 1.25
BLS verifyMultipleSignatures 64 - blst 10.263 ms/op 8.9849 ms/op 1.14
BLS verifyMultipleSignatures 128 - blst 20.931 ms/op 17.353 ms/op 1.21
BLS deserializing 10000 signatures 691.80 ms/op 669.27 ms/op 1.03
BLS deserializing 100000 signatures 6.9257 s/op 6.7720 s/op 1.02
BLS verifyMultipleSignatures - same message - 3 - blst 914.35 us/op 844.35 us/op 1.08
BLS verifyMultipleSignatures - same message - 8 - blst 1.1752 ms/op 979.42 us/op 1.20
BLS verifyMultipleSignatures - same message - 32 - blst 1.7094 ms/op 1.6479 ms/op 1.04
BLS verifyMultipleSignatures - same message - 64 - blst 2.5303 ms/op 2.6162 ms/op 0.97
BLS verifyMultipleSignatures - same message - 128 - blst 4.3086 ms/op 4.3060 ms/op 1.00
BLS aggregatePubkeys 32 - blst 19.276 us/op 19.646 us/op 0.98
BLS aggregatePubkeys 128 - blst 66.094 us/op 70.324 us/op 0.94
notSeenSlots=1 numMissedVotes=1 numBadVotes=10 77.159 ms/op 64.575 ms/op 1.19
notSeenSlots=1 numMissedVotes=0 numBadVotes=4 58.638 ms/op 48.076 ms/op 1.22
notSeenSlots=2 numMissedVotes=1 numBadVotes=10 30.586 ms/op 34.508 ms/op 0.89
getSlashingsAndExits - default max 109.16 us/op 93.530 us/op 1.17
getSlashingsAndExits - 2k 279.24 us/op 292.92 us/op 0.95
proposeBlockBody type=full, size=empty 5.0360 ms/op 5.8352 ms/op 0.86
isKnown best case - 1 super set check 734.00 ns/op 302.00 ns/op 2.43
isKnown normal case - 2 super set checks 686.00 ns/op 288.00 ns/op 2.38
isKnown worse case - 16 super set checks 713.00 ns/op 285.00 ns/op 2.50
InMemoryCheckpointStateCache - add get delete 4.7330 us/op 3.4050 us/op 1.39
updateUnfinalizedPubkeys - updating 10 pubkeys 946.36 us/op 826.53 us/op 1.14
updateUnfinalizedPubkeys - updating 100 pubkeys 2.6107 ms/op 2.4728 ms/op 1.06
updateUnfinalizedPubkeys - updating 1000 pubkeys 38.282 ms/op 52.359 ms/op 0.73
validate api signedAggregateAndProof - struct 1.9584 ms/op 1.3601 ms/op 1.44
validate gossip signedAggregateAndProof - struct 1.9696 ms/op 1.3440 ms/op 1.47
validate gossip attestation - vc 640000 998.86 us/op 863.10 us/op 1.16
batch validate gossip attestation - vc 640000 - chunk 32 119.34 us/op 129.50 us/op 0.92
batch validate gossip attestation - vc 640000 - chunk 64 103.14 us/op 116.68 us/op 0.88
batch validate gossip attestation - vc 640000 - chunk 128 94.414 us/op 103.25 us/op 0.91
batch validate gossip attestation - vc 640000 - chunk 256 94.792 us/op 100.30 us/op 0.95
pickEth1Vote - no votes 883.39 us/op 1.2305 ms/op 0.72
pickEth1Vote - max votes 4.4794 ms/op 5.6369 ms/op 0.79
pickEth1Vote - Eth1Data hashTreeRoot value x2048 10.213 ms/op 11.885 ms/op 0.86
pickEth1Vote - Eth1Data hashTreeRoot tree x2048 12.161 ms/op 15.789 ms/op 0.77
pickEth1Vote - Eth1Data fastSerialize value x2048 382.23 us/op 500.39 us/op 0.76
pickEth1Vote - Eth1Data fastSerialize tree x2048 1.9907 ms/op 2.5484 ms/op 0.78
bytes32 toHexString 596.00 ns/op 488.00 ns/op 1.22
bytes32 Buffer.toString(hex) 444.00 ns/op 262.00 ns/op 1.69
bytes32 Buffer.toString(hex) from Uint8Array 533.00 ns/op 387.00 ns/op 1.38
bytes32 Buffer.toString(hex) + 0x 450.00 ns/op 259.00 ns/op 1.74
Object access 1 prop 0.32500 ns/op 0.14100 ns/op 2.30
Map access 1 prop 0.32600 ns/op 0.13500 ns/op 2.41
Object get x1000 5.4620 ns/op 5.8810 ns/op 0.93
Map get x1000 5.9020 ns/op 6.4980 ns/op 0.91
Object set x1000 22.705 ns/op 33.336 ns/op 0.68
Map set x1000 20.152 ns/op 22.371 ns/op 0.90
Return object 10000 times 0.30270 ns/op 0.29300 ns/op 1.03
Throw Error 10000 times 2.7440 us/op 3.3526 us/op 0.82
toHex 115.98 ns/op 147.38 ns/op 0.79
Buffer.from 107.33 ns/op 143.59 ns/op 0.75
shared Buffer 72.009 ns/op 87.012 ns/op 0.83
fastMsgIdFn sha256 / 200 bytes 2.0440 us/op 2.2020 us/op 0.93
fastMsgIdFn h32 xxhash / 200 bytes 424.00 ns/op 236.00 ns/op 1.80
fastMsgIdFn h64 xxhash / 200 bytes 473.00 ns/op 286.00 ns/op 1.65
fastMsgIdFn sha256 / 1000 bytes 6.0280 us/op 7.6540 us/op 0.79
fastMsgIdFn h32 xxhash / 1000 bytes 561.00 ns/op 419.00 ns/op 1.34
fastMsgIdFn h64 xxhash / 1000 bytes 526.00 ns/op 360.00 ns/op 1.46
fastMsgIdFn sha256 / 10000 bytes 50.266 us/op 66.776 us/op 0.75
fastMsgIdFn h32 xxhash / 10000 bytes 1.8790 us/op 1.9630 us/op 0.96
fastMsgIdFn h64 xxhash / 10000 bytes 1.3250 us/op 1.3020 us/op 1.02
send data - 1000 256B messages 9.5344 ms/op 14.317 ms/op 0.67
send data - 1000 512B messages 12.993 ms/op 18.028 ms/op 0.72
send data - 1000 1024B messages 22.964 ms/op 27.366 ms/op 0.84
send data - 1000 1200B messages 14.024 ms/op 26.615 ms/op 0.53
send data - 1000 2048B messages 30.683 ms/op 33.174 ms/op 0.92
send data - 1000 4096B messages 28.933 ms/op 30.223 ms/op 0.96
send data - 1000 16384B messages 66.187 ms/op 69.440 ms/op 0.95
send data - 1000 65536B messages 242.76 ms/op 222.27 ms/op 1.09
enrSubnets - fastDeserialize 64 bits 1.2250 us/op 1.2410 us/op 0.99
enrSubnets - ssz BitVector 64 bits 537.00 ns/op 409.00 ns/op 1.31
enrSubnets - fastDeserialize 4 bits 367.00 ns/op 190.00 ns/op 1.93
enrSubnets - ssz BitVector 4 bits 589.00 ns/op 406.00 ns/op 1.45
prioritizePeers score -10:0 att 32-0.1 sync 2-0 155.43 us/op 136.18 us/op 1.14
prioritizePeers score 0:0 att 32-0.25 sync 2-0.25 147.70 us/op 171.88 us/op 0.86
prioritizePeers score 0:0 att 32-0.5 sync 2-0.5 251.36 us/op 280.94 us/op 0.89
prioritizePeers score 0:0 att 64-0.75 sync 4-0.75 458.38 us/op 491.44 us/op 0.93
prioritizePeers score 0:0 att 64-1 sync 4-1 690.04 us/op 644.37 us/op 1.07
array of 16000 items push then shift 1.2538 us/op 1.7049 us/op 0.74
LinkedList of 16000 items push then shift 7.5750 ns/op 7.9350 ns/op 0.95
array of 16000 items push then pop 116.36 ns/op 128.93 ns/op 0.90
LinkedList of 16000 items push then pop 6.2640 ns/op 7.6870 ns/op 0.81
array of 24000 items push then shift 1.8408 us/op 2.5203 us/op 0.73
LinkedList of 24000 items push then shift 7.0750 ns/op 8.2490 ns/op 0.86
array of 24000 items push then pop 120.42 ns/op 173.20 ns/op 0.70
LinkedList of 24000 items push then pop 6.9350 ns/op 7.6850 ns/op 0.90
intersect bitArray bitLen 8 5.6560 ns/op 6.6620 ns/op 0.85
intersect array and set length 8 45.049 ns/op 48.636 ns/op 0.93
intersect bitArray bitLen 128 26.893 ns/op 30.802 ns/op 0.87
intersect array and set length 128 607.95 ns/op 712.93 ns/op 0.85
bitArray.getTrueBitIndexes() bitLen 128 1.6870 us/op 1.4680 us/op 1.15
bitArray.getTrueBitIndexes() bitLen 248 3.0180 us/op 2.4790 us/op 1.22
bitArray.getTrueBitIndexes() bitLen 512 6.2180 us/op 4.9460 us/op 1.26
Buffer.concat 32 items 1.1320 us/op 1.0610 us/op 1.07
Uint8Array.set 32 items 1.9000 us/op 2.0430 us/op 0.93
Buffer.copy 2.1620 us/op 2.0910 us/op 1.03
Uint8Array.set - with subarray 3.2630 us/op 2.6360 us/op 1.24
Uint8Array.set - without subarray 1.9300 us/op 1.5120 us/op 1.28
getUint32 - dataview 444.00 ns/op 241.00 ns/op 1.84
getUint32 - manual 489.00 ns/op 162.00 ns/op 3.02
Set add up to 64 items then delete first 2.6106 us/op 2.2243 us/op 1.17
OrderedSet add up to 64 items then delete first 4.7657 us/op 3.5279 us/op 1.35
Set add up to 64 items then delete last 2.5659 us/op 2.5685 us/op 1.00
OrderedSet add up to 64 items then delete last 5.2463 us/op 3.8681 us/op 1.36
Set add up to 64 items then delete middle 3.2003 us/op 2.5134 us/op 1.27
OrderedSet add up to 64 items then delete middle 6.2518 us/op 5.3256 us/op 1.17
Set add up to 128 items then delete first 5.7654 us/op 5.0916 us/op 1.13
OrderedSet add up to 128 items then delete first 9.6387 us/op 7.8616 us/op 1.23
Set add up to 128 items then delete last 5.8411 us/op 5.5099 us/op 1.06
OrderedSet add up to 128 items then delete last 9.9721 us/op 9.3532 us/op 1.07
Set add up to 128 items then delete middle 6.8906 us/op 5.6783 us/op 1.21
OrderedSet add up to 128 items then delete middle 16.081 us/op 16.171 us/op 0.99
Set add up to 256 items then delete first 11.990 us/op 11.747 us/op 1.02
OrderedSet add up to 256 items then delete first 14.782 us/op 18.396 us/op 0.80
Set add up to 256 items then delete last 8.5474 us/op 11.787 us/op 0.73
OrderedSet add up to 256 items then delete last 12.868 us/op 18.028 us/op 0.71
Set add up to 256 items then delete middle 8.1295 us/op 11.730 us/op 0.69
OrderedSet add up to 256 items then delete middle 41.302 us/op 44.353 us/op 0.93
transfer serialized Status (84 B) 1.4760 us/op 1.7090 us/op 0.86
copy serialized Status (84 B) 1.4200 us/op 1.3490 us/op 1.05
transfer serialized SignedVoluntaryExit (112 B) 1.5120 us/op 1.6620 us/op 0.91
copy serialized SignedVoluntaryExit (112 B) 1.6070 us/op 1.3580 us/op 1.18
transfer serialized ProposerSlashing (416 B) 1.9580 us/op 2.2520 us/op 0.87
copy serialized ProposerSlashing (416 B) 2.1220 us/op 1.9560 us/op 1.08
transfer serialized Attestation (485 B) 2.5860 us/op 2.2400 us/op 1.15
copy serialized Attestation (485 B) 2.3620 us/op 1.8100 us/op 1.30
transfer serialized AttesterSlashing (33232 B) 3.1170 us/op 2.6650 us/op 1.17
copy serialized AttesterSlashing (33232 B) 13.457 us/op 6.3300 us/op 2.13
transfer serialized Small SignedBeaconBlock (128000 B) 2.1050 us/op 3.1810 us/op 0.66
copy serialized Small SignedBeaconBlock (128000 B) 19.126 us/op 18.224 us/op 1.05
transfer serialized Avg SignedBeaconBlock (200000 B) 2.5890 us/op 3.4930 us/op 0.74
copy serialized Avg SignedBeaconBlock (200000 B) 18.154 us/op 21.005 us/op 0.86
transfer serialized BlobsSidecar (524380 B) 3.3700 us/op 2.6920 us/op 1.25
copy serialized BlobsSidecar (524380 B) 89.004 us/op 82.152 us/op 1.08
transfer serialized Big SignedBeaconBlock (1000000 B) 3.1450 us/op 3.1970 us/op 0.98
copy serialized Big SignedBeaconBlock (1000000 B) 322.54 us/op 151.67 us/op 2.13
pass gossip attestations to forkchoice per slot 3.1065 ms/op 2.8688 ms/op 1.08
forkChoice updateHead vc 100000 bc 64 eq 0 421.86 us/op 506.48 us/op 0.83
forkChoice updateHead vc 600000 bc 64 eq 0 2.7109 ms/op 3.1326 ms/op 0.87
forkChoice updateHead vc 1000000 bc 64 eq 0 4.4629 ms/op 5.3411 ms/op 0.84
forkChoice updateHead vc 600000 bc 320 eq 0 2.5530 ms/op 3.0190 ms/op 0.85
forkChoice updateHead vc 600000 bc 1200 eq 0 2.6440 ms/op 3.1076 ms/op 0.85
forkChoice updateHead vc 600000 bc 7200 eq 0 3.1152 ms/op 4.1114 ms/op 0.76
forkChoice updateHead vc 600000 bc 64 eq 1000 10.047 ms/op 10.639 ms/op 0.94
forkChoice updateHead vc 600000 bc 64 eq 10000 10.006 ms/op 10.974 ms/op 0.91
forkChoice updateHead vc 600000 bc 64 eq 300000 29.972 ms/op 14.654 ms/op 2.05
computeDeltas 500000 validators 300 proto nodes 3.0967 ms/op 3.4707 ms/op 0.89
computeDeltas 500000 validators 1200 proto nodes 3.1126 ms/op 3.4643 ms/op 0.90
computeDeltas 500000 validators 7200 proto nodes 3.0239 ms/op 3.5337 ms/op 0.86
computeDeltas 750000 validators 300 proto nodes 4.6973 ms/op 5.3136 ms/op 0.88
computeDeltas 750000 validators 1200 proto nodes 4.5838 ms/op 5.4108 ms/op 0.85
computeDeltas 750000 validators 7200 proto nodes 4.4933 ms/op 5.5632 ms/op 0.81
computeDeltas 1400000 validators 300 proto nodes 8.4347 ms/op 10.353 ms/op 0.81
computeDeltas 1400000 validators 1200 proto nodes 8.2559 ms/op 10.382 ms/op 0.80
computeDeltas 1400000 validators 7200 proto nodes 8.4346 ms/op 10.620 ms/op 0.79
computeDeltas 2100000 validators 300 proto nodes 12.625 ms/op 15.625 ms/op 0.81
computeDeltas 2100000 validators 1200 proto nodes 12.488 ms/op 15.555 ms/op 0.80
computeDeltas 2100000 validators 7200 proto nodes 12.861 ms/op 15.341 ms/op 0.84
altair processAttestation - 250000 vs - 7PWei normalcase 1.4297 ms/op 1.7494 ms/op 0.82
altair processAttestation - 250000 vs - 7PWei worstcase 2.1990 ms/op 2.4926 ms/op 0.88
altair processAttestation - setStatus - 1/6 committees join 67.257 us/op 120.73 us/op 0.56
altair processAttestation - setStatus - 1/3 committees join 132.79 us/op 229.50 us/op 0.58
altair processAttestation - setStatus - 1/2 committees join 210.72 us/op 322.10 us/op 0.65
altair processAttestation - setStatus - 2/3 committees join 255.68 us/op 418.65 us/op 0.61
altair processAttestation - setStatus - 4/5 committees join 397.22 us/op 576.00 us/op 0.69
altair processAttestation - setStatus - 100% committees join 485.88 us/op 682.94 us/op 0.71
altair processBlock - 250000 vs - 7PWei normalcase 3.4438 ms/op 5.3781 ms/op 0.64
altair processBlock - 250000 vs - 7PWei normalcase hashState 24.147 ms/op 26.663 ms/op 0.91
altair processBlock - 250000 vs - 7PWei worstcase 41.110 ms/op 36.182 ms/op 1.14
altair processBlock - 250000 vs - 7PWei worstcase hashState 59.160 ms/op 73.196 ms/op 0.81
phase0 processBlock - 250000 vs - 7PWei normalcase 1.7388 ms/op 2.0994 ms/op 0.83
phase0 processBlock - 250000 vs - 7PWei worstcase 22.125 ms/op 22.531 ms/op 0.98
altair processEth1Data - 250000 vs - 7PWei normalcase 241.35 us/op 341.37 us/op 0.71
getExpectedWithdrawals 250000 eb:1,eth1:1,we:0,wn:0,smpl:15 4.9780 us/op 6.4940 us/op 0.77
getExpectedWithdrawals 250000 eb:0.95,eth1:0.1,we:0.05,wn:0,smpl:219 29.500 us/op 41.964 us/op 0.70
getExpectedWithdrawals 250000 eb:0.95,eth1:0.3,we:0.05,wn:0,smpl:42 8.9720 us/op 11.262 us/op 0.80
getExpectedWithdrawals 250000 eb:0.95,eth1:0.7,we:0.05,wn:0,smpl:18 5.2830 us/op 7.1180 us/op 0.74
getExpectedWithdrawals 250000 eb:0.1,eth1:0.1,we:0,wn:0,smpl:1020 125.53 us/op 140.57 us/op 0.89
getExpectedWithdrawals 250000 eb:0.03,eth1:0.03,we:0,wn:0,smpl:11777 825.35 us/op 1.1039 ms/op 0.75
getExpectedWithdrawals 250000 eb:0.01,eth1:0.01,we:0,wn:0,smpl:16384 1.1502 ms/op 1.5439 ms/op 0.75
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,smpl:16384 1.0882 ms/op 1.6708 ms/op 0.65
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,nocache,smpl:16384 2.8821 ms/op 3.6627 ms/op 0.79
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,smpl:16384 1.1497 ms/op 1.5562 ms/op 0.74
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,nocache,smpl:16384 3.1784 ms/op 3.7321 ms/op 0.85
Tree 40 250000 create 184.84 ms/op 214.38 ms/op 0.86
Tree 40 250000 get(125000) 108.12 ns/op 147.22 ns/op 0.73
Tree 40 250000 set(125000) 528.18 ns/op 682.40 ns/op 0.77
Tree 40 250000 toArray() 15.609 ms/op 15.357 ms/op 1.02
Tree 40 250000 iterate all - toArray() + loop 16.182 ms/op 16.239 ms/op 1.00
Tree 40 250000 iterate all - get(i) 44.961 ms/op 51.350 ms/op 0.88
Array 250000 create 2.7386 ms/op 3.0161 ms/op 0.91
Array 250000 clone - spread 1.2039 ms/op 1.4969 ms/op 0.80
Array 250000 get(125000) 0.57700 ns/op 0.42300 ns/op 1.36
Array 250000 set(125000) 0.57900 ns/op 0.44600 ns/op 1.30
Array 250000 iterate all - loop 75.599 us/op 104.84 us/op 0.72
phase0 afterProcessEpoch - 250000 vs - 7PWei 76.817 ms/op 88.175 ms/op 0.87
Array.fill - length 1000000 2.5428 ms/op 3.7275 ms/op 0.68
Array push - length 1000000 14.509 ms/op 17.337 ms/op 0.84
Array.get 0.26122 ns/op 0.28882 ns/op 0.90
Uint8Array.get 0.34796 ns/op 0.44660 ns/op 0.78
phase0 beforeProcessEpoch - 250000 vs - 7PWei 12.552 ms/op 15.695 ms/op 0.80
altair processEpoch - mainnet_e81889 318.16 ms/op 313.42 ms/op 1.02
mainnet_e81889 - altair beforeProcessEpoch 16.359 ms/op 18.112 ms/op 0.90
mainnet_e81889 - altair processJustificationAndFinalization 9.9270 us/op 13.471 us/op 0.74
mainnet_e81889 - altair processInactivityUpdates 4.0619 ms/op 5.8952 ms/op 0.69
mainnet_e81889 - altair processRewardsAndPenalties 51.829 ms/op 48.276 ms/op 1.07
mainnet_e81889 - altair processRegistryUpdates 1.8540 us/op 1.5090 us/op 1.23
mainnet_e81889 - altair processSlashings 755.00 ns/op 339.00 ns/op 2.23
mainnet_e81889 - altair processEth1DataReset 717.00 ns/op 295.00 ns/op 2.43
mainnet_e81889 - altair processEffectiveBalanceUpdates 1.7821 ms/op 1.4401 ms/op 1.24
mainnet_e81889 - altair processSlashingsReset 2.3220 us/op 2.7620 us/op 0.84
mainnet_e81889 - altair processRandaoMixesReset 3.1260 us/op 4.7080 us/op 0.66
mainnet_e81889 - altair processHistoricalRootsUpdate 766.00 ns/op 512.00 ns/op 1.50
mainnet_e81889 - altair processParticipationFlagUpdates 1.7700 us/op 1.9150 us/op 0.92
mainnet_e81889 - altair processSyncCommitteeUpdates 693.00 ns/op 403.00 ns/op 1.72
mainnet_e81889 - altair afterProcessEpoch 82.359 ms/op 93.687 ms/op 0.88
capella processEpoch - mainnet_e217614 945.52 ms/op 1.0977 s/op 0.86
mainnet_e217614 - capella beforeProcessEpoch 64.280 ms/op 74.170 ms/op 0.87
mainnet_e217614 - capella processJustificationAndFinalization 16.671 us/op 14.765 us/op 1.13
mainnet_e217614 - capella processInactivityUpdates 14.476 ms/op 18.181 ms/op 0.80
mainnet_e217614 - capella processRewardsAndPenalties 233.76 ms/op 230.15 ms/op 1.02
mainnet_e217614 - capella processRegistryUpdates 12.501 us/op 15.007 us/op 0.83
mainnet_e217614 - capella processSlashings 804.00 ns/op 554.00 ns/op 1.45
mainnet_e217614 - capella processEth1DataReset 752.00 ns/op 889.00 ns/op 0.85
mainnet_e217614 - capella processEffectiveBalanceUpdates 4.8631 ms/op 13.767 ms/op 0.35
mainnet_e217614 - capella processSlashingsReset 3.1780 us/op 3.4370 us/op 0.92
mainnet_e217614 - capella processRandaoMixesReset 4.1060 us/op 4.0070 us/op 1.02
mainnet_e217614 - capella processHistoricalRootsUpdate 794.00 ns/op 494.00 ns/op 1.61
mainnet_e217614 - capella processParticipationFlagUpdates 4.1260 us/op 2.2970 us/op 1.80
mainnet_e217614 - capella afterProcessEpoch 215.34 ms/op 238.69 ms/op 0.90
phase0 processEpoch - mainnet_e58758 458.38 ms/op 411.01 ms/op 1.12
mainnet_e58758 - phase0 beforeProcessEpoch 90.411 ms/op 84.230 ms/op 1.07
mainnet_e58758 - phase0 processJustificationAndFinalization 19.718 us/op 14.728 us/op 1.34
mainnet_e58758 - phase0 processRewardsAndPenalties 23.592 ms/op 27.491 ms/op 0.86
mainnet_e58758 - phase0 processRegistryUpdates 8.8100 us/op 8.5110 us/op 1.04
mainnet_e58758 - phase0 processSlashings 934.00 ns/op 318.00 ns/op 2.94
mainnet_e58758 - phase0 processEth1DataReset 893.00 ns/op 390.00 ns/op 2.29
mainnet_e58758 - phase0 processEffectiveBalanceUpdates 1.4351 ms/op 1.2332 ms/op 1.16
mainnet_e58758 - phase0 processSlashingsReset 5.1190 us/op 3.4170 us/op 1.50
mainnet_e58758 - phase0 processRandaoMixesReset 6.5420 us/op 5.1780 us/op 1.26
mainnet_e58758 - phase0 processHistoricalRootsUpdate 810.00 ns/op 427.00 ns/op 1.90
mainnet_e58758 - phase0 processParticipationRecordUpdates 3.9690 us/op 4.8690 us/op 0.82
mainnet_e58758 - phase0 afterProcessEpoch 73.603 ms/op 80.569 ms/op 0.91
phase0 processEffectiveBalanceUpdates - 250000 normalcase 1.0615 ms/op 1.9476 ms/op 0.55
phase0 processEffectiveBalanceUpdates - 250000 worstcase 0.5 1.7397 ms/op 2.4929 ms/op 0.70
altair processInactivityUpdates - 250000 normalcase 17.175 ms/op 16.290 ms/op 1.05
altair processInactivityUpdates - 250000 worstcase 16.454 ms/op 16.121 ms/op 1.02
phase0 processRegistryUpdates - 250000 normalcase 6.2720 us/op 7.8000 us/op 0.80
phase0 processRegistryUpdates - 250000 badcase_full_deposits 345.02 us/op 297.38 us/op 1.16
phase0 processRegistryUpdates - 250000 worstcase 0.5 100.50 ms/op 138.23 ms/op 0.73
altair processRewardsAndPenalties - 250000 normalcase 40.596 ms/op 42.776 ms/op 0.95
altair processRewardsAndPenalties - 250000 worstcase 46.169 ms/op 36.218 ms/op 1.27
phase0 getAttestationDeltas - 250000 normalcase 5.4286 ms/op 9.2782 ms/op 0.59
phase0 getAttestationDeltas - 250000 worstcase 5.5345 ms/op 9.8792 ms/op 0.56
phase0 processSlashings - 250000 worstcase 90.929 us/op 115.41 us/op 0.79
altair processSyncCommitteeUpdates - 250000 107.96 ms/op 141.43 ms/op 0.76
BeaconState.hashTreeRoot - No change 454.00 ns/op 398.00 ns/op 1.14
BeaconState.hashTreeRoot - 1 full validator 120.14 us/op 144.96 us/op 0.83
BeaconState.hashTreeRoot - 32 full validator 986.96 us/op 1.2257 ms/op 0.81
BeaconState.hashTreeRoot - 512 full validator 12.688 ms/op 11.819 ms/op 1.07
BeaconState.hashTreeRoot - 1 validator.effectiveBalance 145.37 us/op 140.06 us/op 1.04
BeaconState.hashTreeRoot - 32 validator.effectiveBalance 2.0629 ms/op 1.8038 ms/op 1.14
BeaconState.hashTreeRoot - 512 validator.effectiveBalance 27.066 ms/op 21.443 ms/op 1.26
BeaconState.hashTreeRoot - 1 balances 106.90 us/op 92.371 us/op 1.16
BeaconState.hashTreeRoot - 32 balances 1.0090 ms/op 1.1757 ms/op 0.86
BeaconState.hashTreeRoot - 512 balances 9.8894 ms/op 9.4173 ms/op 1.05
BeaconState.hashTreeRoot - 250000 balances 152.03 ms/op 166.87 ms/op 0.91
aggregationBits - 2048 els - zipIndexesInBitList 20.497 us/op 33.097 us/op 0.62
byteArrayEquals 32 46.080 ns/op 55.632 ns/op 0.83
Buffer.compare 32 14.777 ns/op 17.762 ns/op 0.83
byteArrayEquals 1024 1.2190 us/op 1.6427 us/op 0.74
Buffer.compare 1024 21.566 ns/op 26.809 ns/op 0.80
byteArrayEquals 16384 19.256 us/op 26.061 us/op 0.74
Buffer.compare 16384 189.64 ns/op 207.67 ns/op 0.91
byteArrayEquals 123687377 151.05 ms/op 199.40 ms/op 0.76
Buffer.compare 123687377 4.5277 ms/op 9.3264 ms/op 0.49
byteArrayEquals 32 - diff last byte 48.516 ns/op 55.527 ns/op 0.87
Buffer.compare 32 - diff last byte 16.620 ns/op 18.448 ns/op 0.90
byteArrayEquals 1024 - diff last byte 1.2950 us/op 1.6485 us/op 0.79
Buffer.compare 1024 - diff last byte 24.768 ns/op 27.825 ns/op 0.89
byteArrayEquals 16384 - diff last byte 20.143 us/op 26.178 us/op 0.77
Buffer.compare 16384 - diff last byte 186.99 ns/op 215.10 ns/op 0.87
byteArrayEquals 123687377 - diff last byte 153.30 ms/op 194.64 ms/op 0.79
Buffer.compare 123687377 - diff last byte 5.0026 ms/op 7.6676 ms/op 0.65
byteArrayEquals 32 - random bytes 5.1030 ns/op 5.3040 ns/op 0.96
Buffer.compare 32 - random bytes 15.797 ns/op 17.651 ns/op 0.89
byteArrayEquals 1024 - random bytes 5.0200 ns/op 5.2930 ns/op 0.95
Buffer.compare 1024 - random bytes 15.174 ns/op 17.578 ns/op 0.86
byteArrayEquals 16384 - random bytes 4.8070 ns/op 5.2650 ns/op 0.91
Buffer.compare 16384 - random bytes 15.206 ns/op 17.680 ns/op 0.86
byteArrayEquals 123687377 - random bytes 7.8600 ns/op 6.5900 ns/op 1.19
Buffer.compare 123687377 - random bytes 18.180 ns/op 19.010 ns/op 0.96
regular array get 100000 times 30.336 us/op 33.968 us/op 0.89
wrappedArray get 100000 times 30.307 us/op 33.621 us/op 0.90
arrayWithProxy get 100000 times 9.2918 ms/op 13.782 ms/op 0.67
ssz.Root.equals 43.484 ns/op 46.833 ns/op 0.93
byteArrayEquals 43.096 ns/op 46.135 ns/op 0.93
Buffer.compare 8.8490 ns/op 10.686 ns/op 0.83
shuffle list - 16384 els 5.4271 ms/op 6.3543 ms/op 0.85
shuffle list - 250000 els 80.549 ms/op 94.063 ms/op 0.86
processSlot - 1 slots 15.300 us/op 12.774 us/op 1.20
processSlot - 32 slots 2.8402 ms/op 2.2818 ms/op 1.24
getEffectiveBalanceIncrementsZeroInactive - 250000 vs - 7PWei 37.573 ms/op 35.045 ms/op 1.07
getCommitteeAssignments - req 1 vs - 250000 vc 1.8387 ms/op 2.1612 ms/op 0.85
getCommitteeAssignments - req 100 vs - 250000 vc 3.6158 ms/op 4.1395 ms/op 0.87
getCommitteeAssignments - req 1000 vs - 250000 vc 3.8633 ms/op 4.4041 ms/op 0.88
findModifiedValidators - 10000 modified validators 258.06 ms/op 244.53 ms/op 1.06
findModifiedValidators - 1000 modified validators 172.22 ms/op 159.62 ms/op 1.08
findModifiedValidators - 100 modified validators 163.20 ms/op 152.88 ms/op 1.07
findModifiedValidators - 10 modified validators 146.47 ms/op 159.87 ms/op 0.92
findModifiedValidators - 1 modified validators 147.35 ms/op 172.03 ms/op 0.86
findModifiedValidators - no difference 157.85 ms/op 173.48 ms/op 0.91
compare ViewDUs 3.2735 s/op 2.9980 s/op 1.09
compare each validator Uint8Array 1.5125 s/op 1.3572 s/op 1.11
compare ViewDU to Uint8Array 1.1122 s/op 987.41 ms/op 1.13
migrate state 1000000 validators, 24 modified, 0 new 728.56 ms/op 599.99 ms/op 1.21
migrate state 1000000 validators, 1700 modified, 1000 new 964.32 ms/op 812.92 ms/op 1.19
migrate state 1000000 validators, 3400 modified, 2000 new 1.1199 s/op 998.36 ms/op 1.12
migrate state 1500000 validators, 24 modified, 0 new 574.67 ms/op 601.39 ms/op 0.96
migrate state 1500000 validators, 1700 modified, 1000 new 785.22 ms/op 839.63 ms/op 0.94
migrate state 1500000 validators, 3400 modified, 2000 new 967.23 ms/op 943.46 ms/op 1.03
RootCache.getBlockRootAtSlot - 250000 vs - 7PWei 7.3200 ns/op 4.6500 ns/op 1.57
state getBlockRootAtSlot - 250000 vs - 7PWei 463.41 ns/op 606.87 ns/op 0.76
computeProposers - vc 250000 6.7299 ms/op 7.8766 ms/op 0.85
computeEpochShuffling - vc 250000 81.845 ms/op 94.702 ms/op 0.86
getNextSyncCommittee - vc 250000 95.107 ms/op 123.95 ms/op 0.77
computeSigningRoot for AttestationData 22.310 us/op 19.862 us/op 1.12
hash AttestationData serialized data then Buffer.toString(base64) 1.2057 us/op 1.5693 us/op 0.77
toHexString serialized data 805.61 ns/op 890.36 ns/op 0.90
Buffer.toString(base64) 136.06 ns/op 175.00 ns/op 0.78
nodejs block root to RootHex using toHex 112.61 ns/op 148.61 ns/op 0.76
nodejs block root to RootHex using toRootHex 71.702 ns/op 97.460 ns/op 0.74
browser block root to RootHex using the deprecated toHexString 200.74 ns/op 232.32 ns/op 0.86
browser block root to RootHex using toHex 164.31 ns/op 186.38 ns/op 0.88
browser block root to RootHex using toRootHex 148.82 ns/op 164.45 ns/op 0.90

Please sign in to comment.