Skip to content

Commit

Permalink
chore: update to ssz 0.13.0 (#5959)
Browse files Browse the repository at this point in the history
* chore: update to ssz 0.13.0

* chore: use deserializeUint8ArrayBitListFromBytes util from ssz
  • Loading branch information
twoeths committed Sep 19, 2023
1 parent 8794025 commit 4d5799e
Show file tree
Hide file tree
Showing 12 changed files with 15 additions and 51 deletions.
2 changes: 1 addition & 1 deletion packages/api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
},
"dependencies": {
"@chainsafe/persistent-merkle-tree": "^0.5.0",
"@chainsafe/ssz": "^0.12.0",
"@chainsafe/ssz": "^0.13.0",
"@lodestar/config": "^1.11.1",
"@lodestar/params": "^1.11.1",
"@lodestar/types": "^1.11.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/beacon-node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@
"@chainsafe/libp2p-noise": "^13.0.0",
"@chainsafe/persistent-merkle-tree": "^0.5.0",
"@chainsafe/prometheus-gc-stats": "^1.0.0",
"@chainsafe/ssz": "^0.12.0",
"@chainsafe/ssz": "^0.13.0",
"@chainsafe/threads": "^1.11.1",
"@ethersproject/abi": "^5.7.0",
"@fastify/bearer-auth": "^9.0.0",
Expand Down
38 changes: 1 addition & 37 deletions packages/beacon-node/src/util/sszBytes.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {BitArray} from "@chainsafe/ssz";
import {BitArray, deserializeUint8ArrayBitListFromBytes} from "@chainsafe/ssz";
import {BLSSignature, RootHex, Slot} from "@lodestar/types";
import {toHex} from "@lodestar/utils";

Expand Down Expand Up @@ -210,39 +210,3 @@ function getSlotFromOffset(data: Uint8Array, offset: number): Slot {
// Read only the first 4 bytes of Slot, max value is 4,294,967,295 will be reached 1634 years after genesis
return dv.getUint32(offset, true);
}

type BitArrayDeserialized = {uint8Array: Uint8Array; bitLen: number};

/**
* This is copied from ssz bitList.ts
* TODO: export this util from there
*/
function deserializeUint8ArrayBitListFromBytes(data: Uint8Array, start: number, end: number): BitArrayDeserialized {
if (end > data.length) {
throw Error(`BitList attempting to read byte ${end} of data length ${data.length}`);
}

const lastByte = data[end - 1];
const size = end - start;

if (lastByte === 0) {
throw new Error("Invalid deserialized bitlist, padding bit required");
}

if (lastByte === 1) {
// Buffer.prototype.slice does not copy memory, Enforce Uint8Array usage https://github.com/nodejs/node/issues/28087
const uint8Array = Uint8Array.prototype.slice.call(data, start, end - 1);
const bitLen = (size - 1) * 8;
return {uint8Array, bitLen};
}

// the last byte is > 1, so a padding bit will exist in the last byte and need to be removed
// Buffer.prototype.slice does not copy memory, Enforce Uint8Array usage https://github.com/nodejs/node/issues/28087
const uint8Array = Uint8Array.prototype.slice.call(data, start, end);
// mask lastChunkByte
const lastByteBitLength = lastByte.toString(2).length - 1;
const bitLen = (size - 1) * 8 + lastByteBitLength;
const mask = 0xff >> (8 - lastByteBitLength);
uint8Array[size - 1] &= mask;
return {uint8Array, bitLen};
}
2 changes: 1 addition & 1 deletion packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
"@chainsafe/bls-keystore": "^2.0.0",
"@chainsafe/blst": "^0.2.9",
"@chainsafe/discv5": "^5.1.0",
"@chainsafe/ssz": "^0.12.0",
"@chainsafe/ssz": "^0.13.0",
"@chainsafe/threads": "^1.11.1",
"@libp2p/crypto": "^2.0.2",
"@libp2p/peer-id": "^3.0.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
"blockchain"
],
"dependencies": {
"@chainsafe/ssz": "^0.12.0",
"@chainsafe/ssz": "^0.13.0",
"@lodestar/params": "^1.11.1",
"@lodestar/types": "^1.11.1"
}
Expand Down
2 changes: 1 addition & 1 deletion packages/db/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"check-readme": "typescript-docs-verifier"
},
"dependencies": {
"@chainsafe/ssz": "^0.12.0",
"@chainsafe/ssz": "^0.13.0",
"@lodestar/config": "^1.11.1",
"@lodestar/utils": "^1.11.1",
"@types/levelup": "^4.3.3",
Expand Down
2 changes: 1 addition & 1 deletion packages/fork-choice/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"check-readme": "typescript-docs-verifier"
},
"dependencies": {
"@chainsafe/ssz": "^0.12.0",
"@chainsafe/ssz": "^0.13.0",
"@lodestar/config": "^1.11.1",
"@lodestar/params": "^1.11.1",
"@lodestar/state-transition": "^1.11.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/light-client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
"dependencies": {
"@chainsafe/bls": "7.1.1",
"@chainsafe/persistent-merkle-tree": "^0.5.0",
"@chainsafe/ssz": "^0.12.0",
"@chainsafe/ssz": "^0.13.0",
"@lodestar/api": "^1.11.1",
"@lodestar/config": "^1.11.1",
"@lodestar/params": "^1.11.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/state-transition/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
"@chainsafe/bls": "7.1.1",
"@chainsafe/persistent-merkle-tree": "^0.5.0",
"@chainsafe/persistent-ts": "^0.19.1",
"@chainsafe/ssz": "^0.12.0",
"@chainsafe/ssz": "^0.13.0",
"@lodestar/config": "^1.11.1",
"@lodestar/params": "^1.11.1",
"@lodestar/types": "^1.11.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/types/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
},
"types": "lib/index.d.ts",
"dependencies": {
"@chainsafe/ssz": "^0.12.0",
"@chainsafe/ssz": "^0.13.0",
"@lodestar/params": "^1.11.1"
},
"keywords": [
Expand Down
2 changes: 1 addition & 1 deletion packages/validator/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
],
"dependencies": {
"@chainsafe/bls": "7.1.1",
"@chainsafe/ssz": "^0.12.0",
"@chainsafe/ssz": "^0.13.0",
"@lodestar/api": "^1.11.1",
"@lodestar/config": "^1.11.1",
"@lodestar/db": "^1.11.1",
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -644,10 +644,10 @@
"@chainsafe/as-sha256" "^0.4.1"
"@chainsafe/persistent-merkle-tree" "^0.6.1"

"@chainsafe/ssz@^0.12.0":
version "0.12.0"
resolved "https://registry.yarnpkg.com/@chainsafe/ssz/-/ssz-0.12.0.tgz#60dbbd855d2d39d3bc032f44d18a094c364501ae"
integrity sha512-FZUvB7NsQBQc+/3+QSCaqHjKMAXs+M4NiFsskOcRVm1G2FN19u/Er+783YeIpX8Ld9mLplvn2qv33vQedcul0w==
"@chainsafe/ssz@^0.13.0":
version "0.13.0"
resolved "https://registry.yarnpkg.com/@chainsafe/ssz/-/ssz-0.13.0.tgz#0bd11af6abe023d4cc24067a46889dcabbe573e5"
integrity sha512-73PF5bFXE9juLD1+dkmYV/CMO/5ip0TmyzgYw87vAn8Cn+CbwCOp/HyNNdYCmdl104a2bqcORFJzirCvvc+nNw==
dependencies:
"@chainsafe/as-sha256" "^0.4.1"
"@chainsafe/persistent-merkle-tree" "^0.6.1"
Expand Down

1 comment on commit 4d5799e

@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: 4d5799e Previous: 8794025 Ratio
computeDeltas 500000 validators 1200 proto nodes 11.717 ms/op 2.9488 ms/op 3.97
computeDeltas 500000 validators 7200 proto nodes 13.778 ms/op 2.9376 ms/op 4.69
computeDeltas 750000 validators 300 proto nodes 20.797 ms/op 4.3989 ms/op 4.73
computeDeltas 750000 validators 1200 proto nodes 20.944 ms/op 4.5411 ms/op 4.61
computeDeltas 750000 validators 7200 proto nodes 21.016 ms/op 4.3696 ms/op 4.81
computeDeltas 1400000 validators 300 proto nodes 39.059 ms/op 8.4551 ms/op 4.62
computeDeltas 1400000 validators 1200 proto nodes 38.965 ms/op 8.4631 ms/op 4.60
computeDeltas 1400000 validators 7200 proto nodes 38.974 ms/op 8.5060 ms/op 4.58
computeDeltas 2100000 validators 300 proto nodes 58.156 ms/op 13.527 ms/op 4.30
computeDeltas 2100000 validators 1200 proto nodes 58.230 ms/op 13.194 ms/op 4.41
computeDeltas 2100000 validators 7200 proto nodes 58.173 ms/op 13.245 ms/op 4.39
getExpectedWithdrawals 250000 eb:1,eth1:1,we:0,wn:0,smpl:15 18.549 us/op 3.8900 us/op 4.77
getExpectedWithdrawals 250000 eb:0.95,eth1:0.3,we:0.05,wn:0,smpl:42 39.200 us/op 12.686 us/op 3.09
getExpectedWithdrawals 250000 eb:0.95,eth1:0.7,we:0.05,wn:0,smpl:18 20.152 us/op 3.6020 us/op 5.59
phase0 processEffectiveBalanceUpdates - 250000 normalcase 4.1084 ms/op 975.23 us/op 4.21
RootCache.getBlockRootAtSlot - 250000 vs - 7PWei 16.390 ns/op 4.1600 ns/op 3.94
Full benchmark results
Benchmark suite Current: 4d5799e Previous: 8794025 Ratio
getPubkeys - index2pubkey - req 1000 vs - 250000 vc 617.97 us/op 365.74 us/op 1.69
getPubkeys - validatorsArr - req 1000 vs - 250000 vc 107.23 us/op 47.477 us/op 2.26
BLS verify - blst-native 1.3491 ms/op 1.1504 ms/op 1.17
BLS verifyMultipleSignatures 3 - blst-native 2.8355 ms/op 2.4725 ms/op 1.15
BLS verifyMultipleSignatures 8 - blst-native 6.2302 ms/op 5.4949 ms/op 1.13
BLS verifyMultipleSignatures 32 - blst-native 22.751 ms/op 20.071 ms/op 1.13
BLS verifyMultipleSignatures 64 - blst-native 44.584 ms/op 40.182 ms/op 1.11
BLS verifyMultipleSignatures 128 - blst-native 88.815 ms/op 79.033 ms/op 1.12
BLS deserializing 10000 signatures 919.85 ms/op 842.26 ms/op 1.09
BLS deserializing 100000 signatures 8.9982 s/op 8.5035 s/op 1.06
BLS verifyMultipleSignatures - same message - 3 - blst-native 1.4081 ms/op 1.1783 ms/op 1.20
BLS verifyMultipleSignatures - same message - 8 - blst-native 1.4882 ms/op 1.3914 ms/op 1.07
BLS verifyMultipleSignatures - same message - 32 - blst-native 2.2988 ms/op 2.2468 ms/op 1.02
BLS verifyMultipleSignatures - same message - 64 - blst-native 3.7986 ms/op 3.1446 ms/op 1.21
BLS verifyMultipleSignatures - same message - 128 - blst-native 6.2233 ms/op 5.1688 ms/op 1.20
BLS aggregatePubkeys 32 - blst-native 25.619 us/op 24.614 us/op 1.04
BLS aggregatePubkeys 128 - blst-native 100.32 us/op 92.046 us/op 1.09
getAttestationsForBlock 45.996 ms/op 42.385 ms/op 1.09
isKnown best case - 1 super set check 304.00 ns/op 455.00 ns/op 0.67
isKnown normal case - 2 super set checks 278.00 ns/op 467.00 ns/op 0.60
isKnown worse case - 16 super set checks 267.00 ns/op 440.00 ns/op 0.61
CheckpointStateCache - add get delete 5.0690 us/op 4.2110 us/op 1.20
validate api signedAggregateAndProof - struct 2.6570 ms/op 2.5964 ms/op 1.02
validate gossip signedAggregateAndProof - struct 2.6670 ms/op 2.4986 ms/op 1.07
validate gossip attestation - vc 640000 1.2955 ms/op 1.2197 ms/op 1.06
batch validate gossip attestation - vc 640000 - chunk 32 160.69 us/op 155.48 us/op 1.03
batch validate gossip attestation - vc 640000 - chunk 64 147.75 us/op 143.82 us/op 1.03
batch validate gossip attestation - vc 640000 - chunk 128 138.55 us/op 137.83 us/op 1.01
batch validate gossip attestation - vc 640000 - chunk 256 131.23 us/op 133.38 us/op 0.98
pickEth1Vote - no votes 1.3517 ms/op 1.2477 ms/op 1.08
pickEth1Vote - max votes 10.958 ms/op 7.3695 ms/op 1.49
pickEth1Vote - Eth1Data hashTreeRoot value x2048 23.880 ms/op 15.770 ms/op 1.51
pickEth1Vote - Eth1Data hashTreeRoot tree x2048 31.007 ms/op 20.851 ms/op 1.49
pickEth1Vote - Eth1Data fastSerialize value x2048 701.21 us/op 559.73 us/op 1.25
pickEth1Vote - Eth1Data fastSerialize tree x2048 4.4843 ms/op 9.5260 ms/op 0.47
bytes32 toHexString 595.00 ns/op 722.00 ns/op 0.82
bytes32 Buffer.toString(hex) 314.00 ns/op 253.00 ns/op 1.24
bytes32 Buffer.toString(hex) from Uint8Array 484.00 ns/op 322.00 ns/op 1.50
bytes32 Buffer.toString(hex) + 0x 310.00 ns/op 216.00 ns/op 1.44
Object access 1 prop 0.17300 ns/op 0.11300 ns/op 1.53
Map access 1 prop 0.16200 ns/op 0.10700 ns/op 1.51
Object get x1000 8.5670 ns/op 6.3530 ns/op 1.35
Map get x1000 0.60200 ns/op 0.66200 ns/op 0.91
Object set x1000 59.500 ns/op 45.556 ns/op 1.31
Map set x1000 47.974 ns/op 25.707 ns/op 1.87
Return object 10000 times 0.23520 ns/op 0.29130 ns/op 0.81
Throw Error 10000 times 3.8858 us/op 4.0110 us/op 0.97
fastMsgIdFn sha256 / 200 bytes 3.3730 us/op 2.2040 us/op 1.53
fastMsgIdFn h32 xxhash / 200 bytes 308.00 ns/op 279.00 ns/op 1.10
fastMsgIdFn h64 xxhash / 200 bytes 417.00 ns/op 366.00 ns/op 1.14
fastMsgIdFn sha256 / 1000 bytes 11.675 us/op 10.079 us/op 1.16
fastMsgIdFn h32 xxhash / 1000 bytes 421.00 ns/op 512.00 ns/op 0.82
fastMsgIdFn h64 xxhash / 1000 bytes 485.00 ns/op 414.00 ns/op 1.17
fastMsgIdFn sha256 / 10000 bytes 105.24 us/op 73.434 us/op 1.43
fastMsgIdFn h32 xxhash / 10000 bytes 1.9520 us/op 2.0090 us/op 0.97
fastMsgIdFn h64 xxhash / 10000 bytes 1.3700 us/op 1.3640 us/op 1.00
send data - 1000 256B messages 20.295 ms/op 14.850 ms/op 1.37
send data - 1000 512B messages 28.547 ms/op 21.482 ms/op 1.33
send data - 1000 1024B messages 45.063 ms/op 32.201 ms/op 1.40
send data - 1000 1200B messages 23.761 ms/op 29.985 ms/op 0.79
send data - 1000 2048B messages 32.373 ms/op 36.655 ms/op 0.88
send data - 1000 4096B messages 32.600 ms/op 32.916 ms/op 0.99
send data - 1000 16384B messages 71.694 ms/op 75.600 ms/op 0.95
send data - 1000 65536B messages 271.25 ms/op 259.96 ms/op 1.04
enrSubnets - fastDeserialize 64 bits 1.3830 us/op 1.2010 us/op 1.15
enrSubnets - ssz BitVector 64 bits 438.00 ns/op 620.00 ns/op 0.71
enrSubnets - fastDeserialize 4 bits 176.00 ns/op 169.00 ns/op 1.04
enrSubnets - ssz BitVector 4 bits 444.00 ns/op 544.00 ns/op 0.82
prioritizePeers score -10:0 att 32-0.1 sync 2-0 104.17 us/op 104.51 us/op 1.00
prioritizePeers score 0:0 att 32-0.25 sync 2-0.25 129.08 us/op 152.34 us/op 0.85
prioritizePeers score 0:0 att 32-0.5 sync 2-0.5 172.32 us/op 186.40 us/op 0.92
prioritizePeers score 0:0 att 64-0.75 sync 4-0.75 297.64 us/op 298.39 us/op 1.00
prioritizePeers score 0:0 att 64-1 sync 4-1 360.39 us/op 369.06 us/op 0.98
array of 16000 items push then shift 1.6123 us/op 1.6448 us/op 0.98
LinkedList of 16000 items push then shift 8.9120 ns/op 10.424 ns/op 0.85
array of 16000 items push then pop 77.225 ns/op 129.74 ns/op 0.60
LinkedList of 16000 items push then pop 8.7510 ns/op 9.2720 ns/op 0.94
array of 24000 items push then shift 2.4010 us/op 2.4241 us/op 0.99
LinkedList of 24000 items push then shift 9.7160 ns/op 8.9760 ns/op 1.08
array of 24000 items push then pop 85.622 ns/op 156.66 ns/op 0.55
LinkedList of 24000 items push then pop 9.3600 ns/op 10.223 ns/op 0.92
intersect bitArray bitLen 8 6.7910 ns/op 5.5340 ns/op 1.23
intersect array and set length 8 66.101 ns/op 72.821 ns/op 0.91
intersect bitArray bitLen 128 32.285 ns/op 34.422 ns/op 0.94
intersect array and set length 128 762.14 ns/op 801.32 ns/op 0.95
bitArray.getTrueBitIndexes() bitLen 128 1.5390 us/op 1.6020 us/op 0.96
bitArray.getTrueBitIndexes() bitLen 248 2.5430 us/op 2.7770 us/op 0.92
bitArray.getTrueBitIndexes() bitLen 512 4.9250 us/op 6.2760 us/op 0.78
Buffer.concat 32 items 1.0630 us/op 1.3810 us/op 0.77
Uint8Array.set 32 items 2.2410 us/op 2.4480 us/op 0.92
Set add up to 64 items then delete first 6.4659 us/op 2.3965 us/op 2.70
OrderedSet add up to 64 items then delete first 6.5153 us/op 2.8312 us/op 2.30
Set add up to 64 items then delete last 6.1181 us/op 2.6223 us/op 2.33
OrderedSet add up to 64 items then delete last 7.6634 us/op 4.0205 us/op 1.91
Set add up to 64 items then delete middle 6.0304 us/op 2.4242 us/op 2.49
OrderedSet add up to 64 items then delete middle 8.1662 us/op 5.2633 us/op 1.55
Set add up to 128 items then delete first 12.318 us/op 4.8101 us/op 2.56
OrderedSet add up to 128 items then delete first 15.326 us/op 8.0105 us/op 1.91
Set add up to 128 items then delete last 12.019 us/op 4.9004 us/op 2.45
OrderedSet add up to 128 items then delete last 15.115 us/op 10.036 us/op 1.51
Set add up to 128 items then delete middle 11.846 us/op 5.0029 us/op 2.37
OrderedSet add up to 128 items then delete middle 18.975 us/op 13.609 us/op 1.39
Set add up to 256 items then delete first 25.069 us/op 11.397 us/op 2.20
OrderedSet add up to 256 items then delete first 32.016 us/op 16.452 us/op 1.95
Set add up to 256 items then delete last 23.866 us/op 9.7477 us/op 2.45
OrderedSet add up to 256 items then delete last 30.104 us/op 15.112 us/op 1.99
Set add up to 256 items then delete middle 23.590 us/op 12.106 us/op 1.95
OrderedSet add up to 256 items then delete middle 48.534 us/op 36.715 us/op 1.32
transfer serialized Status (84 B) 1.8610 us/op 1.7050 us/op 1.09
copy serialized Status (84 B) 1.6180 us/op 1.7260 us/op 0.94
transfer serialized SignedVoluntaryExit (112 B) 2.2820 us/op 1.9940 us/op 1.14
copy serialized SignedVoluntaryExit (112 B) 1.8380 us/op 1.6230 us/op 1.13
transfer serialized ProposerSlashing (416 B) 3.2040 us/op 3.3430 us/op 0.96
copy serialized ProposerSlashing (416 B) 2.9140 us/op 3.6770 us/op 0.79
transfer serialized Attestation (485 B) 3.1570 us/op 3.5310 us/op 0.89
copy serialized Attestation (485 B) 2.7680 us/op 3.7080 us/op 0.75
transfer serialized AttesterSlashing (33232 B) 3.4690 us/op 3.5120 us/op 0.99
copy serialized AttesterSlashing (33232 B) 6.6850 us/op 8.7800 us/op 0.76
transfer serialized Small SignedBeaconBlock (128000 B) 3.5150 us/op 3.0540 us/op 1.15
copy serialized Small SignedBeaconBlock (128000 B) 15.543 us/op 22.781 us/op 0.68
transfer serialized Avg SignedBeaconBlock (200000 B) 3.9970 us/op 3.2380 us/op 1.23
copy serialized Avg SignedBeaconBlock (200000 B) 17.921 us/op 33.105 us/op 0.54
transfer serialized BlobsSidecar (524380 B) 3.1530 us/op 3.6210 us/op 0.87
copy serialized BlobsSidecar (524380 B) 74.516 us/op 104.16 us/op 0.72
transfer serialized Big SignedBeaconBlock (1000000 B) 3.3390 us/op 4.0530 us/op 0.82
copy serialized Big SignedBeaconBlock (1000000 B) 145.66 us/op 197.74 us/op 0.74
pass gossip attestations to forkchoice per slot 4.3625 ms/op 2.7890 ms/op 1.56
forkChoice updateHead vc 100000 bc 64 eq 0 673.51 us/op 692.79 us/op 0.97
forkChoice updateHead vc 600000 bc 64 eq 0 4.7899 ms/op 3.2875 ms/op 1.46
forkChoice updateHead vc 1000000 bc 64 eq 0 11.696 ms/op 5.7268 ms/op 2.04
forkChoice updateHead vc 600000 bc 320 eq 0 7.0564 ms/op 2.9925 ms/op 2.36
forkChoice updateHead vc 600000 bc 1200 eq 0 7.0541 ms/op 3.4406 ms/op 2.05
forkChoice updateHead vc 600000 bc 7200 eq 0 8.0454 ms/op 4.6665 ms/op 1.72
forkChoice updateHead vc 600000 bc 64 eq 1000 10.869 ms/op 11.384 ms/op 0.95
forkChoice updateHead vc 600000 bc 64 eq 10000 11.736 ms/op 10.988 ms/op 1.07
forkChoice updateHead vc 600000 bc 64 eq 300000 15.453 ms/op 32.064 ms/op 0.48
computeDeltas 500000 validators 300 proto nodes 7.2071 ms/op 3.1427 ms/op 2.29
computeDeltas 500000 validators 1200 proto nodes 11.717 ms/op 2.9488 ms/op 3.97
computeDeltas 500000 validators 7200 proto nodes 13.778 ms/op 2.9376 ms/op 4.69
computeDeltas 750000 validators 300 proto nodes 20.797 ms/op 4.3989 ms/op 4.73
computeDeltas 750000 validators 1200 proto nodes 20.944 ms/op 4.5411 ms/op 4.61
computeDeltas 750000 validators 7200 proto nodes 21.016 ms/op 4.3696 ms/op 4.81
computeDeltas 1400000 validators 300 proto nodes 39.059 ms/op 8.4551 ms/op 4.62
computeDeltas 1400000 validators 1200 proto nodes 38.965 ms/op 8.4631 ms/op 4.60
computeDeltas 1400000 validators 7200 proto nodes 38.974 ms/op 8.5060 ms/op 4.58
computeDeltas 2100000 validators 300 proto nodes 58.156 ms/op 13.527 ms/op 4.30
computeDeltas 2100000 validators 1200 proto nodes 58.230 ms/op 13.194 ms/op 4.41
computeDeltas 2100000 validators 7200 proto nodes 58.173 ms/op 13.245 ms/op 4.39
computeProposerBoostScoreFromBalances 500000 validators 3.1901 ms/op 2.9024 ms/op 1.10
computeProposerBoostScoreFromBalances 750000 validators 3.0791 ms/op 2.9302 ms/op 1.05
computeProposerBoostScoreFromBalances 1400000 validators 3.1636 ms/op 2.8790 ms/op 1.10
computeProposerBoostScoreFromBalances 2100000 validators 3.1423 ms/op 2.8178 ms/op 1.12
altair processAttestation - 250000 vs - 7PWei normalcase 2.6141 ms/op 1.6226 ms/op 1.61
altair processAttestation - 250000 vs - 7PWei worstcase 3.1970 ms/op 2.1287 ms/op 1.50
altair processAttestation - setStatus - 1/6 committees join 177.21 us/op 71.074 us/op 2.49
altair processAttestation - setStatus - 1/3 committees join 319.69 us/op 161.22 us/op 1.98
altair processAttestation - setStatus - 1/2 committees join 466.60 us/op 218.54 us/op 2.14
altair processAttestation - setStatus - 2/3 committees join 581.65 us/op 316.67 us/op 1.84
altair processAttestation - setStatus - 4/5 committees join 777.39 us/op 436.99 us/op 1.78
altair processAttestation - setStatus - 100% committees join 898.36 us/op 534.13 us/op 1.68
altair processBlock - 250000 vs - 7PWei normalcase 7.3328 ms/op 6.5380 ms/op 1.12
altair processBlock - 250000 vs - 7PWei normalcase hashState 30.248 ms/op 25.967 ms/op 1.16
altair processBlock - 250000 vs - 7PWei worstcase 42.815 ms/op 32.283 ms/op 1.33
altair processBlock - 250000 vs - 7PWei worstcase hashState 94.068 ms/op 78.207 ms/op 1.20
phase0 processBlock - 250000 vs - 7PWei normalcase 2.8941 ms/op 2.0638 ms/op 1.40
phase0 processBlock - 250000 vs - 7PWei worstcase 29.899 ms/op 26.133 ms/op 1.14
altair processEth1Data - 250000 vs - 7PWei normalcase 514.85 us/op 312.05 us/op 1.65
getExpectedWithdrawals 250000 eb:1,eth1:1,we:0,wn:0,smpl:15 18.549 us/op 3.8900 us/op 4.77
getExpectedWithdrawals 250000 eb:0.95,eth1:0.1,we:0.05,wn:0,smpl:219 60.908 us/op 45.523 us/op 1.34
getExpectedWithdrawals 250000 eb:0.95,eth1:0.3,we:0.05,wn:0,smpl:42 39.200 us/op 12.686 us/op 3.09
getExpectedWithdrawals 250000 eb:0.95,eth1:0.7,we:0.05,wn:0,smpl:18 20.152 us/op 3.6020 us/op 5.59
getExpectedWithdrawals 250000 eb:0.1,eth1:0.1,we:0,wn:0,smpl:1020 271.56 us/op 100.12 us/op 2.71
getExpectedWithdrawals 250000 eb:0.03,eth1:0.03,we:0,wn:0,smpl:11777 2.1003 ms/op 1.0526 ms/op 2.00
getExpectedWithdrawals 250000 eb:0.01,eth1:0.01,we:0,wn:0,smpl:16384 2.8864 ms/op 1.1783 ms/op 2.45
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,smpl:16384 1.5472 ms/op 1.0683 ms/op 1.45
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,nocache,smpl:16384 3.8911 ms/op 3.1840 ms/op 1.22
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,smpl:16384 2.7462 ms/op 2.1599 ms/op 1.27
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,nocache,smpl:16384 5.1190 ms/op 5.4796 ms/op 0.93
Tree 40 250000 create 338.90 ms/op 263.11 ms/op 1.29
Tree 40 250000 get(125000) 228.21 ns/op 121.61 ns/op 1.88
Tree 40 250000 set(125000) 1.0197 us/op 757.15 ns/op 1.35
Tree 40 250000 toArray() 19.790 ms/op 20.525 ms/op 0.96
Tree 40 250000 iterate all - toArray() + loop 19.976 ms/op 12.604 ms/op 1.58
Tree 40 250000 iterate all - get(i) 83.737 ms/op 44.833 ms/op 1.87
MutableVector 250000 create 17.210 ms/op 8.0640 ms/op 2.13
MutableVector 250000 get(125000) 6.5910 ns/op 5.6530 ns/op 1.17
MutableVector 250000 set(125000) 326.62 ns/op 192.38 ns/op 1.70
MutableVector 250000 toArray() 3.1703 ms/op 2.9554 ms/op 1.07
MutableVector 250000 iterate all - toArray() + loop 3.2322 ms/op 3.5157 ms/op 0.92
MutableVector 250000 iterate all - get(i) 1.5951 ms/op 1.3440 ms/op 1.19
Array 250000 create 2.7279 ms/op 2.6090 ms/op 1.05
Array 250000 clone - spread 1.0724 ms/op 871.37 us/op 1.23
Array 250000 get(125000) 0.55800 ns/op 0.44700 ns/op 1.25
Array 250000 set(125000) 0.60800 ns/op 0.51300 ns/op 1.19
Array 250000 iterate all - loop 83.718 us/op 78.890 us/op 1.06
effectiveBalanceIncrements clone Uint8Array 300000 22.885 us/op 22.709 us/op 1.01
effectiveBalanceIncrements clone MutableVector 300000 300.00 ns/op 241.00 ns/op 1.24
effectiveBalanceIncrements rw all Uint8Array 300000 180.50 us/op 175.21 us/op 1.03
effectiveBalanceIncrements rw all MutableVector 300000 102.31 ms/op 59.715 ms/op 1.71
phase0 afterProcessEpoch - 250000 vs - 7PWei 121.62 ms/op 78.950 ms/op 1.54
phase0 beforeProcessEpoch - 250000 vs - 7PWei 44.558 ms/op 35.147 ms/op 1.27
altair processEpoch - mainnet_e81889 535.41 ms/op 328.48 ms/op 1.63
mainnet_e81889 - altair beforeProcessEpoch 66.585 ms/op 52.113 ms/op 1.28
mainnet_e81889 - altair processJustificationAndFinalization 17.555 us/op 8.9760 us/op 1.96
mainnet_e81889 - altair processInactivityUpdates 9.7611 ms/op 4.7779 ms/op 2.04
mainnet_e81889 - altair processRewardsAndPenalties 77.788 ms/op 53.941 ms/op 1.44
mainnet_e81889 - altair processRegistryUpdates 2.9500 us/op 1.3390 us/op 2.20
mainnet_e81889 - altair processSlashings 750.00 ns/op 274.00 ns/op 2.74
mainnet_e81889 - altair processEth1DataReset 686.00 ns/op 321.00 ns/op 2.14
mainnet_e81889 - altair processEffectiveBalanceUpdates 2.9628 ms/op 950.11 us/op 3.12
mainnet_e81889 - altair processSlashingsReset 3.4820 us/op 1.9180 us/op 1.82
mainnet_e81889 - altair processRandaoMixesReset 6.7070 us/op 1.9510 us/op 3.44
mainnet_e81889 - altair processHistoricalRootsUpdate 851.00 ns/op 330.00 ns/op 2.58
mainnet_e81889 - altair processParticipationFlagUpdates 2.0990 us/op 699.00 ns/op 3.00
mainnet_e81889 - altair processSyncCommitteeUpdates 903.00 ns/op 240.00 ns/op 3.76
mainnet_e81889 - altair afterProcessEpoch 137.73 ms/op 81.248 ms/op 1.70
capella processEpoch - mainnet_e217614 1.7497 s/op 1.0364 s/op 1.69
mainnet_e217614 - capella beforeProcessEpoch 312.68 ms/op 182.22 ms/op 1.72
mainnet_e217614 - capella processJustificationAndFinalization 25.452 us/op 17.214 us/op 1.48
mainnet_e217614 - capella processInactivityUpdates 29.627 ms/op 21.708 ms/op 1.36
mainnet_e217614 - capella processRewardsAndPenalties 352.57 ms/op 230.32 ms/op 1.53
mainnet_e217614 - capella processRegistryUpdates 36.351 us/op 11.114 us/op 3.27
mainnet_e217614 - capella processSlashings 1.0740 us/op 252.00 ns/op 4.26
mainnet_e217614 - capella processEth1DataReset 941.00 ns/op 268.00 ns/op 3.51
mainnet_e217614 - capella processEffectiveBalanceUpdates 11.856 ms/op 3.0883 ms/op 3.84
mainnet_e217614 - capella processSlashingsReset 5.0850 us/op 1.7880 us/op 2.84
mainnet_e217614 - capella processRandaoMixesReset 9.3700 us/op 1.8540 us/op 5.05
mainnet_e217614 - capella processHistoricalRootsUpdate 1.1530 us/op 472.00 ns/op 2.44
mainnet_e217614 - capella processParticipationFlagUpdates 2.5330 us/op 954.00 ns/op 2.66
mainnet_e217614 - capella afterProcessEpoch 340.36 ms/op 211.48 ms/op 1.61
phase0 processEpoch - mainnet_e58758 573.08 ms/op 346.05 ms/op 1.66
mainnet_e58758 - phase0 beforeProcessEpoch 148.70 ms/op 89.205 ms/op 1.67
mainnet_e58758 - phase0 processJustificationAndFinalization 26.140 us/op 9.0390 us/op 2.89
mainnet_e58758 - phase0 processRewardsAndPenalties 67.423 ms/op 44.801 ms/op 1.50
mainnet_e58758 - phase0 processRegistryUpdates 18.081 us/op 10.616 us/op 1.70
mainnet_e58758 - phase0 processSlashings 870.00 ns/op 223.00 ns/op 3.90
mainnet_e58758 - phase0 processEth1DataReset 1.0320 us/op 308.00 ns/op 3.35
mainnet_e58758 - phase0 processEffectiveBalanceUpdates 3.3805 ms/op 788.57 us/op 4.29
mainnet_e58758 - phase0 processSlashingsReset 3.7910 us/op 1.9370 us/op 1.96
mainnet_e58758 - phase0 processRandaoMixesReset 6.2370 us/op 5.0230 us/op 1.24
mainnet_e58758 - phase0 processHistoricalRootsUpdate 543.00 ns/op 949.00 ns/op 0.57
mainnet_e58758 - phase0 processParticipationRecordUpdates 6.4090 us/op 4.6240 us/op 1.39
mainnet_e58758 - phase0 afterProcessEpoch 109.19 ms/op 72.504 ms/op 1.51
phase0 processEffectiveBalanceUpdates - 250000 normalcase 4.1084 ms/op 975.23 us/op 4.21
phase0 processEffectiveBalanceUpdates - 250000 worstcase 0.5 3.2408 ms/op 1.2011 ms/op 2.70
altair processInactivityUpdates - 250000 normalcase 26.055 ms/op 17.065 ms/op 1.53
altair processInactivityUpdates - 250000 worstcase 22.858 ms/op 18.772 ms/op 1.22
phase0 processRegistryUpdates - 250000 normalcase 10.653 us/op 7.5540 us/op 1.41
phase0 processRegistryUpdates - 250000 badcase_full_deposits 538.65 us/op 416.13 us/op 1.29
phase0 processRegistryUpdates - 250000 worstcase 0.5 158.40 ms/op 113.28 ms/op 1.40
altair processRewardsAndPenalties - 250000 normalcase 65.180 ms/op 61.774 ms/op 1.06
altair processRewardsAndPenalties - 250000 worstcase 71.888 ms/op 59.383 ms/op 1.21
phase0 getAttestationDeltas - 250000 normalcase 12.190 ms/op 6.2303 ms/op 1.96
phase0 getAttestationDeltas - 250000 worstcase 12.020 ms/op 5.4224 ms/op 2.22
phase0 processSlashings - 250000 worstcase 3.3830 ms/op 1.9295 ms/op 1.75
altair processSyncCommitteeUpdates - 250000 178.26 ms/op 126.66 ms/op 1.41
BeaconState.hashTreeRoot - No change 550.00 ns/op 257.00 ns/op 2.14
BeaconState.hashTreeRoot - 1 full validator 158.27 us/op 131.97 us/op 1.20
BeaconState.hashTreeRoot - 32 full validator 1.9864 ms/op 1.2326 ms/op 1.61
BeaconState.hashTreeRoot - 512 full validator 22.025 ms/op 17.181 ms/op 1.28
BeaconState.hashTreeRoot - 1 validator.effectiveBalance 181.74 us/op 152.54 us/op 1.19
BeaconState.hashTreeRoot - 32 validator.effectiveBalance 2.3607 ms/op 2.7516 ms/op 0.86
BeaconState.hashTreeRoot - 512 validator.effectiveBalance 29.451 ms/op 32.068 ms/op 0.92
BeaconState.hashTreeRoot - 1 balances 137.82 us/op 108.62 us/op 1.27
BeaconState.hashTreeRoot - 32 balances 1.4056 ms/op 1.3728 ms/op 1.02
BeaconState.hashTreeRoot - 512 balances 15.355 ms/op 13.085 ms/op 1.17
BeaconState.hashTreeRoot - 250000 balances 238.52 ms/op 198.43 ms/op 1.20
aggregationBits - 2048 els - zipIndexesInBitList 23.409 us/op 13.335 us/op 1.76
regular array get 100000 times 34.713 us/op 30.976 us/op 1.12
wrappedArray get 100000 times 34.825 us/op 30.933 us/op 1.13
arrayWithProxy get 100000 times 18.305 ms/op 10.588 ms/op 1.73
ssz.Root.equals 308.00 ns/op 187.00 ns/op 1.65
byteArrayEquals 296.00 ns/op 172.00 ns/op 1.72
shuffle list - 16384 els 7.4557 ms/op 5.3144 ms/op 1.40
shuffle list - 250000 els 109.73 ms/op 72.114 ms/op 1.52
processSlot - 1 slots 27.004 us/op 17.168 us/op 1.57
processSlot - 32 slots 3.9781 ms/op 2.9879 ms/op 1.33
getEffectiveBalanceIncrementsZeroInactive - 250000 vs - 7PWei 55.247 ms/op 46.808 ms/op 1.18
getCommitteeAssignments - req 1 vs - 250000 vc 2.6345 ms/op 2.2408 ms/op 1.18
getCommitteeAssignments - req 100 vs - 250000 vc 3.8990 ms/op 3.3803 ms/op 1.15
getCommitteeAssignments - req 1000 vs - 250000 vc 4.3452 ms/op 3.6684 ms/op 1.18
RootCache.getBlockRootAtSlot - 250000 vs - 7PWei 16.390 ns/op 4.1600 ns/op 3.94
state getBlockRootAtSlot - 250000 vs - 7PWei 801.91 ns/op 652.38 ns/op 1.23
computeProposers - vc 250000 11.034 ms/op 5.8666 ms/op 1.88
computeEpochShuffling - vc 250000 117.21 ms/op 70.900 ms/op 1.65
getNextSyncCommittee - vc 250000 203.67 ms/op 106.48 ms/op 1.91
computeSigningRoot for AttestationData 30.766 us/op 22.805 us/op 1.35
hash AttestationData serialized data then Buffer.toString(base64) 2.5899 us/op 1.2797 us/op 2.02
toHexString serialized data 1.6056 us/op 784.86 ns/op 2.05
Buffer.toString(base64) 353.20 ns/op 153.68 ns/op 2.30

Please sign in to comment.