ChainSafe / lodestar

🌟 TypeScript Implementation of Ethereum Consensus
https://lodestar.chainsafe.io
Apache License 2.0
1.19k stars 291 forks source link

feat: add validator identities endpoint #7107

Closed nflaig closed 1 month ago

nflaig commented 1 month ago

Motivation

Description

Adds validator identities endpoint which is a much more lightweight alternative to retrieve the validator index from state compared to getStateValidators and also allows SSZ encoding of response.

There still needs to be another endpoint (see https://github.com/ethereum/beacon-APIs/pull/449) before we can make use of this in the validator client as we currently also print out the status of the validator (although this is purely informational) but other clients that only need the index can make use of this as is.

Keep as draft for now until spec PR is merged.

Closes https://github.com/ChainSafe/lodestar/issues/7105

codecov[bot] commented 1 month ago

Codecov Report

Attention: Patch coverage is 96.77419% with 1 line in your changes missing coverage. Please review.

Project coverage is 48.98%. Comparing base (ad4ec77) to head (e595ab7). Report is 7 commits behind head on unstable.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## unstable #7107 +/- ## ============================================ - Coverage 50.82% 48.98% -1.85% ============================================ Files 597 597 Lines 39789 39834 +45 Branches 2059 2056 -3 ============================================ - Hits 20224 19511 -713 - Misses 19565 20282 +717 - Partials 0 41 +41 ```
github-actions[bot] commented 1 month ago

Performance Report

✔️ no performance regression detected

🚀🚀 Significant benchmark improvement detected

Benchmark suite Current: 61743deb118bb047731cab01b8748e76c2c02140 Previous: 77006ea0ce9ac043b71b7aaa07b9fae6f38f5250 Ratio
getExpectedWithdrawals 250000 eb:0.95,eth1:0.1,we:0.05,wn:0,smpl:219 17.668 us/op 60.633 us/op 0.29
Full benchmark results | Benchmark suite | Current: 61743deb118bb047731cab01b8748e76c2c02140 | Previous: 77006ea0ce9ac043b71b7aaa07b9fae6f38f5250 | Ratio | |-|-|-|-| | getPubkeys - index2pubkey - req 1000 vs - 250000 vc | 1.8681 ms/op | 1.7664 ms/op | 1.06 | | getPubkeys - validatorsArr - req 1000 vs - 250000 vc | 46.345 us/op | 45.587 us/op | 1.02 | | BLS verify - blst | 858.49 us/op | 810.21 us/op | 1.06 | | BLS verifyMultipleSignatures 3 - blst | 1.3184 ms/op | 1.1414 ms/op | 1.16 | | BLS verifyMultipleSignatures 8 - blst | 1.5126 ms/op | 1.5921 ms/op | 0.95 | | BLS verifyMultipleSignatures 32 - blst | 4.4629 ms/op | 4.6995 ms/op | 0.95 | | BLS verifyMultipleSignatures 64 - blst | 8.4494 ms/op | 8.6887 ms/op | 0.97 | | BLS verifyMultipleSignatures 128 - blst | 15.963 ms/op | 16.573 ms/op | 0.96 | | BLS deserializing 10000 signatures | 614.49 ms/op | 659.00 ms/op | 0.93 | | BLS deserializing 100000 signatures | 6.3159 s/op | 6.6820 s/op | 0.95 | | BLS verifyMultipleSignatures - same message - 3 - blst | 926.32 us/op | 843.05 us/op | 1.10 | | BLS verifyMultipleSignatures - same message - 8 - blst | 1.0498 ms/op | 1.0002 ms/op | 1.05 | | BLS verifyMultipleSignatures - same message - 32 - blst | 1.6775 ms/op | 1.5985 ms/op | 1.05 | | BLS verifyMultipleSignatures - same message - 64 - blst | 2.5674 ms/op | 2.4852 ms/op | 1.03 | | BLS verifyMultipleSignatures - same message - 128 - blst | 4.0968 ms/op | 4.1647 ms/op | 0.98 | | BLS aggregatePubkeys 32 - blst | 18.750 us/op | 19.153 us/op | 0.98 | | BLS aggregatePubkeys 128 - blst | 66.234 us/op | 67.709 us/op | 0.98 | | notSeenSlots=1 numMissedVotes=1 numBadVotes=10 | 69.633 ms/op | 64.459 ms/op | 1.08 | | notSeenSlots=1 numMissedVotes=0 numBadVotes=4 | 51.419 ms/op | 51.258 ms/op | 1.00 | | notSeenSlots=2 numMissedVotes=1 numBadVotes=10 | 38.250 ms/op | 32.418 ms/op | 1.18 | | getSlashingsAndExits - default max | 107.26 us/op | 97.985 us/op | 1.09 | | getSlashingsAndExits - 2k | 337.12 us/op | 269.70 us/op | 1.25 | | proposeBlockBody type=full, size=empty | 4.9050 ms/op | 5.8009 ms/op | 0.85 | | isKnown best case - 1 super set check | 514.00 ns/op | 293.00 ns/op | 1.75 | | isKnown normal case - 2 super set checks | 495.00 ns/op | 287.00 ns/op | 1.72 | | isKnown worse case - 16 super set checks | 501.00 ns/op | 272.00 ns/op | 1.84 | | InMemoryCheckpointStateCache - add get delete | 3.2690 us/op | 2.6410 us/op | 1.24 | | updateUnfinalizedPubkeys - updating 10 pubkeys | 780.56 us/op | 1.3052 ms/op | 0.60 | | updateUnfinalizedPubkeys - updating 100 pubkeys | 2.8908 ms/op | 3.2881 ms/op | 0.88 | | updateUnfinalizedPubkeys - updating 1000 pubkeys | 40.942 ms/op | 49.833 ms/op | 0.82 | | validate api signedAggregateAndProof - struct | 1.7092 ms/op | 1.3578 ms/op | 1.26 | | validate gossip signedAggregateAndProof - struct | 1.5624 ms/op | 1.4375 ms/op | 1.09 | | validate gossip attestation - vc 640000 | 996.37 us/op | 910.94 us/op | 1.09 | | batch validate gossip attestation - vc 640000 - chunk 32 | 133.63 us/op | 131.25 us/op | 1.02 | | batch validate gossip attestation - vc 640000 - chunk 64 | 115.37 us/op | 114.65 us/op | 1.01 | | batch validate gossip attestation - vc 640000 - chunk 128 | 107.03 us/op | 107.44 us/op | 1.00 | | batch validate gossip attestation - vc 640000 - chunk 256 | 122.76 us/op | 108.89 us/op | 1.13 | | pickEth1Vote - no votes | 890.54 us/op | 1.1913 ms/op | 0.75 | | pickEth1Vote - max votes | 5.3615 ms/op | 7.0098 ms/op | 0.76 | | pickEth1Vote - Eth1Data hashTreeRoot value x2048 | 10.280 ms/op | 14.775 ms/op | 0.70 | | pickEth1Vote - Eth1Data hashTreeRoot tree x2048 | 14.167 ms/op | 22.502 ms/op | 0.63 | | pickEth1Vote - Eth1Data fastSerialize value x2048 | 375.56 us/op | 517.46 us/op | 0.73 | | pickEth1Vote - Eth1Data fastSerialize tree x2048 | 2.6374 ms/op | 2.7279 ms/op | 0.97 | | bytes32 toHexString | 592.00 ns/op | 514.00 ns/op | 1.15 | | bytes32 Buffer.toString(hex) | 444.00 ns/op | 254.00 ns/op | 1.75 | | bytes32 Buffer.toString(hex) from Uint8Array | 580.00 ns/op | 479.00 ns/op | 1.21 | | bytes32 Buffer.toString(hex) + 0x | 446.00 ns/op | 265.00 ns/op | 1.68 | | Object access 1 prop | 0.36100 ns/op | 0.17200 ns/op | 2.10 | | Map access 1 prop | 0.35400 ns/op | 0.13300 ns/op | 2.66 | | Object get x1000 | 5.3800 ns/op | 6.1990 ns/op | 0.87 | | Map get x1000 | 5.7640 ns/op | 6.6150 ns/op | 0.87 | | Object set x1000 | 26.161 ns/op | 41.023 ns/op | 0.64 | | Map set x1000 | 19.012 ns/op | 26.882 ns/op | 0.71 | | Return object 10000 times | 0.31010 ns/op | 0.31020 ns/op | 1.00 | | Throw Error 10000 times | 3.0470 us/op | 3.4461 us/op | 0.88 | | toHex | 111.95 ns/op | 164.86 ns/op | 0.68 | | Buffer.from | 107.75 ns/op | 152.59 ns/op | 0.71 | | shared Buffer | 84.161 ns/op | 91.919 ns/op | 0.92 | | fastMsgIdFn sha256 / 200 bytes | 2.2930 us/op | 2.2980 us/op | 1.00 | | fastMsgIdFn h32 xxhash / 200 bytes | 526.00 ns/op | 290.00 ns/op | 1.81 | | fastMsgIdFn h64 xxhash / 200 bytes | 489.00 ns/op | 277.00 ns/op | 1.77 | | fastMsgIdFn sha256 / 1000 bytes | 6.2990 us/op | 7.5430 us/op | 0.84 | | fastMsgIdFn h32 xxhash / 1000 bytes | 658.00 ns/op | 403.00 ns/op | 1.63 | | fastMsgIdFn h64 xxhash / 1000 bytes | 633.00 ns/op | 349.00 ns/op | 1.81 | | fastMsgIdFn sha256 / 10000 bytes | 56.374 us/op | 65.529 us/op | 0.86 | | fastMsgIdFn h32 xxhash / 10000 bytes | 2.1940 us/op | 1.9490 us/op | 1.13 | | fastMsgIdFn h64 xxhash / 10000 bytes | 1.4540 us/op | 1.2510 us/op | 1.16 | | send data - 1000 256B messages | 14.742 ms/op | 13.796 ms/op | 1.07 | | send data - 1000 512B messages | 17.819 ms/op | 18.592 ms/op | 0.96 | | send data - 1000 1024B messages | 27.018 ms/op | 27.973 ms/op | 0.97 | | send data - 1000 1200B messages | 30.186 ms/op | 27.934 ms/op | 1.08 | | send data - 1000 2048B messages | 31.322 ms/op | 34.302 ms/op | 0.91 | | send data - 1000 4096B messages | 29.010 ms/op | 31.561 ms/op | 0.92 | | send data - 1000 16384B messages | 74.681 ms/op | 70.160 ms/op | 1.06 | | send data - 1000 65536B messages | 282.21 ms/op | 205.56 ms/op | 1.37 | | enrSubnets - fastDeserialize 64 bits | 1.3520 us/op | 1.0800 us/op | 1.25 | | enrSubnets - ssz BitVector 64 bits | 609.00 ns/op | 350.00 ns/op | 1.74 | | enrSubnets - fastDeserialize 4 bits | 378.00 ns/op | 146.00 ns/op | 2.59 | | enrSubnets - ssz BitVector 4 bits | 602.00 ns/op | 340.00 ns/op | 1.77 | | prioritizePeers score -10:0 att 32-0.1 sync 2-0 | 130.70 us/op | 141.38 us/op | 0.92 | | prioritizePeers score 0:0 att 32-0.25 sync 2-0.25 | 156.24 us/op | 154.15 us/op | 1.01 | | prioritizePeers score 0:0 att 32-0.5 sync 2-0.5 | 271.53 us/op | 240.45 us/op | 1.13 | | prioritizePeers score 0:0 att 64-0.75 sync 4-0.75 | 463.61 us/op | 387.81 us/op | 1.20 | | prioritizePeers score 0:0 att 64-1 sync 4-1 | 522.13 us/op | 577.51 us/op | 0.90 | | array of 16000 items push then shift | 1.2694 us/op | 1.6607 us/op | 0.76 | | LinkedList of 16000 items push then shift | 8.7240 ns/op | 7.3710 ns/op | 1.18 | | array of 16000 items push then pop | 122.62 ns/op | 123.85 ns/op | 0.99 | | LinkedList of 16000 items push then pop | 6.6640 ns/op | 7.1450 ns/op | 0.93 | | array of 24000 items push then shift | 1.9744 us/op | 2.4235 us/op | 0.81 | | LinkedList of 24000 items push then shift | 8.3010 ns/op | 7.4670 ns/op | 1.11 | | array of 24000 items push then pop | 186.93 ns/op | 143.77 ns/op | 1.30 | | LinkedList of 24000 items push then pop | 6.9670 ns/op | 7.0170 ns/op | 0.99 | | intersect bitArray bitLen 8 | 5.6580 ns/op | 6.4010 ns/op | 0.88 | | intersect array and set length 8 | 43.443 ns/op | 45.942 ns/op | 0.95 | | intersect bitArray bitLen 128 | 26.525 ns/op | 29.694 ns/op | 0.89 | | intersect array and set length 128 | 721.23 ns/op | 676.36 ns/op | 1.07 | | bitArray.getTrueBitIndexes() bitLen 128 | 1.6620 us/op | 1.8780 us/op | 0.88 | | bitArray.getTrueBitIndexes() bitLen 248 | 2.6850 us/op | 3.3080 us/op | 0.81 | | bitArray.getTrueBitIndexes() bitLen 512 | 5.2320 us/op | 6.3740 us/op | 0.82 | | Buffer.concat 32 items | 1.0400 us/op | 945.00 ns/op | 1.10 | | Uint8Array.set 32 items | 1.7430 us/op | 1.8090 us/op | 0.96 | | Buffer.copy | 1.7710 us/op | 1.7350 us/op | 1.02 | | Uint8Array.set - with subarray | 2.1870 us/op | 2.3360 us/op | 0.94 | | Uint8Array.set - without subarray | 1.5870 us/op | 1.2180 us/op | 1.30 | | getUint32 - dataview | 455.00 ns/op | 240.00 ns/op | 1.90 | | getUint32 - manual | 413.00 ns/op | 165.00 ns/op | 2.50 | | Set add up to 64 items then delete first | 1.8295 us/op | 2.2364 us/op | 0.82 | | OrderedSet add up to 64 items then delete first | 3.5769 us/op | 3.3969 us/op | 1.05 | | Set add up to 64 items then delete last | 2.2908 us/op | 2.5220 us/op | 0.91 | | OrderedSet add up to 64 items then delete last | 3.1270 us/op | 3.9748 us/op | 0.79 | | Set add up to 64 items then delete middle | 2.0641 us/op | 2.5512 us/op | 0.81 | | OrderedSet add up to 64 items then delete middle | 4.7195 us/op | 5.4612 us/op | 0.86 | | Set add up to 128 items then delete first | 4.3751 us/op | 5.1060 us/op | 0.86 | | OrderedSet add up to 128 items then delete first | 6.6276 us/op | 7.6783 us/op | 0.86 | | Set add up to 128 items then delete last | 4.4677 us/op | 5.6974 us/op | 0.78 | | OrderedSet add up to 128 items then delete last | 7.1740 us/op | 7.8696 us/op | 0.91 | | Set add up to 128 items then delete middle | 4.3481 us/op | 4.9461 us/op | 0.88 | | OrderedSet add up to 128 items then delete middle | 12.870 us/op | 13.746 us/op | 0.94 | | Set add up to 256 items then delete first | 8.3488 us/op | 11.852 us/op | 0.70 | | OrderedSet add up to 256 items then delete first | 12.934 us/op | 17.290 us/op | 0.75 | | Set add up to 256 items then delete last | 7.9451 us/op | 10.227 us/op | 0.78 | | OrderedSet add up to 256 items then delete last | 12.722 us/op | 15.365 us/op | 0.83 | | Set add up to 256 items then delete middle | 8.7796 us/op | 9.7523 us/op | 0.90 | | OrderedSet add up to 256 items then delete middle | 37.457 us/op | 40.420 us/op | 0.93 | | transfer serialized Status (84 B) | 1.4550 us/op | 1.3440 us/op | 1.08 | | copy serialized Status (84 B) | 1.3640 us/op | 1.1230 us/op | 1.21 | | transfer serialized SignedVoluntaryExit (112 B) | 1.4760 us/op | 1.4870 us/op | 0.99 | | copy serialized SignedVoluntaryExit (112 B) | 1.4270 us/op | 1.1440 us/op | 1.25 | | transfer serialized ProposerSlashing (416 B) | 2.1740 us/op | 1.5370 us/op | 1.41 | | copy serialized ProposerSlashing (416 B) | 2.2630 us/op | 1.8110 us/op | 1.25 | | transfer serialized Attestation (485 B) | 1.8520 us/op | 2.1900 us/op | 0.85 | | copy serialized Attestation (485 B) | 1.6450 us/op | 1.4310 us/op | 1.15 | | transfer serialized AttesterSlashing (33232 B) | 1.7180 us/op | 2.5540 us/op | 0.67 | | copy serialized AttesterSlashing (33232 B) | 3.7700 us/op | 5.5190 us/op | 0.68 | | transfer serialized Small SignedBeaconBlock (128000 B) | 1.9960 us/op | 3.1090 us/op | 0.64 | | copy serialized Small SignedBeaconBlock (128000 B) | 8.3650 us/op | 15.251 us/op | 0.55 | | transfer serialized Avg SignedBeaconBlock (200000 B) | 2.6930 us/op | 3.7710 us/op | 0.71 | | copy serialized Avg SignedBeaconBlock (200000 B) | 13.999 us/op | 22.660 us/op | 0.62 | | transfer serialized BlobsSidecar (524380 B) | 3.0770 us/op | 2.9160 us/op | 1.06 | | copy serialized BlobsSidecar (524380 B) | 226.83 us/op | 118.01 us/op | 1.92 | | transfer serialized Big SignedBeaconBlock (1000000 B) | 3.9320 us/op | 2.8040 us/op | 1.40 | | copy serialized Big SignedBeaconBlock (1000000 B) | 142.97 us/op | 152.88 us/op | 0.94 | | pass gossip attestations to forkchoice per slot | 2.4705 ms/op | 2.8033 ms/op | 0.88 | | forkChoice updateHead vc 100000 bc 64 eq 0 | 490.76 us/op | 494.60 us/op | 0.99 | | forkChoice updateHead vc 600000 bc 64 eq 0 | 2.8738 ms/op | 2.9678 ms/op | 0.97 | | forkChoice updateHead vc 1000000 bc 64 eq 0 | 4.6199 ms/op | 5.0850 ms/op | 0.91 | | forkChoice updateHead vc 600000 bc 320 eq 0 | 2.7314 ms/op | 3.5187 ms/op | 0.78 | | forkChoice updateHead vc 600000 bc 1200 eq 0 | 2.7300 ms/op | 3.1164 ms/op | 0.88 | | forkChoice updateHead vc 600000 bc 7200 eq 0 | 3.5566 ms/op | 3.4250 ms/op | 1.04 | | forkChoice updateHead vc 600000 bc 64 eq 1000 | 9.9671 ms/op | 10.662 ms/op | 0.93 | | forkChoice updateHead vc 600000 bc 64 eq 10000 | 10.749 ms/op | 10.163 ms/op | 1.06 | | forkChoice updateHead vc 600000 bc 64 eq 300000 | 14.154 ms/op | 14.483 ms/op | 0.98 | | computeDeltas 500000 validators 300 proto nodes | 3.2231 ms/op | 3.6172 ms/op | 0.89 | | computeDeltas 500000 validators 1200 proto nodes | 3.2650 ms/op | 3.8560 ms/op | 0.85 | | computeDeltas 500000 validators 7200 proto nodes | 3.1462 ms/op | 3.8390 ms/op | 0.82 | | computeDeltas 750000 validators 300 proto nodes | 4.8610 ms/op | 5.5696 ms/op | 0.87 | | computeDeltas 750000 validators 1200 proto nodes | 4.6437 ms/op | 5.6050 ms/op | 0.83 | | computeDeltas 750000 validators 7200 proto nodes | 4.4608 ms/op | 5.7264 ms/op | 0.78 | | computeDeltas 1400000 validators 300 proto nodes | 8.2522 ms/op | 10.377 ms/op | 0.80 | | computeDeltas 1400000 validators 1200 proto nodes | 7.9669 ms/op | 10.722 ms/op | 0.74 | | computeDeltas 1400000 validators 7200 proto nodes | 7.8773 ms/op | 11.281 ms/op | 0.70 | | computeDeltas 2100000 validators 300 proto nodes | 12.235 ms/op | 16.546 ms/op | 0.74 | | computeDeltas 2100000 validators 1200 proto nodes | 12.271 ms/op | 16.559 ms/op | 0.74 | | computeDeltas 2100000 validators 7200 proto nodes | 12.077 ms/op | 16.938 ms/op | 0.71 | | altair processAttestation - 250000 vs - 7PWei normalcase | 1.4155 ms/op | 2.7458 ms/op | 0.52 | | altair processAttestation - 250000 vs - 7PWei worstcase | 2.1040 ms/op | 3.9140 ms/op | 0.54 | | altair processAttestation - setStatus - 1/6 committees join | 59.540 us/op | 124.92 us/op | 0.48 | | altair processAttestation - setStatus - 1/3 committees join | 114.39 us/op | 231.18 us/op | 0.49 | | altair processAttestation - setStatus - 1/2 committees join | 170.68 us/op | 352.65 us/op | 0.48 | | altair processAttestation - setStatus - 2/3 committees join | 251.45 us/op | 381.57 us/op | 0.66 | | altair processAttestation - setStatus - 4/5 committees join | 376.85 us/op | 561.53 us/op | 0.67 | | altair processAttestation - setStatus - 100% committees join | 468.29 us/op | 671.35 us/op | 0.70 | | altair processBlock - 250000 vs - 7PWei normalcase | 3.6877 ms/op | 5.2160 ms/op | 0.71 | | altair processBlock - 250000 vs - 7PWei normalcase hashState | 21.978 ms/op | 27.699 ms/op | 0.79 | | altair processBlock - 250000 vs - 7PWei worstcase | 37.452 ms/op | 40.381 ms/op | 0.93 | | altair processBlock - 250000 vs - 7PWei worstcase hashState | 70.605 ms/op | 89.771 ms/op | 0.79 | | phase0 processBlock - 250000 vs - 7PWei normalcase | 1.7075 ms/op | 2.3373 ms/op | 0.73 | | phase0 processBlock - 250000 vs - 7PWei worstcase | 20.814 ms/op | 28.487 ms/op | 0.73 | | altair processEth1Data - 250000 vs - 7PWei normalcase | 241.23 us/op | 532.98 us/op | 0.45 | | getExpectedWithdrawals 250000 eb:1,eth1:1,we:0,wn:0,smpl:15 | 4.5170 us/op | 10.344 us/op | 0.44 | | getExpectedWithdrawals 250000 eb:0.95,eth1:0.1,we:0.05,wn:0,smpl:219 | 17.668 us/op | 60.633 us/op | 0.29 | | getExpectedWithdrawals 250000 eb:0.95,eth1:0.3,we:0.05,wn:0,smpl:42 | 7.2180 us/op | 16.999 us/op | 0.42 | | getExpectedWithdrawals 250000 eb:0.95,eth1:0.7,we:0.05,wn:0,smpl:18 | 5.3190 us/op | 10.299 us/op | 0.52 | | getExpectedWithdrawals 250000 eb:0.1,eth1:0.1,we:0,wn:0,smpl:1020 | 122.17 us/op | 196.34 us/op | 0.62 | | getExpectedWithdrawals 250000 eb:0.03,eth1:0.03,we:0,wn:0,smpl:11777 | 1.3236 ms/op | 1.1862 ms/op | 1.12 | | getExpectedWithdrawals 250000 eb:0.01,eth1:0.01,we:0,wn:0,smpl:16384 | 1.2268 ms/op | 1.7502 ms/op | 0.70 | | getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,smpl:16384 | 1.0876 ms/op | 1.5566 ms/op | 0.70 | | getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,nocache,smpl:16384 | 2.6164 ms/op | 4.5996 ms/op | 0.57 | | getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,smpl:16384 | 1.2664 ms/op | 1.7863 ms/op | 0.71 | | getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,nocache,smpl:16384 | 2.6828 ms/op | 4.5142 ms/op | 0.59 | | Tree 40 250000 create | 183.86 ms/op | 343.63 ms/op | 0.54 | | Tree 40 250000 get(125000) | 110.84 ns/op | 169.05 ns/op | 0.66 | | Tree 40 250000 set(125000) | 551.71 ns/op | 833.64 ns/op | 0.66 | | Tree 40 250000 toArray() | 13.579 ms/op | 22.543 ms/op | 0.60 | | Tree 40 250000 iterate all - toArray() + loop | 11.743 ms/op | 23.616 ms/op | 0.50 | | Tree 40 250000 iterate all - get(i) | 42.310 ms/op | 63.442 ms/op | 0.67 | | Array 250000 create | 2.2605 ms/op | 4.2473 ms/op | 0.53 | | Array 250000 clone - spread | 1.1597 ms/op | 1.6957 ms/op | 0.68 | | Array 250000 get(125000) | 0.58400 ns/op | 0.47900 ns/op | 1.22 | | Array 250000 set(125000) | 0.58900 ns/op | 0.49000 ns/op | 1.20 | | Array 250000 iterate all - loop | 76.641 us/op | 107.83 us/op | 0.71 | | phase0 afterProcessEpoch - 250000 vs - 7PWei | 73.370 ms/op | 97.657 ms/op | 0.75 | | Array.fill - length 1000000 | 2.3038 ms/op | 4.5134 ms/op | 0.51 | | Array push - length 1000000 | 15.153 ms/op | 19.928 ms/op | 0.76 | | Array.get | 0.25660 ns/op | 0.29053 ns/op | 0.88 | | Uint8Array.get | 0.33771 ns/op | 0.47853 ns/op | 0.71 | | phase0 beforeProcessEpoch - 250000 vs - 7PWei | 14.440 ms/op | 20.247 ms/op | 0.71 | | altair processEpoch - mainnet_e81889 | 322.81 ms/op | 374.56 ms/op | 0.86 | | mainnet_e81889 - altair beforeProcessEpoch | 19.786 ms/op | 21.759 ms/op | 0.91 | | mainnet_e81889 - altair processJustificationAndFinalization | 16.423 us/op | 18.687 us/op | 0.88 | | mainnet_e81889 - altair processInactivityUpdates | 5.8042 ms/op | 7.4995 ms/op | 0.77 | | mainnet_e81889 - altair processRewardsAndPenalties | 51.355 ms/op | 46.638 ms/op | 1.10 | | mainnet_e81889 - altair processRegistryUpdates | 1.9270 us/op | 3.6920 us/op | 0.52 | | mainnet_e81889 - altair processSlashings | 748.00 ns/op | 815.00 ns/op | 0.92 | | mainnet_e81889 - altair processEth1DataReset | 730.00 ns/op | 1.5480 us/op | 0.47 | | mainnet_e81889 - altair processEffectiveBalanceUpdates | 1.0534 ms/op | 2.2555 ms/op | 0.47 | | mainnet_e81889 - altair processSlashingsReset | 2.2500 us/op | 10.005 us/op | 0.22 | | mainnet_e81889 - altair processRandaoMixesReset | 2.9990 us/op | 7.1730 us/op | 0.42 | | mainnet_e81889 - altair processHistoricalRootsUpdate | 717.00 ns/op | 986.00 ns/op | 0.73 | | mainnet_e81889 - altair processParticipationFlagUpdates | 2.9110 us/op | 7.1230 us/op | 0.41 | | mainnet_e81889 - altair processSyncCommitteeUpdates | 892.00 ns/op | 1.2720 us/op | 0.70 | | mainnet_e81889 - altair afterProcessEpoch | 79.049 ms/op | 108.59 ms/op | 0.73 | | capella processEpoch - mainnet_e217614 | 1.0835 s/op | 1.4754 s/op | 0.73 | | mainnet_e217614 - capella beforeProcessEpoch | 67.583 ms/op | 88.580 ms/op | 0.76 | | mainnet_e217614 - capella processJustificationAndFinalization | 12.898 us/op | 26.067 us/op | 0.49 | | mainnet_e217614 - capella processInactivityUpdates | 14.350 ms/op | 20.857 ms/op | 0.69 | | mainnet_e217614 - capella processRewardsAndPenalties | 238.78 ms/op | 253.95 ms/op | 0.94 | | mainnet_e217614 - capella processRegistryUpdates | 13.725 us/op | 12.954 us/op | 1.06 | | mainnet_e217614 - capella processSlashings | 1.0520 us/op | 299.00 ns/op | 3.52 | | mainnet_e217614 - capella processEth1DataReset | 856.00 ns/op | 483.00 ns/op | 1.77 | | mainnet_e217614 - capella processEffectiveBalanceUpdates | 13.844 ms/op | 14.871 ms/op | 0.93 | | mainnet_e217614 - capella processSlashingsReset | 6.3950 us/op | 6.2720 us/op | 1.02 | | mainnet_e217614 - capella processRandaoMixesReset | 11.411 us/op | 5.2520 us/op | 2.17 | | mainnet_e217614 - capella processHistoricalRootsUpdate | 1.1640 us/op | 1.2270 us/op | 0.95 | | mainnet_e217614 - capella processParticipationFlagUpdates | 3.2560 us/op | 2.3840 us/op | 1.37 | | mainnet_e217614 - capella afterProcessEpoch | 224.69 ms/op | 247.40 ms/op | 0.91 | | phase0 processEpoch - mainnet_e58758 | 487.31 ms/op | 464.52 ms/op | 1.05 | | mainnet_e58758 - phase0 beforeProcessEpoch | 134.17 ms/op | 110.08 ms/op | 1.22 | | mainnet_e58758 - phase0 processJustificationAndFinalization | 27.269 us/op | 15.293 us/op | 1.78 | | mainnet_e58758 - phase0 processRewardsAndPenalties | 54.130 ms/op | 33.584 ms/op | 1.61 | | mainnet_e58758 - phase0 processRegistryUpdates | 12.706 us/op | 7.8900 us/op | 1.61 | | mainnet_e58758 - phase0 processSlashings | 1.1770 us/op | 334.00 ns/op | 3.52 | | mainnet_e58758 - phase0 processEth1DataReset | 1.3190 us/op | 325.00 ns/op | 4.06 | | mainnet_e58758 - phase0 processEffectiveBalanceUpdates | 1.0399 ms/op | 1.1632 ms/op | 0.89 | | mainnet_e58758 - phase0 processSlashingsReset | 7.9770 us/op | 2.9860 us/op | 2.67 | | mainnet_e58758 - phase0 processRandaoMixesReset | 9.1760 us/op | 4.2250 us/op | 2.17 | | mainnet_e58758 - phase0 processHistoricalRootsUpdate | 1.2920 us/op | 699.00 ns/op | 1.85 | | mainnet_e58758 - phase0 processParticipationRecordUpdates | 5.2590 us/op | 3.3110 us/op | 1.59 | | mainnet_e58758 - phase0 afterProcessEpoch | 71.375 ms/op | 82.009 ms/op | 0.87 | | phase0 processEffectiveBalanceUpdates - 250000 normalcase | 2.4016 ms/op | 1.8536 ms/op | 1.30 | | phase0 processEffectiveBalanceUpdates - 250000 worstcase 0.5 | 1.8597 ms/op | 2.5359 ms/op | 0.73 | | altair processInactivityUpdates - 250000 normalcase | 19.043 ms/op | 16.332 ms/op | 1.17 | | altair processInactivityUpdates - 250000 worstcase | 22.102 ms/op | 17.771 ms/op | 1.24 | | phase0 processRegistryUpdates - 250000 normalcase | 12.989 us/op | 6.4080 us/op | 2.03 | | phase0 processRegistryUpdates - 250000 badcase_full_deposits | 330.61 us/op | 291.27 us/op | 1.14 | | phase0 processRegistryUpdates - 250000 worstcase 0.5 | 160.48 ms/op | 122.79 ms/op | 1.31 | | altair processRewardsAndPenalties - 250000 normalcase | 51.776 ms/op | 40.824 ms/op | 1.27 | | altair processRewardsAndPenalties - 250000 worstcase | 58.189 ms/op | 43.251 ms/op | 1.35 | | phase0 getAttestationDeltas - 250000 normalcase | 11.452 ms/op | 8.8196 ms/op | 1.30 | | phase0 getAttestationDeltas - 250000 worstcase | 11.417 ms/op | 7.7521 ms/op | 1.47 | | phase0 processSlashings - 250000 worstcase | 94.944 us/op | 96.501 us/op | 0.98 | | altair processSyncCommitteeUpdates - 250000 | 124.71 ms/op | 124.89 ms/op | 1.00 | | BeaconState.hashTreeRoot - No change | 480.00 ns/op | 253.00 ns/op | 1.90 | | BeaconState.hashTreeRoot - 1 full validator | 157.08 us/op | 103.54 us/op | 1.52 | | BeaconState.hashTreeRoot - 32 full validator | 1.2187 ms/op | 935.33 us/op | 1.30 | | BeaconState.hashTreeRoot - 512 full validator | 16.101 ms/op | 10.655 ms/op | 1.51 | | BeaconState.hashTreeRoot - 1 validator.effectiveBalance | 204.89 us/op | 117.14 us/op | 1.75 | | BeaconState.hashTreeRoot - 32 validator.effectiveBalance | 3.0005 ms/op | 1.5863 ms/op | 1.89 | | BeaconState.hashTreeRoot - 512 validator.effectiveBalance | 39.429 ms/op | 19.666 ms/op | 2.00 | | BeaconState.hashTreeRoot - 1 balances | 180.18 us/op | 103.77 us/op | 1.74 | | BeaconState.hashTreeRoot - 32 balances | 1.0625 ms/op | 788.97 us/op | 1.35 | | BeaconState.hashTreeRoot - 512 balances | 10.869 ms/op | 7.7002 ms/op | 1.41 | | BeaconState.hashTreeRoot - 250000 balances | 250.34 ms/op | 140.22 ms/op | 1.79 | | aggregationBits - 2048 els - zipIndexesInBitList | 28.885 us/op | 25.749 us/op | 1.12 | | byteArrayEquals 32 | 50.641 ns/op | 56.671 ns/op | 0.89 | | Buffer.compare 32 | 16.275 ns/op | 16.769 ns/op | 0.97 | | byteArrayEquals 1024 | 1.3203 us/op | 1.5667 us/op | 0.84 | | Buffer.compare 1024 | 24.205 ns/op | 24.858 ns/op | 0.97 | | byteArrayEquals 16384 | 20.883 us/op | 24.895 us/op | 0.84 | | Buffer.compare 16384 | 194.25 ns/op | 201.45 ns/op | 0.96 | | byteArrayEquals 123687377 | 170.39 ms/op | 189.53 ms/op | 0.90 | | Buffer.compare 123687377 | 7.6039 ms/op | 7.5462 ms/op | 1.01 | | byteArrayEquals 32 - diff last byte | 48.660 ns/op | 52.023 ns/op | 0.94 | | Buffer.compare 32 - diff last byte | 17.690 ns/op | 16.787 ns/op | 1.05 | | byteArrayEquals 1024 - diff last byte | 1.2919 us/op | 1.5746 us/op | 0.82 | | Buffer.compare 1024 - diff last byte | 24.651 ns/op | 25.252 ns/op | 0.98 | | byteArrayEquals 16384 - diff last byte | 20.420 us/op | 25.054 us/op | 0.82 | | Buffer.compare 16384 - diff last byte | 180.69 ns/op | 199.11 ns/op | 0.91 | | byteArrayEquals 123687377 - diff last byte | 154.52 ms/op | 188.94 ms/op | 0.82 | | Buffer.compare 123687377 - diff last byte | 6.7986 ms/op | 7.6602 ms/op | 0.89 | | byteArrayEquals 32 - random bytes | 5.1520 ns/op | 5.1700 ns/op | 1.00 | | Buffer.compare 32 - random bytes | 16.369 ns/op | 17.043 ns/op | 0.96 | | byteArrayEquals 1024 - random bytes | 5.8110 ns/op | 5.2340 ns/op | 1.11 | | Buffer.compare 1024 - random bytes | 16.264 ns/op | 17.171 ns/op | 0.95 | | byteArrayEquals 16384 - random bytes | 5.1180 ns/op | 5.2030 ns/op | 0.98 | | Buffer.compare 16384 - random bytes | 16.252 ns/op | 17.691 ns/op | 0.92 | | byteArrayEquals 123687377 - random bytes | 8.3900 ns/op | 6.7400 ns/op | 1.24 | | Buffer.compare 123687377 - random bytes | 19.310 ns/op | 19.680 ns/op | 0.98 | | regular array get 100000 times | 31.746 us/op | 41.077 us/op | 0.77 | | wrappedArray get 100000 times | 31.660 us/op | 33.447 us/op | 0.95 | | arrayWithProxy get 100000 times | 10.058 ms/op | 14.144 ms/op | 0.71 | | ssz.Root.equals | 43.714 ns/op | 46.300 ns/op | 0.94 | | byteArrayEquals | 41.781 ns/op | 45.831 ns/op | 0.91 | | Buffer.compare | 8.8220 ns/op | 10.682 ns/op | 0.83 | | shuffle list - 16384 els | 5.4057 ms/op | 6.2665 ms/op | 0.86 | | shuffle list - 250000 els | 81.247 ms/op | 93.423 ms/op | 0.87 | | processSlot - 1 slots | 19.021 us/op | 13.415 us/op | 1.42 | | processSlot - 32 slots | 3.5351 ms/op | 3.2387 ms/op | 1.09 | | getEffectiveBalanceIncrementsZeroInactive - 250000 vs - 7PWei | 44.552 ms/op | 35.511 ms/op | 1.25 | | getCommitteeAssignments - req 1 vs - 250000 vc | 2.6035 ms/op | 2.1018 ms/op | 1.24 | | getCommitteeAssignments - req 100 vs - 250000 vc | 4.4155 ms/op | 4.0816 ms/op | 1.08 | | getCommitteeAssignments - req 1000 vs - 250000 vc | 4.9788 ms/op | 4.4360 ms/op | 1.12 | | findModifiedValidators - 10000 modified validators | 644.05 ms/op | 240.61 ms/op | 2.68 | | findModifiedValidators - 1000 modified validators | 363.95 ms/op | 154.86 ms/op | 2.35 | | findModifiedValidators - 100 modified validators | 266.30 ms/op | 141.02 ms/op | 1.89 | | findModifiedValidators - 10 modified validators | 224.63 ms/op | 138.34 ms/op | 1.62 | | findModifiedValidators - 1 modified validators | 232.66 ms/op | 157.80 ms/op | 1.47 | | findModifiedValidators - no difference | 243.63 ms/op | 141.95 ms/op | 1.72 | | compare ViewDUs | 3.4142 s/op | 3.3910 s/op | 1.01 | | compare each validator Uint8Array | 1.1159 s/op | 1.3887 s/op | 0.80 | | compare ViewDU to Uint8Array | 725.13 ms/op | 1.0282 s/op | 0.71 | | migrate state 1000000 validators, 24 modified, 0 new | 843.80 ms/op | 825.89 ms/op | 1.02 | | migrate state 1000000 validators, 1700 modified, 1000 new | 1.0243 s/op | 1.0503 s/op | 0.98 | | migrate state 1000000 validators, 3400 modified, 2000 new | 1.3056 s/op | 1.2945 s/op | 1.01 | | migrate state 1500000 validators, 24 modified, 0 new | 852.35 ms/op | 867.25 ms/op | 0.98 | | migrate state 1500000 validators, 1700 modified, 1000 new | 989.54 ms/op | 1.0596 s/op | 0.93 | | migrate state 1500000 validators, 3400 modified, 2000 new | 1.1704 s/op | 1.2369 s/op | 0.95 | | RootCache.getBlockRootAtSlot - 250000 vs - 7PWei | 6.5400 ns/op | 4.4100 ns/op | 1.48 | | state getBlockRootAtSlot - 250000 vs - 7PWei | 551.66 ns/op | 741.99 ns/op | 0.74 | | computeProposers - vc 250000 | 5.9914 ms/op | 7.0756 ms/op | 0.85 | | computeEpochShuffling - vc 250000 | 80.895 ms/op | 88.995 ms/op | 0.91 | | getNextSyncCommittee - vc 250000 | 112.45 ms/op | 112.79 ms/op | 1.00 | | computeSigningRoot for AttestationData | 24.203 us/op | 24.471 us/op | 0.99 | | hash AttestationData serialized data then Buffer.toString(base64) | 1.2317 us/op | 1.5181 us/op | 0.81 | | toHexString serialized data | 808.65 ns/op | 852.79 ns/op | 0.95 | | Buffer.toString(base64) | 140.51 ns/op | 183.89 ns/op | 0.76 | | nodejs block root to RootHex using toHex | 119.77 ns/op | 140.29 ns/op | 0.85 | | nodejs block root to RootHex using toRootHex | 81.445 ns/op | 86.734 ns/op | 0.94 | | browser block root to RootHex using the deprecated toHexString | 208.30 ns/op | 221.43 ns/op | 0.94 | | browser block root to RootHex using toHex | 172.30 ns/op | 176.97 ns/op | 0.97 | | browser block root to RootHex using toRootHex | 151.12 ns/op | 157.09 ns/op | 0.96 |

by benchmarkbot/action

wemeetagain commented 1 week ago

:tada: This PR is included in v1.23.0 :tada: