Skip to content

Commit

Permalink
chore: revert "chore: upgrade to js-libp2p 2.0 (#7077)" (#7202)
Browse files Browse the repository at this point in the history
Revert "chore: upgrade to js-libp2p 2.0 (#7077)"

This reverts commit d37bdb0.
  • Loading branch information
wemeetagain authored Oct 28, 2024
1 parent d8b599a commit 4b08c0b
Show file tree
Hide file tree
Showing 41 changed files with 600 additions and 754 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
"https-browserify": "^1.0.0",
"jsdom": "^23.0.1",
"lerna": "^7.3.0",
"libp2p": "2.1.7",
"libp2p": "1.4.3",
"mocha": "^10.2.0",
"node-gyp": "^9.4.0",
"npm-run-all": "^4.1.5",
Expand Down
35 changes: 18 additions & 17 deletions packages/beacon-node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,11 @@
"dependencies": {
"@chainsafe/as-sha256": "^0.5.0",
"@chainsafe/blst": "^2.1.0",
"@chainsafe/discv5": "^10.0.1",
"@chainsafe/enr": "^4.0.1",
"@chainsafe/libp2p-gossipsub": "^14.1.0",
"@chainsafe/libp2p-noise": "^16.0.0",
"@chainsafe/discv5": "^9.0.0",
"@chainsafe/enr": "^3.0.0",
"@chainsafe/libp2p-gossipsub": "^13.0.0",
"@chainsafe/libp2p-identify": "^1.0.0",
"@chainsafe/libp2p-noise": "^15.0.0",
"@chainsafe/persistent-merkle-tree": "^0.8.0",
"@chainsafe/prometheus-gc-stats": "^1.0.0",
"@chainsafe/ssz": "^0.18.0",
Expand All @@ -110,15 +111,15 @@
"@fastify/cors": "^10.0.1",
"@fastify/swagger": "^9.0.0",
"@fastify/swagger-ui": "^5.0.1",
"@libp2p/bootstrap": "^11.0.4",
"@libp2p/crypto": "^5.0.4",
"@libp2p/identify": "^3.0.4",
"@libp2p/interface": "^2.1.2",
"@libp2p/mdns": "^11.0.4",
"@libp2p/mplex": "^11.0.4",
"@libp2p/peer-id": "^5.0.4",
"@libp2p/prometheus-metrics": "^4.1.2",
"@libp2p/tcp": "10.0.4",
"@libp2p/bootstrap": "^10.0.21",
"@libp2p/identify": "^1.0.20",
"@libp2p/interface": "^1.3.0",
"@libp2p/mdns": "^10.0.21",
"@libp2p/mplex": "^10.0.21",
"@libp2p/peer-id": "^4.1.0",
"@libp2p/peer-id-factory": "^4.1.0",
"@libp2p/prometheus-metrics": "^3.0.21",
"@libp2p/tcp": "9.0.23",
"@lodestar/api": "^1.22.0",
"@lodestar/config": "^1.22.0",
"@lodestar/db": "^1.22.0",
Expand All @@ -133,15 +134,15 @@
"@lodestar/validator": "^1.22.0",
"@multiformats/multiaddr": "^12.1.3",
"c-kzg": "^2.1.2",
"datastore-core": "^10.0.0",
"datastore-level": "^11.0.0",
"datastore-core": "^9.1.1",
"datastore-level": "^10.1.1",
"deepmerge": "^4.3.1",
"fastify": "^5.0.0",
"interface-datastore": "^8.3.0",
"interface-datastore": "^8.2.7",
"it-all": "^3.0.4",
"it-pipe": "^3.0.1",
"jwt-simple": "0.5.6",
"libp2p": "2.1.7",
"libp2p": "1.4.3",
"multiformats": "^11.0.1",
"prom-client": "^15.1.0",
"qs": "^6.11.1",
Expand Down
17 changes: 6 additions & 11 deletions packages/beacon-node/src/network/core/networkCore.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {Connection, PrivateKey} from "@libp2p/interface";
import {Connection, PeerId} from "@libp2p/interface";
import {multiaddr} from "@multiformats/multiaddr";
import {PublishOpts} from "@chainsafe/libp2p-gossipsub/types";
import {PeerScoreStatsDump} from "@chainsafe/libp2p-gossipsub/dist/src/score/peer-score.js";
Expand Down Expand Up @@ -55,7 +55,7 @@ type Mods = {
export type BaseNetworkInit = {
opts: NetworkOptions;
config: BeaconConfig;
privateKey: PrivateKey;
peerId: PeerId;
peerStoreDir: string | undefined;
logger: LoggerNode;
metricsRegistry: RegistryMetricCreator | null;
Expand Down Expand Up @@ -126,7 +126,7 @@ export class NetworkCore implements INetworkCore {
static async init({
opts,
config,
privateKey,
peerId,
peerStoreDir,
logger,
metricsRegistry,
Expand All @@ -136,7 +136,7 @@ export class NetworkCore implements INetworkCore {
activeValidatorCount,
initialStatus,
}: BaseNetworkInit): Promise<NetworkCore> {
const libp2p = await createNodeJsLibp2p(privateKey, opts, {
const libp2p = await createNodeJsLibp2p(peerId, opts, {
peerStoreDir,
metrics: Boolean(metricsRegistry),
metricsRegistry: metricsRegistry ?? undefined,
Expand Down Expand Up @@ -200,9 +200,8 @@ export class NetworkCore implements INetworkCore {

const peerManager = await PeerManager.init(
{
privateKey,
libp2p,
gossip,
gossip: gossip,
reqResp,
attnetsService,
syncnetsService,
Expand Down Expand Up @@ -363,11 +362,7 @@ export class NetworkCore implements INetworkCore {
}

getConnectionsByPeer(): Map<string, Connection[]> {
const m = new Map<string, Connection[]>();
for (const [k, v] of getConnectionsMap(this.libp2p).entries()) {
m.set(k, v.value);
}
return m;
return getConnectionsMap(this.libp2p);
}

async getConnectedPeers(): Promise<PeerIdStr[]> {
Expand Down
8 changes: 3 additions & 5 deletions packages/beacon-node/src/network/core/networkCoreWorker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ import path from "node:path";
import worker from "node:worker_threads";
import type {ModuleThread} from "@chainsafe/threads";
import {expose} from "@chainsafe/threads/worker";
import {privateKeyFromProtobuf} from "@libp2p/crypto/keys";
import {peerIdFromPrivateKey} from "@libp2p/peer-id";
import {createFromProtobuf} from "@libp2p/peer-id-factory";
import {chainConfigFromJson, createBeaconConfig} from "@lodestar/config";
import {getNodeLogger} from "@lodestar/logger/node";
import {RegistryMetricCreator, collectNodeJSMetrics} from "../../metrics/index.js";
Expand Down Expand Up @@ -33,8 +32,7 @@ if (!workerData) throw Error("workerData must be defined");
if (!parentPort) throw Error("parentPort must be defined");

const config = createBeaconConfig(chainConfigFromJson(workerData.chainConfigJson), workerData.genesisValidatorsRoot);
const privateKey = privateKeyFromProtobuf(workerData.privateKeyProto);
const peerId = peerIdFromPrivateKey(privateKey);
const peerId = await createFromProtobuf(workerData.peerIdProto);

// TODO: Pass options from main thread for logging
// TODO: Logging won't be visible in file loggers
Expand Down Expand Up @@ -94,7 +92,7 @@ if (networkCoreWorkerMetrics) {
const core = await NetworkCore.init({
opts: workerData.opts,
config,
privateKey,
peerId,
peerStoreDir: workerData.peerStoreDir,
logger,
metricsRegistry: metricsRegister,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import workerThreads from "node:worker_threads";
import {PeerScoreStatsDump} from "@chainsafe/libp2p-gossipsub/dist/src/score/peer-score.js";
import {PublishOpts} from "@chainsafe/libp2p-gossipsub/types";
import {ModuleThread, Thread, Worker, spawn} from "@chainsafe/threads";
import {PrivateKey} from "@libp2p/interface";
import {privateKeyToProtobuf} from "@libp2p/crypto/keys";
import {PeerId, Secp256k1PeerId} from "@libp2p/interface";
import {exportToProtobuf} from "@libp2p/peer-id-factory";
import {routes} from "@lodestar/api";
import {BeaconConfig, chainConfigToJson} from "@lodestar/config";
import type {LoggerNode} from "@lodestar/logger/node";
Expand Down Expand Up @@ -44,7 +44,7 @@ export type WorkerNetworkCoreInitModules = {
opts: WorkerNetworkCoreOpts;
config: BeaconConfig;
logger: LoggerNode;
privateKey: PrivateKey;
peerId: PeerId;
events: NetworkEventBus;
metrics: Metrics | null;
getReqRespHandler: GetReqRespHandlerFn;
Expand Down Expand Up @@ -103,14 +103,14 @@ export class WorkerNetworkCore implements INetworkCore {
}

static async init(modules: WorkerNetworkCoreInitModules): Promise<WorkerNetworkCore> {
const {opts, config, privateKey} = modules;
const {opts, config, peerId} = modules;
const {genesisTime, peerStoreDir, activeValidatorCount, localMultiaddrs, metricsEnabled, initialStatus} = opts;

const workerData: NetworkWorkerData = {
opts,
chainConfigJson: chainConfigToJson(config),
genesisValidatorsRoot: config.genesisValidatorsRoot,
privateKeyProto: privateKeyToProtobuf(privateKey),
peerIdProto: exportToProtobuf(peerId as Secp256k1PeerId),
localMultiaddrs,
metricsEnabled,
peerStoreDir,
Expand Down
2 changes: 1 addition & 1 deletion packages/beacon-node/src/network/core/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ export type NetworkWorkerData = {
genesisTime: number;
activeValidatorCount: number;
initialStatus: phase0.Status;
privateKeyProto: Uint8Array;
peerIdProto: Uint8Array;
localMultiaddrs: string[];
metricsEnabled: boolean;
peerStoreDir?: string;
Expand Down
14 changes: 8 additions & 6 deletions packages/beacon-node/src/network/discv5/index.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import EventEmitter from "node:events";
import {privateKeyToProtobuf} from "@libp2p/crypto/keys";
import {PrivateKey} from "@libp2p/interface";
import {PeerId, Secp256k1PeerId} from "@libp2p/interface";
import {StrictEventEmitter} from "strict-event-emitter-types";
import {ENR, ENRData, SignableENR} from "@chainsafe/enr";
import {exportToProtobuf} from "@libp2p/peer-id-factory";
import {createPrivateKeyFromPeerId, ENR, ENRData, SignableENR} from "@chainsafe/enr";
import {spawn, Thread, Worker} from "@chainsafe/threads";
import {chainConfigFromJson, chainConfigToJson, BeaconConfig} from "@lodestar/config";
import {LoggerNode} from "@lodestar/logger/node";
import {NetworkCoreMetrics} from "../core/metrics.js";
import {Discv5WorkerApi, Discv5WorkerData, LodestarDiscv5Opts} from "./types.js";

export type Discv5Opts = {
privateKey: PrivateKey;
peerId: PeerId;
discv5: LodestarDiscv5Opts;
logger: LoggerNode;
config: BeaconConfig;
Expand All @@ -25,6 +25,7 @@ export type Discv5Events = {
* Wrapper class abstracting the details of discv5 worker instantiation and message-passing
*/
export class Discv5Worker extends (EventEmitter as {new (): StrictEventEmitter<EventEmitter, Discv5Events>}) {
private readonly keypair;
private readonly subscription: {unsubscribe: () => void};
private closed = false;

Expand All @@ -34,13 +35,14 @@ export class Discv5Worker extends (EventEmitter as {new (): StrictEventEmitter<E
) {
super();

this.keypair = createPrivateKeyFromPeerId(this.opts.peerId);
this.subscription = workerApi.discovered().subscribe((enrObj) => this.onDiscovered(enrObj));
}

static async init(opts: Discv5Opts): Promise<Discv5Worker> {
const workerData: Discv5WorkerData = {
enr: opts.discv5.enr,
privateKeyProto: privateKeyToProtobuf(opts.privateKey),
peerIdProto: exportToProtobuf(opts.peerId as Secp256k1PeerId),
bindAddrs: opts.discv5.bindAddrs,
config: opts.discv5.config ?? {},
bootEnrs: opts.discv5.bootEnrs,
Expand Down Expand Up @@ -78,7 +80,7 @@ export class Discv5Worker extends (EventEmitter as {new (): StrictEventEmitter<E

async enr(): Promise<SignableENR> {
const obj = await this.workerApi.enr();
return new SignableENR(obj.kvs, obj.seq, this.opts.privateKey.raw);
return new SignableENR(obj.kvs, obj.seq, this.keypair.privateKey);
}

setEnrValue(key: string, value: Uint8Array): Promise<void> {
Expand Down
2 changes: 1 addition & 1 deletion packages/beacon-node/src/network/discv5/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export type LodestarDiscv5Opts = {
/** discv5 worker constructor data */
export interface Discv5WorkerData {
enr: string;
privateKeyProto: Uint8Array;
peerIdProto: Uint8Array;
bindAddrs: BindAddrs;
config: Discv5Config;
bootEnrs: string[];
Expand Down
13 changes: 6 additions & 7 deletions packages/beacon-node/src/network/discv5/worker.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
import worker from "node:worker_threads";
import path from "node:path";
import fs from "node:fs";
import {createFromProtobuf} from "@libp2p/peer-id-factory";
import {Multiaddr, multiaddr} from "@multiformats/multiaddr";
import {expose} from "@chainsafe/threads/worker";
import {Observable, Subject} from "@chainsafe/threads/observable";
import {Discv5} from "@chainsafe/discv5";
import {ENR, ENRData, SignableENR, SignableENRData} from "@chainsafe/enr";
import {privateKeyFromProtobuf} from "@libp2p/crypto/keys";
import {peerIdFromPrivateKey} from "@libp2p/peer-id";
import {createPrivateKeyFromPeerId, ENR, ENRData, SignableENR, SignableENRData} from "@chainsafe/enr";
import {createBeaconConfig} from "@lodestar/config";
import {getNodeLogger} from "@lodestar/logger/node";
import {Gauge} from "@lodestar/utils";
Expand Down Expand Up @@ -43,15 +42,15 @@ if (workerData.metrics) {
});
}

const privateKey = privateKeyFromProtobuf(workerData.privateKeyProto);
const peerId = peerIdFromPrivateKey(privateKey);
const peerId = await createFromProtobuf(workerData.peerIdProto);
const keypair = createPrivateKeyFromPeerId(peerId);

const config = createBeaconConfig(workerData.chainConfig, workerData.genesisValidatorsRoot);

// Initialize discv5
const discv5 = Discv5.create({
enr: SignableENR.decodeTxt(workerData.enr, privateKey.raw),
privateKey,
enr: SignableENR.decodeTxt(workerData.enr, keypair.privateKey),
peerId,
bindAddrs: {
ip4: (workerData.bindAddrs.ip4 ? multiaddr(workerData.bindAddrs.ip4) : undefined) as Multiaddr,
ip6: workerData.bindAddrs.ip6 ? multiaddr(workerData.bindAddrs.ip6) : undefined,
Expand Down
4 changes: 0 additions & 4 deletions packages/beacon-node/src/network/gossip/gossipsub.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,10 +135,6 @@ export class Eth2Gossipsub extends GossipSub {
// if this is false, only publish to mesh peers. If there is not enough GOSSIP_D mesh peers,
// publish to some more topic peers to make sure we always publish to at least GOSSIP_D peers
floodPublish: !opts?.disableFloodPublish,
// Only send IDONTWANT messages if the message size is larger than this
// This should be large enough to not send IDONTWANT for "small" messages
// See https://github.com/ChainSafe/lodestar/pull/7077#issuecomment-2383679472
idontwantMinDataSize: 16829,
});
this.scoreParams = scoreParams;
this.config = config;
Expand Down
4 changes: 1 addition & 3 deletions packages/beacon-node/src/network/interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,10 @@ import {
PeerRouting,
PeerStore,
Upgrader,
PrivateKey,
} from "@libp2p/interface";
import type {AddressManager, ConnectionManager, Registrar, TransportManager} from "@libp2p/interface-internal";
import type {Datastore} from "interface-datastore";
import {Identify} from "@libp2p/identify";
import {Identify} from "@chainsafe/libp2p-identify";
import {
LightClientFinalityUpdate,
LightClientOptimisticUpdate,
Expand Down Expand Up @@ -94,7 +93,6 @@ export interface INetwork extends INetworkCorePublic {

export type LodestarComponents = {
peerId: PeerId;
privateKey: PrivateKey;
nodeInfo: NodeInfo;
logger: ComponentLogger;
events: TypedEventTarget<Libp2pEvents>;
Expand Down
21 changes: 11 additions & 10 deletions packages/beacon-node/src/network/libp2p/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import {PrivateKey} from "@libp2p/interface";
import {PeerId} from "@libp2p/interface";
import {Registry} from "prom-client";
import {ENR} from "@chainsafe/enr";
import {identify} from "@libp2p/identify";
// TODO: We should use this fork until https://github.com/libp2p/js-libp2p/pull/2387
import {identify} from "@chainsafe/libp2p-identify";
import {bootstrap} from "@libp2p/bootstrap";
import {mdns} from "@libp2p/mdns";
import {createLibp2p} from "libp2p";
Expand Down Expand Up @@ -33,7 +34,7 @@ export async function getDiscv5Multiaddrs(bootEnrs: string[]): Promise<string[]>
}

export async function createNodeJsLibp2p(
privateKey: PrivateKey,
peerId: PeerId,
networkOpts: Partial<NetworkOptions> = {},
nodeJsLibp2pOpts: NodeJsLibp2pOpts = {}
): Promise<Libp2p> {
Expand Down Expand Up @@ -64,12 +65,12 @@ export async function createNodeJsLibp2p(
}

return createLibp2p({
privateKey,
peerId,
addresses: {
listen: localMultiaddrs,
announce: [],
},
connectionEncrypters: [noise()],
connectionEncryption: [noise()],
// Reject connections when the server's connection count gets high
transports: [
tcp({
Expand Down Expand Up @@ -98,14 +99,15 @@ export async function createNodeJsLibp2p(
maxParallelDials: 100,
maxPeerAddrsToDial: 4,
dialTimeout: 30_000,

// Rely entirely on lodestar's peer manager to prune connections
//maxConnections: options.maxConnections,
// DOCS: There is no way to turn off autodial other than setting minConnections to 0
minConnections: 0,
// the maximum number of pending connections libp2p will accept before it starts rejecting incoming connections.
// make it the same to backlog option above
maxIncomingPendingConnections: 5,
},
// rely on lodestar's peer manager to ping peers
connectionMonitor: {
enabled: false,
},
datastore,
services: {
identify: identify({
Expand All @@ -116,7 +118,6 @@ export async function createNodeJsLibp2p(
// and passing it here directly causes problems downstream, not to mention is slowwww
components: (components: LodestarComponents) => ({
peerId: components.peerId,
privateKey: components.privateKey,
nodeInfo: components.nodeInfo,
logger: components.logger,
events: components.events,
Expand Down
Loading

1 comment on commit 4b08c0b

@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: 4b08c0b Previous: d8b599a Ratio
altair processAttestation - 250000 vs - 7PWei worstcase 9.0438 ms/op 2.3962 ms/op 3.77
Full benchmark results
Benchmark suite Current: 4b08c0b Previous: d8b599a Ratio
getPubkeys - index2pubkey - req 1000 vs - 250000 vc 2.1423 ms/op 1.8249 ms/op 1.17
getPubkeys - validatorsArr - req 1000 vs - 250000 vc 54.158 us/op 41.941 us/op 1.29
BLS verify - blst 1.0168 ms/op 907.32 us/op 1.12
BLS verifyMultipleSignatures 3 - blst 1.5181 ms/op 1.3364 ms/op 1.14
BLS verifyMultipleSignatures 8 - blst 2.3346 ms/op 2.2827 ms/op 1.02
BLS verifyMultipleSignatures 32 - blst 7.1848 ms/op 4.4597 ms/op 1.61
BLS verifyMultipleSignatures 64 - blst 11.479 ms/op 8.2968 ms/op 1.38
BLS verifyMultipleSignatures 128 - blst 20.282 ms/op 15.886 ms/op 1.28
BLS deserializing 10000 signatures 749.45 ms/op 597.49 ms/op 1.25
BLS deserializing 100000 signatures 7.5659 s/op 6.2766 s/op 1.21
BLS verifyMultipleSignatures - same message - 3 - blst 1.2316 ms/op 949.54 us/op 1.30
BLS verifyMultipleSignatures - same message - 8 - blst 1.2850 ms/op 1.0752 ms/op 1.20
BLS verifyMultipleSignatures - same message - 32 - blst 2.0669 ms/op 1.6807 ms/op 1.23
BLS verifyMultipleSignatures - same message - 64 - blst 3.0303 ms/op 2.5514 ms/op 1.19
BLS verifyMultipleSignatures - same message - 128 - blst 5.1648 ms/op 4.1658 ms/op 1.24
BLS aggregatePubkeys 32 - blst 22.851 us/op 18.009 us/op 1.27
BLS aggregatePubkeys 128 - blst 77.730 us/op 63.754 us/op 1.22
notSeenSlots=1 numMissedVotes=1 numBadVotes=10 113.29 ms/op 62.382 ms/op 1.82
notSeenSlots=1 numMissedVotes=0 numBadVotes=4 83.000 ms/op 50.373 ms/op 1.65
notSeenSlots=2 numMissedVotes=1 numBadVotes=10 56.077 ms/op 35.147 ms/op 1.60
getSlashingsAndExits - default max 175.88 us/op 64.492 us/op 2.73
getSlashingsAndExits - 2k 423.25 us/op 293.69 us/op 1.44
proposeBlockBody type=full, size=empty 7.8245 ms/op 4.8232 ms/op 1.62
isKnown best case - 1 super set check 691.00 ns/op 530.00 ns/op 1.30
isKnown normal case - 2 super set checks 658.00 ns/op 506.00 ns/op 1.30
isKnown worse case - 16 super set checks 573.00 ns/op 499.00 ns/op 1.15
InMemoryCheckpointStateCache - add get delete 3.7200 us/op 3.3110 us/op 1.12
updateUnfinalizedPubkeys - updating 10 pubkeys 1.7955 ms/op 983.27 us/op 1.83
updateUnfinalizedPubkeys - updating 100 pubkeys 7.3496 ms/op 2.7390 ms/op 2.68
updateUnfinalizedPubkeys - updating 1000 pubkeys 63.912 ms/op 38.608 ms/op 1.66
validate api signedAggregateAndProof - struct 2.1348 ms/op 1.5032 ms/op 1.42
validate gossip signedAggregateAndProof - struct 2.0899 ms/op 1.9341 ms/op 1.08
batch validate gossip attestation - vc 640000 - chunk 32 173.42 us/op 119.36 us/op 1.45
batch validate gossip attestation - vc 640000 - chunk 64 140.73 us/op 103.49 us/op 1.36
batch validate gossip attestation - vc 640000 - chunk 128 131.53 us/op 96.328 us/op 1.37
batch validate gossip attestation - vc 640000 - chunk 256 133.28 us/op 94.069 us/op 1.42
pickEth1Vote - no votes 1.2406 ms/op 880.17 us/op 1.41
pickEth1Vote - max votes 7.1777 ms/op 6.8694 ms/op 1.04
pickEth1Vote - Eth1Data hashTreeRoot value x2048 14.519 ms/op 14.787 ms/op 0.98
pickEth1Vote - Eth1Data hashTreeRoot tree x2048 21.822 ms/op 14.369 ms/op 1.52
pickEth1Vote - Eth1Data fastSerialize value x2048 515.80 us/op 399.58 us/op 1.29
pickEth1Vote - Eth1Data fastSerialize tree x2048 2.9369 ms/op 4.6087 ms/op 0.64
bytes32 toHexString 464.00 ns/op 779.00 ns/op 0.60
bytes32 Buffer.toString(hex) 280.00 ns/op 463.00 ns/op 0.60
bytes32 Buffer.toString(hex) from Uint8Array 411.00 ns/op 672.00 ns/op 0.61
bytes32 Buffer.toString(hex) + 0x 281.00 ns/op 474.00 ns/op 0.59
Object access 1 prop 0.16200 ns/op 0.34300 ns/op 0.47
Map access 1 prop 0.14600 ns/op 0.34600 ns/op 0.42
Object get x1000 6.4380 ns/op 5.6660 ns/op 1.14
Map get x1000 6.7010 ns/op 6.1190 ns/op 1.10
Object set x1000 38.834 ns/op 23.380 ns/op 1.66
Map set x1000 24.366 ns/op 19.907 ns/op 1.22
Return object 10000 times 0.31240 ns/op 0.30760 ns/op 1.02
Throw Error 10000 times 3.5680 us/op 2.7927 us/op 1.28
toHex 166.47 ns/op 119.78 ns/op 1.39
Buffer.from 154.59 ns/op 110.02 ns/op 1.41
shared Buffer 96.121 ns/op 72.699 ns/op 1.32
fastMsgIdFn sha256 / 200 bytes 2.4300 us/op 2.1390 us/op 1.14
fastMsgIdFn h32 xxhash / 200 bytes 276.00 ns/op 462.00 ns/op 0.60
fastMsgIdFn h64 xxhash / 200 bytes 271.00 ns/op 469.00 ns/op 0.58
fastMsgIdFn sha256 / 1000 bytes 7.9120 us/op 6.2180 us/op 1.27
fastMsgIdFn h32 xxhash / 1000 bytes 447.00 ns/op 576.00 ns/op 0.78
fastMsgIdFn h64 xxhash / 1000 bytes 374.00 ns/op 539.00 ns/op 0.69
fastMsgIdFn sha256 / 10000 bytes 71.883 us/op 50.229 us/op 1.43
fastMsgIdFn h32 xxhash / 10000 bytes 2.0850 us/op 1.9940 us/op 1.05
fastMsgIdFn h64 xxhash / 10000 bytes 1.3320 us/op 1.3470 us/op 0.99
send data - 1000 256B messages 17.132 ms/op 14.261 ms/op 1.20
send data - 1000 512B messages 22.598 ms/op 16.523 ms/op 1.37
send data - 1000 1024B messages 30.131 ms/op 25.158 ms/op 1.20
send data - 1000 1200B messages 33.223 ms/op 21.332 ms/op 1.56
send data - 1000 2048B messages 38.410 ms/op 30.490 ms/op 1.26
send data - 1000 4096B messages 37.172 ms/op 24.362 ms/op 1.53
send data - 1000 16384B messages 74.786 ms/op 62.293 ms/op 1.20
send data - 1000 65536B messages 240.39 ms/op 241.34 ms/op 1.00
enrSubnets - fastDeserialize 64 bits 1.3550 us/op 1.2060 us/op 1.12
enrSubnets - ssz BitVector 64 bits 423.00 ns/op 527.00 ns/op 0.80
enrSubnets - fastDeserialize 4 bits 176.00 ns/op 351.00 ns/op 0.50
enrSubnets - ssz BitVector 4 bits 401.00 ns/op 527.00 ns/op 0.76
prioritizePeers score -10:0 att 32-0.1 sync 2-0 185.15 us/op 131.28 us/op 1.41
prioritizePeers score 0:0 att 32-0.25 sync 2-0.25 179.12 us/op 137.07 us/op 1.31
prioritizePeers score 0:0 att 32-0.5 sync 2-0.5 385.45 us/op 253.24 us/op 1.52
prioritizePeers score 0:0 att 64-0.75 sync 4-0.75 504.90 us/op 422.00 us/op 1.20
prioritizePeers score 0:0 att 64-1 sync 4-1 922.03 us/op 473.85 us/op 1.95
array of 16000 items push then shift 1.7214 us/op 1.3058 us/op 1.32
LinkedList of 16000 items push then shift 8.0250 ns/op 6.5890 ns/op 1.22
array of 16000 items push then pop 136.78 ns/op 78.851 ns/op 1.73
LinkedList of 16000 items push then pop 7.7290 ns/op 6.4360 ns/op 1.20
array of 24000 items push then shift 2.5533 us/op 1.9078 us/op 1.34
LinkedList of 24000 items push then shift 7.9390 ns/op 6.4710 ns/op 1.23
array of 24000 items push then pop 186.82 ns/op 113.32 ns/op 1.65
LinkedList of 24000 items push then pop 7.7260 ns/op 6.3460 ns/op 1.22
intersect bitArray bitLen 8 6.8740 ns/op 5.5180 ns/op 1.25
intersect array and set length 8 51.881 ns/op 40.756 ns/op 1.27
intersect bitArray bitLen 128 30.917 ns/op 26.841 ns/op 1.15
intersect array and set length 128 742.24 ns/op 595.86 ns/op 1.25
bitArray.getTrueBitIndexes() bitLen 128 2.2780 us/op 1.7800 us/op 1.28
bitArray.getTrueBitIndexes() bitLen 248 3.9430 us/op 2.3330 us/op 1.69
bitArray.getTrueBitIndexes() bitLen 512 9.0630 us/op 5.4790 us/op 1.65
Buffer.concat 32 items 1.1560 us/op 1.0610 us/op 1.09
Uint8Array.set 32 items 1.7680 us/op 1.3780 us/op 1.28
Buffer.copy 2.2750 us/op 1.4840 us/op 1.53
Uint8Array.set - with subarray 3.0720 us/op 2.0200 us/op 1.52
Uint8Array.set - without subarray 1.6840 us/op 1.2870 us/op 1.31
getUint32 - dataview 272.00 ns/op 422.00 ns/op 0.64
getUint32 - manual 186.00 ns/op 355.00 ns/op 0.52
Set add up to 64 items then delete first 2.4048 us/op 1.8818 us/op 1.28
OrderedSet add up to 64 items then delete first 3.8327 us/op 2.8988 us/op 1.32
Set add up to 64 items then delete last 2.7428 us/op 2.1124 us/op 1.30
OrderedSet add up to 64 items then delete last 4.1054 us/op 3.2058 us/op 1.28
Set add up to 64 items then delete middle 2.9208 us/op 2.1279 us/op 1.37
OrderedSet add up to 64 items then delete middle 6.1265 us/op 4.6198 us/op 1.33
Set add up to 128 items then delete first 5.8707 us/op 4.1580 us/op 1.41
OrderedSet add up to 128 items then delete first 9.2662 us/op 6.5426 us/op 1.42
Set add up to 128 items then delete last 5.9589 us/op 4.0424 us/op 1.47
OrderedSet add up to 128 items then delete last 8.6183 us/op 6.1728 us/op 1.40
Set add up to 128 items then delete middle 5.5509 us/op 4.0799 us/op 1.36
OrderedSet add up to 128 items then delete middle 16.237 us/op 12.524 us/op 1.30
Set add up to 256 items then delete first 11.419 us/op 8.2401 us/op 1.39
OrderedSet add up to 256 items then delete first 18.768 us/op 12.998 us/op 1.44
Set add up to 256 items then delete last 11.814 us/op 7.9680 us/op 1.48
OrderedSet add up to 256 items then delete last 17.519 us/op 12.262 us/op 1.43
Set add up to 256 items then delete middle 13.067 us/op 7.9300 us/op 1.65
OrderedSet add up to 256 items then delete middle 49.463 us/op 35.191 us/op 1.41
transfer serialized Status (84 B) 1.4750 us/op 1.3440 us/op 1.10
copy serialized Status (84 B) 1.2970 us/op 1.1430 us/op 1.13
transfer serialized SignedVoluntaryExit (112 B) 1.5100 us/op 1.3970 us/op 1.08
copy serialized SignedVoluntaryExit (112 B) 1.2960 us/op 1.2070 us/op 1.07
transfer serialized ProposerSlashing (416 B) 1.9910 us/op 1.5390 us/op 1.29
copy serialized ProposerSlashing (416 B) 1.9420 us/op 1.6510 us/op 1.18
transfer serialized Attestation (485 B) 1.8990 us/op 1.5510 us/op 1.22
copy serialized Attestation (485 B) 2.0460 us/op 1.3560 us/op 1.51
transfer serialized AttesterSlashing (33232 B) 2.6220 us/op 1.7150 us/op 1.53
copy serialized AttesterSlashing (33232 B) 7.8510 us/op 3.6870 us/op 2.13
transfer serialized Small SignedBeaconBlock (128000 B) 2.6370 us/op 2.0810 us/op 1.27
copy serialized Small SignedBeaconBlock (128000 B) 20.745 us/op 10.397 us/op 2.00
transfer serialized Avg SignedBeaconBlock (200000 B) 3.1620 us/op 3.2140 us/op 0.98
copy serialized Avg SignedBeaconBlock (200000 B) 28.423 us/op 14.845 us/op 1.91
transfer serialized BlobsSidecar (524380 B) 3.0020 us/op 2.9880 us/op 1.00
copy serialized BlobsSidecar (524380 B) 89.532 us/op 75.204 us/op 1.19
transfer serialized Big SignedBeaconBlock (1000000 B) 3.9390 us/op 3.1750 us/op 1.24
copy serialized Big SignedBeaconBlock (1000000 B) 171.30 us/op 214.35 us/op 0.80
pass gossip attestations to forkchoice per slot 2.9542 ms/op 2.4405 ms/op 1.21
forkChoice updateHead vc 100000 bc 64 eq 0 523.51 us/op 353.19 us/op 1.48
forkChoice updateHead vc 600000 bc 64 eq 0 3.0162 ms/op 2.6585 ms/op 1.13
forkChoice updateHead vc 1000000 bc 64 eq 0 5.6735 ms/op 4.0659 ms/op 1.40
forkChoice updateHead vc 600000 bc 320 eq 0 2.9597 ms/op 2.4492 ms/op 1.21
forkChoice updateHead vc 600000 bc 1200 eq 0 3.1056 ms/op 2.2476 ms/op 1.38
forkChoice updateHead vc 600000 bc 7200 eq 0 4.5658 ms/op 3.1637 ms/op 1.44
forkChoice updateHead vc 600000 bc 64 eq 1000 11.135 ms/op 9.4682 ms/op 1.18
forkChoice updateHead vc 600000 bc 64 eq 10000 10.538 ms/op 9.0856 ms/op 1.16
forkChoice updateHead vc 600000 bc 64 eq 300000 16.213 ms/op 11.977 ms/op 1.35
computeDeltas 500000 validators 300 proto nodes 4.5082 ms/op 4.4504 ms/op 1.01
computeDeltas 500000 validators 1200 proto nodes 5.0495 ms/op 3.5019 ms/op 1.44
computeDeltas 500000 validators 7200 proto nodes 5.0561 ms/op 3.4821 ms/op 1.45
computeDeltas 750000 validators 300 proto nodes 6.8056 ms/op 5.1301 ms/op 1.33
computeDeltas 750000 validators 1200 proto nodes 8.6058 ms/op 5.4964 ms/op 1.57
computeDeltas 750000 validators 7200 proto nodes 13.695 ms/op 5.1577 ms/op 2.66
computeDeltas 1400000 validators 300 proto nodes 22.723 ms/op 9.0155 ms/op 2.52
computeDeltas 1400000 validators 1200 proto nodes 24.620 ms/op 9.2870 ms/op 2.65
computeDeltas 1400000 validators 7200 proto nodes 23.554 ms/op 8.7609 ms/op 2.69
computeDeltas 2100000 validators 300 proto nodes 32.234 ms/op 13.738 ms/op 2.35
computeDeltas 2100000 validators 1200 proto nodes 37.458 ms/op 14.314 ms/op 2.62
computeDeltas 2100000 validators 7200 proto nodes 33.600 ms/op 14.899 ms/op 2.26
altair processAttestation - 250000 vs - 7PWei normalcase 6.5269 ms/op 2.2338 ms/op 2.92
altair processAttestation - 250000 vs - 7PWei worstcase 9.0438 ms/op 2.3962 ms/op 3.77
altair processAttestation - setStatus - 1/6 committees join 214.49 us/op 77.423 us/op 2.77
altair processAttestation - setStatus - 1/3 committees join 418.81 us/op 156.02 us/op 2.68
altair processAttestation - setStatus - 1/2 committees join 421.74 us/op 201.32 us/op 2.09
altair processAttestation - setStatus - 2/3 committees join 597.69 us/op 293.26 us/op 2.04
altair processAttestation - setStatus - 4/5 committees join 799.28 us/op 432.04 us/op 1.85
altair processAttestation - setStatus - 100% committees join 1.2492 ms/op 547.13 us/op 2.28
altair processBlock - 250000 vs - 7PWei normalcase 6.3766 ms/op 4.1207 ms/op 1.55
altair processBlock - 250000 vs - 7PWei normalcase hashState 28.360 ms/op 27.402 ms/op 1.03
altair processBlock - 250000 vs - 7PWei worstcase 43.050 ms/op 36.801 ms/op 1.17
altair processBlock - 250000 vs - 7PWei worstcase hashState 104.04 ms/op 68.552 ms/op 1.52
phase0 processBlock - 250000 vs - 7PWei normalcase 4.0218 ms/op 2.3741 ms/op 1.69
phase0 processBlock - 250000 vs - 7PWei worstcase 37.883 ms/op 26.975 ms/op 1.40
altair processEth1Data - 250000 vs - 7PWei normalcase 638.92 us/op 494.87 us/op 1.29
getExpectedWithdrawals 250000 eb:1,eth1:1,we:0,wn:0,smpl:15 12.140 us/op 8.0850 us/op 1.50
getExpectedWithdrawals 250000 eb:0.95,eth1:0.1,we:0.05,wn:0,smpl:219 60.829 us/op 33.856 us/op 1.80
getExpectedWithdrawals 250000 eb:0.95,eth1:0.3,we:0.05,wn:0,smpl:42 18.789 us/op 10.435 us/op 1.80
getExpectedWithdrawals 250000 eb:0.95,eth1:0.7,we:0.05,wn:0,smpl:18 13.561 us/op 6.6440 us/op 2.04
getExpectedWithdrawals 250000 eb:0.1,eth1:0.1,we:0,wn:0,smpl:1020 225.56 us/op 116.30 us/op 1.94
getExpectedWithdrawals 250000 eb:0.03,eth1:0.03,we:0,wn:0,smpl:11777 2.2510 ms/op 897.26 us/op 2.51
getExpectedWithdrawals 250000 eb:0.01,eth1:0.01,we:0,wn:0,smpl:16384 2.9717 ms/op 1.2778 ms/op 2.33
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,smpl:16384 3.1520 ms/op 1.2250 ms/op 2.57
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,nocache,smpl:16384 8.4617 ms/op 2.9760 ms/op 2.84
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,smpl:16384 2.8265 ms/op 1.2296 ms/op 2.30
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,nocache,smpl:16384 6.7321 ms/op 3.0461 ms/op 2.21
Tree 40 250000 create 590.87 ms/op 179.50 ms/op 3.29
Tree 40 250000 get(125000) 341.06 ns/op 119.36 ns/op 2.86
Tree 40 250000 set(125000) 1.1406 us/op 565.42 ns/op 2.02
Tree 40 250000 toArray() 29.796 ms/op 15.486 ms/op 1.92
Tree 40 250000 iterate all - toArray() + loop 23.706 ms/op 21.759 ms/op 1.09
Tree 40 250000 iterate all - get(i) 73.208 ms/op 54.045 ms/op 1.35
Array 250000 create 4.5180 ms/op 2.8988 ms/op 1.56
Array 250000 clone - spread 3.2390 ms/op 1.3913 ms/op 2.33
Array 250000 get(125000) 0.62500 ns/op 0.67400 ns/op 0.93
Array 250000 set(125000) 0.59800 ns/op 0.62900 ns/op 0.95
Array 250000 iterate all - loop 142.51 us/op 80.776 us/op 1.76
phase0 afterProcessEpoch - 250000 vs - 7PWei 73.703 ms/op 45.552 ms/op 1.62
Array.fill - length 1000000 7.2016 ms/op 2.6572 ms/op 2.71
Array push - length 1000000 30.627 ms/op 19.962 ms/op 1.53
Array.get 0.31509 ns/op 0.27044 ns/op 1.17
Uint8Array.get 0.46962 ns/op 0.35883 ns/op 1.31
phase0 beforeProcessEpoch - 250000 vs - 7PWei 19.883 ms/op 21.492 ms/op 0.93
altair processEpoch - mainnet_e81889 384.74 ms/op 321.03 ms/op 1.20
mainnet_e81889 - altair beforeProcessEpoch 21.904 ms/op 22.098 ms/op 0.99
mainnet_e81889 - altair processJustificationAndFinalization 28.421 us/op 16.098 us/op 1.77
mainnet_e81889 - altair processInactivityUpdates 9.2565 ms/op 7.4955 ms/op 1.23
mainnet_e81889 - altair processRewardsAndPenalties 53.784 ms/op 42.504 ms/op 1.27
mainnet_e81889 - altair processRegistryUpdates 7.0110 us/op 3.5410 us/op 1.98
mainnet_e81889 - altair processSlashings 1.5380 us/op 825.00 ns/op 1.86
mainnet_e81889 - altair processEth1DataReset 1.2420 us/op 885.00 ns/op 1.40
mainnet_e81889 - altair processEffectiveBalanceUpdates 2.0668 ms/op 1.2410 ms/op 1.67
mainnet_e81889 - altair processSlashingsReset 7.0490 us/op 2.5280 us/op 2.79
mainnet_e81889 - altair processRandaoMixesReset 7.3060 us/op 3.6310 us/op 2.01
mainnet_e81889 - altair processHistoricalRootsUpdate 918.00 ns/op 953.00 ns/op 0.96
mainnet_e81889 - altair processParticipationFlagUpdates 2.5520 us/op 3.5490 us/op 0.72
mainnet_e81889 - altair processSyncCommitteeUpdates 434.00 ns/op 756.00 ns/op 0.57
mainnet_e81889 - altair afterProcessEpoch 54.295 ms/op 43.339 ms/op 1.25
capella processEpoch - mainnet_e217614 1.1339 s/op 1.0908 s/op 1.04
mainnet_e217614 - capella beforeProcessEpoch 81.307 ms/op 71.705 ms/op 1.13
mainnet_e217614 - capella processJustificationAndFinalization 23.205 us/op 13.462 us/op 1.72
mainnet_e217614 - capella processInactivityUpdates 21.103 ms/op 15.803 ms/op 1.34
mainnet_e217614 - capella processRewardsAndPenalties 252.87 ms/op 233.26 ms/op 1.08
mainnet_e217614 - capella processRegistryUpdates 27.687 us/op 12.302 us/op 2.25
mainnet_e217614 - capella processSlashings 991.00 ns/op 965.00 ns/op 1.03
mainnet_e217614 - capella processEth1DataReset 795.00 ns/op 784.00 ns/op 1.01
mainnet_e217614 - capella processEffectiveBalanceUpdates 18.259 ms/op 5.2233 ms/op 3.50
mainnet_e217614 - capella processSlashingsReset 8.6640 us/op 3.8600 us/op 2.24
mainnet_e217614 - capella processRandaoMixesReset 10.139 us/op 6.5910 us/op 1.54
mainnet_e217614 - capella processHistoricalRootsUpdate 949.00 ns/op 965.00 ns/op 0.98
mainnet_e217614 - capella processParticipationFlagUpdates 6.8210 us/op 4.6360 us/op 1.47
mainnet_e217614 - capella afterProcessEpoch 153.02 ms/op 111.33 ms/op 1.37
phase0 processEpoch - mainnet_e58758 415.14 ms/op 424.23 ms/op 0.98
mainnet_e58758 - phase0 beforeProcessEpoch 131.30 ms/op 101.70 ms/op 1.29
mainnet_e58758 - phase0 processJustificationAndFinalization 35.001 us/op 25.678 us/op 1.36
mainnet_e58758 - phase0 processRewardsAndPenalties 32.989 ms/op 35.252 ms/op 0.94
mainnet_e58758 - phase0 processRegistryUpdates 15.770 us/op 13.804 us/op 1.14
mainnet_e58758 - phase0 processSlashings 780.00 ns/op 1.2900 us/op 0.60
mainnet_e58758 - phase0 processEth1DataReset 359.00 ns/op 921.00 ns/op 0.39
mainnet_e58758 - phase0 processEffectiveBalanceUpdates 1.6026 ms/op 865.17 us/op 1.85
mainnet_e58758 - phase0 processSlashingsReset 3.1230 us/op 4.9010 us/op 0.64
mainnet_e58758 - phase0 processRandaoMixesReset 9.5360 us/op 9.0500 us/op 1.05
mainnet_e58758 - phase0 processHistoricalRootsUpdate 1.3530 us/op 1.8610 us/op 0.73
mainnet_e58758 - phase0 processParticipationRecordUpdates 8.6290 us/op 8.5510 us/op 1.01
mainnet_e58758 - phase0 afterProcessEpoch 52.006 ms/op 41.596 ms/op 1.25
phase0 processEffectiveBalanceUpdates - 250000 normalcase 2.1061 ms/op 1.4351 ms/op 1.47
phase0 processEffectiveBalanceUpdates - 250000 worstcase 0.5 5.7096 ms/op 2.2290 ms/op 2.56
altair processInactivityUpdates - 250000 normalcase 30.547 ms/op 23.225 ms/op 1.32
altair processInactivityUpdates - 250000 worstcase 20.486 ms/op 21.480 ms/op 0.95
phase0 processRegistryUpdates - 250000 normalcase 15.510 us/op 11.951 us/op 1.30
phase0 processRegistryUpdates - 250000 badcase_full_deposits 430.77 us/op 315.55 us/op 1.37
phase0 processRegistryUpdates - 250000 worstcase 0.5 169.28 ms/op 167.05 ms/op 1.01
altair processRewardsAndPenalties - 250000 normalcase 67.976 ms/op 42.919 ms/op 1.58
altair processRewardsAndPenalties - 250000 worstcase 55.447 ms/op 54.402 ms/op 1.02
phase0 getAttestationDeltas - 250000 normalcase 11.049 ms/op 12.621 ms/op 0.88
phase0 getAttestationDeltas - 250000 worstcase 11.554 ms/op 8.5105 ms/op 1.36
phase0 processSlashings - 250000 worstcase 147.64 us/op 98.996 us/op 1.49
altair processSyncCommitteeUpdates - 250000 167.52 ms/op 119.28 ms/op 1.40
BeaconState.hashTreeRoot - No change 516.00 ns/op 608.00 ns/op 0.85
BeaconState.hashTreeRoot - 1 full validator 166.90 us/op 121.24 us/op 1.38
BeaconState.hashTreeRoot - 32 full validator 1.8904 ms/op 1.0226 ms/op 1.85
BeaconState.hashTreeRoot - 512 full validator 14.310 ms/op 8.3969 ms/op 1.70
BeaconState.hashTreeRoot - 1 validator.effectiveBalance 194.17 us/op 135.94 us/op 1.43
BeaconState.hashTreeRoot - 32 validator.effectiveBalance 2.5346 ms/op 2.4203 ms/op 1.05
BeaconState.hashTreeRoot - 512 validator.effectiveBalance 28.089 ms/op 33.734 ms/op 0.83
BeaconState.hashTreeRoot - 1 balances 135.03 us/op 135.28 us/op 1.00
BeaconState.hashTreeRoot - 32 balances 1.2184 ms/op 921.95 us/op 1.32
BeaconState.hashTreeRoot - 512 balances 13.663 ms/op 7.5291 ms/op 1.81
BeaconState.hashTreeRoot - 250000 balances 299.25 ms/op 191.46 ms/op 1.56
aggregationBits - 2048 els - zipIndexesInBitList 57.916 us/op 27.248 us/op 2.13
byteArrayEquals 32 72.325 ns/op 44.761 ns/op 1.62
Buffer.compare 32 24.298 ns/op 17.150 ns/op 1.42
byteArrayEquals 1024 1.8304 us/op 1.3317 us/op 1.37
Buffer.compare 1024 42.575 ns/op 24.602 ns/op 1.73
byteArrayEquals 16384 29.699 us/op 21.293 us/op 1.39
Buffer.compare 16384 334.10 ns/op 211.30 ns/op 1.58
byteArrayEquals 123687377 229.79 ms/op 160.18 ms/op 1.43
Buffer.compare 123687377 12.857 ms/op 6.5191 ms/op 1.97
byteArrayEquals 32 - diff last byte 64.193 ns/op 47.959 ns/op 1.34
Buffer.compare 32 - diff last byte 24.837 ns/op 16.177 ns/op 1.54
byteArrayEquals 1024 - diff last byte 1.9486 us/op 1.2546 us/op 1.55
Buffer.compare 1024 - diff last byte 31.881 ns/op 24.866 ns/op 1.28
byteArrayEquals 16384 - diff last byte 29.704 us/op 20.155 us/op 1.47
Buffer.compare 16384 - diff last byte 227.66 ns/op 175.11 ns/op 1.30
byteArrayEquals 123687377 - diff last byte 228.14 ms/op 155.47 ms/op 1.47
Buffer.compare 123687377 - diff last byte 11.689 ms/op 5.8910 ms/op 1.98
byteArrayEquals 32 - random bytes 5.7190 ns/op 5.0600 ns/op 1.13
Buffer.compare 32 - random bytes 19.394 ns/op 16.373 ns/op 1.18
byteArrayEquals 1024 - random bytes 5.9220 ns/op 5.0330 ns/op 1.18
Buffer.compare 1024 - random bytes 21.868 ns/op 16.109 ns/op 1.36
byteArrayEquals 16384 - random bytes 6.7800 ns/op 5.0060 ns/op 1.35
Buffer.compare 16384 - random bytes 28.126 ns/op 15.967 ns/op 1.76
byteArrayEquals 123687377 - random bytes 8.8100 ns/op 8.1500 ns/op 1.08
Buffer.compare 123687377 - random bytes 23.380 ns/op 19.770 ns/op 1.18
regular array get 100000 times 47.981 us/op 31.952 us/op 1.50
wrappedArray get 100000 times 37.028 us/op 31.793 us/op 1.16
arrayWithProxy get 100000 times 16.895 ms/op 10.128 ms/op 1.67
ssz.Root.equals 56.278 ns/op 45.685 ns/op 1.23
byteArrayEquals 52.602 ns/op 38.757 ns/op 1.36
Buffer.compare 11.423 ns/op 9.0020 ns/op 1.27
processSlot - 1 slots 18.362 us/op 20.464 us/op 0.90
processSlot - 32 slots 3.4189 ms/op 3.4663 ms/op 0.99
getEffectiveBalanceIncrementsZeroInactive - 250000 vs - 7PWei 46.515 ms/op 38.088 ms/op 1.22
getCommitteeAssignments - req 1 vs - 250000 vc 2.2329 ms/op 1.8523 ms/op 1.21
getCommitteeAssignments - req 100 vs - 250000 vc 4.2998 ms/op 3.6381 ms/op 1.18
getCommitteeAssignments - req 1000 vs - 250000 vc 4.6725 ms/op 3.9471 ms/op 1.18
findModifiedValidators - 10000 modified validators 333.17 ms/op 260.55 ms/op 1.28
findModifiedValidators - 1000 modified validators 197.70 ms/op 173.89 ms/op 1.14
findModifiedValidators - 100 modified validators 199.93 ms/op 163.75 ms/op 1.22
findModifiedValidators - 10 modified validators 241.27 ms/op 160.64 ms/op 1.50
findModifiedValidators - 1 modified validators 225.15 ms/op 177.28 ms/op 1.27
findModifiedValidators - no difference 239.18 ms/op 168.78 ms/op 1.42
compare ViewDUs 4.0413 s/op 3.1476 s/op 1.28
compare each validator Uint8Array 1.7136 s/op 1.5719 s/op 1.09
compare ViewDU to Uint8Array 1.3328 s/op 1.0432 s/op 1.28
migrate state 1000000 validators, 24 modified, 0 new 826.41 ms/op 747.21 ms/op 1.11
migrate state 1000000 validators, 1700 modified, 1000 new 1.0377 s/op 903.52 ms/op 1.15
migrate state 1000000 validators, 3400 modified, 2000 new 1.3649 s/op 1.1006 s/op 1.24
migrate state 1500000 validators, 24 modified, 0 new 886.20 ms/op 689.40 ms/op 1.29
migrate state 1500000 validators, 1700 modified, 1000 new 1.0701 s/op 869.44 ms/op 1.23
migrate state 1500000 validators, 3400 modified, 2000 new 1.4009 s/op 978.41 ms/op 1.43
RootCache.getBlockRootAtSlot - 250000 vs - 7PWei 5.4300 ns/op 6.4800 ns/op 0.84
state getBlockRootAtSlot - 250000 vs - 7PWei 1.1851 us/op 400.10 ns/op 2.96
computeProposers - vc 250000 10.510 ms/op 5.5577 ms/op 1.89
computeEpochShuffling - vc 250000 48.524 ms/op 35.915 ms/op 1.35
getNextSyncCommittee - vc 250000 162.91 ms/op 97.955 ms/op 1.66
computeSigningRoot for AttestationData 29.669 us/op 14.733 us/op 2.01
hash AttestationData serialized data then Buffer.toString(base64) 1.9219 us/op 1.2239 us/op 1.57
toHexString serialized data 1.1925 us/op 819.88 ns/op 1.45
Buffer.toString(base64) 215.96 ns/op 150.73 ns/op 1.43
nodejs block root to RootHex using toHex 199.80 ns/op 110.53 ns/op 1.81
nodejs block root to RootHex using toRootHex 112.78 ns/op 71.189 ns/op 1.58
browser block root to RootHex using the deprecated toHexString 308.06 ns/op 212.09 ns/op 1.45
browser block root to RootHex using toHex 317.14 ns/op 178.01 ns/op 1.78
browser block root to RootHex using toRootHex 229.94 ns/op 156.49 ns/op 1.47

Please sign in to comment.