Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: export beacon utils to be reused by other packages #6640

Merged
merged 1 commit into from
Apr 5, 2024

Conversation

nazarhussain
Copy link
Contributor

Motivation

Make the packages and complex code more re-useable.

Description

We need to use kzg implementation and trusted setup during the blobs testing on the CLI package and sim tests.

It would be difficult to maintain if we duplicate logic like kzg in different packages, so we have to export such utils.

Limit the utils export only to important ones, which are integral for application behavior.

Steps to test or reproduce

  • Run all tests

@nazarhussain nazarhussain requested a review from a team as a code owner April 5, 2024 13:30
@nazarhussain nazarhussain self-assigned this Apr 5, 2024
Copy link

codecov bot commented Apr 5, 2024

Codecov Report

Merging #6640 (abfd900) into unstable (898cd90) will not change coverage.
The diff coverage is n/a.

Additional details and impacted files
@@            Coverage Diff            @@
##           unstable    #6640   +/-   ##
=========================================
  Coverage     61.69%   61.69%           
=========================================
  Files           556      556           
  Lines         58820    58820           
  Branches       1887     1887           
=========================================
  Hits          36287    36287           
  Misses        22492    22492           
  Partials         41       41           

Copy link
Contributor

github-actions bot commented Apr 5, 2024

Performance Report

✔️ no performance regression detected

Full benchmark results
Benchmark suite Current: 488e675 Previous: e202592 Ratio
getPubkeys - index2pubkey - req 1000 vs - 250000 vc 903.42 us/op 580.47 us/op 1.56
getPubkeys - validatorsArr - req 1000 vs - 250000 vc 168.65 us/op 106.08 us/op 1.59
BLS verify - blst-native 1.4239 ms/op 1.3251 ms/op 1.07
BLS verifyMultipleSignatures 3 - blst-native 2.9427 ms/op 2.7329 ms/op 1.08
BLS verifyMultipleSignatures 8 - blst-native 6.3837 ms/op 6.2065 ms/op 1.03
BLS verifyMultipleSignatures 32 - blst-native 24.049 ms/op 22.360 ms/op 1.08
BLS verifyMultipleSignatures 64 - blst-native 45.994 ms/op 43.503 ms/op 1.06
BLS verifyMultipleSignatures 128 - blst-native 91.253 ms/op 85.514 ms/op 1.07
BLS deserializing 10000 signatures 971.65 ms/op 908.72 ms/op 1.07
BLS deserializing 100000 signatures 9.8517 s/op 9.5040 s/op 1.04
BLS verifyMultipleSignatures - same message - 3 - blst-native 1.6821 ms/op 1.3670 ms/op 1.23
BLS verifyMultipleSignatures - same message - 8 - blst-native 1.8256 ms/op 1.7009 ms/op 1.07
BLS verifyMultipleSignatures - same message - 32 - blst-native 2.8808 ms/op 2.8853 ms/op 1.00
BLS verifyMultipleSignatures - same message - 64 - blst-native 4.1355 ms/op 4.7312 ms/op 0.87
BLS verifyMultipleSignatures - same message - 128 - blst-native 6.3251 ms/op 5.6790 ms/op 1.11
BLS aggregatePubkeys 32 - blst-native 28.666 us/op 25.955 us/op 1.10
BLS aggregatePubkeys 128 - blst-native 106.65 us/op 102.09 us/op 1.04
notSeenSlots=1 numMissedVotes=1 numBadVotes=10 96.815 ms/op 59.524 ms/op 1.63
notSeenSlots=1 numMissedVotes=0 numBadVotes=4 101.77 ms/op 61.654 ms/op 1.65
notSeenSlots=2 numMissedVotes=1 numBadVotes=10 72.585 ms/op 49.807 ms/op 1.46
getSlashingsAndExits - default max 321.90 us/op 452.97 us/op 0.71
getSlashingsAndExits - 2k 827.93 us/op 874.70 us/op 0.95
proposeBlockBody type=full, size=empty 9.3419 ms/op 7.5664 ms/op 1.23
isKnown best case - 1 super set check 855.00 ns/op 715.00 ns/op 1.20
isKnown normal case - 2 super set checks 902.00 ns/op 768.00 ns/op 1.17
isKnown worse case - 16 super set checks 996.00 ns/op 749.00 ns/op 1.33
InMemoryCheckpointStateCache - add get delete 10.945 us/op 8.7650 us/op 1.25
validate api signedAggregateAndProof - struct 3.9422 ms/op 3.5039 ms/op 1.13
validate gossip signedAggregateAndProof - struct 3.3607 ms/op 3.2698 ms/op 1.03
validate gossip attestation - vc 640000 1.5173 ms/op 1.6311 ms/op 0.93
batch validate gossip attestation - vc 640000 - chunk 32 189.96 us/op 178.50 us/op 1.06
batch validate gossip attestation - vc 640000 - chunk 64 169.58 us/op 148.23 us/op 1.14
batch validate gossip attestation - vc 640000 - chunk 128 160.17 us/op 145.10 us/op 1.10
batch validate gossip attestation - vc 640000 - chunk 256 158.22 us/op 135.25 us/op 1.17
pickEth1Vote - no votes 1.6723 ms/op 1.1855 ms/op 1.41
pickEth1Vote - max votes 23.068 ms/op 11.089 ms/op 2.08
pickEth1Vote - Eth1Data hashTreeRoot value x2048 30.775 ms/op 20.518 ms/op 1.50
pickEth1Vote - Eth1Data hashTreeRoot tree x2048 44.118 ms/op 26.096 ms/op 1.69
pickEth1Vote - Eth1Data fastSerialize value x2048 936.06 us/op 695.64 us/op 1.35
pickEth1Vote - Eth1Data fastSerialize tree x2048 10.627 ms/op 5.1475 ms/op 2.06
bytes32 toHexString 1.3570 us/op 594.00 ns/op 2.28
bytes32 Buffer.toString(hex) 369.00 ns/op 308.00 ns/op 1.20
bytes32 Buffer.toString(hex) from Uint8Array 634.00 ns/op 433.00 ns/op 1.46
bytes32 Buffer.toString(hex) + 0x 385.00 ns/op 312.00 ns/op 1.23
Object access 1 prop 0.29200 ns/op 0.17900 ns/op 1.63
Map access 1 prop 0.20700 ns/op 0.16100 ns/op 1.29
Object get x1000 10.601 ns/op 7.5710 ns/op 1.40
Map get x1000 1.2130 ns/op 0.81900 ns/op 1.48
Object set x1000 109.25 ns/op 55.818 ns/op 1.96
Map set x1000 73.057 ns/op 43.577 ns/op 1.68
Return object 10000 times 0.35700 ns/op 0.24480 ns/op 1.46
Throw Error 10000 times 4.6128 us/op 3.9267 us/op 1.17
fastMsgIdFn sha256 / 200 bytes 3.9840 us/op 3.3330 us/op 1.20
fastMsgIdFn h32 xxhash / 200 bytes 451.00 ns/op 321.00 ns/op 1.40
fastMsgIdFn h64 xxhash / 200 bytes 461.00 ns/op 375.00 ns/op 1.23
fastMsgIdFn sha256 / 1000 bytes 12.565 us/op 11.565 us/op 1.09
fastMsgIdFn h32 xxhash / 1000 bytes 536.00 ns/op 464.00 ns/op 1.16
fastMsgIdFn h64 xxhash / 1000 bytes 515.00 ns/op 449.00 ns/op 1.15
fastMsgIdFn sha256 / 10000 bytes 110.48 us/op 104.07 us/op 1.06
fastMsgIdFn h32 xxhash / 10000 bytes 2.1330 us/op 1.9870 us/op 1.07
fastMsgIdFn h64 xxhash / 10000 bytes 1.4690 us/op 1.3880 us/op 1.06
send data - 1000 256B messages 24.979 ms/op 21.571 ms/op 1.16
send data - 1000 512B messages 35.095 ms/op 27.478 ms/op 1.28
send data - 1000 1024B messages 49.213 ms/op 44.634 ms/op 1.10
send data - 1000 1200B messages 40.898 ms/op 37.665 ms/op 1.09
send data - 1000 2048B messages 51.527 ms/op 45.750 ms/op 1.13
send data - 1000 4096B messages 49.032 ms/op 25.463 ms/op 1.93
send data - 1000 16384B messages 131.15 ms/op 105.33 ms/op 1.25
send data - 1000 65536B messages 479.28 ms/op 449.21 ms/op 1.07
enrSubnets - fastDeserialize 64 bits 1.6510 us/op 1.2970 us/op 1.27
enrSubnets - ssz BitVector 64 bits 572.00 ns/op 428.00 ns/op 1.34
enrSubnets - fastDeserialize 4 bits 251.00 ns/op 168.00 ns/op 1.49
enrSubnets - ssz BitVector 4 bits 562.00 ns/op 417.00 ns/op 1.35
prioritizePeers score -10:0 att 32-0.1 sync 2-0 115.42 us/op 100.97 us/op 1.14
prioritizePeers score 0:0 att 32-0.25 sync 2-0.25 156.68 us/op 143.78 us/op 1.09
prioritizePeers score 0:0 att 32-0.5 sync 2-0.5 186.84 us/op 192.85 us/op 0.97
prioritizePeers score 0:0 att 64-0.75 sync 4-0.75 363.71 us/op 338.25 us/op 1.08
prioritizePeers score 0:0 att 64-1 sync 4-1 381.48 us/op 371.42 us/op 1.03
array of 16000 items push then shift 1.7481 us/op 1.6295 us/op 1.07
LinkedList of 16000 items push then shift 8.9520 ns/op 8.9980 ns/op 0.99
array of 16000 items push then pop 112.99 ns/op 96.010 ns/op 1.18
LinkedList of 16000 items push then pop 9.0960 ns/op 8.5290 ns/op 1.07
array of 24000 items push then shift 2.5107 us/op 2.5381 us/op 0.99
LinkedList of 24000 items push then shift 9.2410 ns/op 8.9420 ns/op 1.03
array of 24000 items push then pop 148.72 ns/op 119.62 ns/op 1.24
LinkedList of 24000 items push then pop 9.1530 ns/op 8.5660 ns/op 1.07
intersect bitArray bitLen 8 5.9880 ns/op 5.7410 ns/op 1.04
intersect array and set length 8 76.955 ns/op 60.075 ns/op 1.28
intersect bitArray bitLen 128 36.511 ns/op 34.064 ns/op 1.07
intersect array and set length 128 1.1070 us/op 867.90 ns/op 1.28
bitArray.getTrueBitIndexes() bitLen 128 1.8090 us/op 1.6110 us/op 1.12
bitArray.getTrueBitIndexes() bitLen 248 2.9330 us/op 2.8630 us/op 1.02
bitArray.getTrueBitIndexes() bitLen 512 5.8640 us/op 5.0820 us/op 1.15
Buffer.concat 32 items 1.1440 us/op 1.0030 us/op 1.14
Uint8Array.set 32 items 2.2000 us/op 1.7380 us/op 1.27
Set add up to 64 items then delete first 5.1179 us/op 4.4463 us/op 1.15
OrderedSet add up to 64 items then delete first 6.2181 us/op 5.5699 us/op 1.12
Set add up to 64 items then delete last 5.4873 us/op 4.8303 us/op 1.14
OrderedSet add up to 64 items then delete last 7.1769 us/op 6.2230 us/op 1.15
Set add up to 64 items then delete middle 5.2197 us/op 4.6384 us/op 1.13
OrderedSet add up to 64 items then delete middle 8.3983 us/op 7.2445 us/op 1.16
Set add up to 128 items then delete first 10.839 us/op 9.8545 us/op 1.10
OrderedSet add up to 128 items then delete first 14.002 us/op 13.442 us/op 1.04
Set add up to 128 items then delete last 10.477 us/op 9.6281 us/op 1.09
OrderedSet add up to 128 items then delete last 14.349 us/op 11.895 us/op 1.21
Set add up to 128 items then delete middle 10.778 us/op 9.3376 us/op 1.15
OrderedSet add up to 128 items then delete middle 20.224 us/op 17.104 us/op 1.18
Set add up to 256 items then delete first 23.005 us/op 18.781 us/op 1.22
OrderedSet add up to 256 items then delete first 30.913 us/op 25.978 us/op 1.19
Set add up to 256 items then delete last 21.944 us/op 19.221 us/op 1.14
OrderedSet add up to 256 items then delete last 28.757 us/op 23.155 us/op 1.24
Set add up to 256 items then delete middle 22.534 us/op 18.829 us/op 1.20
OrderedSet add up to 256 items then delete middle 51.269 us/op 46.916 us/op 1.09
transfer serialized Status (84 B) 2.0170 us/op 1.6900 us/op 1.19
copy serialized Status (84 B) 1.5130 us/op 1.2790 us/op 1.18
transfer serialized SignedVoluntaryExit (112 B) 2.2300 us/op 1.9240 us/op 1.16
copy serialized SignedVoluntaryExit (112 B) 1.6530 us/op 1.4740 us/op 1.12
transfer serialized ProposerSlashing (416 B) 3.4710 us/op 1.9740 us/op 1.76
copy serialized ProposerSlashing (416 B) 2.9770 us/op 1.9680 us/op 1.51
transfer serialized Attestation (485 B) 2.2710 us/op 2.7810 us/op 0.82
copy serialized Attestation (485 B) 2.0740 us/op 1.9790 us/op 1.05
transfer serialized AttesterSlashing (33232 B) 2.1140 us/op 2.0870 us/op 1.01
copy serialized AttesterSlashing (33232 B) 6.8890 us/op 7.2200 us/op 0.95
transfer serialized Small SignedBeaconBlock (128000 B) 2.4220 us/op 3.3580 us/op 0.72
copy serialized Small SignedBeaconBlock (128000 B) 17.638 us/op 19.035 us/op 0.93
transfer serialized Avg SignedBeaconBlock (200000 B) 2.7200 us/op 3.2320 us/op 0.84
copy serialized Avg SignedBeaconBlock (200000 B) 24.483 us/op 24.561 us/op 1.00
transfer serialized BlobsSidecar (524380 B) 2.7090 us/op 3.4530 us/op 0.78
copy serialized BlobsSidecar (524380 B) 90.857 us/op 102.81 us/op 0.88
transfer serialized Big SignedBeaconBlock (1000000 B) 2.8240 us/op 3.8580 us/op 0.73
copy serialized Big SignedBeaconBlock (1000000 B) 186.07 us/op 168.69 us/op 1.10
pass gossip attestations to forkchoice per slot 3.9760 ms/op 4.3173 ms/op 0.92
forkChoice updateHead vc 100000 bc 64 eq 0 708.69 us/op 715.62 us/op 0.99
forkChoice updateHead vc 600000 bc 64 eq 0 6.0454 ms/op 5.0178 ms/op 1.20
forkChoice updateHead vc 1000000 bc 64 eq 0 7.1865 ms/op 7.1896 ms/op 1.00
forkChoice updateHead vc 600000 bc 320 eq 0 4.2479 ms/op 4.3475 ms/op 0.98
forkChoice updateHead vc 600000 bc 1200 eq 0 4.2604 ms/op 4.6396 ms/op 0.92
forkChoice updateHead vc 600000 bc 7200 eq 0 5.2837 ms/op 5.4306 ms/op 0.97
forkChoice updateHead vc 600000 bc 64 eq 1000 11.235 ms/op 11.449 ms/op 0.98
forkChoice updateHead vc 600000 bc 64 eq 10000 12.100 ms/op 12.221 ms/op 0.99
forkChoice updateHead vc 600000 bc 64 eq 300000 16.930 ms/op 16.691 ms/op 1.01
computeDeltas 500000 validators 300 proto nodes 6.6470 ms/op 6.7785 ms/op 0.98
computeDeltas 500000 validators 1200 proto nodes 6.5095 ms/op 6.8662 ms/op 0.95
computeDeltas 500000 validators 7200 proto nodes 6.5332 ms/op 6.5255 ms/op 1.00
computeDeltas 750000 validators 300 proto nodes 10.022 ms/op 9.8621 ms/op 1.02
computeDeltas 750000 validators 1200 proto nodes 9.6857 ms/op 9.9350 ms/op 0.97
computeDeltas 750000 validators 7200 proto nodes 9.6023 ms/op 10.390 ms/op 0.92
computeDeltas 1400000 validators 300 proto nodes 19.077 ms/op 20.013 ms/op 0.95
computeDeltas 1400000 validators 1200 proto nodes 21.683 ms/op 20.339 ms/op 1.07
computeDeltas 1400000 validators 7200 proto nodes 21.287 ms/op 20.732 ms/op 1.03
computeDeltas 2100000 validators 300 proto nodes 30.544 ms/op 30.790 ms/op 0.99
computeDeltas 2100000 validators 1200 proto nodes 35.218 ms/op 29.483 ms/op 1.19
computeDeltas 2100000 validators 7200 proto nodes 34.581 ms/op 29.520 ms/op 1.17
altair processAttestation - 250000 vs - 7PWei normalcase 4.3362 ms/op 2.4745 ms/op 1.75
altair processAttestation - 250000 vs - 7PWei worstcase 5.8997 ms/op 3.3977 ms/op 1.74
altair processAttestation - setStatus - 1/6 committees join 232.51 us/op 194.33 us/op 1.20
altair processAttestation - setStatus - 1/3 committees join 446.64 us/op 381.16 us/op 1.17
altair processAttestation - setStatus - 1/2 committees join 613.21 us/op 490.48 us/op 1.25
altair processAttestation - setStatus - 2/3 committees join 753.00 us/op 611.96 us/op 1.23
altair processAttestation - setStatus - 4/5 committees join 1.2483 ms/op 871.79 us/op 1.43
altair processAttestation - setStatus - 100% committees join 1.4908 ms/op 978.89 us/op 1.52
altair processBlock - 250000 vs - 7PWei normalcase 12.701 ms/op 8.7717 ms/op 1.45
altair processBlock - 250000 vs - 7PWei normalcase hashState 57.300 ms/op 35.961 ms/op 1.59
altair processBlock - 250000 vs - 7PWei worstcase 53.538 ms/op 47.877 ms/op 1.12
altair processBlock - 250000 vs - 7PWei worstcase hashState 144.68 ms/op 95.943 ms/op 1.51
phase0 processBlock - 250000 vs - 7PWei normalcase 4.9937 ms/op 2.7448 ms/op 1.82
phase0 processBlock - 250000 vs - 7PWei worstcase 37.294 ms/op 31.784 ms/op 1.17
altair processEth1Data - 250000 vs - 7PWei normalcase 836.26 us/op 494.76 us/op 1.69
getExpectedWithdrawals 250000 eb:1,eth1:1,we:0,wn:0,smpl:15 25.866 us/op 13.911 us/op 1.86
getExpectedWithdrawals 250000 eb:0.95,eth1:0.1,we:0.05,wn:0,smpl:219 118.14 us/op 47.913 us/op 2.47
getExpectedWithdrawals 250000 eb:0.95,eth1:0.3,we:0.05,wn:0,smpl:42 52.698 us/op 18.359 us/op 2.87
getExpectedWithdrawals 250000 eb:0.95,eth1:0.7,we:0.05,wn:0,smpl:18 27.167 us/op 15.890 us/op 1.71
getExpectedWithdrawals 250000 eb:0.1,eth1:0.1,we:0,wn:0,smpl:1020 267.23 us/op 243.84 us/op 1.10
getExpectedWithdrawals 250000 eb:0.03,eth1:0.03,we:0,wn:0,smpl:11777 1.6671 ms/op 1.3522 ms/op 1.23
getExpectedWithdrawals 250000 eb:0.01,eth1:0.01,we:0,wn:0,smpl:16384 2.1496 ms/op 1.7781 ms/op 1.21
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,smpl:16384 2.5887 ms/op 1.7730 ms/op 1.46
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,nocache,smpl:16384 4.7804 ms/op 3.2835 ms/op 1.46
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,smpl:16384 3.1559 ms/op 2.8917 ms/op 1.09
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,nocache,smpl:16384 8.3631 ms/op 5.4212 ms/op 1.54
Tree 40 250000 create 459.08 ms/op 369.11 ms/op 1.24
Tree 40 250000 get(125000) 207.09 ns/op 208.11 ns/op 1.00
Tree 40 250000 set(125000) 1.0458 us/op 1.0653 us/op 0.98
Tree 40 250000 toArray() 20.241 ms/op 24.575 ms/op 0.82
Tree 40 250000 iterate all - toArray() + loop 19.600 ms/op 26.735 ms/op 0.73
Tree 40 250000 iterate all - get(i) 68.314 ms/op 77.973 ms/op 0.88
MutableVector 250000 create 16.728 ms/op 17.607 ms/op 0.95
MutableVector 250000 get(125000) 6.7780 ns/op 6.7400 ns/op 1.01
MutableVector 250000 set(125000) 294.79 ns/op 528.49 ns/op 0.56
MutableVector 250000 toArray() 3.4643 ms/op 4.7756 ms/op 0.73
MutableVector 250000 iterate all - toArray() + loop 3.6733 ms/op 4.2648 ms/op 0.86
MutableVector 250000 iterate all - get(i) 1.5309 ms/op 1.5496 ms/op 0.99
Array 250000 create 2.9048 ms/op 3.8098 ms/op 0.76
Array 250000 clone - spread 1.3171 ms/op 1.4657 ms/op 0.90
Array 250000 get(125000) 1.0980 ns/op 1.8060 ns/op 0.61
Array 250000 set(125000) 4.1320 ns/op 5.7530 ns/op 0.72
Array 250000 iterate all - loop 167.58 us/op 173.65 us/op 0.97
effectiveBalanceIncrements clone Uint8Array 300000 32.400 us/op 56.900 us/op 0.57
effectiveBalanceIncrements clone MutableVector 300000 416.00 ns/op 444.00 ns/op 0.94
effectiveBalanceIncrements rw all Uint8Array 300000 201.58 us/op 209.71 us/op 0.96
effectiveBalanceIncrements rw all MutableVector 300000 91.096 ms/op 117.48 ms/op 0.78
phase0 afterProcessEpoch - 250000 vs - 7PWei 115.08 ms/op 116.87 ms/op 0.98
phase0 beforeProcessEpoch - 250000 vs - 7PWei 55.900 ms/op 51.862 ms/op 1.08
altair processEpoch - mainnet_e81889 495.02 ms/op 525.42 ms/op 0.94
mainnet_e81889 - altair beforeProcessEpoch 93.012 ms/op 97.397 ms/op 0.95
mainnet_e81889 - altair processJustificationAndFinalization 26.343 us/op 17.703 us/op 1.49
mainnet_e81889 - altair processInactivityUpdates 9.1874 ms/op 6.9630 ms/op 1.32
mainnet_e81889 - altair processRewardsAndPenalties 85.039 ms/op 74.450 ms/op 1.14
mainnet_e81889 - altair processRegistryUpdates 3.8580 us/op 4.0050 us/op 0.96
mainnet_e81889 - altair processSlashings 677.00 ns/op 539.00 ns/op 1.26
mainnet_e81889 - altair processEth1DataReset 647.00 ns/op 651.00 ns/op 0.99
mainnet_e81889 - altair processEffectiveBalanceUpdates 1.4260 ms/op 1.4178 ms/op 1.01
mainnet_e81889 - altair processSlashingsReset 7.3870 us/op 3.5190 us/op 2.10
mainnet_e81889 - altair processRandaoMixesReset 6.1290 us/op 5.7510 us/op 1.07
mainnet_e81889 - altair processHistoricalRootsUpdate 1.1360 us/op 1.1230 us/op 1.01
mainnet_e81889 - altair processParticipationFlagUpdates 2.5500 us/op 2.4360 us/op 1.05
mainnet_e81889 - altair processSyncCommitteeUpdates 1.0630 us/op 669.00 ns/op 1.59
mainnet_e81889 - altair afterProcessEpoch 127.10 ms/op 124.20 ms/op 1.02
capella processEpoch - mainnet_e217614 2.5510 s/op 2.2937 s/op 1.11
mainnet_e217614 - capella beforeProcessEpoch 564.46 ms/op 511.93 ms/op 1.10
mainnet_e217614 - capella processJustificationAndFinalization 16.368 us/op 17.357 us/op 0.94
mainnet_e217614 - capella processInactivityUpdates 21.983 ms/op 23.704 ms/op 0.93
mainnet_e217614 - capella processRewardsAndPenalties 557.31 ms/op 602.62 ms/op 0.92
mainnet_e217614 - capella processRegistryUpdates 21.136 us/op 38.558 us/op 0.55
mainnet_e217614 - capella processSlashings 523.00 ns/op 1.1340 us/op 0.46
mainnet_e217614 - capella processEth1DataReset 568.00 ns/op 1.7680 us/op 0.32
mainnet_e217614 - capella processEffectiveBalanceUpdates 14.800 ms/op 5.0577 ms/op 2.93
mainnet_e217614 - capella processSlashingsReset 3.1950 us/op 5.9320 us/op 0.54
mainnet_e217614 - capella processRandaoMixesReset 5.6160 us/op 5.6510 us/op 0.99
mainnet_e217614 - capella processHistoricalRootsUpdate 800.00 ns/op 1.0050 us/op 0.80
mainnet_e217614 - capella processParticipationFlagUpdates 1.8030 us/op 2.1810 us/op 0.83
mainnet_e217614 - capella afterProcessEpoch 307.61 ms/op 404.11 ms/op 0.76
phase0 processEpoch - mainnet_e58758 501.93 ms/op 549.37 ms/op 0.91
mainnet_e58758 - phase0 beforeProcessEpoch 148.55 ms/op 141.56 ms/op 1.05
mainnet_e58758 - phase0 processJustificationAndFinalization 16.761 us/op 18.539 us/op 0.90
mainnet_e58758 - phase0 processRewardsAndPenalties 61.688 ms/op 48.246 ms/op 1.28
mainnet_e58758 - phase0 processRegistryUpdates 12.210 us/op 12.212 us/op 1.00
mainnet_e58758 - phase0 processSlashings 579.00 ns/op 759.00 ns/op 0.76
mainnet_e58758 - phase0 processEth1DataReset 442.00 ns/op 846.00 ns/op 0.52
mainnet_e58758 - phase0 processEffectiveBalanceUpdates 1.1029 ms/op 1.2134 ms/op 0.91
mainnet_e58758 - phase0 processSlashingsReset 2.6770 us/op 4.7670 us/op 0.56
mainnet_e58758 - phase0 processRandaoMixesReset 4.0520 us/op 5.9630 us/op 0.68
mainnet_e58758 - phase0 processHistoricalRootsUpdate 709.00 ns/op 703.00 ns/op 1.01
mainnet_e58758 - phase0 processParticipationRecordUpdates 3.4100 us/op 4.3410 us/op 0.79
mainnet_e58758 - phase0 afterProcessEpoch 100.31 ms/op 104.30 ms/op 0.96
phase0 processEffectiveBalanceUpdates - 250000 normalcase 1.3917 ms/op 1.3524 ms/op 1.03
phase0 processEffectiveBalanceUpdates - 250000 worstcase 0.5 1.6469 ms/op 1.5484 ms/op 1.06
altair processInactivityUpdates - 250000 normalcase 32.846 ms/op 33.894 ms/op 0.97
altair processInactivityUpdates - 250000 worstcase 24.205 ms/op 34.717 ms/op 0.70
phase0 processRegistryUpdates - 250000 normalcase 9.0600 us/op 14.222 us/op 0.64
phase0 processRegistryUpdates - 250000 badcase_full_deposits 446.45 us/op 404.40 us/op 1.10
phase0 processRegistryUpdates - 250000 worstcase 0.5 151.67 ms/op 172.60 ms/op 0.88
altair processRewardsAndPenalties - 250000 normalcase 74.564 ms/op 83.652 ms/op 0.89
altair processRewardsAndPenalties - 250000 worstcase 50.030 ms/op 79.911 ms/op 0.63
phase0 getAttestationDeltas - 250000 normalcase 10.909 ms/op 10.729 ms/op 1.02
phase0 getAttestationDeltas - 250000 worstcase 10.178 ms/op 12.070 ms/op 0.84
phase0 processSlashings - 250000 worstcase 98.675 us/op 116.04 us/op 0.85
altair processSyncCommitteeUpdates - 250000 162.80 ms/op 169.29 ms/op 0.96
BeaconState.hashTreeRoot - No change 384.00 ns/op 674.00 ns/op 0.57
BeaconState.hashTreeRoot - 1 full validator 112.22 us/op 148.41 us/op 0.76
BeaconState.hashTreeRoot - 32 full validator 1.2168 ms/op 1.7343 ms/op 0.70
BeaconState.hashTreeRoot - 512 full validator 12.932 ms/op 22.923 ms/op 0.56
BeaconState.hashTreeRoot - 1 validator.effectiveBalance 136.88 us/op 240.88 us/op 0.57
BeaconState.hashTreeRoot - 32 validator.effectiveBalance 1.8905 ms/op 2.5162 ms/op 0.75
BeaconState.hashTreeRoot - 512 validator.effectiveBalance 26.518 ms/op 33.428 ms/op 0.79
BeaconState.hashTreeRoot - 1 balances 109.61 us/op 144.32 us/op 0.76
BeaconState.hashTreeRoot - 32 balances 972.87 us/op 1.5551 ms/op 0.63
BeaconState.hashTreeRoot - 512 balances 9.7703 ms/op 15.880 ms/op 0.62
BeaconState.hashTreeRoot - 250000 balances 205.84 ms/op 220.23 ms/op 0.93
aggregationBits - 2048 els - zipIndexesInBitList 31.299 us/op 30.397 us/op 1.03
byteArrayEquals 32 75.538 ns/op 76.028 ns/op 0.99
Buffer.compare 32 56.196 ns/op 55.889 ns/op 1.01
byteArrayEquals 1024 2.0676 us/op 2.0765 us/op 1.00
Buffer.compare 1024 72.327 ns/op 71.254 ns/op 1.02
byteArrayEquals 16384 32.815 us/op 33.015 us/op 0.99
Buffer.compare 16384 275.45 ns/op 267.61 ns/op 1.03
byteArrayEquals 123687377 246.64 ms/op 250.18 ms/op 0.99
Buffer.compare 123687377 7.1668 ms/op 7.2844 ms/op 0.98
byteArrayEquals 32 - diff last byte 72.340 ns/op 72.920 ns/op 0.99
Buffer.compare 32 - diff last byte 56.279 ns/op 57.348 ns/op 0.98
byteArrayEquals 1024 - diff last byte 2.0422 us/op 2.0793 us/op 0.98
Buffer.compare 1024 - diff last byte 71.772 ns/op 73.793 ns/op 0.97
byteArrayEquals 16384 - diff last byte 32.429 us/op 32.791 us/op 0.99
Buffer.compare 16384 - diff last byte 275.85 ns/op 269.07 ns/op 1.03
byteArrayEquals 123687377 - diff last byte 244.82 ms/op 262.72 ms/op 0.93
Buffer.compare 123687377 - diff last byte 7.8981 ms/op 9.5225 ms/op 0.83
byteArrayEquals 32 - random bytes 6.6540 ns/op 6.5280 ns/op 1.02
Buffer.compare 32 - random bytes 62.623 ns/op 63.029 ns/op 0.99
byteArrayEquals 1024 - random bytes 6.6840 ns/op 6.7140 ns/op 1.00
Buffer.compare 1024 - random bytes 62.019 ns/op 64.714 ns/op 0.96
byteArrayEquals 16384 - random bytes 6.4040 ns/op 6.7560 ns/op 0.95
Buffer.compare 16384 - random bytes 62.155 ns/op 64.585 ns/op 0.96
byteArrayEquals 123687377 - random bytes 9.1100 ns/op 12.290 ns/op 0.74
Buffer.compare 123687377 - random bytes 64.070 ns/op 78.280 ns/op 0.82
regular array get 100000 times 47.032 us/op 47.978 us/op 0.98
wrappedArray get 100000 times 45.330 us/op 47.320 us/op 0.96
arrayWithProxy get 100000 times 15.892 ms/op 15.131 ms/op 1.05
ssz.Root.equals 54.403 ns/op 57.365 ns/op 0.95
byteArrayEquals 54.688 ns/op 55.515 ns/op 0.99
Buffer.compare 11.809 ns/op 12.490 ns/op 0.95
shuffle list - 16384 els 8.6461 ms/op 9.3073 ms/op 0.93
shuffle list - 250000 els 127.02 ms/op 136.83 ms/op 0.93
processSlot - 1 slots 20.989 us/op 19.877 us/op 1.06
processSlot - 32 slots 4.0628 ms/op 3.6167 ms/op 1.12
getEffectiveBalanceIncrementsZeroInactive - 250000 vs - 7PWei 69.913 ms/op 63.741 ms/op 1.10
getCommitteeAssignments - req 1 vs - 250000 vc 2.7799 ms/op 2.7890 ms/op 1.00
getCommitteeAssignments - req 100 vs - 250000 vc 3.9414 ms/op 4.0366 ms/op 0.98
getCommitteeAssignments - req 1000 vs - 250000 vc 4.2288 ms/op 4.4190 ms/op 0.96
findModifiedValidators - 10000 modified validators 412.38 ms/op 387.63 ms/op 1.06
findModifiedValidators - 1000 modified validators 198.68 ms/op 233.15 ms/op 0.85
findModifiedValidators - 100 modified validators 188.95 ms/op 210.04 ms/op 0.90
findModifiedValidators - 10 modified validators 207.49 ms/op 232.89 ms/op 0.89
findModifiedValidators - 1 modified validators 193.74 ms/op 215.68 ms/op 0.90
findModifiedValidators - no difference 210.54 ms/op 313.93 ms/op 0.67
compare ViewDUs 4.7354 s/op 4.9613 s/op 0.95
compare each validator Uint8Array 1.6119 s/op 1.8057 s/op 0.89
compare ViewDU to Uint8Array 1.3873 s/op 1.4496 s/op 0.96
migrate state 1000000 validators, 24 modified, 0 new 782.57 ms/op 821.38 ms/op 0.95
migrate state 1000000 validators, 1700 modified, 1000 new 1.1417 s/op 1.1055 s/op 1.03
migrate state 1000000 validators, 3400 modified, 2000 new 1.4097 s/op 1.3048 s/op 1.08
migrate state 1500000 validators, 24 modified, 0 new 822.92 ms/op 752.09 ms/op 1.09
migrate state 1500000 validators, 1700 modified, 1000 new 1.1182 s/op 1.0388 s/op 1.08
migrate state 1500000 validators, 3400 modified, 2000 new 1.4539 s/op 1.2635 s/op 1.15
RootCache.getBlockRootAtSlot - 250000 vs - 7PWei 5.2300 ns/op 4.2900 ns/op 1.22
state getBlockRootAtSlot - 250000 vs - 7PWei 658.17 ns/op 867.42 ns/op 0.76
computeProposers - vc 250000 9.5733 ms/op 9.6279 ms/op 0.99
computeEpochShuffling - vc 250000 128.99 ms/op 127.56 ms/op 1.01
getNextSyncCommittee - vc 250000 161.20 ms/op 164.83 ms/op 0.98
computeSigningRoot for AttestationData 26.080 us/op 24.798 us/op 1.05
hash AttestationData serialized data then Buffer.toString(base64) 2.4804 us/op 2.3016 us/op 1.08
toHexString serialized data 1.3356 us/op 1.0486 us/op 1.27
Buffer.toString(base64) 263.70 ns/op 208.46 ns/op 1.26

by benchmarkbot/action

Copy link
Member

@matthewkeil matthewkeil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!! 🚀

@nazarhussain nazarhussain enabled auto-merge (squash) April 5, 2024 14:39
@nazarhussain nazarhussain merged commit 5579053 into unstable Apr 5, 2024
20 checks passed
@nazarhussain nazarhussain deleted the nh/beacon-util branch April 5, 2024 14:52
@wemeetagain
Copy link
Member

🎉 This PR is included in v1.18.0 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants