Skip to content

Commit

Permalink
test: migrate light-client tests to vitest (#6221)
Browse files Browse the repository at this point in the history
  • Loading branch information
nazarhussain authored Dec 28, 2023
1 parent d52fb94 commit 82d7bc2
Show file tree
Hide file tree
Showing 19 changed files with 58 additions and 82 deletions.
6 changes: 0 additions & 6 deletions packages/light-client/.mocharc.yaml

This file was deleted.

3 changes: 0 additions & 3 deletions packages/light-client/.nycrc.json

This file was deleted.

9 changes: 0 additions & 9 deletions packages/light-client/karma.config.cjs

This file was deleted.

7 changes: 5 additions & 2 deletions packages/light-client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,11 @@
"lint:fix": "yarn run lint --fix",
"pretest": "yarn run check-types",
"test": "yarn test:unit && yarn test:e2e",
"test:browsers": "yarn karma start karma.config.cjs",
"test:unit": "LODESTAR_PRESET=minimal nyc --cache-dir .nyc_output/.cache -e .ts mocha 'test/unit/**/*.test.ts'",
"test:unit": "vitest --run --dir test/unit/ --coverage",
"test:browsers": "yarn test:browsers:chrome && yarn test:browsers:firefox && yarn test:browsers:electron",
"test:browsers:chrome": "vitest --run --browser chrome --config ./vitest.browser.config.ts --dir test/unit",
"test:browsers:firefox": "vitest --run --browser firefox --config ./vitest.browser.config.ts --dir test/unit",
"test:browsers:electron": "echo 'Electron tests will be introduced back in the future as soon vitest supports electron.'",
"check-readme": "typescript-docs-verifier"
},
"dependencies": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import bls from "@chainsafe/bls/switchable";
import bls from "@chainsafe/bls";
import type {PublicKey, Signature} from "@chainsafe/bls/types";
import {Root, ssz, allForks} from "@lodestar/types";
import {ChainForkConfig} from "@lodestar/config";
Expand Down
2 changes: 1 addition & 1 deletion packages/light-client/src/utils/utils.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import bls from "@chainsafe/bls/switchable";
import bls from "@chainsafe/bls";
import type {PublicKey} from "@chainsafe/bls/types";
import {BitArray} from "@chainsafe/ssz";
import {altair, Root, ssz} from "@lodestar/types";
Expand Down
2 changes: 1 addition & 1 deletion packages/light-client/src/validation.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import bls from "@chainsafe/bls/switchable";
import bls from "@chainsafe/bls";
import type {PublicKey, Signature} from "@chainsafe/bls/types";
import {altair, Root, Slot, ssz, allForks} from "@lodestar/types";
import {
Expand Down
2 changes: 2 additions & 0 deletions packages/light-client/test/globalSetup.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export async function setup(): Promise<void> {}
export async function teardown(): Promise<void> {}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {expect} from "chai";
import {describe, it, expect} from "vitest";
import {fromHexString} from "@chainsafe/ssz";
import {ssz, allForks} from "@lodestar/types";
import {createBeaconConfig, createChainForkConfig, defaultChainConfig} from "@lodestar/config";
Expand Down Expand Up @@ -91,7 +91,7 @@ describe("isValidLightClientHeader", function () {
testCases.forEach(([name, header]: [string, allForks.LightClientHeader]) => {
it(name, function () {
const isValid = isValidLightClientHeader(config, header);
expect(isValid).to.be.true;
expect(isValid).toBe(true);
});
});
});
18 changes: 4 additions & 14 deletions packages/light-client/test/unit/sync.node.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import {expect} from "chai";
import {init} from "@chainsafe/bls/switchable";
import {describe, it, expect, afterEach, vi} from "vitest";
import {JsonPath, toHexString} from "@chainsafe/ssz";
import {computeDescriptor, TreeOffsetProof} from "@chainsafe/persistent-merkle-tree";
import {EPOCHS_PER_SYNC_COMMITTEE_PERIOD, SLOTS_PER_EPOCH} from "@lodestar/params";
Expand All @@ -21,21 +20,15 @@ import {
lastInMap,
} from "../utils/utils.js";
import {startServer, ServerOpts} from "../utils/server.js";
import {isNode} from "../../src/utils/utils.js";
import {computeSyncPeriodAtSlot} from "../../src/utils/clock.js";
import {LightClientRestTransport} from "../../src/transport/rest.js";

const SOME_HASH = Buffer.alloc(32, 0xff);

describe("sync", () => {
vi.setConfig({testTimeout: 30_000});
const afterEachCbs: (() => Promise<unknown> | unknown)[] = [];

before("init bls", async () => {
// This process has to be done manually because of an issue in Karma runner
// https://github.com/karma-runner/karma/issues/3804
await init(isNode ? "blst-native" : "herumi");
});

afterEach(async () => {
await Promise.all(afterEachCbs);
afterEachCbs.length = 0;
Expand Down Expand Up @@ -168,16 +161,13 @@ describe("sync", () => {
});

// Ensure that the lightclient head is correct
expect(lightclient.getHead().beacon.slot).to.equal(targetSlot, "lightclient.head is not the targetSlot head");
expect(lightclient.getHead().beacon.slot).toBe(targetSlot);

// Fetch proof of "latestExecutionPayloadHeader.stateRoot"
const {proof, header} = await getHeadStateProof(lightclient, api, [["latestExecutionPayloadHeader", "stateRoot"]]);

const recoveredState = ssz.bellatrix.BeaconState.createFromProof(proof, header.beacon.stateRoot);
expect(toHexString(recoveredState.latestExecutionPayloadHeader.stateRoot)).to.equal(
toHexString(executionStateRoot),
"Recovered executionStateRoot from getHeadStateProof() not correct"
);
expect(toHexString(recoveredState.latestExecutionPayloadHeader.stateRoot)).toBe(toHexString(executionStateRoot));
});
});

Expand Down
21 changes: 7 additions & 14 deletions packages/light-client/test/unit/syncInMemory.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {expect} from "chai";
import bls, {init} from "@chainsafe/bls/switchable";
import {describe, it, expect, beforeAll, vi} from "vitest";
import bls from "@chainsafe/bls";
import {createBeaconConfig} from "@lodestar/config";
import {chainConfig} from "@lodestar/config/default";
import {EPOCHS_PER_SYNC_COMMITTEE_PERIOD, SLOTS_PER_EPOCH} from "@lodestar/params";
Expand All @@ -9,7 +9,6 @@ import {BeaconChainLcMock} from "../mocks/BeaconChainLcMock.js";
import {processLightClientUpdate} from "../utils/naive/update.js";
import {IBeaconChainLc, prepareUpdateNaive} from "../utils/prepareUpdateNaive.js";
import {getInteropSyncCommittee, getSyncAggregateSigningRoot, SyncCommitteeKeys} from "../utils/utils.js";
import {isNode} from "../../src/utils/utils.js";

function getSyncCommittee(
syncCommitteesKeys: Map<SyncPeriod, SyncCommitteeKeys>,
Expand All @@ -25,7 +24,7 @@ function getSyncCommittee(

describe("syncInMemory", function () {
// In browser test this process is taking more time than default 2000ms
this.timeout(10000);
vi.setConfig({testTimeout: 10000});

// Fixed params
const genValiRoot = Buffer.alloc(32, 9);
Expand All @@ -35,20 +34,14 @@ describe("syncInMemory", function () {
let updateData: {chain: IBeaconChainLc; blockWithSyncAggregate: altair.BeaconBlock};
let update: altair.LightClientUpdate;

before("init bls", async () => {
// This process has to be done manually because of an issue in Karma runner
// https://github.com/karma-runner/karma/issues/3804
await init(isNode ? "blst-native" : "herumi");
});

before("BLS sanity check", () => {
beforeAll(() => {
const sk = bls.SecretKey.fromBytes(Buffer.alloc(32, 1));
expect(sk.toPublicKey().toHex()).to.equal(
expect(sk.toPublicKey().toHex()).toBe(
"0xaa1a1c26055a329817a5759d877a2795f9499b97d6056edde0eea39512f24e8bc874b4471f0501127abb1ea0d9f68ac1"
);
});

before("Generate data for prepareUpdate", () => {
beforeAll(() => {
// Create a state that has as nextSyncCommittee the committee 2
const finalizedBlockSlot = SLOTS_PER_EPOCH * EPOCHS_PER_SYNC_COMMITTEE_PERIOD + 1;
const headerBlockSlot = finalizedBlockSlot + 1;
Expand Down Expand Up @@ -107,6 +100,6 @@ describe("syncInMemory", function () {
},
};

expect(() => processLightClientUpdate(config, store, update, currentSlot)).to.not.throw();
expect(() => processLightClientUpdate(config, store, update, currentSlot)).not.toThrow();
});
});
4 changes: 2 additions & 2 deletions packages/light-client/test/unit/utils.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {expect} from "chai";
import {describe, it, expect} from "vitest";
import {isValidMerkleBranch} from "../../src/utils/verifyMerkleBranch.js";
import {computeMerkleBranch} from "../utils/utils.js";

Expand All @@ -9,6 +9,6 @@ describe("utils", () => {
const index = 22;
const {root, proof} = computeMerkleBranch(leaf, depth, index);

expect(isValidMerkleBranch(leaf, proof, depth, index, root)).to.equal(true);
expect(isValidMerkleBranch(leaf, proof, depth, index, root)).toBe(true);
});
});
4 changes: 2 additions & 2 deletions packages/light-client/test/unit/utils/chunkify.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {expect} from "chai";
import {describe, it, expect} from "vitest";
import {chunkifyInclusiveRange} from "../../../src/utils/chunkify.js";

describe("utils / chunkifyInclusiveRange", () => {
Expand All @@ -20,7 +20,7 @@ describe("utils / chunkifyInclusiveRange", () => {

for (const {id, from, to, max, result} of testCases) {
it(id, () => {
expect(chunkifyInclusiveRange(from, to, max)).to.deep.equal(result);
expect(chunkifyInclusiveRange(from, to, max)).toEqual(result);
});
}
});
17 changes: 5 additions & 12 deletions packages/light-client/test/unit/validation.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {expect} from "chai";
import bls, {init} from "@chainsafe/bls/switchable";
import {describe, it, expect, beforeAll, vi} from "vitest";
import bls from "@chainsafe/bls";
import {Tree} from "@chainsafe/persistent-merkle-tree";
import {altair, ssz} from "@lodestar/types";
import {chainConfig} from "@lodestar/config/default";
Expand All @@ -14,26 +14,19 @@ import {
import {assertValidLightClientUpdate} from "../../src/validation.js";
import {LightClientSnapshotFast, SyncCommitteeFast} from "../../src/types.js";
import {defaultBeaconBlockHeader, getSyncAggregateSigningRoot, signAndAggregate} from "../utils/utils.js";
import {isNode} from "../../src/utils/utils.js";

describe("validation", function () {
// In browser test this process is taking more time than default 2000ms
// specially on the CI
this.timeout(15000);
vi.setConfig({testTimeout: 15000});

const genValiRoot = Buffer.alloc(32, 9);
const config = createBeaconConfig(chainConfig, genValiRoot);

let update: altair.LightClientUpdate;
let snapshot: LightClientSnapshotFast;

before("prepare bls", async () => {
// This process has to be done manually because of an issue in Karma runner
// https://github.com/karma-runner/karma/issues/3804
await init(isNode ? "blst-native" : "herumi");
});

before("prepare data", function () {
beforeAll(function () {
// Update slot must > snapshot slot
// attestedHeaderSlot must == updateHeaderSlot + 1
const snapshotHeaderSlot = 1;
Expand Down Expand Up @@ -106,6 +99,6 @@ describe("validation", function () {
});

it("should validate valid update", () => {
expect(() => assertValidLightClientUpdate(config, snapshot.nextSyncCommittee, update)).to.not.throw();
expect(() => assertValidLightClientUpdate(config, snapshot.nextSyncCommittee, update)).not.toThrow();
});
});
2 changes: 1 addition & 1 deletion packages/light-client/test/utils/utils.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import bls from "@chainsafe/bls/switchable";
import bls from "@chainsafe/bls";
import {PointFormat, PublicKey, SecretKey} from "@chainsafe/bls/types";
import {hasher, Tree} from "@chainsafe/persistent-merkle-tree";
import {BitArray, fromHexString} from "@chainsafe/ssz";
Expand Down
7 changes: 0 additions & 7 deletions packages/light-client/tsconfig.e2e.json

This file was deleted.

14 changes: 14 additions & 0 deletions packages/light-client/vitest.browser.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import {defineConfig, mergeConfig} from "vitest/config";
import vitestConfig from "../../vitest.base.browser.config";

export default mergeConfig(
vitestConfig,
defineConfig({
test: {
globalSetup: ["./test/globalSetup.ts"],
},
optimizeDeps: {
exclude: ["@chainsafe/blst"],
},
})
);
11 changes: 11 additions & 0 deletions packages/light-client/vitest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import {defineConfig, mergeConfig} from "vitest/config";
import vitestConfig from "../../vitest.base.config";

export default mergeConfig(
vitestConfig,
defineConfig({
test: {
globalSetup: ["./test/globalSetup.ts"],
},
})
);
5 changes: 0 additions & 5 deletions packages/light-client/webpack.test.config.cjs

This file was deleted.

1 comment on commit 82d7bc2

@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: 82d7bc2 Previous: d52fb94 Ratio
Object set x1000 117.60 ns/op 24.216 ns/op 4.86
Map set x1000 75.426 ns/op 17.519 ns/op 4.31
send data - 1000 512B messages 45.533 ms/op 14.775 ms/op 3.08
send data - 1000 1024B messages 68.795 ms/op 21.964 ms/op 3.13
Set add up to 64 items then delete first 5.4489 us/op 1.7277 us/op 3.15
Set add up to 64 items then delete middle 5.7751 us/op 1.8297 us/op 3.16
Set add up to 128 items then delete first 11.561 us/op 3.5987 us/op 3.21
Set add up to 128 items then delete last 11.847 us/op 3.4871 us/op 3.40
Set add up to 128 items then delete middle 11.244 us/op 3.4844 us/op 3.23
Set add up to 256 items then delete first 23.036 us/op 7.4577 us/op 3.09
Set add up to 256 items then delete last 23.235 us/op 7.2347 us/op 3.21
Set add up to 256 items then delete middle 23.128 us/op 7.2383 us/op 3.20
forkChoice updateHead vc 600000 bc 64 eq 300000 39.804 ms/op 11.702 ms/op 3.40
computeDeltas 1400000 validators 300 proto nodes 29.788 ms/op 8.5604 ms/op 3.48
computeDeltas 2100000 validators 300 proto nodes 44.468 ms/op 12.902 ms/op 3.45
Full benchmark results
Benchmark suite Current: 82d7bc2 Previous: d52fb94 Ratio
getPubkeys - index2pubkey - req 1000 vs - 250000 vc 610.63 us/op 748.08 us/op 0.82
getPubkeys - validatorsArr - req 1000 vs - 250000 vc 81.183 us/op 49.313 us/op 1.65
BLS verify - blst-native 1.2961 ms/op 1.0485 ms/op 1.24
BLS verifyMultipleSignatures 3 - blst-native 2.7134 ms/op 2.2332 ms/op 1.22
BLS verifyMultipleSignatures 8 - blst-native 5.9653 ms/op 4.9388 ms/op 1.21
BLS verifyMultipleSignatures 32 - blst-native 22.424 ms/op 18.163 ms/op 1.23
BLS verifyMultipleSignatures 64 - blst-native 43.231 ms/op 35.802 ms/op 1.21
BLS verifyMultipleSignatures 128 - blst-native 86.039 ms/op 71.078 ms/op 1.21
BLS deserializing 10000 signatures 947.35 ms/op 795.71 ms/op 1.19
BLS deserializing 100000 signatures 9.5166 s/op 8.0009 s/op 1.19
BLS verifyMultipleSignatures - same message - 3 - blst-native 1.3365 ms/op 1.1408 ms/op 1.17
BLS verifyMultipleSignatures - same message - 8 - blst-native 1.4967 ms/op 1.2897 ms/op 1.16
BLS verifyMultipleSignatures - same message - 32 - blst-native 2.2998 ms/op 2.0317 ms/op 1.13
BLS verifyMultipleSignatures - same message - 64 - blst-native 4.4828 ms/op 3.9486 ms/op 1.14
BLS verifyMultipleSignatures - same message - 128 - blst-native 7.8381 ms/op 6.5673 ms/op 1.19
BLS aggregatePubkeys 32 - blst-native 27.537 us/op 23.096 us/op 1.19
BLS aggregatePubkeys 128 - blst-native 104.16 us/op 83.488 us/op 1.25
getAttestationsForBlock 53.255 ms/op 33.075 ms/op 1.61
getSlashingsAndExits - default max 179.74 us/op 120.81 us/op 1.49
getSlashingsAndExits - 2k 818.93 us/op 288.76 us/op 2.84
proposeBlockBody type=full, size=empty 6.4131 ms/op 3.9396 ms/op 1.63
isKnown best case - 1 super set check 675.00 ns/op 325.00 ns/op 2.08
isKnown normal case - 2 super set checks 766.00 ns/op 317.00 ns/op 2.42
isKnown worse case - 16 super set checks 692.00 ns/op 314.00 ns/op 2.20
CheckpointStateCache - add get delete 6.7080 us/op 3.6000 us/op 1.86
validate api signedAggregateAndProof - struct 2.8906 ms/op 2.3363 ms/op 1.24
validate gossip signedAggregateAndProof - struct 2.8774 ms/op 2.3603 ms/op 1.22
validate gossip attestation - vc 640000 1.3825 ms/op 1.0936 ms/op 1.26
batch validate gossip attestation - vc 640000 - chunk 32 178.04 us/op 132.76 us/op 1.34
batch validate gossip attestation - vc 640000 - chunk 64 161.70 us/op 118.70 us/op 1.36
batch validate gossip attestation - vc 640000 - chunk 128 184.68 us/op 113.20 us/op 1.63
batch validate gossip attestation - vc 640000 - chunk 256 182.14 us/op 107.01 us/op 1.70
pickEth1Vote - no votes 1.6979 ms/op 860.90 us/op 1.97
pickEth1Vote - max votes 19.319 ms/op 8.6522 ms/op 2.23
pickEth1Vote - Eth1Data hashTreeRoot value x2048 34.018 ms/op 16.065 ms/op 2.12
pickEth1Vote - Eth1Data hashTreeRoot tree x2048 52.530 ms/op 18.283 ms/op 2.87
pickEth1Vote - Eth1Data fastSerialize value x2048 1.0304 ms/op 417.74 us/op 2.47
pickEth1Vote - Eth1Data fastSerialize tree x2048 7.7234 ms/op 6.7695 ms/op 1.14
bytes32 toHexString 980.00 ns/op 464.00 ns/op 2.11
bytes32 Buffer.toString(hex) 342.00 ns/op 326.00 ns/op 1.05
bytes32 Buffer.toString(hex) from Uint8Array 564.00 ns/op 411.00 ns/op 1.37
bytes32 Buffer.toString(hex) + 0x 319.00 ns/op 316.00 ns/op 1.01
Object access 1 prop 0.24100 ns/op 0.19400 ns/op 1.24
Map access 1 prop 0.16100 ns/op 0.18500 ns/op 0.87
Object get x1000 7.8640 ns/op 4.7090 ns/op 1.67
Map get x1000 1.0450 ns/op 0.68100 ns/op 1.53
Object set x1000 117.60 ns/op 24.216 ns/op 4.86
Map set x1000 75.426 ns/op 17.519 ns/op 4.31
Return object 10000 times 0.30490 ns/op 0.21540 ns/op 1.42
Throw Error 10000 times 4.7384 us/op 2.6746 us/op 1.77
fastMsgIdFn sha256 / 200 bytes 4.2720 us/op 1.8990 us/op 2.25
fastMsgIdFn h32 xxhash / 200 bytes 480.00 ns/op 298.00 ns/op 1.61
fastMsgIdFn h64 xxhash / 200 bytes 504.00 ns/op 348.00 ns/op 1.45
fastMsgIdFn sha256 / 1000 bytes 13.454 us/op 5.7560 us/op 2.34
fastMsgIdFn h32 xxhash / 1000 bytes 636.00 ns/op 394.00 ns/op 1.61
fastMsgIdFn h64 xxhash / 1000 bytes 578.00 ns/op 409.00 ns/op 1.41
fastMsgIdFn sha256 / 10000 bytes 110.57 us/op 50.292 us/op 2.20
fastMsgIdFn h32 xxhash / 10000 bytes 2.2170 us/op 1.7970 us/op 1.23
fastMsgIdFn h64 xxhash / 10000 bytes 1.6120 us/op 1.2090 us/op 1.33
send data - 1000 256B messages 33.591 ms/op 11.451 ms/op 2.93
send data - 1000 512B messages 45.533 ms/op 14.775 ms/op 3.08
send data - 1000 1024B messages 68.795 ms/op 21.964 ms/op 3.13
send data - 1000 1200B messages 63.500 ms/op 27.134 ms/op 2.34
send data - 1000 2048B messages 75.541 ms/op 30.480 ms/op 2.48
send data - 1000 4096B messages 65.587 ms/op 31.331 ms/op 2.09
send data - 1000 16384B messages 189.83 ms/op 89.898 ms/op 2.11
send data - 1000 65536B messages 724.38 ms/op 421.18 ms/op 1.72
enrSubnets - fastDeserialize 64 bits 2.0420 us/op 985.00 ns/op 2.07
enrSubnets - ssz BitVector 64 bits 725.00 ns/op 481.00 ns/op 1.51
enrSubnets - fastDeserialize 4 bits 275.00 ns/op 246.00 ns/op 1.12
enrSubnets - ssz BitVector 4 bits 670.00 ns/op 479.00 ns/op 1.40
prioritizePeers score -10:0 att 32-0.1 sync 2-0 138.44 us/op 71.375 us/op 1.94
prioritizePeers score 0:0 att 32-0.25 sync 2-0.25 178.74 us/op 81.293 us/op 2.20
prioritizePeers score 0:0 att 32-0.5 sync 2-0.5 210.15 us/op 117.31 us/op 1.79
prioritizePeers score 0:0 att 64-0.75 sync 4-0.75 352.61 us/op 197.99 us/op 1.78
prioritizePeers score 0:0 att 64-1 sync 4-1 355.83 us/op 213.26 us/op 1.67
array of 16000 items push then shift 1.7133 us/op 1.2560 us/op 1.36
LinkedList of 16000 items push then shift 9.2950 ns/op 6.9040 ns/op 1.35
array of 16000 items push then pop 111.25 ns/op 58.810 ns/op 1.89
LinkedList of 16000 items push then pop 11.576 ns/op 5.6750 ns/op 2.04
array of 24000 items push then shift 2.8278 us/op 1.8064 us/op 1.57
LinkedList of 24000 items push then shift 12.218 ns/op 6.5670 ns/op 1.86
array of 24000 items push then pop 179.36 ns/op 101.45 ns/op 1.77
LinkedList of 24000 items push then pop 10.130 ns/op 5.4230 ns/op 1.87
intersect bitArray bitLen 8 6.9070 ns/op 4.6850 ns/op 1.47
intersect array and set length 8 93.626 ns/op 45.830 ns/op 2.04
intersect bitArray bitLen 128 39.678 ns/op 26.170 ns/op 1.52
intersect array and set length 128 1.2105 us/op 647.72 ns/op 1.87
bitArray.getTrueBitIndexes() bitLen 128 2.4000 us/op 1.2320 us/op 1.95
bitArray.getTrueBitIndexes() bitLen 248 3.6550 us/op 2.0160 us/op 1.81
bitArray.getTrueBitIndexes() bitLen 512 8.0650 us/op 3.8560 us/op 2.09
Buffer.concat 32 items 1.2260 us/op 811.00 ns/op 1.51
Uint8Array.set 32 items 3.2800 us/op 1.6150 us/op 2.03
Set add up to 64 items then delete first 5.4489 us/op 1.7277 us/op 3.15
OrderedSet add up to 64 items then delete first 7.5553 us/op 2.6508 us/op 2.85
Set add up to 64 items then delete last 5.8359 us/op 1.9600 us/op 2.98
OrderedSet add up to 64 items then delete last 7.6853 us/op 2.7500 us/op 2.79
Set add up to 64 items then delete middle 5.7751 us/op 1.8297 us/op 3.16
OrderedSet add up to 64 items then delete middle 9.2780 us/op 3.9760 us/op 2.33
Set add up to 128 items then delete first 11.561 us/op 3.5987 us/op 3.21
OrderedSet add up to 128 items then delete first 16.816 us/op 5.7103 us/op 2.94
Set add up to 128 items then delete last 11.847 us/op 3.4871 us/op 3.40
OrderedSet add up to 128 items then delete last 15.801 us/op 5.2744 us/op 3.00
Set add up to 128 items then delete middle 11.244 us/op 3.4844 us/op 3.23
OrderedSet add up to 128 items then delete middle 20.806 us/op 10.355 us/op 2.01
Set add up to 256 items then delete first 23.036 us/op 7.4577 us/op 3.09
OrderedSet add up to 256 items then delete first 33.050 us/op 11.892 us/op 2.78
Set add up to 256 items then delete last 23.235 us/op 7.2347 us/op 3.21
OrderedSet add up to 256 items then delete last 30.903 us/op 11.025 us/op 2.80
Set add up to 256 items then delete middle 23.128 us/op 7.2383 us/op 3.20
OrderedSet add up to 256 items then delete middle 49.483 us/op 29.780 us/op 1.66
transfer serialized Status (84 B) 2.0550 us/op 1.3120 us/op 1.57
copy serialized Status (84 B) 1.8050 us/op 1.2110 us/op 1.49
transfer serialized SignedVoluntaryExit (112 B) 2.1670 us/op 1.5020 us/op 1.44
copy serialized SignedVoluntaryExit (112 B) 1.8410 us/op 1.2550 us/op 1.47
transfer serialized ProposerSlashing (416 B) 3.1340 us/op 1.7650 us/op 1.78
copy serialized ProposerSlashing (416 B) 3.3070 us/op 1.6900 us/op 1.96
transfer serialized Attestation (485 B) 3.3140 us/op 1.7370 us/op 1.91
copy serialized Attestation (485 B) 3.2270 us/op 1.7110 us/op 1.89
transfer serialized AttesterSlashing (33232 B) 3.4070 us/op 2.3770 us/op 1.43
copy serialized AttesterSlashing (33232 B) 10.092 us/op 4.4400 us/op 2.27
transfer serialized Small SignedBeaconBlock (128000 B) 3.6500 us/op 2.5640 us/op 1.42
copy serialized Small SignedBeaconBlock (128000 B) 23.845 us/op 9.1380 us/op 2.61
transfer serialized Avg SignedBeaconBlock (200000 B) 3.5340 us/op 2.6240 us/op 1.35
copy serialized Avg SignedBeaconBlock (200000 B) 31.642 us/op 12.621 us/op 2.51
transfer serialized BlobsSidecar (524380 B) 3.5180 us/op 2.9190 us/op 1.21
copy serialized BlobsSidecar (524380 B) 134.44 us/op 67.837 us/op 1.98
transfer serialized Big SignedBeaconBlock (1000000 B) 3.5370 us/op 2.8110 us/op 1.26
copy serialized Big SignedBeaconBlock (1000000 B) 168.53 us/op 125.02 us/op 1.35
pass gossip attestations to forkchoice per slot 4.7660 ms/op 2.6135 ms/op 1.82
forkChoice updateHead vc 100000 bc 64 eq 0 773.56 us/op 479.34 us/op 1.61
forkChoice updateHead vc 600000 bc 64 eq 0 7.2933 ms/op 2.6055 ms/op 2.80
forkChoice updateHead vc 1000000 bc 64 eq 0 8.8675 ms/op 4.3502 ms/op 2.04
forkChoice updateHead vc 600000 bc 320 eq 0 5.1151 ms/op 2.5283 ms/op 2.02
forkChoice updateHead vc 600000 bc 1200 eq 0 5.2090 ms/op 2.6635 ms/op 1.96
forkChoice updateHead vc 600000 bc 7200 eq 0 6.0367 ms/op 3.2124 ms/op 1.88
forkChoice updateHead vc 600000 bc 64 eq 1000 11.820 ms/op 9.4075 ms/op 1.26
forkChoice updateHead vc 600000 bc 64 eq 10000 13.631 ms/op 9.7289 ms/op 1.40
forkChoice updateHead vc 600000 bc 64 eq 300000 39.804 ms/op 11.702 ms/op 3.40
computeDeltas 500000 validators 300 proto nodes 7.1339 ms/op 3.0382 ms/op 2.35
computeDeltas 500000 validators 1200 proto nodes 7.2778 ms/op 2.9321 ms/op 2.48
computeDeltas 500000 validators 7200 proto nodes 6.9708 ms/op 2.8770 ms/op 2.42
computeDeltas 750000 validators 300 proto nodes 10.030 ms/op 4.4240 ms/op 2.27
computeDeltas 750000 validators 1200 proto nodes 9.8866 ms/op 4.4169 ms/op 2.24
computeDeltas 750000 validators 7200 proto nodes 9.9363 ms/op 4.3856 ms/op 2.27
computeDeltas 1400000 validators 300 proto nodes 29.788 ms/op 8.5604 ms/op 3.48
computeDeltas 1400000 validators 1200 proto nodes 18.890 ms/op 8.5523 ms/op 2.21
computeDeltas 1400000 validators 7200 proto nodes 18.626 ms/op 8.6741 ms/op 2.15
computeDeltas 2100000 validators 300 proto nodes 44.468 ms/op 12.902 ms/op 3.45
computeDeltas 2100000 validators 1200 proto nodes 28.782 ms/op 13.239 ms/op 2.17
computeDeltas 2100000 validators 7200 proto nodes 28.575 ms/op 12.648 ms/op 2.26
computeProposerBoostScoreFromBalances 500000 validators 3.7505 ms/op 3.2497 ms/op 1.15
computeProposerBoostScoreFromBalances 750000 validators 3.7109 ms/op 3.2322 ms/op 1.15
computeProposerBoostScoreFromBalances 1400000 validators 3.6681 ms/op 3.2198 ms/op 1.14
computeProposerBoostScoreFromBalances 2100000 validators 3.5974 ms/op 3.2455 ms/op 1.11
altair processAttestation - 250000 vs - 7PWei normalcase 2.2594 ms/op 1.4214 ms/op 1.59
altair processAttestation - 250000 vs - 7PWei worstcase 3.2683 ms/op 2.1624 ms/op 1.51
altair processAttestation - setStatus - 1/6 committees join 168.11 us/op 68.804 us/op 2.44
altair processAttestation - setStatus - 1/3 committees join 333.98 us/op 134.16 us/op 2.49
altair processAttestation - setStatus - 1/2 committees join 448.69 us/op 182.51 us/op 2.46
altair processAttestation - setStatus - 2/3 committees join 566.28 us/op 252.21 us/op 2.25
altair processAttestation - setStatus - 4/5 committees join 755.09 us/op 371.26 us/op 2.03
altair processAttestation - setStatus - 100% committees join 893.20 us/op 448.98 us/op 1.99
altair processBlock - 250000 vs - 7PWei normalcase 11.018 ms/op 6.8561 ms/op 1.61
altair processBlock - 250000 vs - 7PWei normalcase hashState 36.687 ms/op 31.087 ms/op 1.18
altair processBlock - 250000 vs - 7PWei worstcase 40.983 ms/op 29.042 ms/op 1.41
altair processBlock - 250000 vs - 7PWei worstcase hashState 89.314 ms/op 79.638 ms/op 1.12
phase0 processBlock - 250000 vs - 7PWei normalcase 2.9168 ms/op 2.5268 ms/op 1.15
phase0 processBlock - 250000 vs - 7PWei worstcase 28.905 ms/op 25.631 ms/op 1.13
altair processEth1Data - 250000 vs - 7PWei normalcase 482.93 us/op 299.20 us/op 1.61
getExpectedWithdrawals 250000 eb:1,eth1:1,we:0,wn:0,smpl:15 7.0620 us/op 7.4790 us/op 0.94
getExpectedWithdrawals 250000 eb:0.95,eth1:0.1,we:0.05,wn:0,smpl:219 31.949 us/op 32.289 us/op 0.99
getExpectedWithdrawals 250000 eb:0.95,eth1:0.3,we:0.05,wn:0,smpl:42 14.775 us/op 13.969 us/op 1.06
getExpectedWithdrawals 250000 eb:0.95,eth1:0.7,we:0.05,wn:0,smpl:18 10.964 us/op 9.2570 us/op 1.18
getExpectedWithdrawals 250000 eb:0.1,eth1:0.1,we:0,wn:0,smpl:1020 119.42 us/op 77.848 us/op 1.53
getExpectedWithdrawals 250000 eb:0.03,eth1:0.03,we:0,wn:0,smpl:11777 1.3146 ms/op 1.0635 ms/op 1.24
getExpectedWithdrawals 250000 eb:0.01,eth1:0.01,we:0,wn:0,smpl:16384 1.4979 ms/op 1.4204 ms/op 1.05
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,smpl:16384 1.6986 ms/op 1.4683 ms/op 1.16
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,nocache,smpl:16384 3.3959 ms/op 2.1823 ms/op 1.56
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,smpl:16384 2.2614 ms/op 1.6711 ms/op 1.35
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,nocache,smpl:16384 5.3300 ms/op 3.6913 ms/op 1.44
Tree 40 250000 create 364.17 ms/op 246.40 ms/op 1.48
Tree 40 250000 get(125000) 196.57 ns/op 98.710 ns/op 1.99
Tree 40 250000 set(125000) 986.33 ns/op 722.55 ns/op 1.37
Tree 40 250000 toArray() 19.201 ms/op 14.512 ms/op 1.32
Tree 40 250000 iterate all - toArray() + loop 18.405 ms/op 9.6430 ms/op 1.91
Tree 40 250000 iterate all - get(i) 64.089 ms/op 36.742 ms/op 1.74
MutableVector 250000 create 13.280 ms/op 10.307 ms/op 1.29
MutableVector 250000 get(125000) 6.3880 ns/op 6.0820 ns/op 1.05
MutableVector 250000 set(125000) 270.24 ns/op 186.49 ns/op 1.45
MutableVector 250000 toArray() 3.5345 ms/op 2.5713 ms/op 1.37
MutableVector 250000 iterate all - toArray() + loop 3.1920 ms/op 2.6437 ms/op 1.21
MutableVector 250000 iterate all - get(i) 1.5475 ms/op 1.2498 ms/op 1.24
Array 250000 create 2.8264 ms/op 2.3678 ms/op 1.19
Array 250000 clone - spread 1.2902 ms/op 1.0104 ms/op 1.28
Array 250000 get(125000) 1.0320 ns/op 0.92700 ns/op 1.11
Array 250000 set(125000) 4.1090 ns/op 1.1130 ns/op 3.69
Array 250000 iterate all - loop 166.51 us/op 142.57 us/op 1.17
effectiveBalanceIncrements clone Uint8Array 300000 27.859 us/op 16.678 us/op 1.67
effectiveBalanceIncrements clone MutableVector 300000 364.00 ns/op 345.00 ns/op 1.06
effectiveBalanceIncrements rw all Uint8Array 300000 201.40 us/op 171.41 us/op 1.17
effectiveBalanceIncrements rw all MutableVector 300000 81.220 ms/op 59.642 ms/op 1.36
phase0 afterProcessEpoch - 250000 vs - 7PWei 111.64 ms/op 73.548 ms/op 1.52
phase0 beforeProcessEpoch - 250000 vs - 7PWei 51.373 ms/op 45.817 ms/op 1.12
altair processEpoch - mainnet_e81889 507.73 ms/op 426.74 ms/op 1.19
mainnet_e81889 - altair beforeProcessEpoch 82.309 ms/op 67.893 ms/op 1.21
mainnet_e81889 - altair processJustificationAndFinalization 14.812 us/op 6.5410 us/op 2.26
mainnet_e81889 - altair processInactivityUpdates 6.0311 ms/op 3.6821 ms/op 1.64
mainnet_e81889 - altair processRewardsAndPenalties 64.460 ms/op 56.505 ms/op 1.14
mainnet_e81889 - altair processRegistryUpdates 2.1950 us/op 1.1770 us/op 1.86
mainnet_e81889 - altair processSlashings 588.00 ns/op 328.00 ns/op 1.79
mainnet_e81889 - altair processEth1DataReset 615.00 ns/op 323.00 ns/op 1.90
mainnet_e81889 - altair processEffectiveBalanceUpdates 1.4786 ms/op 993.72 us/op 1.49
mainnet_e81889 - altair processSlashingsReset 3.3440 us/op 2.6510 us/op 1.26
mainnet_e81889 - altair processRandaoMixesReset 7.7880 us/op 3.6970 us/op 2.11
mainnet_e81889 - altair processHistoricalRootsUpdate 882.00 ns/op 779.00 ns/op 1.13
mainnet_e81889 - altair processParticipationFlagUpdates 1.9400 us/op 2.2670 us/op 0.86
mainnet_e81889 - altair processSyncCommitteeUpdates 1.0470 us/op 731.00 ns/op 1.43
mainnet_e81889 - altair afterProcessEpoch 119.68 ms/op 73.960 ms/op 1.62
capella processEpoch - mainnet_e217614 2.0965 s/op 1.8320 s/op 1.14
mainnet_e217614 - capella beforeProcessEpoch 530.60 ms/op 429.00 ms/op 1.24
mainnet_e217614 - capella processJustificationAndFinalization 20.930 us/op 12.861 us/op 1.63
mainnet_e217614 - capella processInactivityUpdates 22.356 ms/op 15.832 ms/op 1.41
mainnet_e217614 - capella processRewardsAndPenalties 400.59 ms/op 360.40 ms/op 1.11
mainnet_e217614 - capella processRegistryUpdates 23.051 us/op 24.664 us/op 0.93
mainnet_e217614 - capella processSlashings 586.00 ns/op 805.00 ns/op 0.73
mainnet_e217614 - capella processEth1DataReset 412.00 ns/op 727.00 ns/op 0.57
mainnet_e217614 - capella processEffectiveBalanceUpdates 9.5672 ms/op 3.7923 ms/op 2.52
mainnet_e217614 - capella processSlashingsReset 3.0300 us/op 2.9940 us/op 1.01
mainnet_e217614 - capella processRandaoMixesReset 4.6650 us/op 4.1960 us/op 1.11
mainnet_e217614 - capella processHistoricalRootsUpdate 541.00 ns/op 827.00 ns/op 0.65
mainnet_e217614 - capella processParticipationFlagUpdates 1.5160 us/op 1.2850 us/op 1.18
mainnet_e217614 - capella afterProcessEpoch 303.07 ms/op 207.44 ms/op 1.46
phase0 processEpoch - mainnet_e58758 470.18 ms/op 369.44 ms/op 1.27
mainnet_e58758 - phase0 beforeProcessEpoch 130.72 ms/op 119.57 ms/op 1.09
mainnet_e58758 - phase0 processJustificationAndFinalization 15.686 us/op 14.122 us/op 1.11
mainnet_e58758 - phase0 processRewardsAndPenalties 56.623 ms/op 44.103 ms/op 1.28
mainnet_e58758 - phase0 processRegistryUpdates 10.240 us/op 6.8180 us/op 1.50
mainnet_e58758 - phase0 processSlashings 527.00 ns/op 717.00 ns/op 0.74
mainnet_e58758 - phase0 processEth1DataReset 410.00 ns/op 663.00 ns/op 0.62
mainnet_e58758 - phase0 processEffectiveBalanceUpdates 1.1498 ms/op 902.84 us/op 1.27
mainnet_e58758 - phase0 processSlashingsReset 2.9120 us/op 2.5490 us/op 1.14
mainnet_e58758 - phase0 processRandaoMixesReset 3.6930 us/op 4.2530 us/op 0.87
mainnet_e58758 - phase0 processHistoricalRootsUpdate 361.00 ns/op 738.00 ns/op 0.49
mainnet_e58758 - phase0 processParticipationRecordUpdates 5.2230 us/op 4.4800 us/op 1.17
mainnet_e58758 - phase0 afterProcessEpoch 99.264 ms/op 65.836 ms/op 1.51
phase0 processEffectiveBalanceUpdates - 250000 normalcase 1.4304 ms/op 1.0446 ms/op 1.37
phase0 processEffectiveBalanceUpdates - 250000 worstcase 0.5 1.4613 ms/op 1.9873 ms/op 0.74
altair processInactivityUpdates - 250000 normalcase 29.176 ms/op 21.958 ms/op 1.33
altair processInactivityUpdates - 250000 worstcase 28.707 ms/op 26.200 ms/op 1.10
phase0 processRegistryUpdates - 250000 normalcase 8.4210 us/op 8.6200 us/op 0.98
phase0 processRegistryUpdates - 250000 badcase_full_deposits 326.32 us/op 393.00 us/op 0.83
phase0 processRegistryUpdates - 250000 worstcase 0.5 143.66 ms/op 120.65 ms/op 1.19
altair processRewardsAndPenalties - 250000 normalcase 54.701 ms/op 57.969 ms/op 0.94
altair processRewardsAndPenalties - 250000 worstcase 58.030 ms/op 57.705 ms/op 1.01
phase0 getAttestationDeltas - 250000 normalcase 9.1796 ms/op 5.0069 ms/op 1.83
phase0 getAttestationDeltas - 250000 worstcase 8.6843 ms/op 5.6087 ms/op 1.55
phase0 processSlashings - 250000 worstcase 81.056 us/op 77.127 us/op 1.05
altair processSyncCommitteeUpdates - 250000 154.96 ms/op 110.79 ms/op 1.40
BeaconState.hashTreeRoot - No change 238.00 ns/op 334.00 ns/op 0.71
BeaconState.hashTreeRoot - 1 full validator 156.48 us/op 137.47 us/op 1.14
BeaconState.hashTreeRoot - 32 full validator 1.6776 ms/op 1.7185 ms/op 0.98
BeaconState.hashTreeRoot - 512 full validator 14.915 ms/op 17.890 ms/op 0.83
BeaconState.hashTreeRoot - 1 validator.effectiveBalance 150.86 us/op 154.53 us/op 0.98
BeaconState.hashTreeRoot - 32 validator.effectiveBalance 1.9797 ms/op 2.0069 ms/op 0.99
BeaconState.hashTreeRoot - 512 validator.effectiveBalance 24.420 ms/op 27.707 ms/op 0.88
BeaconState.hashTreeRoot - 1 balances 145.02 us/op 133.35 us/op 1.09
BeaconState.hashTreeRoot - 32 balances 1.1878 ms/op 1.0567 ms/op 1.12
BeaconState.hashTreeRoot - 512 balances 12.194 ms/op 11.116 ms/op 1.10
BeaconState.hashTreeRoot - 250000 balances 215.65 ms/op 202.11 ms/op 1.07
aggregationBits - 2048 els - zipIndexesInBitList 15.961 us/op 11.757 us/op 1.36
byteArrayEquals 32 72.390 ns/op 60.316 ns/op 1.20
Buffer.compare 32 54.004 ns/op 38.139 ns/op 1.42
byteArrayEquals 1024 1.9762 us/op 1.6015 us/op 1.23
Buffer.compare 1024 69.746 ns/op 45.006 ns/op 1.55
byteArrayEquals 16384 31.439 us/op 25.355 us/op 1.24
Buffer.compare 16384 261.47 ns/op 210.69 ns/op 1.24
byteArrayEquals 123687377 236.99 ms/op 193.08 ms/op 1.23
Buffer.compare 123687377 6.3091 ms/op 4.9685 ms/op 1.27
byteArrayEquals 32 - diff last byte 69.426 ns/op 58.268 ns/op 1.19
Buffer.compare 32 - diff last byte 55.364 ns/op 39.184 ns/op 1.41
byteArrayEquals 1024 - diff last byte 1.9663 us/op 1.6096 us/op 1.22
Buffer.compare 1024 - diff last byte 70.597 ns/op 44.363 ns/op 1.59
byteArrayEquals 16384 - diff last byte 31.351 us/op 26.053 us/op 1.20
Buffer.compare 16384 - diff last byte 257.52 ns/op 192.77 ns/op 1.34
byteArrayEquals 123687377 - diff last byte 236.72 ms/op 198.41 ms/op 1.19
Buffer.compare 123687377 - diff last byte 6.0769 ms/op 3.8040 ms/op 1.60
byteArrayEquals 32 - random bytes 5.0590 ns/op 4.5800 ns/op 1.10
Buffer.compare 32 - random bytes 58.150 ns/op 41.851 ns/op 1.39
byteArrayEquals 1024 - random bytes 4.9600 ns/op 4.4520 ns/op 1.11
Buffer.compare 1024 - random bytes 57.617 ns/op 39.582 ns/op 1.46
byteArrayEquals 16384 - random bytes 4.9680 ns/op 4.4360 ns/op 1.12
Buffer.compare 16384 - random bytes 57.559 ns/op 37.875 ns/op 1.52
byteArrayEquals 123687377 - random bytes 8.1700 ns/op 7.8100 ns/op 1.05
Buffer.compare 123687377 - random bytes 60.990 ns/op 43.350 ns/op 1.41
regular array get 100000 times 42.211 us/op 40.795 us/op 1.03
wrappedArray get 100000 times 42.176 us/op 40.738 us/op 1.04
arrayWithProxy get 100000 times 13.837 ms/op 10.457 ms/op 1.32
ssz.Root.equals 51.380 ns/op 54.096 ns/op 0.95
byteArrayEquals 50.630 ns/op 53.129 ns/op 0.95
Buffer.compare 10.417 ns/op 9.3910 ns/op 1.11
shuffle list - 16384 els 6.8945 ms/op 4.1839 ms/op 1.65
shuffle list - 250000 els 101.44 ms/op 61.755 ms/op 1.64
processSlot - 1 slots 17.034 us/op 15.270 us/op 1.12
processSlot - 32 slots 3.9580 ms/op 3.2525 ms/op 1.22
getEffectiveBalanceIncrementsZeroInactive - 250000 vs - 7PWei 60.092 ms/op 59.569 ms/op 1.01
getCommitteeAssignments - req 1 vs - 250000 vc 2.5268 ms/op 2.1369 ms/op 1.18
getCommitteeAssignments - req 100 vs - 250000 vc 3.7165 ms/op 3.2000 ms/op 1.16
getCommitteeAssignments - req 1000 vs - 250000 vc 4.1758 ms/op 3.4918 ms/op 1.20
findModifiedValidators - 10000 modified validators 539.89 ms/op 419.03 ms/op 1.29
findModifiedValidators - 1000 modified validators 439.88 ms/op 314.82 ms/op 1.40
findModifiedValidators - 100 modified validators 433.41 ms/op 304.25 ms/op 1.42
findModifiedValidators - 10 modified validators 429.00 ms/op 299.33 ms/op 1.43
findModifiedValidators - 1 modified validators 418.83 ms/op 304.09 ms/op 1.38
findModifiedValidators - no difference 419.44 ms/op 316.77 ms/op 1.32
compare ViewDUs 4.1780 s/op 3.9839 s/op 1.05
compare each validator Uint8Array 1.8604 s/op 1.2794 s/op 1.45
compare ViewDU to Uint8Array 1.0942 s/op 817.73 ms/op 1.34
migrate state 1000000 validators, 24 modified, 0 new 796.54 ms/op 761.25 ms/op 1.05
migrate state 1000000 validators, 1700 modified, 1000 new 1.0733 s/op 1.0383 s/op 1.03
migrate state 1000000 validators, 3400 modified, 2000 new 1.3053 s/op 1.2602 s/op 1.04
migrate state 1500000 validators, 24 modified, 0 new 803.04 ms/op 754.59 ms/op 1.06
migrate state 1500000 validators, 1700 modified, 1000 new 1.0907 s/op 1.0220 s/op 1.07
migrate state 1500000 validators, 3400 modified, 2000 new 1.3209 s/op 1.2389 s/op 1.07
RootCache.getBlockRootAtSlot - 250000 vs - 7PWei 4.3500 ns/op 4.2700 ns/op 1.02
state getBlockRootAtSlot - 250000 vs - 7PWei 552.74 ns/op 786.58 ns/op 0.70
computeProposers - vc 250000 8.5106 ms/op 6.6804 ms/op 1.27
computeEpochShuffling - vc 250000 102.47 ms/op 64.736 ms/op 1.58
getNextSyncCommittee - vc 250000 153.00 ms/op 108.01 ms/op 1.42
computeSigningRoot for AttestationData 26.909 us/op 26.430 us/op 1.02
hash AttestationData serialized data then Buffer.toString(base64) 2.2525 us/op 1.1769 us/op 1.91
toHexString serialized data 1.0834 us/op 735.60 ns/op 1.47
Buffer.toString(base64) 204.72 ns/op 147.47 ns/op 1.39

Please sign in to comment.