Skip to content

Commit

Permalink
feat: update libp2p (#6285)
Browse files Browse the repository at this point in the history
* wip

* chore: update discv5 and enr

* chore: bump dependencies

* chore: fix import statement

* chore: update libp2p dependencies

* chore: yarn.lock cleanup

* chore: update discv5

* feat: revamp libp2p dashboard

* Clean up metrics registry type casts

* chore: fix lint / build errors

* chore: more import updates

* chore: more yarn.lock cleanup

* chore: update gossipsub

---------

Co-authored-by: Nico Flaig <[email protected]>
  • Loading branch information
wemeetagain and nflaig authored Jan 16, 2024
1 parent 4ec413c commit 9eb9cce
Show file tree
Hide file tree
Showing 65 changed files with 1,083 additions and 932 deletions.
470 changes: 378 additions & 92 deletions dashboards/lodestar_libp2p.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
"karma-spec-reporter": "^0.0.36",
"karma-webpack": "^5.0.0",
"lerna": "^7.3.0",
"libp2p": "0.46.12",
"libp2p": "1.1.1",
"mocha": "^10.2.0",
"node-gyp": "^9.4.0",
"npm-run-all": "^4.1.5",
Expand Down
36 changes: 19 additions & 17 deletions packages/beacon-node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,10 @@
"@chainsafe/as-sha256": "^0.3.1",
"@chainsafe/bls": "7.1.1",
"@chainsafe/blst": "^0.2.9",
"@chainsafe/discv5": "^5.1.0",
"@chainsafe/libp2p-gossipsub": "^10.1.1",
"@chainsafe/libp2p-noise": "^13.0.1",
"@chainsafe/discv5": "^7.1.0",
"@chainsafe/enr": "^2.0.2",
"@chainsafe/libp2p-gossipsub": "^11.1.0",
"@chainsafe/libp2p-noise": "^14.1.0",
"@chainsafe/persistent-merkle-tree": "^0.6.1",
"@chainsafe/prometheus-gc-stats": "^1.0.0",
"@chainsafe/ssz": "^0.14.0",
Expand All @@ -111,14 +112,15 @@
"@fastify/cors": "^8.2.1",
"@fastify/swagger": "^8.10.0",
"@fastify/swagger-ui": "^1.9.3",
"@libp2p/bootstrap": "^9.0.7",
"@libp2p/interface": "^0.1.2",
"@libp2p/mdns": "^9.0.9",
"@libp2p/mplex": "^9.0.7",
"@libp2p/peer-id": "^3.0.2",
"@libp2p/peer-id-factory": "^3.0.4",
"@libp2p/prometheus-metrics": "^2.0.7",
"@libp2p/tcp": "8.0.8",
"@libp2p/bootstrap": "^10.0.10",
"@libp2p/identify": "^1.0.9",
"@libp2p/interface": "^1.1.1",
"@libp2p/mdns": "^10.0.10",
"@libp2p/mplex": "^10.0.10",
"@libp2p/peer-id": "^4.0.4",
"@libp2p/peer-id-factory": "^4.0.3",
"@libp2p/prometheus-metrics": "^3.0.10",
"@libp2p/tcp": "9.0.10",
"@lodestar/api": "^1.14.0",
"@lodestar/config": "^1.14.0",
"@lodestar/db": "^1.14.0",
Expand All @@ -139,20 +141,20 @@
"datastore-level": "^10.1.1",
"deepmerge": "^4.3.1",
"fastify": "^4.19.0",
"interface-datastore": "^8.2.0",
"it-all": "^3.0.2",
"interface-datastore": "^8.2.7",
"it-all": "^3.0.4",
"it-pipe": "^3.0.1",
"jwt-simple": "0.5.6",
"libp2p": "0.46.12",
"libp2p": "1.1.1",
"multiformats": "^11.0.1",
"prom-client": "^15.1.0",
"qs": "^6.11.1",
"snappyjs": "^0.7.0",
"strict-event-emitter-types": "^2.0.0",
"systeminformation": "^5.17.12",
"uint8-varint": "^2.0.1",
"uint8arraylist": "^2.4.3",
"uint8arrays": "^4.0.3",
"uint8-varint": "^2.0.2",
"uint8arraylist": "^2.4.7",
"uint8arrays": "^4.0.9",
"xxhash-wasm": "1.0.2"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/beacon-node/src/api/impl/node/utils.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {Connection, StreamStatus} from "@libp2p/interface/connection";
import {Connection, StreamStatus} from "@libp2p/interface";
import {routes} from "@lodestar/api";

/**
Expand Down
5 changes: 2 additions & 3 deletions packages/beacon-node/src/network/core/networkCore.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import {PeerId} from "@libp2p/interface/peer-id";
import {Connection, PeerId} from "@libp2p/interface";
import {multiaddr} from "@multiformats/multiaddr";
import {Connection} from "@libp2p/interface/connection";
import {PublishOpts} from "@chainsafe/libp2p-gossipsub/types";
import {PeerScoreStatsDump} from "@chainsafe/libp2p-gossipsub/dist/src/score/peer-score.js";
import {fromHexString} from "@chainsafe/ssz";
import {ENR} from "@chainsafe/discv5";
import {ENR} from "@chainsafe/enr";
import {routes} from "@lodestar/api";
import {BeaconConfig} from "@lodestar/config";
import type {LoggerNode} from "@lodestar/logger/node";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import worker_threads 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 {PeerId} from "@libp2p/interface/peer-id";
import {PeerId} from "@libp2p/interface";
import {exportToProtobuf} from "@libp2p/peer-id-factory";
import {routes} from "@lodestar/api";
import {BeaconConfig, chainConfigToJson} from "@lodestar/config";
Expand Down
10 changes: 5 additions & 5 deletions packages/beacon-node/src/network/discv5/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import EventEmitter from "events";
import {PeerId} from "@libp2p/interface/peer-id";
import {PeerId} from "@libp2p/interface";
import StrictEventEmitter from "strict-event-emitter-types";
import {exportToProtobuf} from "@libp2p/peer-id-factory";
import {createKeypairFromPeerId, ENR, ENRData, IKeypair, SignableENR} from "@chainsafe/discv5";
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";
Expand All @@ -25,7 +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: IKeypair;
private readonly keypair;
private readonly subscription: {unsubscribe: () => void};
private closed = false;

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

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

Expand Down Expand Up @@ -80,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.keypair);
return new SignableENR(obj.kvs, obj.seq, this.keypair.privateKey);
}

setEnrValue(key: string, value: Uint8Array): Promise<void> {
Expand Down
3 changes: 2 additions & 1 deletion packages/beacon-node/src/network/discv5/types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import {Discv5, ENRData, SignableENRData} from "@chainsafe/discv5";
import {Discv5} from "@chainsafe/discv5";
import {ENRData, SignableENRData} from "@chainsafe/enr";
import {Observable} from "@chainsafe/threads/observable";
import {ChainConfig} from "@lodestar/config";
import {LoggerNodeOpts} from "@lodestar/logger/node";
Expand Down
2 changes: 1 addition & 1 deletion packages/beacon-node/src/network/discv5/utils.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {ENR} from "@chainsafe/discv5";
import {ENR} from "@chainsafe/enr";
import {BeaconConfig} from "@lodestar/config";
import {ENRKey} from "../metadata.js";

Expand Down
17 changes: 5 additions & 12 deletions packages/beacon-node/src/network/discv5/worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,8 @@ 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 {
createKeypairFromPeerId,
Discv5,
ENR,
ENRData,
IDiscv5CreateOptions,
SignableENR,
SignableENRData,
} from "@chainsafe/discv5";
import {Discv5} from "@chainsafe/discv5";
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 @@ -51,20 +44,20 @@ if (workerData.metrics) {
}

const peerId = await createFromProtobuf(workerData.peerIdProto);
const keypair = createKeypairFromPeerId(peerId);
const keypair = createPrivateKeyFromPeerId(peerId);

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

// Initialize discv5
const discv5 = Discv5.create({
enr: SignableENR.decodeTxt(workerData.enr, keypair),
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,
},
config: workerData.config,
metricsRegistry: metricsRegistry as IDiscv5CreateOptions["metricsRegistry"],
metricsRegistry,
});

// Load boot enrs
Expand Down
3 changes: 1 addition & 2 deletions packages/beacon-node/src/network/events.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import {EventEmitter} from "events";
import {PeerId} from "@libp2p/interface/peer-id";
import {TopicValidatorResult} from "@libp2p/interface/pubsub";
import {PeerId, TopicValidatorResult} from "@libp2p/interface";
import {phase0, RootHex} from "@lodestar/types";
import {BlockInput} from "../chain/blocks/types.js";
import {StrictEventEmitterSingleArg} from "../util/strictEvents.js";
Expand Down
2 changes: 1 addition & 1 deletion packages/beacon-node/src/network/gossip/encoding.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {compress, uncompress} from "snappyjs";
import xxhashFactory from "xxhash-wasm";
import {Message} from "@libp2p/interface/pubsub";
import {Message} from "@libp2p/interface";
import {digest} from "@chainsafe/as-sha256";
import {RPC} from "@chainsafe/libp2p-gossipsub/message";
import {intToBytes, toHex} from "@lodestar/utils";
Expand Down
2 changes: 1 addition & 1 deletion packages/beacon-node/src/network/gossip/interface.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {Libp2p} from "libp2p";
import {Message, TopicValidatorResult} from "@libp2p/interface/pubsub";
import {Message, TopicValidatorResult} from "@libp2p/interface";
import {PeerIdStr} from "@chainsafe/libp2p-gossipsub/types";
import {ForkName} from "@lodestar/params";
import {allForks, altair, capella, deneb, phase0, Slot} from "@lodestar/types";
Expand Down
53 changes: 35 additions & 18 deletions packages/beacon-node/src/network/interface.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
import {Libp2p as ILibp2p} from "libp2p";
import {Components} from "libp2p/components";
import {
Libp2pEvents,
ComponentLogger,
NodeInfo,
ConnectionProtector,
ConnectionGater,
ContentRouting,
TypedEventTarget,
Metrics,
PeerId,
PeerRouting,
PeerStore,
Upgrader,
} from "@libp2p/interface";
import type {AddressManager, ConnectionManager, Registrar, TransportManager} from "@libp2p/interface-internal";
import type {Datastore} from "interface-datastore";
import {Slot, SlotRootHex, allForks, altair, capella, deneb, phase0} from "@lodestar/types";
import {PeerIdStr} from "../util/peerId.js";
import {INetworkEventBus} from "./events.js";
Expand Down Expand Up @@ -64,21 +79,23 @@ export interface INetwork extends INetworkCorePublic {
writeDiscv5HeapSnapshot(prefix: string, dirpath: string): Promise<string>;
}

export type LodestarComponents = Pick<
Components,
| "peerId"
| "events"
| "addressManager"
| "peerStore"
| "upgrader"
| "registrar"
| "connectionManager"
| "transportManager"
| "connectionGater"
| "contentRouting"
| "peerRouting"
| "datastore"
| "connectionProtector"
| "metrics"
>;
export type LodestarComponents = {
peerId: PeerId;
nodeInfo: NodeInfo;
logger: ComponentLogger;
events: TypedEventTarget<Libp2pEvents>;
addressManager: AddressManager;
peerStore: PeerStore;
upgrader: Upgrader;
registrar: Registrar;
connectionManager: ConnectionManager;
transportManager: TransportManager;
connectionGater: ConnectionGater;
contentRouting: ContentRouting;
peerRouting: PeerRouting;
datastore: Datastore;
connectionProtector?: ConnectionProtector;
metrics?: Metrics;
};

export type Libp2p = ILibp2p<{components: LodestarComponents}>;
20 changes: 10 additions & 10 deletions packages/beacon-node/src/network/libp2p/index.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
import {PeerId} from "@libp2p/interface/peer-id";
import {PeerId} from "@libp2p/interface";
import {Registry} from "prom-client";
import {ENR} from "@chainsafe/discv5";
import type {Components} from "libp2p/components";
import {identifyService} from "libp2p/identify";
import {ENR} from "@chainsafe/enr";
import {identify} from "@libp2p/identify";
import {bootstrap} from "@libp2p/bootstrap";
import {mdns} from "@libp2p/mdns";
import {createLibp2p} from "libp2p";
import {mplex} from "@libp2p/mplex";
import {prometheusMetrics} from "@libp2p/prometheus-metrics";
import {tcp} from "@libp2p/tcp";
import {noise} from "@chainsafe/libp2p-noise";
import {defaultNetworkOptions, NetworkOptions} from "../options.js";
import {Eth2PeerDataStore} from "../peers/datastore.js";
import {Libp2p} from "../interface.js";
import {createNoise} from "./noise.js";
import {Libp2p, LodestarComponents} from "../interface.js";

export type NodeJsLibp2pOpts = {
peerStoreDir?: string;
Expand Down Expand Up @@ -70,7 +69,7 @@ export async function createNodeJsLibp2p(
listen: localMultiaddrs,
announce: [],
},
connectionEncryption: [createNoise()],
connectionEncryption: [noise()],
// Reject connections when the server's connection count gets high
transports: [
tcp({
Expand Down Expand Up @@ -98,7 +97,6 @@ export async function createNodeJsLibp2p(
// dialer config
maxParallelDials: 100,
maxPeerAddrsToDial: 4,
maxParallelDialsPerPeer: 2,
dialTimeout: 30_000,

// Rely entirely on lodestar's peer manager to prune connections
Expand All @@ -111,13 +109,15 @@ export async function createNodeJsLibp2p(
},
datastore,
services: {
identify: identifyService({
identify: identify({
agentVersion: networkOpts.private ? "" : networkOpts.version ? `lodestar/${networkOpts.version}` : "lodestar",
}),
// individual components are specified because the components object is a Proxy
// and passing it here directly causes problems downstream, not to mention is slowwww
components: (components: Components) => ({
components: (components: LodestarComponents) => ({
peerId: components.peerId,
nodeInfo: components.nodeInfo,
logger: components.logger,
events: components.events,
addressManager: components.addressManager,
peerStore: components.peerStore,
Expand Down
Loading

1 comment on commit 9eb9cce

@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: 9eb9cce Previous: 4ec413c Ratio
forkChoice updateHead vc 600000 bc 64 eq 300000 62.507 ms/op 17.932 ms/op 3.49
Full benchmark results
Benchmark suite Current: 9eb9cce Previous: 4ec413c Ratio
getPubkeys - index2pubkey - req 1000 vs - 250000 vc 791.59 us/op 566.24 us/op 1.40
getPubkeys - validatorsArr - req 1000 vs - 250000 vc 103.01 us/op 115.40 us/op 0.89
BLS verify - blst-native 1.3680 ms/op 1.3746 ms/op 1.00
BLS verifyMultipleSignatures 3 - blst-native 2.8373 ms/op 2.8624 ms/op 0.99
BLS verifyMultipleSignatures 8 - blst-native 6.3555 ms/op 6.2259 ms/op 1.02
BLS verifyMultipleSignatures 32 - blst-native 23.450 ms/op 22.838 ms/op 1.03
BLS verifyMultipleSignatures 64 - blst-native 46.093 ms/op 45.329 ms/op 1.02
BLS verifyMultipleSignatures 128 - blst-native 91.733 ms/op 89.131 ms/op 1.03
BLS deserializing 10000 signatures 958.74 ms/op 932.74 ms/op 1.03
BLS deserializing 100000 signatures 9.7453 s/op 9.5380 s/op 1.02
BLS verifyMultipleSignatures - same message - 3 - blst-native 1.5295 ms/op 1.4026 ms/op 1.09
BLS verifyMultipleSignatures - same message - 8 - blst-native 1.6159 ms/op 1.7452 ms/op 0.93
BLS verifyMultipleSignatures - same message - 32 - blst-native 2.4445 ms/op 3.1271 ms/op 0.78
BLS verifyMultipleSignatures - same message - 64 - blst-native 3.9249 ms/op 4.3829 ms/op 0.90
BLS verifyMultipleSignatures - same message - 128 - blst-native 6.1466 ms/op 7.8576 ms/op 0.78
BLS aggregatePubkeys 32 - blst-native 28.447 us/op 27.462 us/op 1.04
BLS aggregatePubkeys 128 - blst-native 110.03 us/op 101.83 us/op 1.08
getAttestationsForBlock 52.539 ms/op 56.860 ms/op 0.92
getSlashingsAndExits - default max 168.34 us/op 133.79 us/op 1.26
getSlashingsAndExits - 2k 500.70 us/op 541.88 us/op 0.92
proposeBlockBody type=full, size=empty 6.3014 ms/op 5.8862 ms/op 1.07
isKnown best case - 1 super set check 375.00 ns/op 601.00 ns/op 0.62
isKnown normal case - 2 super set checks 400.00 ns/op 585.00 ns/op 0.68
isKnown worse case - 16 super set checks 436.00 ns/op 648.00 ns/op 0.67
CheckpointStateCache - add get delete 6.3900 us/op 6.2040 us/op 1.03
validate api signedAggregateAndProof - struct 3.0515 ms/op 2.8824 ms/op 1.06
validate gossip signedAggregateAndProof - struct 3.0198 ms/op 2.8713 ms/op 1.05
validate gossip attestation - vc 640000 1.4890 ms/op 1.4228 ms/op 1.05
batch validate gossip attestation - vc 640000 - chunk 32 181.00 us/op 178.20 us/op 1.02
batch validate gossip attestation - vc 640000 - chunk 64 184.28 us/op 155.59 us/op 1.18
batch validate gossip attestation - vc 640000 - chunk 128 157.37 us/op 151.73 us/op 1.04
batch validate gossip attestation - vc 640000 - chunk 256 138.16 us/op 143.41 us/op 0.96
pickEth1Vote - no votes 1.3260 ms/op 1.3954 ms/op 0.95
pickEth1Vote - max votes 13.394 ms/op 17.256 ms/op 0.78
pickEth1Vote - Eth1Data hashTreeRoot value x2048 21.799 ms/op 23.571 ms/op 0.92
pickEth1Vote - Eth1Data hashTreeRoot tree x2048 30.195 ms/op 38.734 ms/op 0.78
pickEth1Vote - Eth1Data fastSerialize value x2048 648.50 us/op 787.38 us/op 0.82
pickEth1Vote - Eth1Data fastSerialize tree x2048 7.0413 ms/op 7.3526 ms/op 0.96
bytes32 toHexString 547.00 ns/op 623.00 ns/op 0.88
bytes32 Buffer.toString(hex) 293.00 ns/op 304.00 ns/op 0.96
bytes32 Buffer.toString(hex) from Uint8Array 438.00 ns/op 534.00 ns/op 0.82
bytes32 Buffer.toString(hex) + 0x 290.00 ns/op 311.00 ns/op 0.93
Object access 1 prop 0.16600 ns/op 0.23200 ns/op 0.72
Map access 1 prop 0.15200 ns/op 0.16000 ns/op 0.95
Object get x1000 8.0580 ns/op 8.2100 ns/op 0.98
Map get x1000 0.79600 ns/op 0.96100 ns/op 0.83
Object set x1000 53.724 ns/op 67.881 ns/op 0.79
Map set x1000 42.656 ns/op 54.869 ns/op 0.78
Return object 10000 times 0.25040 ns/op 0.26350 ns/op 0.95
Throw Error 10000 times 3.9591 us/op 4.1060 us/op 0.96
fastMsgIdFn sha256 / 200 bytes 3.4080 us/op 3.5380 us/op 0.96
fastMsgIdFn h32 xxhash / 200 bytes 294.00 ns/op 352.00 ns/op 0.84
fastMsgIdFn h64 xxhash / 200 bytes 346.00 ns/op 398.00 ns/op 0.87
fastMsgIdFn sha256 / 1000 bytes 12.100 us/op 11.890 us/op 1.02
fastMsgIdFn h32 xxhash / 1000 bytes 459.00 ns/op 499.00 ns/op 0.92
fastMsgIdFn h64 xxhash / 1000 bytes 445.00 ns/op 491.00 ns/op 0.91
fastMsgIdFn sha256 / 10000 bytes 105.99 us/op 105.73 us/op 1.00
fastMsgIdFn h32 xxhash / 10000 bytes 2.0250 us/op 2.0610 us/op 0.98
fastMsgIdFn h64 xxhash / 10000 bytes 1.4000 us/op 1.4290 us/op 0.98
send data - 1000 256B messages 20.806 ms/op 23.893 ms/op 0.87
send data - 1000 512B messages 27.238 ms/op 29.842 ms/op 0.91
send data - 1000 1024B messages 42.930 ms/op 44.722 ms/op 0.96
send data - 1000 1200B messages 38.623 ms/op 47.288 ms/op 0.82
send data - 1000 2048B messages 55.818 ms/op 56.141 ms/op 0.99
send data - 1000 4096B messages 49.729 ms/op 54.741 ms/op 0.91
send data - 1000 16384B messages 118.16 ms/op 126.36 ms/op 0.94
send data - 1000 65536B messages 556.71 ms/op 490.40 ms/op 1.14
enrSubnets - fastDeserialize 64 bits 1.7200 us/op 1.4950 us/op 1.15
enrSubnets - ssz BitVector 64 bits 620.00 ns/op 550.00 ns/op 1.13
enrSubnets - fastDeserialize 4 bits 278.00 ns/op 204.00 ns/op 1.36
enrSubnets - ssz BitVector 4 bits 771.00 ns/op 555.00 ns/op 1.39
prioritizePeers score -10:0 att 32-0.1 sync 2-0 158.24 us/op 134.50 us/op 1.18
prioritizePeers score 0:0 att 32-0.25 sync 2-0.25 174.28 us/op 171.54 us/op 1.02
prioritizePeers score 0:0 att 32-0.5 sync 2-0.5 246.50 us/op 216.38 us/op 1.14
prioritizePeers score 0:0 att 64-0.75 sync 4-0.75 425.84 us/op 354.09 us/op 1.20
prioritizePeers score 0:0 att 64-1 sync 4-1 431.71 us/op 434.66 us/op 0.99
array of 16000 items push then shift 2.0011 us/op 1.7734 us/op 1.13
LinkedList of 16000 items push then shift 11.875 ns/op 9.5090 ns/op 1.25
array of 16000 items push then pop 131.59 ns/op 128.79 ns/op 1.02
LinkedList of 16000 items push then pop 12.246 ns/op 10.123 ns/op 1.21
array of 24000 items push then shift 2.8680 us/op 2.8899 us/op 0.99
LinkedList of 24000 items push then shift 10.988 ns/op 11.825 ns/op 0.93
array of 24000 items push then pop 198.24 ns/op 197.79 ns/op 1.00
LinkedList of 24000 items push then pop 11.729 ns/op 11.786 ns/op 1.00
intersect bitArray bitLen 8 7.9110 ns/op 7.1680 ns/op 1.10
intersect array and set length 8 109.27 ns/op 105.55 ns/op 1.04
intersect bitArray bitLen 128 42.096 ns/op 48.336 ns/op 0.87
intersect array and set length 128 1.3022 us/op 1.2528 us/op 1.04
bitArray.getTrueBitIndexes() bitLen 128 2.1540 us/op 2.5870 us/op 0.83
bitArray.getTrueBitIndexes() bitLen 248 3.5600 us/op 3.8400 us/op 0.93
bitArray.getTrueBitIndexes() bitLen 512 8.6730 us/op 7.0770 us/op 1.23
Buffer.concat 32 items 1.4250 us/op 1.2530 us/op 1.14
Uint8Array.set 32 items 2.6590 us/op 2.4320 us/op 1.09
Set add up to 64 items then delete first 6.0124 us/op 5.4317 us/op 1.11
OrderedSet add up to 64 items then delete first 8.1531 us/op 6.7675 us/op 1.20
Set add up to 64 items then delete last 6.4095 us/op 5.5213 us/op 1.16
OrderedSet add up to 64 items then delete last 9.0354 us/op 7.3127 us/op 1.24
Set add up to 64 items then delete middle 6.8116 us/op 5.4270 us/op 1.26
OrderedSet add up to 64 items then delete middle 10.682 us/op 8.4430 us/op 1.27
Set add up to 128 items then delete first 12.387 us/op 11.005 us/op 1.13
OrderedSet add up to 128 items then delete first 16.667 us/op 14.069 us/op 1.18
Set add up to 128 items then delete last 11.479 us/op 10.167 us/op 1.13
OrderedSet add up to 128 items then delete last 19.986 us/op 14.387 us/op 1.39
Set add up to 128 items then delete middle 12.675 us/op 10.401 us/op 1.22
OrderedSet add up to 128 items then delete middle 27.400 us/op 19.835 us/op 1.38
Set add up to 256 items then delete first 25.894 us/op 21.356 us/op 1.21
OrderedSet add up to 256 items then delete first 34.277 us/op 28.405 us/op 1.21
Set add up to 256 items then delete last 25.513 us/op 21.140 us/op 1.21
OrderedSet add up to 256 items then delete last 42.812 us/op 30.244 us/op 1.42
Set add up to 256 items then delete middle 24.615 us/op 21.417 us/op 1.15
OrderedSet add up to 256 items then delete middle 66.267 us/op 51.890 us/op 1.28
transfer serialized Status (84 B) 2.5780 us/op 1.8750 us/op 1.37
copy serialized Status (84 B) 2.1110 us/op 1.7380 us/op 1.21
transfer serialized SignedVoluntaryExit (112 B) 2.5620 us/op 1.9100 us/op 1.34
copy serialized SignedVoluntaryExit (112 B) 2.3970 us/op 1.9980 us/op 1.20
transfer serialized ProposerSlashing (416 B) 3.2320 us/op 3.2280 us/op 1.00
copy serialized ProposerSlashing (416 B) 3.3670 us/op 2.8430 us/op 1.18
transfer serialized Attestation (485 B) 3.8990 us/op 3.1770 us/op 1.23
copy serialized Attestation (485 B) 3.7870 us/op 2.8130 us/op 1.35
transfer serialized AttesterSlashing (33232 B) 5.5450 us/op 2.3580 us/op 2.35
copy serialized AttesterSlashing (33232 B) 12.540 us/op 7.2910 us/op 1.72
transfer serialized Small SignedBeaconBlock (128000 B) 4.6560 us/op 2.8080 us/op 1.66
copy serialized Small SignedBeaconBlock (128000 B) 40.181 us/op 23.491 us/op 1.71
transfer serialized Avg SignedBeaconBlock (200000 B) 5.7870 us/op 3.3780 us/op 1.71
copy serialized Avg SignedBeaconBlock (200000 B) 53.403 us/op 27.509 us/op 1.94
transfer serialized BlobsSidecar (524380 B) 6.2430 us/op 4.0390 us/op 1.55
copy serialized BlobsSidecar (524380 B) 336.52 us/op 112.71 us/op 2.99
transfer serialized Big SignedBeaconBlock (1000000 B) 14.067 us/op 4.8590 us/op 2.90
copy serialized Big SignedBeaconBlock (1000000 B) 492.89 us/op 173.15 us/op 2.85
pass gossip attestations to forkchoice per slot 5.1405 ms/op 3.8831 ms/op 1.32
forkChoice updateHead vc 100000 bc 64 eq 0 1.0162 ms/op 826.41 us/op 1.23
forkChoice updateHead vc 600000 bc 64 eq 0 8.6248 ms/op 4.4393 ms/op 1.94
forkChoice updateHead vc 1000000 bc 64 eq 0 11.635 ms/op 7.4132 ms/op 1.57
forkChoice updateHead vc 600000 bc 320 eq 0 5.4436 ms/op 4.3076 ms/op 1.26
forkChoice updateHead vc 600000 bc 1200 eq 0 7.2623 ms/op 4.4601 ms/op 1.63
forkChoice updateHead vc 600000 bc 7200 eq 0 7.7341 ms/op 5.4065 ms/op 1.43
forkChoice updateHead vc 600000 bc 64 eq 1000 15.114 ms/op 11.347 ms/op 1.33
forkChoice updateHead vc 600000 bc 64 eq 10000 16.043 ms/op 12.019 ms/op 1.33
forkChoice updateHead vc 600000 bc 64 eq 300000 62.507 ms/op 17.932 ms/op 3.49
computeDeltas 500000 validators 300 proto nodes 8.3379 ms/op 6.8601 ms/op 1.22
computeDeltas 500000 validators 1200 proto nodes 8.4451 ms/op 7.0391 ms/op 1.20
computeDeltas 500000 validators 7200 proto nodes 8.1976 ms/op 6.6578 ms/op 1.23
computeDeltas 750000 validators 300 proto nodes 12.277 ms/op 10.229 ms/op 1.20
computeDeltas 750000 validators 1200 proto nodes 12.609 ms/op 10.597 ms/op 1.19
computeDeltas 750000 validators 7200 proto nodes 11.994 ms/op 10.236 ms/op 1.17
computeDeltas 1400000 validators 300 proto nodes 23.369 ms/op 18.995 ms/op 1.23
computeDeltas 1400000 validators 1200 proto nodes 24.034 ms/op 18.982 ms/op 1.27
computeDeltas 1400000 validators 7200 proto nodes 24.347 ms/op 19.452 ms/op 1.25
computeDeltas 2100000 validators 300 proto nodes 32.664 ms/op 30.981 ms/op 1.05
computeDeltas 2100000 validators 1200 proto nodes 32.968 ms/op 29.001 ms/op 1.14
computeDeltas 2100000 validators 7200 proto nodes 34.412 ms/op 28.820 ms/op 1.19
computeProposerBoostScoreFromBalances 500000 validators 4.5806 ms/op 3.7960 ms/op 1.21
computeProposerBoostScoreFromBalances 750000 validators 4.6154 ms/op 3.7953 ms/op 1.22
computeProposerBoostScoreFromBalances 1400000 validators 4.7396 ms/op 3.8729 ms/op 1.22
computeProposerBoostScoreFromBalances 2100000 validators 4.5402 ms/op 4.1025 ms/op 1.11
altair processAttestation - 250000 vs - 7PWei normalcase 5.0228 ms/op 4.4069 ms/op 1.14
altair processAttestation - 250000 vs - 7PWei worstcase 6.1000 ms/op 4.3594 ms/op 1.40
altair processAttestation - setStatus - 1/6 committees join 281.64 us/op 154.97 us/op 1.82
altair processAttestation - setStatus - 1/3 committees join 459.03 us/op 288.82 us/op 1.59
altair processAttestation - setStatus - 1/2 committees join 624.70 us/op 415.75 us/op 1.50
altair processAttestation - setStatus - 2/3 committees join 873.25 us/op 507.61 us/op 1.72
altair processAttestation - setStatus - 4/5 committees join 1.1522 ms/op 714.76 us/op 1.61
altair processAttestation - setStatus - 100% committees join 1.1969 ms/op 831.35 us/op 1.44
altair processBlock - 250000 vs - 7PWei normalcase 17.274 ms/op 11.870 ms/op 1.46
altair processBlock - 250000 vs - 7PWei normalcase hashState 57.265 ms/op 49.545 ms/op 1.16
altair processBlock - 250000 vs - 7PWei worstcase 58.490 ms/op 43.860 ms/op 1.33
altair processBlock - 250000 vs - 7PWei worstcase hashState 139.63 ms/op 122.91 ms/op 1.14
phase0 processBlock - 250000 vs - 7PWei normalcase 5.4960 ms/op 3.3582 ms/op 1.64
phase0 processBlock - 250000 vs - 7PWei worstcase 40.786 ms/op 40.604 ms/op 1.00
altair processEth1Data - 250000 vs - 7PWei normalcase 1.0833 ms/op 873.71 us/op 1.24
getExpectedWithdrawals 250000 eb:1,eth1:1,we:0,wn:0,smpl:15 26.646 us/op 23.962 us/op 1.11
getExpectedWithdrawals 250000 eb:0.95,eth1:0.1,we:0.05,wn:0,smpl:219 126.28 us/op 123.92 us/op 1.02
getExpectedWithdrawals 250000 eb:0.95,eth1:0.3,we:0.05,wn:0,smpl:42 31.306 us/op 30.844 us/op 1.01
getExpectedWithdrawals 250000 eb:0.95,eth1:0.7,we:0.05,wn:0,smpl:18 27.636 us/op 27.332 us/op 1.01
getExpectedWithdrawals 250000 eb:0.1,eth1:0.1,we:0,wn:0,smpl:1020 235.91 us/op 274.54 us/op 0.86
getExpectedWithdrawals 250000 eb:0.03,eth1:0.03,we:0,wn:0,smpl:11777 2.9163 ms/op 1.8274 ms/op 1.60
getExpectedWithdrawals 250000 eb:0.01,eth1:0.01,we:0,wn:0,smpl:16384 3.2881 ms/op 2.3205 ms/op 1.42
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,smpl:16384 2.8855 ms/op 3.1938 ms/op 0.90
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,nocache,smpl:16384 5.7392 ms/op 5.2338 ms/op 1.10
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,smpl:16384 3.4394 ms/op 3.3100 ms/op 1.04
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,nocache,smpl:16384 10.660 ms/op 7.2485 ms/op 1.47
Tree 40 250000 create 855.15 ms/op 671.54 ms/op 1.27
Tree 40 250000 get(125000) 230.35 ns/op 219.95 ns/op 1.05
Tree 40 250000 set(125000) 1.3870 us/op 1.4503 us/op 0.96
Tree 40 250000 toArray() 24.882 ms/op 25.545 ms/op 0.97
Tree 40 250000 iterate all - toArray() + loop 28.085 ms/op 29.920 ms/op 0.94
Tree 40 250000 iterate all - get(i) 82.785 ms/op 80.195 ms/op 1.03
MutableVector 250000 create 22.605 ms/op 17.589 ms/op 1.29
MutableVector 250000 get(125000) 7.0330 ns/op 6.9550 ns/op 1.01
MutableVector 250000 set(125000) 438.14 ns/op 484.20 ns/op 0.90
MutableVector 250000 toArray() 5.6022 ms/op 4.9976 ms/op 1.12
MutableVector 250000 iterate all - toArray() + loop 5.6824 ms/op 5.0754 ms/op 1.12
MutableVector 250000 iterate all - get(i) 1.7159 ms/op 1.5722 ms/op 1.09
Array 250000 create 6.0469 ms/op 3.6792 ms/op 1.64
Array 250000 clone - spread 2.4923 ms/op 1.2643 ms/op 1.97
Array 250000 get(125000) 2.4120 ns/op 1.0900 ns/op 2.21
Array 250000 set(125000) 6.1790 ns/op 4.6190 ns/op 1.34
Array 250000 iterate all - loop 198.24 us/op 165.69 us/op 1.20
effectiveBalanceIncrements clone Uint8Array 300000 83.049 us/op 49.131 us/op 1.69
effectiveBalanceIncrements clone MutableVector 300000 538.00 ns/op 379.00 ns/op 1.42
effectiveBalanceIncrements rw all Uint8Array 300000 209.70 us/op 203.21 us/op 1.03
effectiveBalanceIncrements rw all MutableVector 300000 140.29 ms/op 95.054 ms/op 1.48
phase0 afterProcessEpoch - 250000 vs - 7PWei 126.02 ms/op 119.46 ms/op 1.05
phase0 beforeProcessEpoch - 250000 vs - 7PWei 61.049 ms/op 59.418 ms/op 1.03
altair processEpoch - mainnet_e81889 616.40 ms/op 530.48 ms/op 1.16
mainnet_e81889 - altair beforeProcessEpoch 123.82 ms/op 89.318 ms/op 1.39
mainnet_e81889 - altair processJustificationAndFinalization 26.018 us/op 16.517 us/op 1.58
mainnet_e81889 - altair processInactivityUpdates 8.1916 ms/op 7.1959 ms/op 1.14
mainnet_e81889 - altair processRewardsAndPenalties 74.802 ms/op 68.637 ms/op 1.09
mainnet_e81889 - altair processRegistryUpdates 3.7960 us/op 3.2270 us/op 1.18
mainnet_e81889 - altair processSlashings 727.00 ns/op 457.00 ns/op 1.59
mainnet_e81889 - altair processEth1DataReset 935.00 ns/op 574.00 ns/op 1.63
mainnet_e81889 - altair processEffectiveBalanceUpdates 1.9928 ms/op 1.7683 ms/op 1.13
mainnet_e81889 - altair processSlashingsReset 9.6330 us/op 3.9480 us/op 2.44
mainnet_e81889 - altair processRandaoMixesReset 8.3430 us/op 5.0600 us/op 1.65
mainnet_e81889 - altair processHistoricalRootsUpdate 882.00 ns/op 840.00 ns/op 1.05
mainnet_e81889 - altair processParticipationFlagUpdates 2.6210 us/op 2.3910 us/op 1.10
mainnet_e81889 - altair processSyncCommitteeUpdates 1.0270 us/op 626.00 ns/op 1.64
mainnet_e81889 - altair afterProcessEpoch 127.13 ms/op 123.73 ms/op 1.03
capella processEpoch - mainnet_e217614 2.5535 s/op 2.7245 s/op 0.94
mainnet_e217614 - capella beforeProcessEpoch 540.00 ms/op 560.45 ms/op 0.96
mainnet_e217614 - capella processJustificationAndFinalization 30.922 us/op 19.938 us/op 1.55
mainnet_e217614 - capella processInactivityUpdates 28.395 ms/op 25.188 ms/op 1.13
mainnet_e217614 - capella processRewardsAndPenalties 463.85 ms/op 504.26 ms/op 0.92
mainnet_e217614 - capella processRegistryUpdates 30.967 us/op 50.575 us/op 0.61
mainnet_e217614 - capella processSlashings 814.00 ns/op 1.5060 us/op 0.54
mainnet_e217614 - capella processEth1DataReset 714.00 ns/op 1.3290 us/op 0.54
mainnet_e217614 - capella processEffectiveBalanceUpdates 6.3268 ms/op 8.4200 ms/op 0.75
mainnet_e217614 - capella processSlashingsReset 6.4720 us/op 8.8310 us/op 0.73
mainnet_e217614 - capella processRandaoMixesReset 7.5620 us/op 11.951 us/op 0.63
mainnet_e217614 - capella processHistoricalRootsUpdate 1.1990 us/op 1.1690 us/op 1.03
mainnet_e217614 - capella processParticipationFlagUpdates 4.3360 us/op 2.7940 us/op 1.55
mainnet_e217614 - capella afterProcessEpoch 371.76 ms/op 380.87 ms/op 0.98
phase0 processEpoch - mainnet_e58758 739.45 ms/op 640.46 ms/op 1.15
mainnet_e58758 - phase0 beforeProcessEpoch 203.35 ms/op 255.95 ms/op 0.79
mainnet_e58758 - phase0 processJustificationAndFinalization 32.653 us/op 32.598 us/op 1.00
mainnet_e58758 - phase0 processRewardsAndPenalties 64.884 ms/op 52.327 ms/op 1.24
mainnet_e58758 - phase0 processRegistryUpdates 25.976 us/op 22.150 us/op 1.17
mainnet_e58758 - phase0 processSlashings 1.0570 us/op 1.3150 us/op 0.80
mainnet_e58758 - phase0 processEth1DataReset 1.1170 us/op 904.00 ns/op 1.24
mainnet_e58758 - phase0 processEffectiveBalanceUpdates 1.6747 ms/op 1.5938 ms/op 1.05
mainnet_e58758 - phase0 processSlashingsReset 7.5670 us/op 5.7780 us/op 1.31
mainnet_e58758 - phase0 processRandaoMixesReset 9.4380 us/op 9.3440 us/op 1.01
mainnet_e58758 - phase0 processHistoricalRootsUpdate 1.1370 us/op 975.00 ns/op 1.17
mainnet_e58758 - phase0 processParticipationRecordUpdates 9.3040 us/op 11.809 us/op 0.79
mainnet_e58758 - phase0 afterProcessEpoch 105.97 ms/op 106.15 ms/op 1.00
phase0 processEffectiveBalanceUpdates - 250000 normalcase 2.1864 ms/op 2.1204 ms/op 1.03
phase0 processEffectiveBalanceUpdates - 250000 worstcase 0.5 2.5729 ms/op 1.9463 ms/op 1.32
altair processInactivityUpdates - 250000 normalcase 39.608 ms/op 31.550 ms/op 1.26
altair processInactivityUpdates - 250000 worstcase 50.352 ms/op 30.944 ms/op 1.63
phase0 processRegistryUpdates - 250000 normalcase 20.662 us/op 18.368 us/op 1.12
phase0 processRegistryUpdates - 250000 badcase_full_deposits 580.12 us/op 501.31 us/op 1.16
phase0 processRegistryUpdates - 250000 worstcase 0.5 183.57 ms/op 175.06 ms/op 1.05
altair processRewardsAndPenalties - 250000 normalcase 68.748 ms/op 67.424 ms/op 1.02
altair processRewardsAndPenalties - 250000 worstcase 84.115 ms/op 60.147 ms/op 1.40
phase0 getAttestationDeltas - 250000 normalcase 14.683 ms/op 14.043 ms/op 1.05
phase0 getAttestationDeltas - 250000 worstcase 13.037 ms/op 13.580 ms/op 0.96
phase0 processSlashings - 250000 worstcase 126.56 us/op 134.01 us/op 0.94
altair processSyncCommitteeUpdates - 250000 213.77 ms/op 172.57 ms/op 1.24
BeaconState.hashTreeRoot - No change 303.00 ns/op 305.00 ns/op 0.99
BeaconState.hashTreeRoot - 1 full validator 178.64 us/op 146.52 us/op 1.22
BeaconState.hashTreeRoot - 32 full validator 1.9040 ms/op 1.6162 ms/op 1.18
BeaconState.hashTreeRoot - 512 full validator 22.272 ms/op 16.970 ms/op 1.31
BeaconState.hashTreeRoot - 1 validator.effectiveBalance 245.27 us/op 219.49 us/op 1.12
BeaconState.hashTreeRoot - 32 validator.effectiveBalance 3.0218 ms/op 3.1971 ms/op 0.95
BeaconState.hashTreeRoot - 512 validator.effectiveBalance 37.984 ms/op 37.175 ms/op 1.02
BeaconState.hashTreeRoot - 1 balances 166.06 us/op 172.96 us/op 0.96
BeaconState.hashTreeRoot - 32 balances 1.5801 ms/op 1.3949 ms/op 1.13
BeaconState.hashTreeRoot - 512 balances 15.919 ms/op 15.677 ms/op 1.02
BeaconState.hashTreeRoot - 250000 balances 291.74 ms/op 264.74 ms/op 1.10
aggregationBits - 2048 els - zipIndexesInBitList 34.288 us/op 24.557 us/op 1.40
byteArrayEquals 32 90.774 ns/op 79.161 ns/op 1.15
Buffer.compare 32 58.936 ns/op 57.192 ns/op 1.03
byteArrayEquals 1024 2.1640 us/op 2.1588 us/op 1.00
Buffer.compare 1024 81.118 ns/op 72.500 ns/op 1.12
byteArrayEquals 16384 37.212 us/op 33.846 us/op 1.10
Buffer.compare 16384 317.16 ns/op 277.11 ns/op 1.14
byteArrayEquals 123687377 285.15 ms/op 270.10 ms/op 1.06
Buffer.compare 123687377 8.4471 ms/op 10.553 ms/op 0.80
byteArrayEquals 32 - diff last byte 83.331 ns/op 83.514 ns/op 1.00
Buffer.compare 32 - diff last byte 60.469 ns/op 62.627 ns/op 0.97
byteArrayEquals 1024 - diff last byte 2.1362 us/op 2.1858 us/op 0.98
Buffer.compare 1024 - diff last byte 76.499 ns/op 77.811 ns/op 0.98
byteArrayEquals 16384 - diff last byte 36.493 us/op 34.029 us/op 1.07
Buffer.compare 16384 - diff last byte 318.87 ns/op 283.82 ns/op 1.12
byteArrayEquals 123687377 - diff last byte 296.69 ms/op 259.06 ms/op 1.15
Buffer.compare 123687377 - diff last byte 9.1159 ms/op 9.0136 ms/op 1.01
byteArrayEquals 32 - random bytes 7.1290 ns/op 6.4650 ns/op 1.10
Buffer.compare 32 - random bytes 70.094 ns/op 64.333 ns/op 1.09
byteArrayEquals 1024 - random bytes 6.1880 ns/op 6.6580 ns/op 0.93
Buffer.compare 1024 - random bytes 66.605 ns/op 63.329 ns/op 1.05
byteArrayEquals 16384 - random bytes 6.3000 ns/op 6.3520 ns/op 0.99
Buffer.compare 16384 - random bytes 69.270 ns/op 63.277 ns/op 1.09
byteArrayEquals 123687377 - random bytes 9.2700 ns/op 10.370 ns/op 0.89
Buffer.compare 123687377 - random bytes 74.540 ns/op 75.200 ns/op 0.99
regular array get 100000 times 49.394 us/op 47.770 us/op 1.03
wrappedArray get 100000 times 48.543 us/op 49.291 us/op 0.98
arrayWithProxy get 100000 times 15.502 ms/op 15.335 ms/op 1.01
ssz.Root.equals 59.572 ns/op 60.087 ns/op 0.99
byteArrayEquals 58.565 ns/op 55.433 ns/op 1.06
Buffer.compare 12.540 ns/op 12.407 ns/op 1.01
shuffle list - 16384 els 7.3903 ms/op 7.2144 ms/op 1.02
shuffle list - 250000 els 108.71 ms/op 106.11 ms/op 1.02
processSlot - 1 slots 19.208 us/op 17.727 us/op 1.08
processSlot - 32 slots 4.5259 ms/op 4.8141 ms/op 0.94
getEffectiveBalanceIncrementsZeroInactive - 250000 vs - 7PWei 60.510 ms/op 70.910 ms/op 0.85
getCommitteeAssignments - req 1 vs - 250000 vc 2.7159 ms/op 2.7580 ms/op 0.98
getCommitteeAssignments - req 100 vs - 250000 vc 4.0714 ms/op 3.9608 ms/op 1.03
getCommitteeAssignments - req 1000 vs - 250000 vc 4.3140 ms/op 4.6624 ms/op 0.93
findModifiedValidators - 10000 modified validators 573.92 ms/op 684.18 ms/op 0.84
findModifiedValidators - 1000 modified validators 447.02 ms/op 544.15 ms/op 0.82
findModifiedValidators - 100 modified validators 458.15 ms/op 494.80 ms/op 0.93
findModifiedValidators - 10 modified validators 463.46 ms/op 524.62 ms/op 0.88
findModifiedValidators - 1 modified validators 485.65 ms/op 492.15 ms/op 0.99
findModifiedValidators - no difference 455.52 ms/op 522.35 ms/op 0.87
compare ViewDUs 5.1169 s/op 5.8222 s/op 0.88
compare each validator Uint8Array 1.9278 s/op 1.9818 s/op 0.97
compare ViewDU to Uint8Array 1.4412 s/op 1.4893 s/op 0.97
migrate state 1000000 validators, 24 modified, 0 new 903.31 ms/op 854.03 ms/op 1.06
migrate state 1000000 validators, 1700 modified, 1000 new 1.2271 s/op 1.2517 s/op 0.98
migrate state 1000000 validators, 3400 modified, 2000 new 1.5579 s/op 1.5201 s/op 1.02
migrate state 1500000 validators, 24 modified, 0 new 1.0198 s/op 947.09 ms/op 1.08
migrate state 1500000 validators, 1700 modified, 1000 new 1.4855 s/op 1.4712 s/op 1.01
migrate state 1500000 validators, 3400 modified, 2000 new 1.9378 s/op 1.9369 s/op 1.00
RootCache.getBlockRootAtSlot - 250000 vs - 7PWei 6.4800 ns/op 5.2500 ns/op 1.23
state getBlockRootAtSlot - 250000 vs - 7PWei 819.92 ns/op 814.03 ns/op 1.01
computeProposers - vc 250000 11.624 ms/op 10.580 ms/op 1.10
computeEpochShuffling - vc 250000 119.66 ms/op 119.75 ms/op 1.00
getNextSyncCommittee - vc 250000 225.91 ms/op 178.70 ms/op 1.26
computeSigningRoot for AttestationData 33.525 us/op 39.753 us/op 0.84
hash AttestationData serialized data then Buffer.toString(base64) 2.7060 us/op 2.6296 us/op 1.03
toHexString serialized data 1.5569 us/op 1.7972 us/op 0.87
Buffer.toString(base64) 255.00 ns/op 292.61 ns/op 0.87

Please sign in to comment.