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

fix: chunkIntoN to chunk correctly #6035

Merged
merged 7 commits into from
Oct 12, 2023
Merged

Conversation

nazarhussain
Copy link
Contributor

Motivation

Fix the chunk size helper.

Description

  • The function is used handling the batch request handling
  • Earlier the chunkSize helper was using the wrong chunk size

Steps to test or reproduce

Run all tests

* FIX: fixed chunkIntoN to chunk correctly

chunkIntoN was chunking into N chunks, however it is used to chunk eth_getCode and eth_getProof responses into chunks of 2, so the desired action should be to chunk into chunks of length N
https://github.com/ChainSafe/lodestar/blob/unstable/packages/prover/src/utils/evm.ts#L105

Because the current tests work on chunking array of length 4 into 2 the previous behavior was working and passing tests. When there are 6 requests the current behavior no longer works

* Fix strings in test
@nazarhussain nazarhussain requested a review from a team as a code owner October 12, 2023 12:33
packages/prover/test/unit/utils/conversion.test.ts Outdated Show resolved Hide resolved
output: [[1, 2, 3], [4]],
},
{
title: "when data have different order",
Copy link
Member

Choose a reason for hiding this comment

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

Does this test case make sense? it makes it seem like the type of elements are relevant, rather would add 1-2 tests cases that show that it works with any type of elements, e.g. objects or nested arrays

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes just want to make sure doing chunk does not change the order.

Copy link
Member

Choose a reason for hiding this comment

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

All the other existing test cases already assert that.

My point is that why would the values of elements impact that?

data have different order

Makes it sounds like this chunkIntoN inspects the value of elements, which it does not. IMO better way to prove this is to use different types of elements.

@github-actions
Copy link
Contributor

github-actions bot commented Oct 12, 2023

Performance Report

✔️ no performance regression detected

Full benchmark results
Benchmark suite Current: 7b96ecb Previous: 1aa6561 Ratio
getPubkeys - index2pubkey - req 1000 vs - 250000 vc 847.32 us/op 714.36 us/op 1.19
getPubkeys - validatorsArr - req 1000 vs - 250000 vc 112.30 us/op 88.192 us/op 1.27
BLS verify - blst-native 1.4005 ms/op 1.3477 ms/op 1.04
BLS verifyMultipleSignatures 3 - blst-native 2.8475 ms/op 2.8464 ms/op 1.00
BLS verifyMultipleSignatures 8 - blst-native 6.4335 ms/op 6.2056 ms/op 1.04
BLS verifyMultipleSignatures 32 - blst-native 23.053 ms/op 23.126 ms/op 1.00
BLS verifyMultipleSignatures 64 - blst-native 46.677 ms/op 45.174 ms/op 1.03
BLS verifyMultipleSignatures 128 - blst-native 94.702 ms/op 89.280 ms/op 1.06
BLS deserializing 10000 signatures 965.53 ms/op 913.10 ms/op 1.06
BLS deserializing 100000 signatures 9.1184 s/op 9.3535 s/op 0.97
BLS verifyMultipleSignatures - same message - 3 - blst-native 1.3661 ms/op 1.3807 ms/op 0.99
BLS verifyMultipleSignatures - same message - 8 - blst-native 1.5748 ms/op 1.5972 ms/op 0.99
BLS verifyMultipleSignatures - same message - 32 - blst-native 2.5267 ms/op 2.7197 ms/op 0.93
BLS verifyMultipleSignatures - same message - 64 - blst-native 3.5135 ms/op 4.5061 ms/op 0.78
BLS verifyMultipleSignatures - same message - 128 - blst-native 5.8387 ms/op 6.8206 ms/op 0.86
BLS aggregatePubkeys 32 - blst-native 26.832 us/op 27.031 us/op 0.99
BLS aggregatePubkeys 128 - blst-native 104.06 us/op 104.21 us/op 1.00
getAttestationsForBlock 38.537 ms/op 56.920 ms/op 0.68
isKnown best case - 1 super set check 324.00 ns/op 469.00 ns/op 0.69
isKnown normal case - 2 super set checks 491.00 ns/op 459.00 ns/op 1.07
isKnown worse case - 16 super set checks 404.00 ns/op 537.00 ns/op 0.75
CheckpointStateCache - add get delete 5.9840 us/op 6.3910 us/op 0.94
validate api signedAggregateAndProof - struct 2.8062 ms/op 3.0603 ms/op 0.92
validate gossip signedAggregateAndProof - struct 2.9776 ms/op 2.9941 ms/op 0.99
validate gossip attestation - vc 640000 1.4573 ms/op 1.5056 ms/op 0.97
batch validate gossip attestation - vc 640000 - chunk 32 178.85 us/op 179.83 us/op 0.99
batch validate gossip attestation - vc 640000 - chunk 64 161.59 us/op 175.27 us/op 0.92
batch validate gossip attestation - vc 640000 - chunk 128 168.57 us/op 176.23 us/op 0.96
batch validate gossip attestation - vc 640000 - chunk 256 155.04 us/op 153.22 us/op 1.01
pickEth1Vote - no votes 1.4310 ms/op 1.4832 ms/op 0.96
pickEth1Vote - max votes 12.054 ms/op 14.304 ms/op 0.84
pickEth1Vote - Eth1Data hashTreeRoot value x2048 19.783 ms/op 21.561 ms/op 0.92
pickEth1Vote - Eth1Data hashTreeRoot tree x2048 30.764 ms/op 34.248 ms/op 0.90
pickEth1Vote - Eth1Data fastSerialize value x2048 659.64 us/op 656.42 us/op 1.00
pickEth1Vote - Eth1Data fastSerialize tree x2048 10.422 ms/op 6.6833 ms/op 1.56
bytes32 toHexString 642.00 ns/op 707.00 ns/op 0.91
bytes32 Buffer.toString(hex) 319.00 ns/op 321.00 ns/op 0.99
bytes32 Buffer.toString(hex) from Uint8Array 583.00 ns/op 578.00 ns/op 1.01
bytes32 Buffer.toString(hex) + 0x 342.00 ns/op 349.00 ns/op 0.98
Object access 1 prop 0.20800 ns/op 0.20600 ns/op 1.01
Map access 1 prop 0.16600 ns/op 0.16600 ns/op 1.00
Object get x1000 7.6740 ns/op 8.8510 ns/op 0.87
Map get x1000 0.70800 ns/op 0.85800 ns/op 0.83
Object set x1000 59.989 ns/op 80.276 ns/op 0.75
Map set x1000 45.837 ns/op 57.346 ns/op 0.80
Return object 10000 times 0.27560 ns/op 0.34780 ns/op 0.79
Throw Error 10000 times 4.2978 us/op 4.7681 us/op 0.90
fastMsgIdFn sha256 / 200 bytes 3.4830 us/op 3.9220 us/op 0.89
fastMsgIdFn h32 xxhash / 200 bytes 346.00 ns/op 355.00 ns/op 0.97
fastMsgIdFn h64 xxhash / 200 bytes 401.00 ns/op 396.00 ns/op 1.01
fastMsgIdFn sha256 / 1000 bytes 12.299 us/op 12.690 us/op 0.97
fastMsgIdFn h32 xxhash / 1000 bytes 462.00 ns/op 497.00 ns/op 0.93
fastMsgIdFn h64 xxhash / 1000 bytes 467.00 ns/op 472.00 ns/op 0.99
fastMsgIdFn sha256 / 10000 bytes 110.13 us/op 114.88 us/op 0.96
fastMsgIdFn h32 xxhash / 10000 bytes 2.2580 us/op 2.0720 us/op 1.09
fastMsgIdFn h64 xxhash / 10000 bytes 1.4270 us/op 1.4680 us/op 0.97
send data - 1000 256B messages 22.013 ms/op 24.115 ms/op 0.91
send data - 1000 512B messages 29.361 ms/op 34.112 ms/op 0.86
send data - 1000 1024B messages 46.451 ms/op 45.501 ms/op 1.02
send data - 1000 1200B messages 34.225 ms/op 34.828 ms/op 0.98
send data - 1000 2048B messages 35.356 ms/op 41.150 ms/op 0.86
send data - 1000 4096B messages 35.805 ms/op 34.417 ms/op 1.04
send data - 1000 16384B messages 77.689 ms/op 95.662 ms/op 0.81
send data - 1000 65536B messages 293.49 ms/op 500.19 ms/op 0.59
enrSubnets - fastDeserialize 64 bits 1.5080 us/op 1.7210 us/op 0.88
enrSubnets - ssz BitVector 64 bits 484.00 ns/op 568.00 ns/op 0.85
enrSubnets - fastDeserialize 4 bits 200.00 ns/op 239.00 ns/op 0.84
enrSubnets - ssz BitVector 4 bits 469.00 ns/op 584.00 ns/op 0.80
prioritizePeers score -10:0 att 32-0.1 sync 2-0 108.14 us/op 128.25 us/op 0.84
prioritizePeers score 0:0 att 32-0.25 sync 2-0.25 140.57 us/op 183.02 us/op 0.77
prioritizePeers score 0:0 att 32-0.5 sync 2-0.5 181.83 us/op 253.99 us/op 0.72
prioritizePeers score 0:0 att 64-0.75 sync 4-0.75 320.81 us/op 401.58 us/op 0.80
prioritizePeers score 0:0 att 64-1 sync 4-1 431.58 us/op 454.68 us/op 0.95
array of 16000 items push then shift 1.9061 us/op 1.7843 us/op 1.07
LinkedList of 16000 items push then shift 10.975 ns/op 12.945 ns/op 0.85
array of 16000 items push then pop 106.81 ns/op 121.21 ns/op 0.88
LinkedList of 16000 items push then pop 10.396 ns/op 10.290 ns/op 1.01
array of 24000 items push then shift 2.7613 us/op 2.7081 us/op 1.02
LinkedList of 24000 items push then shift 11.614 ns/op 11.959 ns/op 0.97
array of 24000 items push then pop 159.29 ns/op 171.17 ns/op 0.93
LinkedList of 24000 items push then pop 12.789 ns/op 10.182 ns/op 1.26
intersect bitArray bitLen 8 9.1400 ns/op 7.1830 ns/op 1.27
intersect array and set length 8 94.898 ns/op 65.670 ns/op 1.45
intersect bitArray bitLen 128 41.858 ns/op 34.785 ns/op 1.20
intersect array and set length 128 1.1213 us/op 938.38 ns/op 1.19
bitArray.getTrueBitIndexes() bitLen 128 1.7790 us/op 1.8060 us/op 0.99
bitArray.getTrueBitIndexes() bitLen 248 3.3080 us/op 3.0090 us/op 1.10
bitArray.getTrueBitIndexes() bitLen 512 6.0070 us/op 6.6920 us/op 0.90
Buffer.concat 32 items 1.1340 us/op 1.1040 us/op 1.03
Uint8Array.set 32 items 2.0810 us/op 2.1800 us/op 0.95
Set add up to 64 items then delete first 4.8579 us/op 4.9253 us/op 0.99
OrderedSet add up to 64 items then delete first 5.8544 us/op 6.3959 us/op 0.92
Set add up to 64 items then delete last 4.9417 us/op 5.6163 us/op 0.88
OrderedSet add up to 64 items then delete last 6.2559 us/op 7.5228 us/op 0.83
Set add up to 64 items then delete middle 5.0987 us/op 5.3409 us/op 0.95
OrderedSet add up to 64 items then delete middle 7.6433 us/op 8.3779 us/op 0.91
Set add up to 128 items then delete first 9.9101 us/op 10.697 us/op 0.93
OrderedSet add up to 128 items then delete first 13.527 us/op 14.302 us/op 0.95
Set add up to 128 items then delete last 9.5616 us/op 10.375 us/op 0.92
OrderedSet add up to 128 items then delete last 12.686 us/op 13.961 us/op 0.91
Set add up to 128 items then delete middle 9.9116 us/op 10.701 us/op 0.93
OrderedSet add up to 128 items then delete middle 17.846 us/op 19.100 us/op 0.93
Set add up to 256 items then delete first 20.062 us/op 20.721 us/op 0.97
OrderedSet add up to 256 items then delete first 26.515 us/op 29.602 us/op 0.90
Set add up to 256 items then delete last 19.588 us/op 21.718 us/op 0.90
OrderedSet add up to 256 items then delete last 25.599 us/op 28.646 us/op 0.89
Set add up to 256 items then delete middle 20.565 us/op 21.535 us/op 0.95
OrderedSet add up to 256 items then delete middle 53.276 us/op 55.187 us/op 0.97
transfer serialized Status (84 B) 2.0330 us/op 2.5480 us/op 0.80
copy serialized Status (84 B) 1.5620 us/op 2.1990 us/op 0.71
transfer serialized SignedVoluntaryExit (112 B) 1.9120 us/op 2.3210 us/op 0.82
copy serialized SignedVoluntaryExit (112 B) 1.6300 us/op 1.9930 us/op 0.82
transfer serialized ProposerSlashing (416 B) 2.1590 us/op 2.8900 us/op 0.75
copy serialized ProposerSlashing (416 B) 2.3630 us/op 2.9990 us/op 0.79
transfer serialized Attestation (485 B) 2.4230 us/op 2.9710 us/op 0.82
copy serialized Attestation (485 B) 2.2190 us/op 2.9590 us/op 0.75
transfer serialized AttesterSlashing (33232 B) 2.5230 us/op 2.8090 us/op 0.90
copy serialized AttesterSlashing (33232 B) 8.9210 us/op 11.071 us/op 0.81
transfer serialized Small SignedBeaconBlock (128000 B) 3.5210 us/op 4.0300 us/op 0.87
copy serialized Small SignedBeaconBlock (128000 B) 18.512 us/op 43.183 us/op 0.43
transfer serialized Avg SignedBeaconBlock (200000 B) 3.5280 us/op 4.8940 us/op 0.72
copy serialized Avg SignedBeaconBlock (200000 B) 33.709 us/op 50.015 us/op 0.67
transfer serialized BlobsSidecar (524380 B) 4.8250 us/op 6.4640 us/op 0.75
copy serialized BlobsSidecar (524380 B) 135.27 us/op 196.66 us/op 0.69
transfer serialized Big SignedBeaconBlock (1000000 B) 5.3500 us/op 9.3580 us/op 0.57
copy serialized Big SignedBeaconBlock (1000000 B) 248.01 us/op 336.19 us/op 0.74
pass gossip attestations to forkchoice per slot 4.4221 ms/op 5.4530 ms/op 0.81
forkChoice updateHead vc 100000 bc 64 eq 0 710.20 us/op 710.91 us/op 1.00
forkChoice updateHead vc 600000 bc 64 eq 0 6.2660 ms/op 8.1950 ms/op 0.76
forkChoice updateHead vc 1000000 bc 64 eq 0 8.6257 ms/op 9.2631 ms/op 0.93
forkChoice updateHead vc 600000 bc 320 eq 0 5.2132 ms/op 5.0442 ms/op 1.03
forkChoice updateHead vc 600000 bc 1200 eq 0 4.4912 ms/op 5.7430 ms/op 0.78
forkChoice updateHead vc 600000 bc 7200 eq 0 6.3429 ms/op 6.7940 ms/op 0.93
forkChoice updateHead vc 600000 bc 64 eq 1000 12.389 ms/op 13.998 ms/op 0.89
forkChoice updateHead vc 600000 bc 64 eq 10000 14.065 ms/op 15.769 ms/op 0.89
forkChoice updateHead vc 600000 bc 64 eq 300000 31.977 ms/op 63.321 ms/op 0.50
computeDeltas 500000 validators 300 proto nodes 7.1854 ms/op 7.7764 ms/op 0.92
computeDeltas 500000 validators 1200 proto nodes 6.9959 ms/op 7.4626 ms/op 0.94
computeDeltas 500000 validators 7200 proto nodes 7.4306 ms/op 7.0544 ms/op 1.05
computeDeltas 750000 validators 300 proto nodes 10.349 ms/op 10.417 ms/op 0.99
computeDeltas 750000 validators 1200 proto nodes 10.523 ms/op 10.575 ms/op 1.00
computeDeltas 750000 validators 7200 proto nodes 10.929 ms/op 10.382 ms/op 1.05
computeDeltas 1400000 validators 300 proto nodes 20.555 ms/op 19.317 ms/op 1.06
computeDeltas 1400000 validators 1200 proto nodes 20.248 ms/op 19.463 ms/op 1.04
computeDeltas 1400000 validators 7200 proto nodes 19.090 ms/op 19.085 ms/op 1.00
computeDeltas 2100000 validators 300 proto nodes 28.953 ms/op 28.160 ms/op 1.03
computeDeltas 2100000 validators 1200 proto nodes 29.202 ms/op 28.340 ms/op 1.03
computeDeltas 2100000 validators 7200 proto nodes 27.967 ms/op 32.182 ms/op 0.87
computeProposerBoostScoreFromBalances 500000 validators 3.5376 ms/op 4.2463 ms/op 0.83
computeProposerBoostScoreFromBalances 750000 validators 3.4364 ms/op 4.0646 ms/op 0.85
computeProposerBoostScoreFromBalances 1400000 validators 3.4018 ms/op 4.0478 ms/op 0.84
computeProposerBoostScoreFromBalances 2100000 validators 3.3693 ms/op 4.1755 ms/op 0.81
altair processAttestation - 250000 vs - 7PWei normalcase 3.5511 ms/op 4.4791 ms/op 0.79
altair processAttestation - 250000 vs - 7PWei worstcase 3.6683 ms/op 5.8387 ms/op 0.63
altair processAttestation - setStatus - 1/6 committees join 209.52 us/op 280.88 us/op 0.75
altair processAttestation - setStatus - 1/3 committees join 375.94 us/op 471.42 us/op 0.80
altair processAttestation - setStatus - 1/2 committees join 509.97 us/op 627.59 us/op 0.81
altair processAttestation - setStatus - 2/3 committees join 627.86 us/op 729.25 us/op 0.86
altair processAttestation - setStatus - 4/5 committees join 841.71 us/op 1.0848 ms/op 0.78
altair processAttestation - setStatus - 100% committees join 1.0197 ms/op 1.3829 ms/op 0.74
altair processBlock - 250000 vs - 7PWei normalcase 8.2855 ms/op 13.623 ms/op 0.61
altair processBlock - 250000 vs - 7PWei normalcase hashState 30.292 ms/op 45.015 ms/op 0.67
altair processBlock - 250000 vs - 7PWei worstcase 40.052 ms/op 53.893 ms/op 0.74
altair processBlock - 250000 vs - 7PWei worstcase hashState 93.578 ms/op 143.26 ms/op 0.65
phase0 processBlock - 250000 vs - 7PWei normalcase 2.7419 ms/op 5.5778 ms/op 0.49
phase0 processBlock - 250000 vs - 7PWei worstcase 31.647 ms/op 43.929 ms/op 0.72
altair processEth1Data - 250000 vs - 7PWei normalcase 649.35 us/op 784.86 us/op 0.83
getExpectedWithdrawals 250000 eb:1,eth1:1,we:0,wn:0,smpl:15 13.495 us/op 30.016 us/op 0.45
getExpectedWithdrawals 250000 eb:0.95,eth1:0.1,we:0.05,wn:0,smpl:219 65.771 us/op 118.90 us/op 0.55
getExpectedWithdrawals 250000 eb:0.95,eth1:0.3,we:0.05,wn:0,smpl:42 14.920 us/op 32.712 us/op 0.46
getExpectedWithdrawals 250000 eb:0.95,eth1:0.7,we:0.05,wn:0,smpl:18 18.728 us/op 33.810 us/op 0.55
getExpectedWithdrawals 250000 eb:0.1,eth1:0.1,we:0,wn:0,smpl:1020 181.49 us/op 264.34 us/op 0.69
getExpectedWithdrawals 250000 eb:0.03,eth1:0.03,we:0,wn:0,smpl:11777 1.2323 ms/op 2.3591 ms/op 0.52
getExpectedWithdrawals 250000 eb:0.01,eth1:0.01,we:0,wn:0,smpl:16384 1.7276 ms/op 2.6897 ms/op 0.64
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,smpl:16384 1.5608 ms/op 2.6884 ms/op 0.58
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,nocache,smpl:16384 4.1331 ms/op 7.0213 ms/op 0.59
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,smpl:16384 2.5538 ms/op 3.5215 ms/op 0.73
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,nocache,smpl:16384 5.6470 ms/op 8.2806 ms/op 0.68
Tree 40 250000 create 373.94 ms/op 571.47 ms/op 0.65
Tree 40 250000 get(125000) 215.50 ns/op 253.12 ns/op 0.85
Tree 40 250000 set(125000) 997.90 ns/op 2.6365 us/op 0.38
Tree 40 250000 toArray() 22.311 ms/op 39.932 ms/op 0.56
Tree 40 250000 iterate all - toArray() + loop 21.992 ms/op 36.043 ms/op 0.61
Tree 40 250000 iterate all - get(i) 73.897 ms/op 93.942 ms/op 0.79
MutableVector 250000 create 13.153 ms/op 18.903 ms/op 0.70
MutableVector 250000 get(125000) 6.7140 ns/op 8.3910 ns/op 0.80
MutableVector 250000 set(125000) 295.26 ns/op 674.67 ns/op 0.44
MutableVector 250000 toArray() 4.0410 ms/op 5.6759 ms/op 0.71
MutableVector 250000 iterate all - toArray() + loop 4.4496 ms/op 5.3933 ms/op 0.83
MutableVector 250000 iterate all - get(i) 1.5904 ms/op 1.7909 ms/op 0.89
Array 250000 create 4.1431 ms/op 5.8248 ms/op 0.71
Array 250000 clone - spread 1.8279 ms/op 1.4296 ms/op 1.28
Array 250000 get(125000) 1.0160 ns/op 0.83400 ns/op 1.22
Array 250000 set(125000) 1.2800 ns/op 1.2470 ns/op 1.03
Array 250000 iterate all - loop 108.07 us/op 89.878 us/op 1.20
effectiveBalanceIncrements clone Uint8Array 300000 51.358 us/op 91.443 us/op 0.56
effectiveBalanceIncrements clone MutableVector 300000 432.00 ns/op 349.00 ns/op 1.24
effectiveBalanceIncrements rw all Uint8Array 300000 185.48 us/op 202.06 us/op 0.92
effectiveBalanceIncrements rw all MutableVector 300000 161.27 ms/op 185.35 ms/op 0.87
phase0 afterProcessEpoch - 250000 vs - 7PWei 123.64 ms/op 126.82 ms/op 0.97
phase0 beforeProcessEpoch - 250000 vs - 7PWei 46.122 ms/op 69.973 ms/op 0.66
altair processEpoch - mainnet_e81889 541.46 ms/op 536.05 ms/op 1.01
mainnet_e81889 - altair beforeProcessEpoch 75.248 ms/op 81.447 ms/op 0.92
mainnet_e81889 - altair processJustificationAndFinalization 24.660 us/op 30.166 us/op 0.82
mainnet_e81889 - altair processInactivityUpdates 10.407 ms/op 10.650 ms/op 0.98
mainnet_e81889 - altair processRewardsAndPenalties 71.093 ms/op 88.119 ms/op 0.81
mainnet_e81889 - altair processRegistryUpdates 5.3810 us/op 5.2090 us/op 1.03
mainnet_e81889 - altair processSlashings 1.0050 us/op 1.3710 us/op 0.73
mainnet_e81889 - altair processEth1DataReset 945.00 ns/op 1.1870 us/op 0.80
mainnet_e81889 - altair processEffectiveBalanceUpdates 1.5315 ms/op 1.3170 ms/op 1.16
mainnet_e81889 - altair processSlashingsReset 4.5290 us/op 5.1340 us/op 0.88
mainnet_e81889 - altair processRandaoMixesReset 9.1720 us/op 8.7760 us/op 1.05
mainnet_e81889 - altair processHistoricalRootsUpdate 1.0430 us/op 710.00 ns/op 1.47
mainnet_e81889 - altair processParticipationFlagUpdates 3.0640 us/op 3.6310 us/op 0.84
mainnet_e81889 - altair processSyncCommitteeUpdates 681.00 ns/op 876.00 ns/op 0.78
mainnet_e81889 - altair afterProcessEpoch 127.82 ms/op 131.16 ms/op 0.97
capella processEpoch - mainnet_e217614 1.7816 s/op 1.8423 s/op 0.97
mainnet_e217614 - capella beforeProcessEpoch 288.26 ms/op 314.52 ms/op 0.92
mainnet_e217614 - capella processJustificationAndFinalization 22.182 us/op 25.122 us/op 0.88
mainnet_e217614 - capella processInactivityUpdates 23.906 ms/op 25.520 ms/op 0.94
mainnet_e217614 - capella processRewardsAndPenalties 267.64 ms/op 335.12 ms/op 0.80
mainnet_e217614 - capella processRegistryUpdates 23.419 us/op 34.203 us/op 0.68
mainnet_e217614 - capella processSlashings 573.00 ns/op 1.4200 us/op 0.40
mainnet_e217614 - capella processEth1DataReset 615.00 ns/op 1.5190 us/op 0.40
mainnet_e217614 - capella processEffectiveBalanceUpdates 4.1858 ms/op 8.0649 ms/op 0.52
mainnet_e217614 - capella processSlashingsReset 2.4880 us/op 7.6600 us/op 0.32
mainnet_e217614 - capella processRandaoMixesReset 3.6350 us/op 9.9600 us/op 0.36
mainnet_e217614 - capella processHistoricalRootsUpdate 821.00 ns/op 1.0310 us/op 0.80
mainnet_e217614 - capella processParticipationFlagUpdates 2.0250 us/op 4.5300 us/op 0.45
mainnet_e217614 - capella afterProcessEpoch 299.14 ms/op 327.21 ms/op 0.91
phase0 processEpoch - mainnet_e58758 456.09 ms/op 546.03 ms/op 0.84
mainnet_e58758 - phase0 beforeProcessEpoch 133.05 ms/op 186.78 ms/op 0.71
mainnet_e58758 - phase0 processJustificationAndFinalization 18.510 us/op 25.948 us/op 0.71
mainnet_e58758 - phase0 processRewardsAndPenalties 61.978 ms/op 61.931 ms/op 1.00
mainnet_e58758 - phase0 processRegistryUpdates 13.251 us/op 18.204 us/op 0.73
mainnet_e58758 - phase0 processSlashings 711.00 ns/op 1.1160 us/op 0.64
mainnet_e58758 - phase0 processEth1DataReset 713.00 ns/op 1.2460 us/op 0.57
mainnet_e58758 - phase0 processEffectiveBalanceUpdates 1.1390 ms/op 3.8441 ms/op 0.30
mainnet_e58758 - phase0 processSlashingsReset 3.1550 us/op 4.1600 us/op 0.76
mainnet_e58758 - phase0 processRandaoMixesReset 5.5670 us/op 7.1030 us/op 0.78
mainnet_e58758 - phase0 processHistoricalRootsUpdate 755.00 ns/op 1.5110 us/op 0.50
mainnet_e58758 - phase0 processParticipationRecordUpdates 8.3830 us/op 14.612 us/op 0.57
mainnet_e58758 - phase0 afterProcessEpoch 118.85 ms/op 117.37 ms/op 1.01
phase0 processEffectiveBalanceUpdates - 250000 normalcase 1.3604 ms/op 2.5391 ms/op 0.54
phase0 processEffectiveBalanceUpdates - 250000 worstcase 0.5 1.6749 ms/op 1.5595 ms/op 1.07
altair processInactivityUpdates - 250000 normalcase 21.733 ms/op 32.271 ms/op 0.67
altair processInactivityUpdates - 250000 worstcase 22.311 ms/op 30.210 ms/op 0.74
phase0 processRegistryUpdates - 250000 normalcase 10.720 us/op 15.405 us/op 0.70
phase0 processRegistryUpdates - 250000 badcase_full_deposits 404.02 us/op 405.34 us/op 1.00
phase0 processRegistryUpdates - 250000 worstcase 0.5 144.30 ms/op 158.14 ms/op 0.91
altair processRewardsAndPenalties - 250000 normalcase 61.732 ms/op 72.373 ms/op 0.85
altair processRewardsAndPenalties - 250000 worstcase 65.861 ms/op 76.935 ms/op 0.86
phase0 getAttestationDeltas - 250000 normalcase 8.4958 ms/op 11.734 ms/op 0.72
phase0 getAttestationDeltas - 250000 worstcase 9.5259 ms/op 13.231 ms/op 0.72
phase0 processSlashings - 250000 worstcase 2.5962 ms/op 3.3191 ms/op 0.78
altair processSyncCommitteeUpdates - 250000 168.77 ms/op 173.69 ms/op 0.97
BeaconState.hashTreeRoot - No change 395.00 ns/op 448.00 ns/op 0.88
BeaconState.hashTreeRoot - 1 full validator 133.70 us/op 180.95 us/op 0.74
BeaconState.hashTreeRoot - 32 full validator 1.5687 ms/op 2.1819 ms/op 0.72
BeaconState.hashTreeRoot - 512 full validator 18.011 ms/op 22.483 ms/op 0.80
BeaconState.hashTreeRoot - 1 validator.effectiveBalance 172.64 us/op 189.96 us/op 0.91
BeaconState.hashTreeRoot - 32 validator.effectiveBalance 2.1811 ms/op 2.6305 ms/op 0.83
BeaconState.hashTreeRoot - 512 validator.effectiveBalance 24.746 ms/op 36.150 ms/op 0.68
BeaconState.hashTreeRoot - 1 balances 121.06 us/op 145.15 us/op 0.83
BeaconState.hashTreeRoot - 32 balances 1.3210 ms/op 1.3299 ms/op 0.99
BeaconState.hashTreeRoot - 512 balances 12.616 ms/op 14.497 ms/op 0.87
BeaconState.hashTreeRoot - 250000 balances 215.90 ms/op 246.58 ms/op 0.88
aggregationBits - 2048 els - zipIndexesInBitList 15.787 us/op 22.680 us/op 0.70
regular array get 100000 times 38.638 us/op 46.653 us/op 0.83
wrappedArray get 100000 times 33.270 us/op 34.334 us/op 0.97
arrayWithProxy get 100000 times 13.605 ms/op 15.777 ms/op 0.86
ssz.Root.equals 231.00 ns/op 276.00 ns/op 0.84
byteArrayEquals 222.00 ns/op 250.00 ns/op 0.89
shuffle list - 16384 els 6.9573 ms/op 7.3162 ms/op 0.95
shuffle list - 250000 els 101.49 ms/op 104.38 ms/op 0.97
processSlot - 1 slots 18.117 us/op 17.462 us/op 1.04
processSlot - 32 slots 3.8536 ms/op 4.1741 ms/op 0.92
getEffectiveBalanceIncrementsZeroInactive - 250000 vs - 7PWei 52.199 ms/op 59.783 ms/op 0.87
getCommitteeAssignments - req 1 vs - 250000 vc 2.5062 ms/op 2.6488 ms/op 0.95
getCommitteeAssignments - req 100 vs - 250000 vc 3.7040 ms/op 4.1590 ms/op 0.89
getCommitteeAssignments - req 1000 vs - 250000 vc 4.0732 ms/op 4.6536 ms/op 0.88
RootCache.getBlockRootAtSlot - 250000 vs - 7PWei 4.9700 ns/op 6.2500 ns/op 0.80
state getBlockRootAtSlot - 250000 vs - 7PWei 759.53 ns/op 684.02 ns/op 1.11
computeProposers - vc 250000 9.2395 ms/op 9.9774 ms/op 0.93
computeEpochShuffling - vc 250000 104.78 ms/op 108.94 ms/op 0.96
getNextSyncCommittee - vc 250000 156.38 ms/op 172.79 ms/op 0.91
computeSigningRoot for AttestationData 23.782 us/op 30.558 us/op 0.78
hash AttestationData serialized data then Buffer.toString(base64) 2.3064 us/op 2.4419 us/op 0.94
toHexString serialized data 1.0389 us/op 1.4676 us/op 0.71
Buffer.toString(base64) 205.07 ns/op 307.97 ns/op 0.67

by benchmarkbot/action

output: [[1, 2, 3], [4]],
},
{
title: "when data have different order",
Copy link
Member

Choose a reason for hiding this comment

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

All the other existing test cases already assert that.

My point is that why would the values of elements impact that?

data have different order

Makes it sounds like this chunkIntoN inspects the value of elements, which it does not. IMO better way to prove this is to use different types of elements.

packages/prover/test/unit/utils/conversion.test.ts Outdated Show resolved Hide resolved
@nazarhussain
Copy link
Contributor Author

@nflaig When reading the test we should read in full context from the description. So I believe current pattern feels more natural to read.

@wemeetagain wemeetagain merged commit 93709ff into unstable Oct 12, 2023
15 checks passed
@wemeetagain wemeetagain deleted the nh/chunkinton-fix-2 branch October 12, 2023 19:18
@wemeetagain
Copy link
Member

🎉 This PR is included in v1.12.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