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

test: migrate reqresp unit tests to vitest #6191

Merged
merged 5 commits into from
Dec 19, 2023
Merged

Conversation

nazarhussain
Copy link
Contributor

Motivation

Consolidate the testing frameworks and migrate to vitest.

Description

Migrate reqresp unit tests to vitest.

Steps to test or reproduce

  • Run all tests

@nazarhussain nazarhussain requested a review from a team as a code owner December 14, 2023 10:30
Copy link

codecov bot commented Dec 14, 2023

Codecov Report

Merging #6191 (22a6d5c) into unstable (c044d4c) will decrease coverage by 1.80%.
Report is 4 commits behind head on unstable.
The diff coverage is n/a.

Additional details and impacted files
@@             Coverage Diff              @@
##           unstable    #6191      +/-   ##
============================================
- Coverage     90.35%   88.55%   -1.80%     
============================================
  Files            78      109      +31     
  Lines          8087    10302    +2215     
  Branches        490      648     +158     
============================================
+ Hits           7307     9123    +1816     
- Misses          772     1169     +397     
- Partials          8       10       +2     

Copy link
Contributor

github-actions bot commented Dec 14, 2023

Performance Report

✔️ no performance regression detected

Full benchmark results
Benchmark suite Current: 482ab7c Previous: 54e8c45 Ratio
getPubkeys - index2pubkey - req 1000 vs - 250000 vc 590.92 us/op 508.55 us/op 1.16
getPubkeys - validatorsArr - req 1000 vs - 250000 vc 115.73 us/op 86.547 us/op 1.34
BLS verify - blst-native 1.3440 ms/op 1.3290 ms/op 1.01
BLS verifyMultipleSignatures 3 - blst-native 2.9135 ms/op 2.7994 ms/op 1.04
BLS verifyMultipleSignatures 8 - blst-native 6.3306 ms/op 6.1283 ms/op 1.03
BLS verifyMultipleSignatures 32 - blst-native 22.843 ms/op 22.437 ms/op 1.02
BLS verifyMultipleSignatures 64 - blst-native 44.659 ms/op 44.212 ms/op 1.01
BLS verifyMultipleSignatures 128 - blst-native 88.734 ms/op 87.739 ms/op 1.01
BLS deserializing 10000 signatures 942.92 ms/op 938.93 ms/op 1.00
BLS deserializing 100000 signatures 9.4448 s/op 9.5031 s/op 0.99
BLS verifyMultipleSignatures - same message - 3 - blst-native 1.4103 ms/op 1.4930 ms/op 0.94
BLS verifyMultipleSignatures - same message - 8 - blst-native 1.6245 ms/op 1.5380 ms/op 1.06
BLS verifyMultipleSignatures - same message - 32 - blst-native 2.4920 ms/op 2.3800 ms/op 1.05
BLS verifyMultipleSignatures - same message - 64 - blst-native 3.6643 ms/op 4.6236 ms/op 0.79
BLS verifyMultipleSignatures - same message - 128 - blst-native 5.7867 ms/op 5.6894 ms/op 1.02
BLS aggregatePubkeys 32 - blst-native 27.137 us/op 26.081 us/op 1.04
BLS aggregatePubkeys 128 - blst-native 106.16 us/op 101.71 us/op 1.04
getAttestationsForBlock 53.734 ms/op 52.762 ms/op 1.02
getSlashingsAndExits - default max 170.10 us/op 141.30 us/op 1.20
getSlashingsAndExits - 2k 449.22 us/op 355.36 us/op 1.26
proposeBlockBody type=full, size=empty 7.2730 ms/op 5.0777 ms/op 1.43
isKnown best case - 1 super set check 562.00 ns/op 325.00 ns/op 1.73
isKnown normal case - 2 super set checks 534.00 ns/op 315.00 ns/op 1.70
isKnown worse case - 16 super set checks 535.00 ns/op 309.00 ns/op 1.73
CheckpointStateCache - add get delete 6.0190 us/op 5.1190 us/op 1.18
validate api signedAggregateAndProof - struct 2.9546 ms/op 2.7954 ms/op 1.06
validate gossip signedAggregateAndProof - struct 2.9095 ms/op 2.8161 ms/op 1.03
validate gossip attestation - vc 640000 1.4226 ms/op 1.3730 ms/op 1.04
batch validate gossip attestation - vc 640000 - chunk 32 162.06 us/op 164.65 us/op 0.98
batch validate gossip attestation - vc 640000 - chunk 64 148.19 us/op 143.01 us/op 1.04
batch validate gossip attestation - vc 640000 - chunk 128 148.15 us/op 134.57 us/op 1.10
batch validate gossip attestation - vc 640000 - chunk 256 135.30 us/op 124.67 us/op 1.09
pickEth1Vote - no votes 1.4009 ms/op 1.1261 ms/op 1.24
pickEth1Vote - max votes 12.588 ms/op 9.8201 ms/op 1.28
pickEth1Vote - Eth1Data hashTreeRoot value x2048 26.408 ms/op 21.413 ms/op 1.23
pickEth1Vote - Eth1Data hashTreeRoot tree x2048 36.465 ms/op 28.608 ms/op 1.27
pickEth1Vote - Eth1Data fastSerialize value x2048 714.22 us/op 573.40 us/op 1.25
pickEth1Vote - Eth1Data fastSerialize tree x2048 8.5559 ms/op 6.2549 ms/op 1.37
bytes32 toHexString 799.00 ns/op 489.00 ns/op 1.63
bytes32 Buffer.toString(hex) 343.00 ns/op 276.00 ns/op 1.24
bytes32 Buffer.toString(hex) from Uint8Array 578.00 ns/op 417.00 ns/op 1.39
bytes32 Buffer.toString(hex) + 0x 310.00 ns/op 273.00 ns/op 1.14
Object access 1 prop 0.27300 ns/op 0.16000 ns/op 1.71
Map access 1 prop 0.16300 ns/op 0.14100 ns/op 1.16
Object get x1000 10.220 ns/op 7.3280 ns/op 1.39
Map get x1000 0.96900 ns/op 0.73800 ns/op 1.31
Object set x1000 83.675 ns/op 48.316 ns/op 1.73
Map set x1000 60.564 ns/op 38.020 ns/op 1.59
Return object 10000 times 0.26920 ns/op 0.23120 ns/op 1.16
Throw Error 10000 times 4.2375 us/op 3.7641 us/op 1.13
fastMsgIdFn sha256 / 200 bytes 3.6740 us/op 3.1740 us/op 1.16
fastMsgIdFn h32 xxhash / 200 bytes 407.00 ns/op 279.00 ns/op 1.46
fastMsgIdFn h64 xxhash / 200 bytes 417.00 ns/op 330.00 ns/op 1.26
fastMsgIdFn sha256 / 1000 bytes 12.343 us/op 11.013 us/op 1.12
fastMsgIdFn h32 xxhash / 1000 bytes 532.00 ns/op 400.00 ns/op 1.33
fastMsgIdFn h64 xxhash / 1000 bytes 507.00 ns/op 402.00 ns/op 1.26
fastMsgIdFn sha256 / 10000 bytes 108.61 us/op 100.55 us/op 1.08
fastMsgIdFn h32 xxhash / 10000 bytes 2.1510 us/op 1.8590 us/op 1.16
fastMsgIdFn h64 xxhash / 10000 bytes 1.4500 us/op 1.2600 us/op 1.15
send data - 1000 256B messages 21.543 ms/op 18.196 ms/op 1.18
send data - 1000 512B messages 31.189 ms/op 25.701 ms/op 1.21
send data - 1000 1024B messages 45.191 ms/op 40.369 ms/op 1.12
send data - 1000 1200B messages 38.667 ms/op 36.683 ms/op 1.05
send data - 1000 2048B messages 48.064 ms/op 43.485 ms/op 1.11
send data - 1000 4096B messages 44.526 ms/op 42.335 ms/op 1.05
send data - 1000 16384B messages 122.20 ms/op 117.39 ms/op 1.04
send data - 1000 65536B messages 444.28 ms/op 448.55 ms/op 0.99
enrSubnets - fastDeserialize 64 bits 1.7500 us/op 1.2640 us/op 1.38
enrSubnets - ssz BitVector 64 bits 572.00 ns/op 413.00 ns/op 1.38
enrSubnets - fastDeserialize 4 bits 257.00 ns/op 170.00 ns/op 1.51
enrSubnets - ssz BitVector 4 bits 574.00 ns/op 406.00 ns/op 1.41
prioritizePeers score -10:0 att 32-0.1 sync 2-0 122.83 us/op 98.743 us/op 1.24
prioritizePeers score 0:0 att 32-0.25 sync 2-0.25 151.54 us/op 129.84 us/op 1.17
prioritizePeers score 0:0 att 32-0.5 sync 2-0.5 200.13 us/op 177.60 us/op 1.13
prioritizePeers score 0:0 att 64-0.75 sync 4-0.75 355.77 us/op 307.75 us/op 1.16
prioritizePeers score 0:0 att 64-1 sync 4-1 481.68 us/op 381.06 us/op 1.26
array of 16000 items push then shift 1.7536 us/op 1.7163 us/op 1.02
LinkedList of 16000 items push then shift 9.5570 ns/op 9.3250 ns/op 1.02
array of 16000 items push then pop 125.00 ns/op 106.29 ns/op 1.18
LinkedList of 16000 items push then pop 9.5900 ns/op 9.3730 ns/op 1.02
array of 24000 items push then shift 2.5786 us/op 2.5667 us/op 1.00
LinkedList of 24000 items push then shift 9.9150 ns/op 9.0550 ns/op 1.09
array of 24000 items push then pop 159.55 ns/op 130.47 ns/op 1.22
LinkedList of 24000 items push then pop 9.1750 ns/op 8.8210 ns/op 1.04
intersect bitArray bitLen 8 6.8810 ns/op 6.4440 ns/op 1.07
intersect array and set length 8 88.561 ns/op 64.852 ns/op 1.37
intersect bitArray bitLen 128 36.098 ns/op 34.346 ns/op 1.05
intersect array and set length 128 1.1124 us/op 892.49 ns/op 1.25
bitArray.getTrueBitIndexes() bitLen 128 1.9640 us/op 1.7300 us/op 1.14
bitArray.getTrueBitIndexes() bitLen 248 3.2980 us/op 2.9120 us/op 1.13
bitArray.getTrueBitIndexes() bitLen 512 6.5330 us/op 6.0610 us/op 1.08
Buffer.concat 32 items 1.1180 us/op 980.00 ns/op 1.14
Uint8Array.set 32 items 1.9920 us/op 1.6900 us/op 1.18
Set add up to 64 items then delete first 5.2685 us/op 4.4267 us/op 1.19
OrderedSet add up to 64 items then delete first 7.1347 us/op 5.5546 us/op 1.28
Set add up to 64 items then delete last 5.4446 us/op 4.7185 us/op 1.15
OrderedSet add up to 64 items then delete last 7.4956 us/op 5.7867 us/op 1.30
Set add up to 64 items then delete middle 5.4985 us/op 4.5942 us/op 1.20
OrderedSet add up to 64 items then delete middle 8.7704 us/op 7.0266 us/op 1.25
Set add up to 128 items then delete first 10.934 us/op 9.5234 us/op 1.15
OrderedSet add up to 128 items then delete first 15.276 us/op 12.556 us/op 1.22
Set add up to 128 items then delete last 10.886 us/op 9.5788 us/op 1.14
OrderedSet add up to 128 items then delete last 14.285 us/op 11.893 us/op 1.20
Set add up to 128 items then delete middle 10.617 us/op 9.3712 us/op 1.13
OrderedSet add up to 128 items then delete middle 20.316 us/op 17.371 us/op 1.17
Set add up to 256 items then delete first 21.951 us/op 18.954 us/op 1.16
OrderedSet add up to 256 items then delete first 29.929 us/op 25.265 us/op 1.18
Set add up to 256 items then delete last 21.342 us/op 19.497 us/op 1.09
OrderedSet add up to 256 items then delete last 28.492 us/op 24.895 us/op 1.14
Set add up to 256 items then delete middle 21.702 us/op 20.608 us/op 1.05
OrderedSet add up to 256 items then delete middle 51.925 us/op 48.583 us/op 1.07
transfer serialized Status (84 B) 1.9070 us/op 1.7600 us/op 1.08
copy serialized Status (84 B) 1.7380 us/op 1.4860 us/op 1.17
transfer serialized SignedVoluntaryExit (112 B) 2.0500 us/op 2.1280 us/op 0.96
copy serialized SignedVoluntaryExit (112 B) 1.7810 us/op 1.7950 us/op 0.99
transfer serialized ProposerSlashing (416 B) 2.4020 us/op 2.9980 us/op 0.80
copy serialized ProposerSlashing (416 B) 2.3230 us/op 2.9420 us/op 0.79
transfer serialized Attestation (485 B) 2.9850 us/op 3.0680 us/op 0.97
copy serialized Attestation (485 B) 2.9880 us/op 2.9570 us/op 1.01
transfer serialized AttesterSlashing (33232 B) 3.7490 us/op 3.0740 us/op 1.22
copy serialized AttesterSlashing (33232 B) 8.6480 us/op 6.5380 us/op 1.32
transfer serialized Small SignedBeaconBlock (128000 B) 4.0110 us/op 2.8050 us/op 1.43
copy serialized Small SignedBeaconBlock (128000 B) 28.031 us/op 17.375 us/op 1.61
transfer serialized Avg SignedBeaconBlock (200000 B) 4.2020 us/op 3.4810 us/op 1.21
copy serialized Avg SignedBeaconBlock (200000 B) 38.666 us/op 26.765 us/op 1.44
transfer serialized BlobsSidecar (524380 B) 5.6610 us/op 3.5020 us/op 1.62
copy serialized BlobsSidecar (524380 B) 169.49 us/op 96.789 us/op 1.75
transfer serialized Big SignedBeaconBlock (1000000 B) 4.5130 us/op 3.5820 us/op 1.26
copy serialized Big SignedBeaconBlock (1000000 B) 245.62 us/op 166.79 us/op 1.47
pass gossip attestations to forkchoice per slot 4.2653 ms/op 4.3835 ms/op 0.97
forkChoice updateHead vc 100000 bc 64 eq 0 734.99 us/op 709.90 us/op 1.04
forkChoice updateHead vc 600000 bc 64 eq 0 4.5173 ms/op 4.8934 ms/op 0.92
forkChoice updateHead vc 1000000 bc 64 eq 0 7.8919 ms/op 7.1200 ms/op 1.11
forkChoice updateHead vc 600000 bc 320 eq 0 4.4967 ms/op 4.4321 ms/op 1.01
forkChoice updateHead vc 600000 bc 1200 eq 0 4.7440 ms/op 4.7277 ms/op 1.00
forkChoice updateHead vc 600000 bc 7200 eq 0 5.8424 ms/op 5.6719 ms/op 1.03
forkChoice updateHead vc 600000 bc 64 eq 1000 12.576 ms/op 12.065 ms/op 1.04
forkChoice updateHead vc 600000 bc 64 eq 10000 13.385 ms/op 12.654 ms/op 1.06
forkChoice updateHead vc 600000 bc 64 eq 300000 21.006 ms/op 17.912 ms/op 1.17
computeDeltas 500000 validators 300 proto nodes 7.2106 ms/op 6.8496 ms/op 1.05
computeDeltas 500000 validators 1200 proto nodes 7.9461 ms/op 6.7632 ms/op 1.17
computeDeltas 500000 validators 7200 proto nodes 6.6652 ms/op 6.8001 ms/op 0.98
computeDeltas 750000 validators 300 proto nodes 9.5961 ms/op 10.490 ms/op 0.91
computeDeltas 750000 validators 1200 proto nodes 9.6151 ms/op 10.504 ms/op 0.92
computeDeltas 750000 validators 7200 proto nodes 9.6371 ms/op 10.566 ms/op 0.91
computeDeltas 1400000 validators 300 proto nodes 18.088 ms/op 21.309 ms/op 0.85
computeDeltas 1400000 validators 1200 proto nodes 18.626 ms/op 20.555 ms/op 0.91
computeDeltas 1400000 validators 7200 proto nodes 19.036 ms/op 22.109 ms/op 0.86
computeDeltas 2100000 validators 300 proto nodes 30.325 ms/op 31.210 ms/op 0.97
computeDeltas 2100000 validators 1200 proto nodes 31.704 ms/op 29.433 ms/op 1.08
computeDeltas 2100000 validators 7200 proto nodes 30.293 ms/op 29.316 ms/op 1.03
computeProposerBoostScoreFromBalances 500000 validators 3.7660 ms/op 4.0270 ms/op 0.94
computeProposerBoostScoreFromBalances 750000 validators 3.6970 ms/op 4.0655 ms/op 0.91
computeProposerBoostScoreFromBalances 1400000 validators 3.6807 ms/op 4.0659 ms/op 0.91
computeProposerBoostScoreFromBalances 2100000 validators 3.7150 ms/op 3.9443 ms/op 0.94
altair processAttestation - 250000 vs - 7PWei normalcase 2.2242 ms/op 3.7058 ms/op 0.60
altair processAttestation - 250000 vs - 7PWei worstcase 3.1420 ms/op 6.4829 ms/op 0.48
altair processAttestation - setStatus - 1/6 committees join 172.89 us/op 207.94 us/op 0.83
altair processAttestation - setStatus - 1/3 committees join 360.95 us/op 414.83 us/op 0.87
altair processAttestation - setStatus - 1/2 committees join 473.42 us/op 469.06 us/op 1.01
altair processAttestation - setStatus - 2/3 committees join 618.42 us/op 576.57 us/op 1.07
altair processAttestation - setStatus - 4/5 committees join 819.10 us/op 898.92 us/op 0.91
altair processAttestation - setStatus - 100% committees join 963.80 us/op 1.0709 ms/op 0.90
altair processBlock - 250000 vs - 7PWei normalcase 11.452 ms/op 14.116 ms/op 0.81
altair processBlock - 250000 vs - 7PWei normalcase hashState 33.910 ms/op 51.470 ms/op 0.66
altair processBlock - 250000 vs - 7PWei worstcase 38.785 ms/op 46.924 ms/op 0.83
altair processBlock - 250000 vs - 7PWei worstcase hashState 96.912 ms/op 130.78 ms/op 0.74
phase0 processBlock - 250000 vs - 7PWei normalcase 2.7743 ms/op 3.3999 ms/op 0.82
phase0 processBlock - 250000 vs - 7PWei worstcase 31.582 ms/op 39.869 ms/op 0.79
altair processEth1Data - 250000 vs - 7PWei normalcase 559.43 us/op 862.78 us/op 0.65
getExpectedWithdrawals 250000 eb:1,eth1:1,we:0,wn:0,smpl:15 12.290 us/op 12.305 us/op 1.00
getExpectedWithdrawals 250000 eb:0.95,eth1:0.1,we:0.05,wn:0,smpl:219 59.995 us/op 89.135 us/op 0.67
getExpectedWithdrawals 250000 eb:0.95,eth1:0.3,we:0.05,wn:0,smpl:42 18.694 us/op 18.232 us/op 1.03
getExpectedWithdrawals 250000 eb:0.95,eth1:0.7,we:0.05,wn:0,smpl:18 13.673 us/op 20.464 us/op 0.67
getExpectedWithdrawals 250000 eb:0.1,eth1:0.1,we:0,wn:0,smpl:1020 202.48 us/op 242.04 us/op 0.84
getExpectedWithdrawals 250000 eb:0.03,eth1:0.03,we:0,wn:0,smpl:11777 1.8887 ms/op 1.3779 ms/op 1.37
getExpectedWithdrawals 250000 eb:0.01,eth1:0.01,we:0,wn:0,smpl:16384 1.9900 ms/op 2.4169 ms/op 0.82
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,smpl:16384 2.0925 ms/op 2.3268 ms/op 0.90
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,nocache,smpl:16384 5.4863 ms/op 4.5207 ms/op 1.21
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,smpl:16384 3.1115 ms/op 2.9243 ms/op 1.06
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,nocache,smpl:16384 6.7435 ms/op 6.3556 ms/op 1.06
Tree 40 250000 create 675.88 ms/op 682.17 ms/op 0.99
Tree 40 250000 get(125000) 243.74 ns/op 242.37 ns/op 1.01
Tree 40 250000 set(125000) 2.4421 us/op 1.3688 us/op 1.78
Tree 40 250000 toArray() 30.011 ms/op 24.277 ms/op 1.24
Tree 40 250000 iterate all - toArray() + loop 31.304 ms/op 24.515 ms/op 1.28
Tree 40 250000 iterate all - get(i) 81.195 ms/op 77.551 ms/op 1.05
MutableVector 250000 create 12.394 ms/op 15.761 ms/op 0.79
MutableVector 250000 get(125000) 7.0800 ns/op 6.9670 ns/op 1.02
MutableVector 250000 set(125000) 443.01 ns/op 351.67 ns/op 1.26
MutableVector 250000 toArray() 4.4890 ms/op 4.4171 ms/op 1.02
MutableVector 250000 iterate all - toArray() + loop 6.8300 ms/op 4.6190 ms/op 1.48
MutableVector 250000 iterate all - get(i) 1.6250 ms/op 1.6005 ms/op 1.02
Array 250000 create 3.9398 ms/op 4.2646 ms/op 0.92
Array 250000 clone - spread 1.3290 ms/op 1.4685 ms/op 0.91
Array 250000 get(125000) 1.3780 ns/op 1.2210 ns/op 1.13
Array 250000 set(125000) 5.1880 ns/op 5.5220 ns/op 0.94
Array 250000 iterate all - loop 173.21 us/op 181.57 us/op 0.95
effectiveBalanceIncrements clone Uint8Array 300000 36.731 us/op 44.642 us/op 0.82
effectiveBalanceIncrements clone MutableVector 300000 371.00 ns/op 431.00 ns/op 0.86
effectiveBalanceIncrements rw all Uint8Array 300000 209.05 us/op 209.85 us/op 1.00
effectiveBalanceIncrements rw all MutableVector 300000 123.51 ms/op 99.324 ms/op 1.24
phase0 afterProcessEpoch - 250000 vs - 7PWei 117.98 ms/op 124.73 ms/op 0.95
phase0 beforeProcessEpoch - 250000 vs - 7PWei 58.663 ms/op 57.113 ms/op 1.03
altair processEpoch - mainnet_e81889 556.49 ms/op 615.63 ms/op 0.90
mainnet_e81889 - altair beforeProcessEpoch 96.375 ms/op 101.11 ms/op 0.95
mainnet_e81889 - altair processJustificationAndFinalization 20.751 us/op 29.933 us/op 0.69
mainnet_e81889 - altair processInactivityUpdates 7.1463 ms/op 8.2329 ms/op 0.87
mainnet_e81889 - altair processRewardsAndPenalties 63.654 ms/op 73.459 ms/op 0.87
mainnet_e81889 - altair processRegistryUpdates 2.9840 us/op 3.5490 us/op 0.84
mainnet_e81889 - altair processSlashings 569.00 ns/op 498.00 ns/op 1.14
mainnet_e81889 - altair processEth1DataReset 537.00 ns/op 939.00 ns/op 0.57
mainnet_e81889 - altair processEffectiveBalanceUpdates 1.3433 ms/op 1.5775 ms/op 0.85
mainnet_e81889 - altair processSlashingsReset 4.1840 us/op 6.5010 us/op 0.64
mainnet_e81889 - altair processRandaoMixesReset 5.3370 us/op 6.8870 us/op 0.77
mainnet_e81889 - altair processHistoricalRootsUpdate 990.00 ns/op 1.5180 us/op 0.65
mainnet_e81889 - altair processParticipationFlagUpdates 3.1420 us/op 3.1430 us/op 1.00
mainnet_e81889 - altair processSyncCommitteeUpdates 653.00 ns/op 1.2850 us/op 0.51
mainnet_e81889 - altair afterProcessEpoch 121.99 ms/op 127.09 ms/op 0.96
capella processEpoch - mainnet_e217614 2.0843 s/op 2.4582 s/op 0.85
mainnet_e217614 - capella beforeProcessEpoch 489.55 ms/op 538.77 ms/op 0.91
mainnet_e217614 - capella processJustificationAndFinalization 18.493 us/op 19.213 us/op 0.96
mainnet_e217614 - capella processInactivityUpdates 24.490 ms/op 20.375 ms/op 1.20
mainnet_e217614 - capella processRewardsAndPenalties 406.77 ms/op 442.08 ms/op 0.92
mainnet_e217614 - capella processRegistryUpdates 25.202 us/op 38.342 us/op 0.66
mainnet_e217614 - capella processSlashings 533.00 ns/op 886.00 ns/op 0.60
mainnet_e217614 - capella processEth1DataReset 428.00 ns/op 845.00 ns/op 0.51
mainnet_e217614 - capella processEffectiveBalanceUpdates 5.1642 ms/op 11.453 ms/op 0.45
mainnet_e217614 - capella processSlashingsReset 3.0480 us/op 8.3110 us/op 0.37
mainnet_e217614 - capella processRandaoMixesReset 3.6500 us/op 9.2280 us/op 0.40
mainnet_e217614 - capella processHistoricalRootsUpdate 526.00 ns/op 751.00 ns/op 0.70
mainnet_e217614 - capella processParticipationFlagUpdates 1.4210 us/op 2.3590 us/op 0.60
mainnet_e217614 - capella afterProcessEpoch 300.61 ms/op 378.58 ms/op 0.79
phase0 processEpoch - mainnet_e58758 447.07 ms/op 559.04 ms/op 0.80
mainnet_e58758 - phase0 beforeProcessEpoch 114.61 ms/op 174.60 ms/op 0.66
mainnet_e58758 - phase0 processJustificationAndFinalization 14.939 us/op 19.996 us/op 0.75
mainnet_e58758 - phase0 processRewardsAndPenalties 53.100 ms/op 43.779 ms/op 1.21
mainnet_e58758 - phase0 processRegistryUpdates 11.408 us/op 17.404 us/op 0.66
mainnet_e58758 - phase0 processSlashings 495.00 ns/op 711.00 ns/op 0.70
mainnet_e58758 - phase0 processEth1DataReset 538.00 ns/op 983.00 ns/op 0.55
mainnet_e58758 - phase0 processEffectiveBalanceUpdates 1.4555 ms/op 1.3263 ms/op 1.10
mainnet_e58758 - phase0 processSlashingsReset 3.5730 us/op 6.3950 us/op 0.56
mainnet_e58758 - phase0 processRandaoMixesReset 4.6060 us/op 5.9310 us/op 0.78
mainnet_e58758 - phase0 processHistoricalRootsUpdate 653.00 ns/op 813.00 ns/op 0.80
mainnet_e58758 - phase0 processParticipationRecordUpdates 4.6170 us/op 6.2040 us/op 0.74
mainnet_e58758 - phase0 afterProcessEpoch 100.46 ms/op 104.03 ms/op 0.97
phase0 processEffectiveBalanceUpdates - 250000 normalcase 1.4349 ms/op 1.4956 ms/op 0.96
phase0 processEffectiveBalanceUpdates - 250000 worstcase 0.5 1.4559 ms/op 1.5726 ms/op 0.93
altair processInactivityUpdates - 250000 normalcase 25.632 ms/op 27.035 ms/op 0.95
altair processInactivityUpdates - 250000 worstcase 23.458 ms/op 34.524 ms/op 0.68
phase0 processRegistryUpdates - 250000 normalcase 8.7800 us/op 9.7100 us/op 0.90
phase0 processRegistryUpdates - 250000 badcase_full_deposits 402.65 us/op 366.50 us/op 1.10
phase0 processRegistryUpdates - 250000 worstcase 0.5 132.18 ms/op 144.62 ms/op 0.91
altair processRewardsAndPenalties - 250000 normalcase 44.391 ms/op 42.613 ms/op 1.04
altair processRewardsAndPenalties - 250000 worstcase 39.827 ms/op 54.755 ms/op 0.73
phase0 getAttestationDeltas - 250000 normalcase 9.5451 ms/op 8.2731 ms/op 1.15
phase0 getAttestationDeltas - 250000 worstcase 9.3910 ms/op 8.1090 ms/op 1.16
phase0 processSlashings - 250000 worstcase 97.923 us/op 89.114 us/op 1.10
altair processSyncCommitteeUpdates - 250000 158.93 ms/op 159.12 ms/op 1.00
BeaconState.hashTreeRoot - No change 252.00 ns/op 260.00 ns/op 0.97
BeaconState.hashTreeRoot - 1 full validator 124.21 us/op 137.18 us/op 0.91
BeaconState.hashTreeRoot - 32 full validator 1.3389 ms/op 1.4486 ms/op 0.92
BeaconState.hashTreeRoot - 512 full validator 14.114 ms/op 14.973 ms/op 0.94
BeaconState.hashTreeRoot - 1 validator.effectiveBalance 180.51 us/op 179.87 us/op 1.00
BeaconState.hashTreeRoot - 32 validator.effectiveBalance 2.1373 ms/op 2.1550 ms/op 0.99
BeaconState.hashTreeRoot - 512 validator.effectiveBalance 32.517 ms/op 28.247 ms/op 1.15
BeaconState.hashTreeRoot - 1 balances 151.82 us/op 137.28 us/op 1.11
BeaconState.hashTreeRoot - 32 balances 1.1405 ms/op 1.1039 ms/op 1.03
BeaconState.hashTreeRoot - 512 balances 11.017 ms/op 13.086 ms/op 0.84
BeaconState.hashTreeRoot - 250000 balances 199.39 ms/op 219.99 ms/op 0.91
aggregationBits - 2048 els - zipIndexesInBitList 20.403 us/op 17.777 us/op 1.15
byteArrayEquals 32 76.120 ns/op 78.722 ns/op 0.97
Buffer.compare 32 55.888 ns/op 60.961 ns/op 0.92
byteArrayEquals 1024 2.0821 us/op 2.1434 us/op 0.97
Buffer.compare 1024 71.876 ns/op 73.935 ns/op 0.97
byteArrayEquals 16384 33.002 us/op 34.430 us/op 0.96
Buffer.compare 16384 251.88 ns/op 278.14 ns/op 0.91
byteArrayEquals 123687377 286.84 ms/op 253.25 ms/op 1.13
Buffer.compare 123687377 11.987 ms/op 7.6628 ms/op 1.56
byteArrayEquals 32 - diff last byte 85.793 ns/op 73.871 ns/op 1.16
Buffer.compare 32 - diff last byte 66.598 ns/op 57.172 ns/op 1.16
byteArrayEquals 1024 - diff last byte 2.2994 us/op 2.1068 us/op 1.09
Buffer.compare 1024 - diff last byte 83.663 ns/op 72.217 ns/op 1.16
byteArrayEquals 16384 - diff last byte 38.974 us/op 33.066 us/op 1.18
Buffer.compare 16384 - diff last byte 323.94 ns/op 279.06 ns/op 1.16
byteArrayEquals 123687377 - diff last byte 332.26 ms/op 254.55 ms/op 1.31
Buffer.compare 123687377 - diff last byte 11.489 ms/op 8.0229 ms/op 1.43
byteArrayEquals 32 - random bytes 7.4000 ns/op 6.0550 ns/op 1.22
Buffer.compare 32 - random bytes 68.256 ns/op 63.170 ns/op 1.08
byteArrayEquals 1024 - random bytes 7.1920 ns/op 5.7390 ns/op 1.25
Buffer.compare 1024 - random bytes 69.755 ns/op 62.509 ns/op 1.12
byteArrayEquals 16384 - random bytes 7.2510 ns/op 5.7140 ns/op 1.27
Buffer.compare 16384 - random bytes 68.075 ns/op 62.773 ns/op 1.08
byteArrayEquals 123687377 - random bytes 13.180 ns/op 9.2300 ns/op 1.43
Buffer.compare 123687377 - random bytes 83.770 ns/op 75.960 ns/op 1.10
regular array get 100000 times 52.250 us/op 47.017 us/op 1.11
wrappedArray get 100000 times 51.719 us/op 47.011 us/op 1.10
arrayWithProxy get 100000 times 17.040 ms/op 15.239 ms/op 1.12
ssz.Root.equals 68.619 ns/op 56.669 ns/op 1.21
byteArrayEquals 64.247 ns/op 56.494 ns/op 1.14
Buffer.compare 14.679 ns/op 12.419 ns/op 1.18
shuffle list - 16384 els 8.8849 ms/op 7.3461 ms/op 1.21
shuffle list - 250000 els 114.32 ms/op 107.98 ms/op 1.06
processSlot - 1 slots 25.172 us/op 17.683 us/op 1.42
processSlot - 32 slots 4.9446 ms/op 3.4730 ms/op 1.42
getEffectiveBalanceIncrementsZeroInactive - 250000 vs - 7PWei 72.133 ms/op 60.119 ms/op 1.20
getCommitteeAssignments - req 1 vs - 250000 vc 2.6811 ms/op 2.5939 ms/op 1.03
getCommitteeAssignments - req 100 vs - 250000 vc 4.0228 ms/op 3.8332 ms/op 1.05
getCommitteeAssignments - req 1000 vs - 250000 vc 4.4330 ms/op 4.1567 ms/op 1.07
findModifiedValidators - 10000 modified validators 675.40 ms/op 551.61 ms/op 1.22
findModifiedValidators - 1000 modified validators 542.10 ms/op 433.57 ms/op 1.25
findModifiedValidators - 100 modified validators 480.45 ms/op 453.18 ms/op 1.06
findModifiedValidators - 10 modified validators 524.51 ms/op 439.19 ms/op 1.19
findModifiedValidators - 1 modified validators 505.57 ms/op 402.01 ms/op 1.26
findModifiedValidators - no difference 485.51 ms/op 450.30 ms/op 1.08
compare ViewDUs 5.0505 s/op 4.8344 s/op 1.04
compare each validator Uint8Array 1.7432 s/op 1.7874 s/op 0.98
compare ViewDU to Uint8Array 1.1475 s/op 1.3506 s/op 0.85
migrate state 1000000 validators, 24 modified, 0 new 774.62 ms/op 846.68 ms/op 0.91
migrate state 1000000 validators, 1700 modified, 1000 new 1.1517 s/op 1.1225 s/op 1.03
migrate state 1000000 validators, 3400 modified, 2000 new 1.5726 s/op 1.3858 s/op 1.13
migrate state 1500000 validators, 24 modified, 0 new 1.1171 s/op 873.97 ms/op 1.28
migrate state 1500000 validators, 1700 modified, 1000 new 1.3987 s/op 1.1279 s/op 1.24
migrate state 1500000 validators, 3400 modified, 2000 new 1.6908 s/op 1.5115 s/op 1.12
RootCache.getBlockRootAtSlot - 250000 vs - 7PWei 5.6300 ns/op 5.2400 ns/op 1.07
state getBlockRootAtSlot - 250000 vs - 7PWei 1.1748 us/op 726.15 ns/op 1.62
computeProposers - vc 250000 12.179 ms/op 10.023 ms/op 1.22
computeEpochShuffling - vc 250000 121.00 ms/op 111.29 ms/op 1.09
getNextSyncCommittee - vc 250000 187.18 ms/op 179.41 ms/op 1.04
computeSigningRoot for AttestationData 30.986 us/op 28.491 us/op 1.09
hash AttestationData serialized data then Buffer.toString(base64) 2.5040 us/op 2.5532 us/op 0.98
toHexString serialized data 1.6151 us/op 1.2515 us/op 1.29
Buffer.toString(base64) 277.38 ns/op 281.41 ns/op 0.99

by benchmarkbot/action

@nazarhussain
Copy link
Contributor Author

@wemeetagain Please re-review this PR. I went through the changes again and made sure only the absolute necessary changes are included from the src.

Copy link
Contributor

@g11tech g11tech left a comment

Choose a reason for hiding this comment

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

looks good, would let @wemeetagain decided on Buffer.from usage on the src/responseEncode.ts, afaik we didn't want any actual Buffer usage in the main src

Copy link
Member

@nflaig nflaig left a comment

Choose a reason for hiding this comment

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

Looks good to me, PR no longer modifies src/

@wemeetagain wemeetagain merged commit 6085a54 into unstable Dec 19, 2023
15 checks passed
@wemeetagain wemeetagain deleted the nh/vitest-reqresp branch December 19, 2023 14:01
twoeths pushed a commit that referenced this pull request Dec 22, 2023
* Migrate reqresp unit tests to vitest

* Fix the build step

* Fix the types

* Fix the source changes

* Remove the  usage in src
@wemeetagain
Copy link
Member

🎉 This PR is included in v1.14.0 🎉

ensi321 pushed a commit to ensi321/lodestar that referenced this pull request Jan 22, 2024
* Migrate reqresp unit tests to vitest

* Fix the build step

* Fix the types

* Fix the source changes

* Remove the  usage in src
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.

None yet

4 participants