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: fix flaky e2e tests #6231

Merged
merged 3 commits into from
Dec 25, 2023
Merged

test: fix flaky e2e tests #6231

merged 3 commits into from
Dec 25, 2023

Conversation

nflaig
Copy link
Member

@nflaig nflaig commented Dec 22, 2023

Motivation

Fixes flaky e2e tests since we merged #6192.

As mentioned in #6192 (comment), the expectDeepEqualsUnordered function does not work as expected. Sorting an array of objects does not work like that, we would have to sort by pubkey for our specific use case but since this is supposed to be a generic function I used expect.arrayContaining which if called on both arrays works similar to to.have.deep.members.

I also noticed that the test does not print the diff on failure and just the message is not very helpful to diagnose the issue.

Description

  • Fixes assertion to check deep equality unordered arrays of objects
  • Update custom matchers to print diff on failure to make it easier to diagnose issues, see extending-matchers

Previous error on failure

image

Updated error on failure

image

@nflaig nflaig requested a review from a team as a code owner December 22, 2023 13:46
@nflaig nflaig requested a review from nazarhussain December 22, 2023 13:48
Copy link

codecov bot commented Dec 22, 2023

Codecov Report

Merging #6231 (815a4f1) into unstable (ae04197) will not change coverage.
Report is 1 commits behind head on unstable.
The diff coverage is n/a.

Additional details and impacted files
@@            Coverage Diff            @@
##           unstable    #6231   +/-   ##
=========================================
  Coverage     80.81%   80.81%           
=========================================
  Files           185      185           
  Lines         17964    17964           
  Branches       1082     1082           
=========================================
  Hits          14517    14517           
  Misses         3421     3421           
  Partials         26       26           

packages/cli/test/utils/runUtils.ts Show resolved Hide resolved
packages/cli/test/utils/runUtils.ts Show resolved Hide resolved
} catch (e) {
expect.fail(message);
}
expect(a).toEqualWithMessage(expect.arrayContaining(b), message);
Copy link
Contributor

Choose a reason for hiding this comment

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

Would it be sufficient to ensure that both array have the same size, then check with arrayContaining only once? Could act as a fail fast too.

Also not sure what should be the expected behavior with duplicates.

Copy link
Member Author

Choose a reason for hiding this comment

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

This gives you a better error message if one array contains additional elements, instead of just a size is different error you will get the extraneous element printed out

Copy link
Member Author

Choose a reason for hiding this comment

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

Also not sure what should be the expected behavior with duplicates.

Duplicates are fine as long as both arrays contain same count of elements. Or any specific case you had in mind?

Copy link
Contributor

Choose a reason for hiding this comment

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

That's very much a cornercase, but on the top of my head I would expect expectDeepEquals(['a', 'a', 'b'], ['a', 'b', 'b']) to pass.

Copy link
Member Author

Choose a reason for hiding this comment

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

I guess you mean expectDeepEqualsUnordered but yeah that would pass, the built-in assertions in vitest are just sad... we might wanna consider adding something like https://github.com/jest-community/jest-extended which has toIncludeSameMembers.

I mean the fact that there is no builtin way to do this (or at least I did not find any) makes no sense to me. There is a stackoverflow thread on the topic https://stackoverflow.com/questions/32103252/expect-arrays-to-be-equal-ignoring-order.

Copy link
Member Author

Choose a reason for hiding this comment

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

seems to be quite easy to add but not sure if it's worth just for this case https://jest-extended.jestcommunity.dev/docs/getting-started/setup#use-with-vitest

Copy link
Member Author

Choose a reason for hiding this comment

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

Added an additional length check now to catch cases like

expectDeepEqualsUnordered([{a: "a"}, {a: "a"}, {b: "b"}], [{a: "a"}, {b: "b"}, {b: "b"}, {b: "b"}])

I honestly think this is sufficient, but let me know if you have another idea

Copy link
Contributor

github-actions bot commented Dec 22, 2023

Performance Report

✔️ no performance regression detected

Full benchmark results
Benchmark suite Current: 220f819 Previous: 267991a Ratio
getPubkeys - index2pubkey - req 1000 vs - 250000 vc 447.94 us/op 898.76 us/op 0.50
getPubkeys - validatorsArr - req 1000 vs - 250000 vc 80.366 us/op 118.22 us/op 0.68
BLS verify - blst-native 1.3035 ms/op 1.3606 ms/op 0.96
BLS verifyMultipleSignatures 3 - blst-native 2.7354 ms/op 2.8491 ms/op 0.96
BLS verifyMultipleSignatures 8 - blst-native 5.9975 ms/op 6.2783 ms/op 0.96
BLS verifyMultipleSignatures 32 - blst-native 22.178 ms/op 23.021 ms/op 0.96
BLS verifyMultipleSignatures 64 - blst-native 43.400 ms/op 45.201 ms/op 0.96
BLS verifyMultipleSignatures 128 - blst-native 86.493 ms/op 90.475 ms/op 0.96
BLS deserializing 10000 signatures 934.94 ms/op 969.10 ms/op 0.96
BLS deserializing 100000 signatures 9.4833 s/op 9.5203 s/op 1.00
BLS verifyMultipleSignatures - same message - 3 - blst-native 1.3316 ms/op 1.3598 ms/op 0.98
BLS verifyMultipleSignatures - same message - 8 - blst-native 1.4752 ms/op 1.6356 ms/op 0.90
BLS verifyMultipleSignatures - same message - 32 - blst-native 2.9226 ms/op 2.3489 ms/op 1.24
BLS verifyMultipleSignatures - same message - 64 - blst-native 4.1879 ms/op 4.4483 ms/op 0.94
BLS verifyMultipleSignatures - same message - 128 - blst-native 7.7919 ms/op 7.7458 ms/op 1.01
BLS aggregatePubkeys 32 - blst-native 27.713 us/op 25.052 us/op 1.11
BLS aggregatePubkeys 128 - blst-native 106.34 us/op 100.31 us/op 1.06
getAttestationsForBlock 50.183 ms/op 50.245 ms/op 1.00
getSlashingsAndExits - default max 171.78 us/op 198.14 us/op 0.87
getSlashingsAndExits - 2k 433.09 us/op 399.84 us/op 1.08
proposeBlockBody type=full, size=empty 5.1620 ms/op 5.6186 ms/op 0.92
isKnown best case - 1 super set check 350.00 ns/op 378.00 ns/op 0.93
isKnown normal case - 2 super set checks 398.00 ns/op 331.00 ns/op 1.20
isKnown worse case - 16 super set checks 322.00 ns/op 322.00 ns/op 1.00
CheckpointStateCache - add get delete 6.6490 us/op 5.2680 us/op 1.26
validate api signedAggregateAndProof - struct 2.8242 ms/op 2.7939 ms/op 1.01
validate gossip signedAggregateAndProof - struct 2.8399 ms/op 2.7909 ms/op 1.02
validate gossip attestation - vc 640000 1.3710 ms/op 1.3714 ms/op 1.00
batch validate gossip attestation - vc 640000 - chunk 32 164.53 us/op 166.84 us/op 0.99
batch validate gossip attestation - vc 640000 - chunk 64 146.08 us/op 152.08 us/op 0.96
batch validate gossip attestation - vc 640000 - chunk 128 136.73 us/op 142.52 us/op 0.96
batch validate gossip attestation - vc 640000 - chunk 256 139.59 us/op 139.98 us/op 1.00
pickEth1Vote - no votes 1.2710 ms/op 1.3755 ms/op 0.92
pickEth1Vote - max votes 9.9454 ms/op 10.254 ms/op 0.97
pickEth1Vote - Eth1Data hashTreeRoot value x2048 17.620 ms/op 17.557 ms/op 1.00
pickEth1Vote - Eth1Data hashTreeRoot tree x2048 23.966 ms/op 25.839 ms/op 0.93
pickEth1Vote - Eth1Data fastSerialize value x2048 645.25 us/op 706.12 us/op 0.91
pickEth1Vote - Eth1Data fastSerialize tree x2048 4.6096 ms/op 5.1272 ms/op 0.90
bytes32 toHexString 531.00 ns/op 555.00 ns/op 0.96
bytes32 Buffer.toString(hex) 292.00 ns/op 329.00 ns/op 0.89
bytes32 Buffer.toString(hex) from Uint8Array 475.00 ns/op 502.00 ns/op 0.95
bytes32 Buffer.toString(hex) + 0x 285.00 ns/op 290.00 ns/op 0.98
Object access 1 prop 0.17200 ns/op 0.16700 ns/op 1.03
Map access 1 prop 0.14700 ns/op 0.15100 ns/op 0.97
Object get x1000 7.7890 ns/op 7.3780 ns/op 1.06
Map get x1000 0.78900 ns/op 0.84700 ns/op 0.93
Object set x1000 55.840 ns/op 57.373 ns/op 0.97
Map set x1000 41.268 ns/op 45.551 ns/op 0.91
Return object 10000 times 0.24650 ns/op 0.25770 ns/op 0.96
Throw Error 10000 times 3.9455 us/op 3.9605 us/op 1.00
fastMsgIdFn sha256 / 200 bytes 3.3580 us/op 3.5210 us/op 0.95
fastMsgIdFn h32 xxhash / 200 bytes 318.00 ns/op 328.00 ns/op 0.97
fastMsgIdFn h64 xxhash / 200 bytes 360.00 ns/op 406.00 ns/op 0.89
fastMsgIdFn sha256 / 1000 bytes 11.538 us/op 12.068 us/op 0.96
fastMsgIdFn h32 xxhash / 1000 bytes 415.00 ns/op 511.00 ns/op 0.81
fastMsgIdFn h64 xxhash / 1000 bytes 444.00 ns/op 458.00 ns/op 0.97
fastMsgIdFn sha256 / 10000 bytes 103.52 us/op 106.90 us/op 0.97
fastMsgIdFn h32 xxhash / 10000 bytes 2.0040 us/op 2.0670 us/op 0.97
fastMsgIdFn h64 xxhash / 10000 bytes 1.4000 us/op 1.4030 us/op 1.00
send data - 1000 256B messages 22.608 ms/op 22.602 ms/op 1.00
send data - 1000 512B messages 29.547 ms/op 29.488 ms/op 1.00
send data - 1000 1024B messages 40.681 ms/op 44.720 ms/op 0.91
send data - 1000 1200B messages 38.271 ms/op 41.192 ms/op 0.93
send data - 1000 2048B messages 41.254 ms/op 25.044 ms/op 1.65
send data - 1000 4096B messages 45.129 ms/op 46.096 ms/op 0.98
send data - 1000 16384B messages 113.91 ms/op 126.14 ms/op 0.90
send data - 1000 65536B messages 444.46 ms/op 532.41 ms/op 0.83
enrSubnets - fastDeserialize 64 bits 1.2860 us/op 1.5470 us/op 0.83
enrSubnets - ssz BitVector 64 bits 430.00 ns/op 502.00 ns/op 0.86
enrSubnets - fastDeserialize 4 bits 174.00 ns/op 223.00 ns/op 0.78
enrSubnets - ssz BitVector 4 bits 439.00 ns/op 520.00 ns/op 0.84
prioritizePeers score -10:0 att 32-0.1 sync 2-0 103.82 us/op 118.14 us/op 0.88
prioritizePeers score 0:0 att 32-0.25 sync 2-0.25 127.39 us/op 144.03 us/op 0.88
prioritizePeers score 0:0 att 32-0.5 sync 2-0.5 161.78 us/op 189.68 us/op 0.85
prioritizePeers score 0:0 att 64-0.75 sync 4-0.75 297.57 us/op 332.72 us/op 0.89
prioritizePeers score 0:0 att 64-1 sync 4-1 346.44 us/op 374.12 us/op 0.93
array of 16000 items push then shift 1.6325 us/op 1.6799 us/op 0.97
LinkedList of 16000 items push then shift 8.9440 ns/op 9.2200 ns/op 0.97
array of 16000 items push then pop 84.392 ns/op 107.30 ns/op 0.79
LinkedList of 16000 items push then pop 8.7450 ns/op 9.2010 ns/op 0.95
array of 24000 items push then shift 2.4088 us/op 2.7242 us/op 0.88
LinkedList of 24000 items push then shift 8.5700 ns/op 9.6400 ns/op 0.89
array of 24000 items push then pop 94.279 ns/op 160.71 ns/op 0.59
LinkedList of 24000 items push then pop 8.4320 ns/op 9.0560 ns/op 0.93
intersect bitArray bitLen 8 6.2110 ns/op 6.6540 ns/op 0.93
intersect array and set length 8 60.154 ns/op 77.756 ns/op 0.77
intersect bitArray bitLen 128 32.745 ns/op 36.300 ns/op 0.90
intersect array and set length 128 824.48 ns/op 1.0582 us/op 0.78
bitArray.getTrueBitIndexes() bitLen 128 1.4080 us/op 1.7970 us/op 0.78
bitArray.getTrueBitIndexes() bitLen 248 2.3900 us/op 3.1400 us/op 0.76
bitArray.getTrueBitIndexes() bitLen 512 4.6240 us/op 6.0470 us/op 0.76
Buffer.concat 32 items 934.00 ns/op 1.2000 us/op 0.78
Uint8Array.set 32 items 1.8480 us/op 2.1170 us/op 0.87
Set add up to 64 items then delete first 4.1504 us/op 5.0926 us/op 0.81
OrderedSet add up to 64 items then delete first 5.2631 us/op 6.4941 us/op 0.81
Set add up to 64 items then delete last 4.4464 us/op 5.0492 us/op 0.88
OrderedSet add up to 64 items then delete last 5.5372 us/op 7.0543 us/op 0.78
Set add up to 64 items then delete middle 4.4226 us/op 5.0389 us/op 0.88
OrderedSet add up to 64 items then delete middle 6.9914 us/op 7.9862 us/op 0.88
Set add up to 128 items then delete first 9.2074 us/op 10.238 us/op 0.90
OrderedSet add up to 128 items then delete first 12.208 us/op 13.814 us/op 0.88
Set add up to 128 items then delete last 8.9352 us/op 11.016 us/op 0.81
OrderedSet add up to 128 items then delete last 11.083 us/op 13.955 us/op 0.79
Set add up to 128 items then delete middle 8.6950 us/op 10.642 us/op 0.82
OrderedSet add up to 128 items then delete middle 16.150 us/op 18.795 us/op 0.86
Set add up to 256 items then delete first 17.913 us/op 21.168 us/op 0.85
OrderedSet add up to 256 items then delete first 24.071 us/op 29.647 us/op 0.81
Set add up to 256 items then delete last 17.440 us/op 21.114 us/op 0.83
OrderedSet add up to 256 items then delete last 22.071 us/op 26.179 us/op 0.84
Set add up to 256 items then delete middle 17.406 us/op 20.346 us/op 0.86
OrderedSet add up to 256 items then delete middle 43.021 us/op 50.943 us/op 0.84
transfer serialized Status (84 B) 1.7480 us/op 1.9940 us/op 0.88
copy serialized Status (84 B) 1.4840 us/op 1.7090 us/op 0.87
transfer serialized SignedVoluntaryExit (112 B) 1.8280 us/op 2.2320 us/op 0.82
copy serialized SignedVoluntaryExit (112 B) 1.4480 us/op 1.8770 us/op 0.77
transfer serialized ProposerSlashing (416 B) 2.1780 us/op 2.6820 us/op 0.81
copy serialized ProposerSlashing (416 B) 2.1960 us/op 2.3780 us/op 0.92
transfer serialized Attestation (485 B) 2.8050 us/op 2.3020 us/op 1.22
copy serialized Attestation (485 B) 1.9110 us/op 2.2620 us/op 0.84
transfer serialized AttesterSlashing (33232 B) 2.2370 us/op 2.3550 us/op 0.95
copy serialized AttesterSlashing (33232 B) 5.3210 us/op 8.0470 us/op 0.66
transfer serialized Small SignedBeaconBlock (128000 B) 2.5440 us/op 3.0380 us/op 0.84
copy serialized Small SignedBeaconBlock (128000 B) 13.317 us/op 37.624 us/op 0.35
transfer serialized Avg SignedBeaconBlock (200000 B) 2.8010 us/op 4.3930 us/op 0.64
copy serialized Avg SignedBeaconBlock (200000 B) 19.805 us/op 29.136 us/op 0.68
transfer serialized BlobsSidecar (524380 B) 2.8170 us/op 3.8920 us/op 0.72
copy serialized BlobsSidecar (524380 B) 76.785 us/op 139.69 us/op 0.55
transfer serialized Big SignedBeaconBlock (1000000 B) 3.0280 us/op 4.5660 us/op 0.66
copy serialized Big SignedBeaconBlock (1000000 B) 173.23 us/op 186.63 us/op 0.93
pass gossip attestations to forkchoice per slot 3.7284 ms/op 4.4754 ms/op 0.83
forkChoice updateHead vc 100000 bc 64 eq 0 657.24 us/op 721.59 us/op 0.91
forkChoice updateHead vc 600000 bc 64 eq 0 4.1047 ms/op 4.8391 ms/op 0.85
forkChoice updateHead vc 1000000 bc 64 eq 0 6.7440 ms/op 7.5122 ms/op 0.90
forkChoice updateHead vc 600000 bc 320 eq 0 4.0110 ms/op 4.4595 ms/op 0.90
forkChoice updateHead vc 600000 bc 1200 eq 0 4.1703 ms/op 4.4937 ms/op 0.93
forkChoice updateHead vc 600000 bc 7200 eq 0 5.1319 ms/op 5.5748 ms/op 0.92
forkChoice updateHead vc 600000 bc 64 eq 1000 10.995 ms/op 11.574 ms/op 0.95
forkChoice updateHead vc 600000 bc 64 eq 10000 11.702 ms/op 12.443 ms/op 0.94
forkChoice updateHead vc 600000 bc 64 eq 300000 15.984 ms/op 17.070 ms/op 0.94
computeDeltas 500000 validators 300 proto nodes 6.5726 ms/op 7.0240 ms/op 0.94
computeDeltas 500000 validators 1200 proto nodes 6.4013 ms/op 6.8286 ms/op 0.94
computeDeltas 500000 validators 7200 proto nodes 6.2749 ms/op 6.5556 ms/op 0.96
computeDeltas 750000 validators 300 proto nodes 9.4419 ms/op 10.105 ms/op 0.93
computeDeltas 750000 validators 1200 proto nodes 9.3473 ms/op 10.113 ms/op 0.92
computeDeltas 750000 validators 7200 proto nodes 9.3502 ms/op 10.201 ms/op 0.92
computeDeltas 1400000 validators 300 proto nodes 18.203 ms/op 19.624 ms/op 0.93
computeDeltas 1400000 validators 1200 proto nodes 18.590 ms/op 19.106 ms/op 0.97
computeDeltas 1400000 validators 7200 proto nodes 18.758 ms/op 19.115 ms/op 0.98
computeDeltas 2100000 validators 300 proto nodes 28.702 ms/op 28.943 ms/op 0.99
computeDeltas 2100000 validators 1200 proto nodes 28.347 ms/op 29.625 ms/op 0.96
computeDeltas 2100000 validators 7200 proto nodes 28.349 ms/op 28.909 ms/op 0.98
computeProposerBoostScoreFromBalances 500000 validators 3.8005 ms/op 3.7932 ms/op 1.00
computeProposerBoostScoreFromBalances 750000 validators 3.8069 ms/op 3.7894 ms/op 1.00
computeProposerBoostScoreFromBalances 1400000 validators 3.8199 ms/op 3.8957 ms/op 0.98
computeProposerBoostScoreFromBalances 2100000 validators 3.8504 ms/op 3.9825 ms/op 0.97
altair processAttestation - 250000 vs - 7PWei normalcase 2.7785 ms/op 2.6560 ms/op 1.05
altair processAttestation - 250000 vs - 7PWei worstcase 4.4444 ms/op 3.6904 ms/op 1.20
altair processAttestation - setStatus - 1/6 committees join 208.39 us/op 190.18 us/op 1.10
altair processAttestation - setStatus - 1/3 committees join 386.71 us/op 372.44 us/op 1.04
altair processAttestation - setStatus - 1/2 committees join 518.56 us/op 497.86 us/op 1.04
altair processAttestation - setStatus - 2/3 committees join 649.97 us/op 621.23 us/op 1.05
altair processAttestation - setStatus - 4/5 committees join 898.03 us/op 843.88 us/op 1.06
altair processAttestation - setStatus - 100% committees join 1.0222 ms/op 979.70 us/op 1.04
altair processBlock - 250000 vs - 7PWei normalcase 11.580 ms/op 11.370 ms/op 1.02
altair processBlock - 250000 vs - 7PWei normalcase hashState 35.662 ms/op 41.450 ms/op 0.86
altair processBlock - 250000 vs - 7PWei worstcase 39.237 ms/op 41.138 ms/op 0.95
altair processBlock - 250000 vs - 7PWei worstcase hashState 104.12 ms/op 94.107 ms/op 1.11
phase0 processBlock - 250000 vs - 7PWei normalcase 2.8570 ms/op 2.9232 ms/op 0.98
phase0 processBlock - 250000 vs - 7PWei worstcase 31.949 ms/op 32.064 ms/op 1.00
altair processEth1Data - 250000 vs - 7PWei normalcase 657.29 us/op 549.66 us/op 1.20
getExpectedWithdrawals 250000 eb:1,eth1:1,we:0,wn:0,smpl:15 15.248 us/op 14.679 us/op 1.04
getExpectedWithdrawals 250000 eb:0.95,eth1:0.1,we:0.05,wn:0,smpl:219 71.568 us/op 89.697 us/op 0.80
getExpectedWithdrawals 250000 eb:0.95,eth1:0.3,we:0.05,wn:0,smpl:42 36.470 us/op 23.843 us/op 1.53
getExpectedWithdrawals 250000 eb:0.95,eth1:0.7,we:0.05,wn:0,smpl:18 12.020 us/op 15.555 us/op 0.77
getExpectedWithdrawals 250000 eb:0.1,eth1:0.1,we:0,wn:0,smpl:1020 204.16 us/op 230.09 us/op 0.89
getExpectedWithdrawals 250000 eb:0.03,eth1:0.03,we:0,wn:0,smpl:11777 1.3039 ms/op 1.2450 ms/op 1.05
getExpectedWithdrawals 250000 eb:0.01,eth1:0.01,we:0,wn:0,smpl:16384 1.8007 ms/op 2.1923 ms/op 0.82
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,smpl:16384 1.4791 ms/op 1.9415 ms/op 0.76
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,nocache,smpl:16384 3.9541 ms/op 4.0845 ms/op 0.97
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,smpl:16384 2.5725 ms/op 3.0421 ms/op 0.85
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,nocache,smpl:16384 5.2772 ms/op 6.3500 ms/op 0.83
Tree 40 250000 create 406.20 ms/op 440.92 ms/op 0.92
Tree 40 250000 get(125000) 211.32 ns/op 220.30 ns/op 0.96
Tree 40 250000 set(125000) 1.1096 us/op 1.2141 us/op 0.91
Tree 40 250000 toArray() 23.376 ms/op 24.738 ms/op 0.94
Tree 40 250000 iterate all - toArray() + loop 24.361 ms/op 24.016 ms/op 1.01
Tree 40 250000 iterate all - get(i) 74.850 ms/op 79.580 ms/op 0.94
MutableVector 250000 create 16.995 ms/op 16.423 ms/op 1.03
MutableVector 250000 get(125000) 7.1500 ns/op 7.2730 ns/op 0.98
MutableVector 250000 set(125000) 265.16 ns/op 401.84 ns/op 0.66
MutableVector 250000 toArray() 3.6276 ms/op 6.6616 ms/op 0.54
MutableVector 250000 iterate all - toArray() + loop 3.6186 ms/op 5.3576 ms/op 0.68
MutableVector 250000 iterate all - get(i) 1.7636 ms/op 1.6242 ms/op 1.09
Array 250000 create 2.8167 ms/op 4.9630 ms/op 0.57
Array 250000 clone - spread 1.2773 ms/op 1.4097 ms/op 0.91
Array 250000 get(125000) 1.0600 ns/op 1.1970 ns/op 0.89
Array 250000 set(125000) 4.2440 ns/op 5.4780 ns/op 0.77
Array 250000 iterate all - loop 168.91 us/op 184.04 us/op 0.92
effectiveBalanceIncrements clone Uint8Array 300000 30.506 us/op 57.850 us/op 0.53
effectiveBalanceIncrements clone MutableVector 300000 368.00 ns/op 478.00 ns/op 0.77
effectiveBalanceIncrements rw all Uint8Array 300000 203.69 us/op 236.20 us/op 0.86
effectiveBalanceIncrements rw all MutableVector 300000 85.922 ms/op 152.82 ms/op 0.56
phase0 afterProcessEpoch - 250000 vs - 7PWei 114.76 ms/op 124.54 ms/op 0.92
phase0 beforeProcessEpoch - 250000 vs - 7PWei 51.983 ms/op 63.104 ms/op 0.82
altair processEpoch - mainnet_e81889 497.42 ms/op 579.11 ms/op 0.86
mainnet_e81889 - altair beforeProcessEpoch 81.504 ms/op 102.22 ms/op 0.80
mainnet_e81889 - altair processJustificationAndFinalization 15.760 us/op 26.503 us/op 0.59
mainnet_e81889 - altair processInactivityUpdates 6.1268 ms/op 6.7978 ms/op 0.90
mainnet_e81889 - altair processRewardsAndPenalties 65.165 ms/op 43.781 ms/op 1.49
mainnet_e81889 - altair processRegistryUpdates 2.7150 us/op 4.7190 us/op 0.58
mainnet_e81889 - altair processSlashings 386.00 ns/op 896.00 ns/op 0.43
mainnet_e81889 - altair processEth1DataReset 510.00 ns/op 615.00 ns/op 0.83
mainnet_e81889 - altair processEffectiveBalanceUpdates 1.4512 ms/op 1.4864 ms/op 0.98
mainnet_e81889 - altair processSlashingsReset 5.4610 us/op 7.3290 us/op 0.75
mainnet_e81889 - altair processRandaoMixesReset 5.2940 us/op 5.7620 us/op 0.92
mainnet_e81889 - altair processHistoricalRootsUpdate 581.00 ns/op 1.3390 us/op 0.43
mainnet_e81889 - altair processParticipationFlagUpdates 1.7710 us/op 3.1430 us/op 0.56
mainnet_e81889 - altair processSyncCommitteeUpdates 593.00 ns/op 942.00 ns/op 0.63
mainnet_e81889 - altair afterProcessEpoch 119.21 ms/op 127.40 ms/op 0.94
capella processEpoch - mainnet_e217614 2.2400 s/op 2.2828 s/op 0.98
mainnet_e217614 - capella beforeProcessEpoch 490.59 ms/op 525.43 ms/op 0.93
mainnet_e217614 - capella processJustificationAndFinalization 15.213 us/op 23.291 us/op 0.65
mainnet_e217614 - capella processInactivityUpdates 20.116 ms/op 27.958 ms/op 0.72
mainnet_e217614 - capella processRewardsAndPenalties 450.40 ms/op 413.86 ms/op 1.09
mainnet_e217614 - capella processRegistryUpdates 21.657 us/op 26.434 us/op 0.82
mainnet_e217614 - capella processSlashings 544.00 ns/op 578.00 ns/op 0.94
mainnet_e217614 - capella processEth1DataReset 759.00 ns/op 605.00 ns/op 1.25
mainnet_e217614 - capella processEffectiveBalanceUpdates 5.6894 ms/op 4.5327 ms/op 1.26
mainnet_e217614 - capella processSlashingsReset 4.0690 us/op 4.3500 us/op 0.94
mainnet_e217614 - capella processRandaoMixesReset 6.8420 us/op 4.6480 us/op 1.47
mainnet_e217614 - capella processHistoricalRootsUpdate 723.00 ns/op 692.00 ns/op 1.04
mainnet_e217614 - capella processParticipationFlagUpdates 2.0620 us/op 1.6380 us/op 1.26
mainnet_e217614 - capella afterProcessEpoch 337.60 ms/op 314.87 ms/op 1.07
phase0 processEpoch - mainnet_e58758 498.59 ms/op 464.67 ms/op 1.07
mainnet_e58758 - phase0 beforeProcessEpoch 156.34 ms/op 138.10 ms/op 1.13
mainnet_e58758 - phase0 processJustificationAndFinalization 15.595 us/op 19.862 us/op 0.79
mainnet_e58758 - phase0 processRewardsAndPenalties 53.080 ms/op 58.533 ms/op 0.91
mainnet_e58758 - phase0 processRegistryUpdates 9.0650 us/op 14.016 us/op 0.65
mainnet_e58758 - phase0 processSlashings 565.00 ns/op 539.00 ns/op 1.05
mainnet_e58758 - phase0 processEth1DataReset 426.00 ns/op 419.00 ns/op 1.02
mainnet_e58758 - phase0 processEffectiveBalanceUpdates 1.1651 ms/op 1.1786 ms/op 0.99
mainnet_e58758 - phase0 processSlashingsReset 3.0320 us/op 3.3910 us/op 0.89
mainnet_e58758 - phase0 processRandaoMixesReset 4.3340 us/op 4.2390 us/op 1.02
mainnet_e58758 - phase0 processHistoricalRootsUpdate 421.00 ns/op 434.00 ns/op 0.97
mainnet_e58758 - phase0 processParticipationRecordUpdates 3.3290 us/op 3.6370 us/op 0.92
mainnet_e58758 - phase0 afterProcessEpoch 95.518 ms/op 97.043 ms/op 0.98
phase0 processEffectiveBalanceUpdates - 250000 normalcase 1.3896 ms/op 1.3549 ms/op 1.03
phase0 processEffectiveBalanceUpdates - 250000 worstcase 0.5 1.5195 ms/op 1.4834 ms/op 1.02
altair processInactivityUpdates - 250000 normalcase 24.192 ms/op 25.087 ms/op 0.96
altair processInactivityUpdates - 250000 worstcase 25.641 ms/op 21.344 ms/op 1.20
phase0 processRegistryUpdates - 250000 normalcase 9.5200 us/op 12.654 us/op 0.75
phase0 processRegistryUpdates - 250000 badcase_full_deposits 313.24 us/op 455.26 us/op 0.69
phase0 processRegistryUpdates - 250000 worstcase 0.5 141.51 ms/op 136.49 ms/op 1.04
altair processRewardsAndPenalties - 250000 normalcase 53.467 ms/op 57.619 ms/op 0.93
altair processRewardsAndPenalties - 250000 worstcase 53.786 ms/op 56.031 ms/op 0.96
phase0 getAttestationDeltas - 250000 normalcase 8.8955 ms/op 10.157 ms/op 0.88
phase0 getAttestationDeltas - 250000 worstcase 8.9986 ms/op 11.209 ms/op 0.80
phase0 processSlashings - 250000 worstcase 81.639 us/op 119.55 us/op 0.68
altair processSyncCommitteeUpdates - 250000 147.31 ms/op 166.03 ms/op 0.89
BeaconState.hashTreeRoot - No change 257.00 ns/op 260.00 ns/op 0.99
BeaconState.hashTreeRoot - 1 full validator 142.25 us/op 162.11 us/op 0.88
BeaconState.hashTreeRoot - 32 full validator 1.6174 ms/op 1.5574 ms/op 1.04
BeaconState.hashTreeRoot - 512 full validator 15.754 ms/op 22.227 ms/op 0.71
BeaconState.hashTreeRoot - 1 validator.effectiveBalance 183.60 us/op 204.55 us/op 0.90
BeaconState.hashTreeRoot - 32 validator.effectiveBalance 2.1664 ms/op 2.2080 ms/op 0.98
BeaconState.hashTreeRoot - 512 validator.effectiveBalance 30.152 ms/op 26.860 ms/op 1.12
BeaconState.hashTreeRoot - 1 balances 142.23 us/op 135.77 us/op 1.05
BeaconState.hashTreeRoot - 32 balances 1.2977 ms/op 1.1851 ms/op 1.10
BeaconState.hashTreeRoot - 512 balances 13.091 ms/op 12.449 ms/op 1.05
BeaconState.hashTreeRoot - 250000 balances 231.42 ms/op 203.61 ms/op 1.14
aggregationBits - 2048 els - zipIndexesInBitList 16.758 us/op 20.642 us/op 0.81
byteArrayEquals 32 74.868 ns/op 78.072 ns/op 0.96
Buffer.compare 32 56.528 ns/op 57.505 ns/op 0.98
byteArrayEquals 1024 2.0372 us/op 2.1088 us/op 0.97
Buffer.compare 1024 72.005 ns/op 72.836 ns/op 0.99
byteArrayEquals 16384 32.631 us/op 34.299 us/op 0.95
Buffer.compare 16384 277.33 ns/op 291.39 ns/op 0.95
byteArrayEquals 123687377 247.08 ms/op 259.37 ms/op 0.95
Buffer.compare 123687377 6.0699 ms/op 8.7215 ms/op 0.70
byteArrayEquals 32 - diff last byte 72.364 ns/op 78.057 ns/op 0.93
Buffer.compare 32 - diff last byte 58.896 ns/op 58.408 ns/op 1.01
byteArrayEquals 1024 - diff last byte 2.0701 us/op 2.0826 us/op 0.99
Buffer.compare 1024 - diff last byte 71.673 ns/op 74.413 ns/op 0.96
byteArrayEquals 16384 - diff last byte 32.992 us/op 33.610 us/op 0.98
Buffer.compare 16384 - diff last byte 272.14 ns/op 288.89 ns/op 0.94
byteArrayEquals 123687377 - diff last byte 247.31 ms/op 254.44 ms/op 0.97
Buffer.compare 123687377 - diff last byte 6.4673 ms/op 8.3138 ms/op 0.78
byteArrayEquals 32 - random bytes 5.4300 ns/op 6.6520 ns/op 0.82
Buffer.compare 32 - random bytes 60.609 ns/op 64.783 ns/op 0.94
byteArrayEquals 1024 - random bytes 5.1980 ns/op 6.2450 ns/op 0.83
Buffer.compare 1024 - random bytes 60.156 ns/op 63.071 ns/op 0.95
byteArrayEquals 16384 - random bytes 5.1550 ns/op 5.4580 ns/op 0.94
Buffer.compare 16384 - random bytes 59.123 ns/op 62.293 ns/op 0.95
byteArrayEquals 123687377 - random bytes 8.3400 ns/op 8.8000 ns/op 0.95
Buffer.compare 123687377 - random bytes 62.960 ns/op 67.640 ns/op 0.93
regular array get 100000 times 44.493 us/op 46.564 us/op 0.96
wrappedArray get 100000 times 43.928 us/op 46.787 us/op 0.94
arrayWithProxy get 100000 times 14.419 ms/op 14.571 ms/op 0.99
ssz.Root.equals 51.842 ns/op 55.444 ns/op 0.94
byteArrayEquals 50.760 ns/op 60.735 ns/op 0.84
Buffer.compare 10.381 ns/op 12.373 ns/op 0.84
shuffle list - 16384 els 6.9643 ms/op 7.4408 ms/op 0.94
shuffle list - 250000 els 101.54 ms/op 105.30 ms/op 0.96
processSlot - 1 slots 16.969 us/op 18.143 us/op 0.94
processSlot - 32 slots 3.4851 ms/op 3.6951 ms/op 0.94
getEffectiveBalanceIncrementsZeroInactive - 250000 vs - 7PWei 54.756 ms/op 57.861 ms/op 0.95
getCommitteeAssignments - req 1 vs - 250000 vc 2.5165 ms/op 2.5519 ms/op 0.99
getCommitteeAssignments - req 100 vs - 250000 vc 3.7130 ms/op 3.7634 ms/op 0.99
getCommitteeAssignments - req 1000 vs - 250000 vc 4.0177 ms/op 4.0995 ms/op 0.98
findModifiedValidators - 10000 modified validators 517.26 ms/op 574.20 ms/op 0.90
findModifiedValidators - 1000 modified validators 424.77 ms/op 439.10 ms/op 0.97
findModifiedValidators - 100 modified validators 419.90 ms/op 399.85 ms/op 1.05
findModifiedValidators - 10 modified validators 411.55 ms/op 420.93 ms/op 0.98
findModifiedValidators - 1 modified validators 392.81 ms/op 406.11 ms/op 0.97
findModifiedValidators - no difference 380.74 ms/op 387.54 ms/op 0.98
compare ViewDUs 4.2149 s/op 4.8782 s/op 0.86
compare each validator Uint8Array 1.5830 s/op 2.0056 s/op 0.79
compare ViewDU to Uint8Array 1.2449 s/op 1.5338 s/op 0.81
migrate state 1000000 validators, 24 modified, 0 new 851.94 ms/op 919.84 ms/op 0.93
migrate state 1000000 validators, 1700 modified, 1000 new 1.3033 s/op 1.3200 s/op 0.99
migrate state 1000000 validators, 3400 modified, 2000 new 1.5101 s/op 1.3176 s/op 1.15
migrate state 1500000 validators, 24 modified, 0 new 804.70 ms/op 806.87 ms/op 1.00
migrate state 1500000 validators, 1700 modified, 1000 new 996.03 ms/op 1.0716 s/op 0.93
migrate state 1500000 validators, 3400 modified, 2000 new 1.2671 s/op 1.3184 s/op 0.96
RootCache.getBlockRootAtSlot - 250000 vs - 7PWei 4.3800 ns/op 4.3500 ns/op 1.01
state getBlockRootAtSlot - 250000 vs - 7PWei 518.60 ns/op 767.56 ns/op 0.68
computeProposers - vc 250000 8.7850 ms/op 9.2688 ms/op 0.95
computeEpochShuffling - vc 250000 103.50 ms/op 103.13 ms/op 1.00
getNextSyncCommittee - vc 250000 147.70 ms/op 149.52 ms/op 0.99
computeSigningRoot for AttestationData 22.192 us/op 24.399 us/op 0.91
hash AttestationData serialized data then Buffer.toString(base64) 2.3078 us/op 2.3062 us/op 1.00
toHexString serialized data 1.0952 us/op 1.0798 us/op 1.01
Buffer.toString(base64) 223.58 ns/op 216.38 ns/op 1.03

by benchmarkbot/action

@nazarhussain nazarhussain merged commit a573b92 into unstable Dec 25, 2023
13 of 14 checks passed
@nazarhussain nazarhussain deleted the nflaig/fix-e2e-tests branch December 25, 2023 15:14
@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
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