Skip to content

Commit

Permalink
test: fix flaky e2e tests (#6231)
Browse files Browse the repository at this point in the history
  • Loading branch information
nflaig authored Dec 25, 2023
1 parent 592c147 commit a573b92
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 14 deletions.
14 changes: 4 additions & 10 deletions packages/cli/test/utils/runUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,14 @@ export function findApiToken(dirpath: string): string {
}

export function expectDeepEquals<T>(a: T, b: T, message: string): void {
try {
expect(a).toEqual(b);
} catch (e) {
expect.fail(message);
}
expect(a).toEqualWithMessage(b, message);
}

/**
* Similar to `expectDeepEquals` but only checks presence of all elements in array, irrespective of their order.
*/
export function expectDeepEqualsUnordered<T>(a: T[], b: T[], message: string): void {
try {
expect(a.sort()).toEqual(b.sort());
} catch (e) {
expect.fail(message);
}
expect(a).toEqualWithMessage(expect.arrayContaining(b), message);
expect(b).toEqualWithMessage(expect.arrayContaining(a), message);
expect(a).toHaveLength(b.length);
}
12 changes: 8 additions & 4 deletions scripts/vitest/customMatchers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,40 +42,44 @@ expect.extend({
toBeWithMessage(received: unknown, expected: unknown, message: string) {
if (Object.is(received, expected)) {
return {
message: () => "Expected value is truthy",
message: () => "Received value is the same as expected value",
pass: true,
};
}

return {
pass: false,
message: () => message,
actual: received,
expected,
};
},
toSatisfy(received: unknown, func: (received: unknown) => boolean) {
if (func(received)) {
return {
message: () => "Expected value satisfied the condition",
message: () => "Received value satisfied the condition",
pass: true,
};
}

return {
pass: false,
message: () => "Expected value did not satisfy the condition",
message: () => "Received value did not satisfy the condition",
};
},
toEqualWithMessage(received: unknown, expected: unknown, message: string) {
if (this.equals(received, expected)) {
return {
message: () => "Expected value is truthy",
message: () => "Received value equals expected value",
pass: true,
};
}

return {
pass: false,
message: () => message,
actual: received,
expected,
};
},
});

1 comment on commit a573b92

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Performance Alert ⚠️

Possible performance regression was detected for some benchmarks.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold.

Benchmark suite Current: a573b92 Previous: 592c147 Ratio
getSlashingsAndExits - default max 301.62 us/op 92.657 us/op 3.26
Set add up to 128 items then delete middle 10.662 us/op 3.4628 us/op 3.08
altair processEth1Data - 250000 vs - 7PWei normalcase 2.2905 ms/op 293.45 us/op 7.81
Full benchmark results
Benchmark suite Current: a573b92 Previous: 592c147 Ratio
getPubkeys - index2pubkey - req 1000 vs - 250000 vc 569.88 us/op 907.02 us/op 0.63
getPubkeys - validatorsArr - req 1000 vs - 250000 vc 97.373 us/op 49.748 us/op 1.96
BLS verify - blst-native 1.3183 ms/op 1.0506 ms/op 1.25
BLS verifyMultipleSignatures 3 - blst-native 2.7655 ms/op 2.2425 ms/op 1.23
BLS verifyMultipleSignatures 8 - blst-native 6.0616 ms/op 4.9645 ms/op 1.22
BLS verifyMultipleSignatures 32 - blst-native 22.234 ms/op 18.247 ms/op 1.22
BLS verifyMultipleSignatures 64 - blst-native 44.013 ms/op 35.953 ms/op 1.22
BLS verifyMultipleSignatures 128 - blst-native 86.956 ms/op 71.369 ms/op 1.22
BLS deserializing 10000 signatures 939.38 ms/op 787.65 ms/op 1.19
BLS deserializing 100000 signatures 9.5140 s/op 8.0244 s/op 1.19
BLS verifyMultipleSignatures - same message - 3 - blst-native 1.3425 ms/op 1.1342 ms/op 1.18
BLS verifyMultipleSignatures - same message - 8 - blst-native 1.5223 ms/op 1.2849 ms/op 1.18
BLS verifyMultipleSignatures - same message - 32 - blst-native 2.3629 ms/op 2.0209 ms/op 1.17
BLS verifyMultipleSignatures - same message - 64 - blst-native 4.5487 ms/op 3.8664 ms/op 1.18
BLS verifyMultipleSignatures - same message - 128 - blst-native 7.4112 ms/op 4.7827 ms/op 1.55
BLS aggregatePubkeys 32 - blst-native 28.061 us/op 21.803 us/op 1.29
BLS aggregatePubkeys 128 - blst-native 101.52 us/op 84.720 us/op 1.20
getAttestationsForBlock 52.492 ms/op 35.122 ms/op 1.49
getSlashingsAndExits - default max 301.62 us/op 92.657 us/op 3.26
getSlashingsAndExits - 2k 408.65 us/op 297.23 us/op 1.37
proposeBlockBody type=full, size=empty 5.4203 ms/op 3.8611 ms/op 1.40
isKnown best case - 1 super set check 541.00 ns/op 324.00 ns/op 1.67
isKnown normal case - 2 super set checks 350.00 ns/op 336.00 ns/op 1.04
isKnown worse case - 16 super set checks 356.00 ns/op 356.00 ns/op 1.00
CheckpointStateCache - add get delete 5.9620 us/op 3.6510 us/op 1.63
validate api signedAggregateAndProof - struct 2.8142 ms/op 2.3322 ms/op 1.21
validate gossip signedAggregateAndProof - struct 2.8427 ms/op 2.3889 ms/op 1.19
validate gossip attestation - vc 640000 1.3889 ms/op 1.1377 ms/op 1.22
batch validate gossip attestation - vc 640000 - chunk 32 168.92 us/op 132.73 us/op 1.27
batch validate gossip attestation - vc 640000 - chunk 64 147.69 us/op 118.81 us/op 1.24
batch validate gossip attestation - vc 640000 - chunk 128 139.21 us/op 113.37 us/op 1.23
batch validate gossip attestation - vc 640000 - chunk 256 130.14 us/op 108.21 us/op 1.20
pickEth1Vote - no votes 1.1896 ms/op 928.88 us/op 1.28
pickEth1Vote - max votes 9.2334 ms/op 8.9913 ms/op 1.03
pickEth1Vote - Eth1Data hashTreeRoot value x2048 15.726 ms/op 21.102 ms/op 0.75
pickEth1Vote - Eth1Data hashTreeRoot tree x2048 24.651 ms/op 28.910 ms/op 0.85
pickEth1Vote - Eth1Data fastSerialize value x2048 586.53 us/op 431.60 us/op 1.36
pickEth1Vote - Eth1Data fastSerialize tree x2048 4.9317 ms/op 7.3803 ms/op 0.67
bytes32 toHexString 509.00 ns/op 432.00 ns/op 1.18
bytes32 Buffer.toString(hex) 282.00 ns/op 300.00 ns/op 0.94
bytes32 Buffer.toString(hex) from Uint8Array 467.00 ns/op 418.00 ns/op 1.12
bytes32 Buffer.toString(hex) + 0x 290.00 ns/op 301.00 ns/op 0.96
Object access 1 prop 0.15800 ns/op 0.18600 ns/op 0.85
Map access 1 prop 0.14500 ns/op 0.17600 ns/op 0.82
Object get x1000 7.6440 ns/op 4.7410 ns/op 1.61
Map get x1000 0.80200 ns/op 0.69100 ns/op 1.16
Object set x1000 53.806 ns/op 25.133 ns/op 2.14
Map set x1000 41.964 ns/op 17.015 ns/op 2.47
Return object 10000 times 0.24220 ns/op 0.21230 ns/op 1.14
Throw Error 10000 times 3.9846 us/op 2.6206 us/op 1.52
fastMsgIdFn sha256 / 200 bytes 3.3130 us/op 1.8310 us/op 1.81
fastMsgIdFn h32 xxhash / 200 bytes 321.00 ns/op 278.00 ns/op 1.15
fastMsgIdFn h64 xxhash / 200 bytes 366.00 ns/op 347.00 ns/op 1.05
fastMsgIdFn sha256 / 1000 bytes 11.639 us/op 5.9010 us/op 1.97
fastMsgIdFn h32 xxhash / 1000 bytes 443.00 ns/op 390.00 ns/op 1.14
fastMsgIdFn h64 xxhash / 1000 bytes 450.00 ns/op 407.00 ns/op 1.11
fastMsgIdFn sha256 / 10000 bytes 105.45 us/op 49.835 us/op 2.12
fastMsgIdFn h32 xxhash / 10000 bytes 1.9720 us/op 1.6950 us/op 1.16
fastMsgIdFn h64 xxhash / 10000 bytes 1.3680 us/op 1.1640 us/op 1.18
send data - 1000 256B messages 20.568 ms/op 12.698 ms/op 1.62
send data - 1000 512B messages 28.260 ms/op 15.088 ms/op 1.87
send data - 1000 1024B messages 41.192 ms/op 22.395 ms/op 1.84
send data - 1000 1200B messages 39.193 ms/op 28.314 ms/op 1.38
send data - 1000 2048B messages 43.609 ms/op 33.459 ms/op 1.30
send data - 1000 4096B messages 41.686 ms/op 30.064 ms/op 1.39
send data - 1000 16384B messages 119.99 ms/op 91.277 ms/op 1.31
send data - 1000 65536B messages 460.13 ms/op 434.23 ms/op 1.06
enrSubnets - fastDeserialize 64 bits 1.4160 us/op 914.00 ns/op 1.55
enrSubnets - ssz BitVector 64 bits 464.00 ns/op 417.00 ns/op 1.11
enrSubnets - fastDeserialize 4 bits 186.00 ns/op 195.00 ns/op 0.95
enrSubnets - ssz BitVector 4 bits 432.00 ns/op 417.00 ns/op 1.04
prioritizePeers score -10:0 att 32-0.1 sync 2-0 111.68 us/op 86.072 us/op 1.30
prioritizePeers score 0:0 att 32-0.25 sync 2-0.25 137.22 us/op 83.762 us/op 1.64
prioritizePeers score 0:0 att 32-0.5 sync 2-0.5 182.55 us/op 110.26 us/op 1.66
prioritizePeers score 0:0 att 64-0.75 sync 4-0.75 327.55 us/op 196.54 us/op 1.67
prioritizePeers score 0:0 att 64-1 sync 4-1 367.56 us/op 213.95 us/op 1.72
array of 16000 items push then shift 1.6673 us/op 1.2363 us/op 1.35
LinkedList of 16000 items push then shift 9.3710 ns/op 6.6490 ns/op 1.41
array of 16000 items push then pop 95.692 ns/op 60.947 ns/op 1.57
LinkedList of 16000 items push then pop 8.8160 ns/op 5.5550 ns/op 1.59
array of 24000 items push then shift 2.4210 us/op 1.7899 us/op 1.35
LinkedList of 24000 items push then shift 9.1720 ns/op 6.1690 ns/op 1.49
array of 24000 items push then pop 139.19 ns/op 87.948 ns/op 1.58
LinkedList of 24000 items push then pop 8.7180 ns/op 5.5090 ns/op 1.58
intersect bitArray bitLen 8 6.4450 ns/op 4.6060 ns/op 1.40
intersect array and set length 8 68.093 ns/op 46.786 ns/op 1.46
intersect bitArray bitLen 128 34.434 ns/op 26.241 ns/op 1.31
intersect array and set length 128 974.22 ns/op 676.42 ns/op 1.44
bitArray.getTrueBitIndexes() bitLen 128 1.6100 us/op 1.1840 us/op 1.36
bitArray.getTrueBitIndexes() bitLen 248 3.0420 us/op 1.9530 us/op 1.56
bitArray.getTrueBitIndexes() bitLen 512 5.2280 us/op 3.7820 us/op 1.38
Buffer.concat 32 items 1.0530 us/op 942.00 ns/op 1.12
Uint8Array.set 32 items 2.9280 us/op 1.8590 us/op 1.58
Set add up to 64 items then delete first 4.4680 us/op 1.6606 us/op 2.69
OrderedSet add up to 64 items then delete first 5.8232 us/op 2.4917 us/op 2.34
Set add up to 64 items then delete last 5.0080 us/op 1.8652 us/op 2.68
OrderedSet add up to 64 items then delete last 6.2607 us/op 2.7697 us/op 2.26
Set add up to 64 items then delete middle 5.2150 us/op 1.8235 us/op 2.86
OrderedSet add up to 64 items then delete middle 7.6162 us/op 3.8760 us/op 1.96
Set add up to 128 items then delete first 10.001 us/op 3.6117 us/op 2.77
OrderedSet add up to 128 items then delete first 12.956 us/op 5.6915 us/op 2.28
Set add up to 128 items then delete last 10.347 us/op 3.4862 us/op 2.97
OrderedSet add up to 128 items then delete last 13.708 us/op 5.2551 us/op 2.61
Set add up to 128 items then delete middle 10.662 us/op 3.4628 us/op 3.08
OrderedSet add up to 128 items then delete middle 17.644 us/op 10.009 us/op 1.76
Set add up to 256 items then delete first 20.355 us/op 7.1028 us/op 2.87
OrderedSet add up to 256 items then delete first 25.617 us/op 11.743 us/op 2.18
Set add up to 256 items then delete last 18.542 us/op 7.0369 us/op 2.63
OrderedSet add up to 256 items then delete last 23.853 us/op 10.858 us/op 2.20
Set add up to 256 items then delete middle 18.303 us/op 6.9565 us/op 2.63
OrderedSet add up to 256 items then delete middle 47.112 us/op 32.881 us/op 1.43
transfer serialized Status (84 B) 1.7420 us/op 1.3690 us/op 1.27
copy serialized Status (84 B) 1.4810 us/op 1.3600 us/op 1.09
transfer serialized SignedVoluntaryExit (112 B) 1.8770 us/op 1.7630 us/op 1.06
copy serialized SignedVoluntaryExit (112 B) 1.5180 us/op 1.5190 us/op 1.00
transfer serialized ProposerSlashing (416 B) 2.0270 us/op 2.7530 us/op 0.74
copy serialized ProposerSlashing (416 B) 1.8510 us/op 2.9360 us/op 0.63
transfer serialized Attestation (485 B) 2.0480 us/op 2.4270 us/op 0.84
copy serialized Attestation (485 B) 1.8750 us/op 2.5710 us/op 0.73
transfer serialized AttesterSlashing (33232 B) 2.2190 us/op 2.4120 us/op 0.92
copy serialized AttesterSlashing (33232 B) 6.0950 us/op 4.6730 us/op 1.30
transfer serialized Small SignedBeaconBlock (128000 B) 2.7060 us/op 3.1210 us/op 0.87
copy serialized Small SignedBeaconBlock (128000 B) 17.731 us/op 9.2370 us/op 1.92
transfer serialized Avg SignedBeaconBlock (200000 B) 3.0920 us/op 2.5030 us/op 1.24
copy serialized Avg SignedBeaconBlock (200000 B) 27.432 us/op 13.107 us/op 2.09
transfer serialized BlobsSidecar (524380 B) 3.0030 us/op 2.9100 us/op 1.03
copy serialized BlobsSidecar (524380 B) 89.724 us/op 74.740 us/op 1.20
transfer serialized Big SignedBeaconBlock (1000000 B) 3.0740 us/op 3.2290 us/op 0.95
copy serialized Big SignedBeaconBlock (1000000 B) 208.84 us/op 161.18 us/op 1.30
pass gossip attestations to forkchoice per slot 4.4864 ms/op 2.7191 ms/op 1.65
forkChoice updateHead vc 100000 bc 64 eq 0 705.73 us/op 516.77 us/op 1.37
forkChoice updateHead vc 600000 bc 64 eq 0 4.4359 ms/op 2.5958 ms/op 1.71
forkChoice updateHead vc 1000000 bc 64 eq 0 7.4063 ms/op 4.4349 ms/op 1.67
forkChoice updateHead vc 600000 bc 320 eq 0 4.1485 ms/op 2.5843 ms/op 1.61
forkChoice updateHead vc 600000 bc 1200 eq 0 4.2844 ms/op 2.6518 ms/op 1.62
forkChoice updateHead vc 600000 bc 7200 eq 0 5.4257 ms/op 3.2864 ms/op 1.65
forkChoice updateHead vc 600000 bc 64 eq 1000 11.375 ms/op 9.4540 ms/op 1.20
forkChoice updateHead vc 600000 bc 64 eq 10000 12.191 ms/op 9.7975 ms/op 1.24
forkChoice updateHead vc 600000 bc 64 eq 300000 17.353 ms/op 11.592 ms/op 1.50
computeDeltas 500000 validators 300 proto nodes 6.6254 ms/op 2.9815 ms/op 2.22
computeDeltas 500000 validators 1200 proto nodes 6.4975 ms/op 2.8968 ms/op 2.24
computeDeltas 500000 validators 7200 proto nodes 6.4665 ms/op 2.8940 ms/op 2.23
computeDeltas 750000 validators 300 proto nodes 9.7886 ms/op 4.4529 ms/op 2.20
computeDeltas 750000 validators 1200 proto nodes 9.4271 ms/op 4.4744 ms/op 2.11
computeDeltas 750000 validators 7200 proto nodes 9.7401 ms/op 4.4220 ms/op 2.20
computeDeltas 1400000 validators 300 proto nodes 18.654 ms/op 8.5677 ms/op 2.18
computeDeltas 1400000 validators 1200 proto nodes 19.300 ms/op 8.5956 ms/op 2.25
computeDeltas 1400000 validators 7200 proto nodes 19.209 ms/op 8.5750 ms/op 2.24
computeDeltas 2100000 validators 300 proto nodes 27.465 ms/op 12.945 ms/op 2.12
computeDeltas 2100000 validators 1200 proto nodes 28.110 ms/op 13.205 ms/op 2.13
computeDeltas 2100000 validators 7200 proto nodes 27.744 ms/op 13.107 ms/op 2.12
computeProposerBoostScoreFromBalances 500000 validators 3.7654 ms/op 3.2951 ms/op 1.14
computeProposerBoostScoreFromBalances 750000 validators 3.7069 ms/op 3.0830 ms/op 1.20
computeProposerBoostScoreFromBalances 1400000 validators 3.7674 ms/op 3.1155 ms/op 1.21
computeProposerBoostScoreFromBalances 2100000 validators 3.7611 ms/op 3.1300 ms/op 1.20
altair processAttestation - 250000 vs - 7PWei normalcase 2.3588 ms/op 1.4480 ms/op 1.63
altair processAttestation - 250000 vs - 7PWei worstcase 3.2895 ms/op 2.2185 ms/op 1.48
altair processAttestation - setStatus - 1/6 committees join 145.79 us/op 74.151 us/op 1.97
altair processAttestation - setStatus - 1/3 committees join 287.50 us/op 134.65 us/op 2.14
altair processAttestation - setStatus - 1/2 committees join 387.29 us/op 194.80 us/op 1.99
altair processAttestation - setStatus - 2/3 committees join 486.07 us/op 255.19 us/op 1.90
altair processAttestation - setStatus - 4/5 committees join 686.13 us/op 377.53 us/op 1.82
altair processAttestation - setStatus - 100% committees join 792.61 us/op 478.52 us/op 1.66
altair processBlock - 250000 vs - 7PWei normalcase 11.098 ms/op 9.0862 ms/op 1.22
altair processBlock - 250000 vs - 7PWei normalcase hashState 38.275 ms/op 31.901 ms/op 1.20
altair processBlock - 250000 vs - 7PWei worstcase 39.286 ms/op 32.970 ms/op 1.19
altair processBlock - 250000 vs - 7PWei worstcase hashState 94.246 ms/op 77.738 ms/op 1.21
phase0 processBlock - 250000 vs - 7PWei normalcase 2.5307 ms/op 2.6466 ms/op 0.96
phase0 processBlock - 250000 vs - 7PWei worstcase 31.068 ms/op 25.212 ms/op 1.23
altair processEth1Data - 250000 vs - 7PWei normalcase 2.2905 ms/op 293.45 us/op 7.81
getExpectedWithdrawals 250000 eb:1,eth1:1,we:0,wn:0,smpl:15 13.683 us/op 12.191 us/op 1.12
getExpectedWithdrawals 250000 eb:0.95,eth1:0.1,we:0.05,wn:0,smpl:219 73.955 us/op 65.322 us/op 1.13
getExpectedWithdrawals 250000 eb:0.95,eth1:0.3,we:0.05,wn:0,smpl:42 21.236 us/op 9.4610 us/op 2.24
getExpectedWithdrawals 250000 eb:0.95,eth1:0.7,we:0.05,wn:0,smpl:18 8.0780 us/op 5.0970 us/op 1.58
getExpectedWithdrawals 250000 eb:0.1,eth1:0.1,we:0,wn:0,smpl:1020 196.94 us/op 92.489 us/op 2.13
getExpectedWithdrawals 250000 eb:0.03,eth1:0.03,we:0,wn:0,smpl:11777 1.3288 ms/op 1.1565 ms/op 1.15
getExpectedWithdrawals 250000 eb:0.01,eth1:0.01,we:0,wn:0,smpl:16384 2.0042 ms/op 1.2487 ms/op 1.61
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,smpl:16384 1.5548 ms/op 973.66 us/op 1.60
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,nocache,smpl:16384 4.2498 ms/op 2.7283 ms/op 1.56
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,smpl:16384 2.4872 ms/op 1.4546 ms/op 1.71
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,nocache,smpl:16384 5.1395 ms/op 3.8200 ms/op 1.35
Tree 40 250000 create 372.63 ms/op 255.33 ms/op 1.46
Tree 40 250000 get(125000) 207.54 ns/op 101.27 ns/op 2.05
Tree 40 250000 set(125000) 1.0446 us/op 778.05 ns/op 1.34
Tree 40 250000 toArray() 19.763 ms/op 16.079 ms/op 1.23
Tree 40 250000 iterate all - toArray() + loop 22.287 ms/op 17.400 ms/op 1.28
Tree 40 250000 iterate all - get(i) 70.759 ms/op 44.917 ms/op 1.58
MutableVector 250000 create 14.189 ms/op 9.0659 ms/op 1.57
MutableVector 250000 get(125000) 6.5090 ns/op 5.3240 ns/op 1.22
MutableVector 250000 set(125000) 294.44 ns/op 191.32 ns/op 1.54
MutableVector 250000 toArray() 4.5655 ms/op 2.3283 ms/op 1.96
MutableVector 250000 iterate all - toArray() + loop 4.5273 ms/op 2.4078 ms/op 1.88
MutableVector 250000 iterate all - get(i) 1.6001 ms/op 1.3307 ms/op 1.20
Array 250000 create 3.7108 ms/op 2.1078 ms/op 1.76
Array 250000 clone - spread 1.2741 ms/op 1.0841 ms/op 1.18
Array 250000 get(125000) 1.0630 ns/op 1.0160 ns/op 1.05
Array 250000 set(125000) 4.2580 ns/op 1.2190 ns/op 3.49
Array 250000 iterate all - loop 173.52 us/op 153.15 us/op 1.13
effectiveBalanceIncrements clone Uint8Array 300000 30.980 us/op 13.355 us/op 2.32
effectiveBalanceIncrements clone MutableVector 300000 359.00 ns/op 398.00 ns/op 0.90
effectiveBalanceIncrements rw all Uint8Array 300000 203.36 us/op 182.93 us/op 1.11
effectiveBalanceIncrements rw all MutableVector 300000 79.271 ms/op 64.071 ms/op 1.24
phase0 afterProcessEpoch - 250000 vs - 7PWei 113.33 ms/op 73.057 ms/op 1.55
phase0 beforeProcessEpoch - 250000 vs - 7PWei 51.709 ms/op 43.696 ms/op 1.18
altair processEpoch - mainnet_e81889 508.87 ms/op 411.80 ms/op 1.24
mainnet_e81889 - altair beforeProcessEpoch 82.448 ms/op 65.525 ms/op 1.26
mainnet_e81889 - altair processJustificationAndFinalization 14.068 us/op 6.4160 us/op 2.19
mainnet_e81889 - altair processInactivityUpdates 6.0199 ms/op 3.9963 ms/op 1.51
mainnet_e81889 - altair processRewardsAndPenalties 64.212 ms/op 59.768 ms/op 1.07
mainnet_e81889 - altair processRegistryUpdates 2.5380 us/op 2.0420 us/op 1.24
mainnet_e81889 - altair processSlashings 504.00 ns/op 654.00 ns/op 0.77
mainnet_e81889 - altair processEth1DataReset 460.00 ns/op 543.00 ns/op 0.85
mainnet_e81889 - altair processEffectiveBalanceUpdates 1.4277 ms/op 1.7551 ms/op 0.81
mainnet_e81889 - altair processSlashingsReset 3.4340 us/op 2.5220 us/op 1.36
mainnet_e81889 - altair processRandaoMixesReset 4.2230 us/op 3.2740 us/op 1.29
mainnet_e81889 - altair processHistoricalRootsUpdate 682.00 ns/op 847.00 ns/op 0.81
mainnet_e81889 - altair processParticipationFlagUpdates 1.9570 us/op 1.8350 us/op 1.07
mainnet_e81889 - altair processSyncCommitteeUpdates 1.2970 us/op 601.00 ns/op 2.16
mainnet_e81889 - altair afterProcessEpoch 118.71 ms/op 76.094 ms/op 1.56
capella processEpoch - mainnet_e217614 2.1016 s/op 1.8391 s/op 1.14
mainnet_e217614 - capella beforeProcessEpoch 495.10 ms/op 423.99 ms/op 1.17
mainnet_e217614 - capella processJustificationAndFinalization 14.889 us/op 8.6740 us/op 1.72
mainnet_e217614 - capella processInactivityUpdates 20.813 ms/op 13.127 ms/op 1.59
mainnet_e217614 - capella processRewardsAndPenalties 421.04 ms/op 356.26 ms/op 1.18
mainnet_e217614 - capella processRegistryUpdates 21.241 us/op 18.422 us/op 1.15
mainnet_e217614 - capella processSlashings 569.00 ns/op 536.00 ns/op 1.06
mainnet_e217614 - capella processEth1DataReset 438.00 ns/op 643.00 ns/op 0.68
mainnet_e217614 - capella processEffectiveBalanceUpdates 4.1553 ms/op 4.6015 ms/op 0.90
mainnet_e217614 - capella processSlashingsReset 3.3590 us/op 2.9050 us/op 1.16
mainnet_e217614 - capella processRandaoMixesReset 5.2720 us/op 3.2250 us/op 1.63
mainnet_e217614 - capella processHistoricalRootsUpdate 574.00 ns/op 638.00 ns/op 0.90
mainnet_e217614 - capella processParticipationFlagUpdates 2.1580 us/op 1.7640 us/op 1.22
mainnet_e217614 - capella afterProcessEpoch 321.80 ms/op 194.91 ms/op 1.65
phase0 processEpoch - mainnet_e58758 409.14 ms/op 410.08 ms/op 1.00
mainnet_e58758 - phase0 beforeProcessEpoch 111.59 ms/op 102.86 ms/op 1.08
mainnet_e58758 - phase0 processJustificationAndFinalization 16.402 us/op 10.950 us/op 1.50
mainnet_e58758 - phase0 processRewardsAndPenalties 55.535 ms/op 50.957 ms/op 1.09
mainnet_e58758 - phase0 processRegistryUpdates 8.9690 us/op 7.0530 us/op 1.27
mainnet_e58758 - phase0 processSlashings 525.00 ns/op 649.00 ns/op 0.81
mainnet_e58758 - phase0 processEth1DataReset 381.00 ns/op 487.00 ns/op 0.78
mainnet_e58758 - phase0 processEffectiveBalanceUpdates 1.1288 ms/op 1.4023 ms/op 0.81
mainnet_e58758 - phase0 processSlashingsReset 3.0370 us/op 2.0230 us/op 1.50
mainnet_e58758 - phase0 processRandaoMixesReset 4.1120 us/op 2.8320 us/op 1.45
mainnet_e58758 - phase0 processHistoricalRootsUpdate 408.00 ns/op 514.00 ns/op 0.79
mainnet_e58758 - phase0 processParticipationRecordUpdates 3.7310 us/op 2.8550 us/op 1.31
mainnet_e58758 - phase0 afterProcessEpoch 96.141 ms/op 60.067 ms/op 1.60
phase0 processEffectiveBalanceUpdates - 250000 normalcase 1.3618 ms/op 1.6740 ms/op 0.81
phase0 processEffectiveBalanceUpdates - 250000 worstcase 0.5 1.4536 ms/op 1.0873 ms/op 1.34
altair processInactivityUpdates - 250000 normalcase 26.291 ms/op 22.680 ms/op 1.16
altair processInactivityUpdates - 250000 worstcase 21.037 ms/op 22.261 ms/op 0.95
phase0 processRegistryUpdates - 250000 normalcase 8.4380 us/op 3.4300 us/op 2.46
phase0 processRegistryUpdates - 250000 badcase_full_deposits 335.46 us/op 390.30 us/op 0.86
phase0 processRegistryUpdates - 250000 worstcase 0.5 139.02 ms/op 127.75 ms/op 1.09
altair processRewardsAndPenalties - 250000 normalcase 55.279 ms/op 59.381 ms/op 0.93
altair processRewardsAndPenalties - 250000 worstcase 57.016 ms/op 58.324 ms/op 0.98
phase0 getAttestationDeltas - 250000 normalcase 8.7592 ms/op 5.6716 ms/op 1.54
phase0 getAttestationDeltas - 250000 worstcase 8.8759 ms/op 5.6654 ms/op 1.57
phase0 processSlashings - 250000 worstcase 81.217 us/op 83.052 us/op 0.98
altair processSyncCommitteeUpdates - 250000 154.61 ms/op 120.30 ms/op 1.29
BeaconState.hashTreeRoot - No change 235.00 ns/op 323.00 ns/op 0.73
BeaconState.hashTreeRoot - 1 full validator 144.14 us/op 144.40 us/op 1.00
BeaconState.hashTreeRoot - 32 full validator 1.7182 ms/op 1.7379 ms/op 0.99
BeaconState.hashTreeRoot - 512 full validator 17.753 ms/op 14.698 ms/op 1.21
BeaconState.hashTreeRoot - 1 validator.effectiveBalance 188.77 us/op 162.05 us/op 1.16
BeaconState.hashTreeRoot - 32 validator.effectiveBalance 2.0371 ms/op 1.9621 ms/op 1.04
BeaconState.hashTreeRoot - 512 validator.effectiveBalance 32.511 ms/op 29.319 ms/op 1.11
BeaconState.hashTreeRoot - 1 balances 131.57 us/op 126.88 us/op 1.04
BeaconState.hashTreeRoot - 32 balances 1.1833 ms/op 950.00 us/op 1.25
BeaconState.hashTreeRoot - 512 balances 12.551 ms/op 9.5242 ms/op 1.32
BeaconState.hashTreeRoot - 250000 balances 198.64 ms/op 154.08 ms/op 1.29
aggregationBits - 2048 els - zipIndexesInBitList 16.896 us/op 10.487 us/op 1.61
byteArrayEquals 32 72.981 ns/op 63.985 ns/op 1.14
Buffer.compare 32 54.436 ns/op 38.764 ns/op 1.40
byteArrayEquals 1024 1.9920 us/op 1.7406 us/op 1.14
Buffer.compare 1024 69.102 ns/op 46.018 ns/op 1.50
byteArrayEquals 16384 31.694 us/op 27.660 us/op 1.15
Buffer.compare 16384 253.23 ns/op 230.80 ns/op 1.10
byteArrayEquals 123687377 241.47 ms/op 207.94 ms/op 1.16
Buffer.compare 123687377 6.0414 ms/op 3.7136 ms/op 1.63
byteArrayEquals 32 - diff last byte 70.457 ns/op 61.464 ns/op 1.15
Buffer.compare 32 - diff last byte 55.419 ns/op 39.006 ns/op 1.42
byteArrayEquals 1024 - diff last byte 2.0102 us/op 1.7440 us/op 1.15
Buffer.compare 1024 - diff last byte 71.127 ns/op 47.193 ns/op 1.51
byteArrayEquals 16384 - diff last byte 32.084 us/op 27.807 us/op 1.15
Buffer.compare 16384 - diff last byte 263.82 ns/op 220.08 ns/op 1.20
byteArrayEquals 123687377 - diff last byte 244.34 ms/op 206.00 ms/op 1.19
Buffer.compare 123687377 - diff last byte 6.0693 ms/op 4.0857 ms/op 1.49
byteArrayEquals 32 - random bytes 5.3680 ns/op 4.5160 ns/op 1.19
Buffer.compare 32 - random bytes 60.135 ns/op 40.050 ns/op 1.50
byteArrayEquals 1024 - random bytes 5.1270 ns/op 4.3570 ns/op 1.18
Buffer.compare 1024 - random bytes 59.531 ns/op 37.933 ns/op 1.57
byteArrayEquals 16384 - random bytes 5.1290 ns/op 4.3690 ns/op 1.17
Buffer.compare 16384 - random bytes 59.570 ns/op 37.882 ns/op 1.57
byteArrayEquals 123687377 - random bytes 8.2200 ns/op 7.6400 ns/op 1.08
Buffer.compare 123687377 - random bytes 62.700 ns/op 41.260 ns/op 1.52
regular array get 100000 times 43.849 us/op 40.550 us/op 1.08
wrappedArray get 100000 times 43.798 us/op 40.457 us/op 1.08
arrayWithProxy get 100000 times 14.018 ms/op 10.322 ms/op 1.36
ssz.Root.equals 53.198 ns/op 54.596 ns/op 0.97
byteArrayEquals 52.418 ns/op 53.374 ns/op 0.98
Buffer.compare 10.790 ns/op 9.5080 ns/op 1.13
shuffle list - 16384 els 6.8452 ms/op 4.5352 ms/op 1.51
shuffle list - 250000 els 100.59 ms/op 67.637 ms/op 1.49
processSlot - 1 slots 16.569 us/op 14.281 us/op 1.16
processSlot - 32 slots 3.0915 ms/op 2.7485 ms/op 1.12
getEffectiveBalanceIncrementsZeroInactive - 250000 vs - 7PWei 58.115 ms/op 51.186 ms/op 1.14
getCommitteeAssignments - req 1 vs - 250000 vc 2.4590 ms/op 2.2252 ms/op 1.11
getCommitteeAssignments - req 100 vs - 250000 vc 3.6279 ms/op 3.2855 ms/op 1.10
getCommitteeAssignments - req 1000 vs - 250000 vc 3.9492 ms/op 3.5894 ms/op 1.10
findModifiedValidators - 10000 modified validators 526.14 ms/op 419.57 ms/op 1.25
findModifiedValidators - 1000 modified validators 406.59 ms/op 323.61 ms/op 1.26
findModifiedValidators - 100 modified validators 423.96 ms/op 297.64 ms/op 1.42
findModifiedValidators - 10 modified validators 402.55 ms/op 297.55 ms/op 1.35
findModifiedValidators - 1 modified validators 397.47 ms/op 288.07 ms/op 1.38
findModifiedValidators - no difference 374.68 ms/op 323.10 ms/op 1.16
compare ViewDUs 4.2899 s/op 3.9315 s/op 1.09
compare each validator Uint8Array 1.6871 s/op 1.6450 s/op 1.03
compare ViewDU to Uint8Array 1.2342 s/op 746.93 ms/op 1.65
migrate state 1000000 validators, 24 modified, 0 new 824.13 ms/op 758.48 ms/op 1.09
migrate state 1000000 validators, 1700 modified, 1000 new 1.0539 s/op 966.06 ms/op 1.09
migrate state 1000000 validators, 3400 modified, 2000 new 1.2825 s/op 1.1745 s/op 1.09
migrate state 1500000 validators, 24 modified, 0 new 756.61 ms/op 738.90 ms/op 1.02
migrate state 1500000 validators, 1700 modified, 1000 new 1.0864 s/op 998.45 ms/op 1.09
migrate state 1500000 validators, 3400 modified, 2000 new 1.3212 s/op 1.1351 s/op 1.16
RootCache.getBlockRootAtSlot - 250000 vs - 7PWei 4.1500 ns/op 4.2300 ns/op 0.98
state getBlockRootAtSlot - 250000 vs - 7PWei 742.98 ns/op 862.94 ns/op 0.86
computeProposers - vc 250000 9.3798 ms/op 6.5636 ms/op 1.43
computeEpochShuffling - vc 250000 101.72 ms/op 65.894 ms/op 1.54
getNextSyncCommittee - vc 250000 153.65 ms/op 110.79 ms/op 1.39
computeSigningRoot for AttestationData 25.565 us/op 27.931 us/op 0.92
hash AttestationData serialized data then Buffer.toString(base64) 2.2502 us/op 1.1564 us/op 1.95
toHexString serialized data 1.0326 us/op 746.89 ns/op 1.38
Buffer.toString(base64) 204.27 ns/op 152.70 ns/op 1.34

Please sign in to comment.