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: ignore empty array when filtering validator balances #6878

Merged
merged 1 commit into from
Jun 13, 2024

Conversation

nflaig
Copy link
Member

@nflaig nflaig commented Jun 12, 2024

Motivation

Similar to #6876, and further clarified in ethereum/beacon-APIs#453

Description

Ignore empty array when filtering validator balances

@nflaig nflaig requested a review from a team as a code owner June 12, 2024 08:46
Copy link
Contributor

Performance Report

✔️ no performance regression detected

Full benchmark results
Benchmark suite Current: 9a128a5 Previous: 3be656b Ratio
getPubkeys - index2pubkey - req 1000 vs - 250000 vc 1.0735 ms/op 1.1239 ms/op 0.96
getPubkeys - validatorsArr - req 1000 vs - 250000 vc 71.186 us/op 83.503 us/op 0.85
BLS verify - blst-native 1.1131 ms/op 1.3629 ms/op 0.82
BLS verifyMultipleSignatures 3 - blst-native 2.4498 ms/op 2.9835 ms/op 0.82
BLS verifyMultipleSignatures 8 - blst-native 5.5581 ms/op 6.7223 ms/op 0.83
BLS verifyMultipleSignatures 32 - blst-native 19.415 ms/op 22.745 ms/op 0.85
BLS verifyMultipleSignatures 64 - blst-native 37.339 ms/op 45.844 ms/op 0.81
BLS verifyMultipleSignatures 128 - blst-native 75.912 ms/op 105.22 ms/op 0.72
BLS deserializing 10000 signatures 810.17 ms/op 995.85 ms/op 0.81
BLS deserializing 100000 signatures 8.2831 s/op 9.3458 s/op 0.89
BLS verifyMultipleSignatures - same message - 3 - blst-native 1.2282 ms/op 1.3663 ms/op 0.90
BLS verifyMultipleSignatures - same message - 8 - blst-native 1.3726 ms/op 1.5286 ms/op 0.90
BLS verifyMultipleSignatures - same message - 32 - blst-native 2.0852 ms/op 2.4822 ms/op 0.84
BLS verifyMultipleSignatures - same message - 64 - blst-native 3.5942 ms/op 3.5260 ms/op 1.02
BLS verifyMultipleSignatures - same message - 128 - blst-native 5.0532 ms/op 5.8715 ms/op 0.86
BLS aggregatePubkeys 32 - blst-native 23.213 us/op 26.996 us/op 0.86
BLS aggregatePubkeys 128 - blst-native 90.132 us/op 106.72 us/op 0.84
notSeenSlots=1 numMissedVotes=1 numBadVotes=10 67.226 ms/op 66.512 ms/op 1.01
notSeenSlots=1 numMissedVotes=0 numBadVotes=4 58.130 ms/op 84.646 ms/op 0.69
notSeenSlots=2 numMissedVotes=1 numBadVotes=10 33.038 ms/op 49.935 ms/op 0.66
getSlashingsAndExits - default max 129.04 us/op 127.87 us/op 1.01
getSlashingsAndExits - 2k 327.10 us/op 338.32 us/op 0.97
proposeBlockBody type=full, size=empty 5.0167 ms/op 7.3718 ms/op 0.68
isKnown best case - 1 super set check 618.00 ns/op 460.00 ns/op 1.34
isKnown normal case - 2 super set checks 524.00 ns/op 357.00 ns/op 1.47
isKnown worse case - 16 super set checks 659.00 ns/op 432.00 ns/op 1.53
InMemoryCheckpointStateCache - add get delete 5.2870 us/op 5.6700 us/op 0.93
validate api signedAggregateAndProof - struct 2.3414 ms/op 2.7218 ms/op 0.86
validate gossip signedAggregateAndProof - struct 2.3133 ms/op 2.7322 ms/op 0.85
validate gossip attestation - vc 640000 1.1304 ms/op 1.3139 ms/op 0.86
batch validate gossip attestation - vc 640000 - chunk 32 138.69 us/op 162.78 us/op 0.85
batch validate gossip attestation - vc 640000 - chunk 64 131.31 us/op 159.00 us/op 0.83
batch validate gossip attestation - vc 640000 - chunk 128 118.29 us/op 150.36 us/op 0.79
batch validate gossip attestation - vc 640000 - chunk 256 105.47 us/op 134.24 us/op 0.79
pickEth1Vote - no votes 823.20 us/op 1.2442 ms/op 0.66
pickEth1Vote - max votes 7.6969 ms/op 11.393 ms/op 0.68
pickEth1Vote - Eth1Data hashTreeRoot value x2048 14.061 ms/op 20.825 ms/op 0.68
pickEth1Vote - Eth1Data hashTreeRoot tree x2048 20.886 ms/op 28.872 ms/op 0.72
pickEth1Vote - Eth1Data fastSerialize value x2048 383.10 us/op 626.39 us/op 0.61
pickEth1Vote - Eth1Data fastSerialize tree x2048 5.3592 ms/op 5.0378 ms/op 1.06
bytes32 toHexString 607.00 ns/op 657.00 ns/op 0.92
bytes32 Buffer.toString(hex) 436.00 ns/op 256.00 ns/op 1.70
bytes32 Buffer.toString(hex) from Uint8Array 519.00 ns/op 479.00 ns/op 1.08
bytes32 Buffer.toString(hex) + 0x 440.00 ns/op 256.00 ns/op 1.72
Object access 1 prop 0.32200 ns/op 0.16400 ns/op 1.96
Map access 1 prop 0.32200 ns/op 0.13800 ns/op 2.33
Object get x1000 4.9780 ns/op 6.0360 ns/op 0.82
Map get x1000 5.4700 ns/op 6.4400 ns/op 0.85
Object set x1000 25.081 ns/op 37.252 ns/op 0.67
Map set x1000 19.556 ns/op 27.399 ns/op 0.71
Return object 10000 times 0.29210 ns/op 0.30300 ns/op 0.96
Throw Error 10000 times 2.7514 us/op 3.4793 us/op 0.79
fastMsgIdFn sha256 / 200 bytes 2.0810 us/op 2.3520 us/op 0.88
fastMsgIdFn h32 xxhash / 200 bytes 399.00 ns/op 287.00 ns/op 1.39
fastMsgIdFn h64 xxhash / 200 bytes 442.00 ns/op 301.00 ns/op 1.47
fastMsgIdFn sha256 / 1000 bytes 5.9520 us/op 7.5500 us/op 0.79
fastMsgIdFn h32 xxhash / 1000 bytes 558.00 ns/op 409.00 ns/op 1.36
fastMsgIdFn h64 xxhash / 1000 bytes 515.00 ns/op 373.00 ns/op 1.38
fastMsgIdFn sha256 / 10000 bytes 48.092 us/op 65.681 us/op 0.73
fastMsgIdFn h32 xxhash / 10000 bytes 1.8030 us/op 1.9570 us/op 0.92
fastMsgIdFn h64 xxhash / 10000 bytes 1.2970 us/op 1.2470 us/op 1.04
send data - 1000 256B messages 9.1147 ms/op 13.365 ms/op 0.68
send data - 1000 512B messages 13.988 ms/op 19.439 ms/op 0.72
send data - 1000 1024B messages 23.954 ms/op 29.912 ms/op 0.80
send data - 1000 1200B messages 23.871 ms/op 29.192 ms/op 0.82
send data - 1000 2048B messages 29.055 ms/op 34.677 ms/op 0.84
send data - 1000 4096B messages 25.864 ms/op 34.772 ms/op 0.74
send data - 1000 16384B messages 72.384 ms/op 74.786 ms/op 0.97
send data - 1000 65536B messages 253.42 ms/op 253.37 ms/op 1.00
enrSubnets - fastDeserialize 64 bits 1.0600 us/op 1.7650 us/op 0.60
enrSubnets - ssz BitVector 64 bits 479.00 ns/op 518.00 ns/op 0.92
enrSubnets - fastDeserialize 4 bits 300.00 ns/op 224.00 ns/op 1.34
enrSubnets - ssz BitVector 4 bits 480.00 ns/op 471.00 ns/op 1.02
prioritizePeers score -10:0 att 32-0.1 sync 2-0 115.17 us/op 221.02 us/op 0.52
prioritizePeers score 0:0 att 32-0.25 sync 2-0.25 149.87 us/op 239.17 us/op 0.63
prioritizePeers score 0:0 att 32-0.5 sync 2-0.5 279.38 us/op 316.19 us/op 0.88
prioritizePeers score 0:0 att 64-0.75 sync 4-0.75 470.45 us/op 473.46 us/op 0.99
prioritizePeers score 0:0 att 64-1 sync 4-1 575.97 us/op 936.35 us/op 0.62
array of 16000 items push then shift 1.2503 us/op 1.7531 us/op 0.71
LinkedList of 16000 items push then shift 7.8650 ns/op 8.2760 ns/op 0.95
array of 16000 items push then pop 118.94 ns/op 144.77 ns/op 0.82
LinkedList of 16000 items push then pop 6.7280 ns/op 8.5480 ns/op 0.79
array of 24000 items push then shift 1.7841 us/op 2.6200 us/op 0.68
LinkedList of 24000 items push then shift 6.5560 ns/op 8.8030 ns/op 0.74
array of 24000 items push then pop 103.79 ns/op 198.04 ns/op 0.52
LinkedList of 24000 items push then pop 5.8400 ns/op 7.8780 ns/op 0.74
intersect bitArray bitLen 8 5.4080 ns/op 7.2470 ns/op 0.75
intersect array and set length 8 35.637 ns/op 58.427 ns/op 0.61
intersect bitArray bitLen 128 24.634 ns/op 33.569 ns/op 0.73
intersect array and set length 128 530.43 ns/op 810.33 ns/op 0.65
bitArray.getTrueBitIndexes() bitLen 128 2.0430 us/op 2.4060 us/op 0.85
bitArray.getTrueBitIndexes() bitLen 248 3.0950 us/op 4.4190 us/op 0.70
bitArray.getTrueBitIndexes() bitLen 512 6.4670 us/op 10.105 us/op 0.64
Buffer.concat 32 items 1.0180 us/op 1.2460 us/op 0.82
Uint8Array.set 32 items 1.6200 us/op 2.1550 us/op 0.75
Buffer.copy 1.7070 us/op 1.9490 us/op 0.88
Uint8Array.set - with subarray 2.1830 us/op 3.5860 us/op 0.61
Uint8Array.set - without subarray 1.5250 us/op 1.6670 us/op 0.91
Set add up to 64 items then delete first 1.6854 us/op 3.1049 us/op 0.54
OrderedSet add up to 64 items then delete first 2.7638 us/op 5.7634 us/op 0.48
Set add up to 64 items then delete last 1.9124 us/op 3.5539 us/op 0.54
OrderedSet add up to 64 items then delete last 2.9282 us/op 5.4541 us/op 0.54
Set add up to 64 items then delete middle 1.9027 us/op 3.5535 us/op 0.54
OrderedSet add up to 64 items then delete middle 4.2865 us/op 7.1284 us/op 0.60
Set add up to 128 items then delete first 3.7714 us/op 6.9868 us/op 0.54
OrderedSet add up to 128 items then delete first 5.9557 us/op 11.120 us/op 0.54
Set add up to 128 items then delete last 3.6516 us/op 6.8925 us/op 0.53
OrderedSet add up to 128 items then delete last 5.6357 us/op 11.521 us/op 0.49
Set add up to 128 items then delete middle 3.6660 us/op 7.1696 us/op 0.51
OrderedSet add up to 128 items then delete middle 11.853 us/op 18.636 us/op 0.64
Set add up to 256 items then delete first 7.4915 us/op 16.146 us/op 0.46
OrderedSet add up to 256 items then delete first 12.058 us/op 24.599 us/op 0.49
Set add up to 256 items then delete last 7.2510 us/op 15.107 us/op 0.48
OrderedSet add up to 256 items then delete last 11.373 us/op 23.445 us/op 0.49
Set add up to 256 items then delete middle 7.1810 us/op 14.618 us/op 0.49
OrderedSet add up to 256 items then delete middle 32.650 us/op 52.380 us/op 0.62
transfer serialized Status (84 B) 1.3400 us/op 1.6630 us/op 0.81
copy serialized Status (84 B) 1.1790 us/op 1.4390 us/op 0.82
transfer serialized SignedVoluntaryExit (112 B) 1.4780 us/op 1.7780 us/op 0.83
copy serialized SignedVoluntaryExit (112 B) 1.2350 us/op 1.7550 us/op 0.70
transfer serialized ProposerSlashing (416 B) 2.0910 us/op 2.7260 us/op 0.77
copy serialized ProposerSlashing (416 B) 2.4580 us/op 2.6580 us/op 0.92
transfer serialized Attestation (485 B) 2.2760 us/op 3.2410 us/op 0.70
copy serialized Attestation (485 B) 2.4630 us/op 2.7380 us/op 0.90
transfer serialized AttesterSlashing (33232 B) 2.7560 us/op 3.4170 us/op 0.81
copy serialized AttesterSlashing (33232 B) 6.2670 us/op 11.212 us/op 0.56
transfer serialized Small SignedBeaconBlock (128000 B) 2.5410 us/op 4.2570 us/op 0.60
copy serialized Small SignedBeaconBlock (128000 B) 14.138 us/op 36.057 us/op 0.39
transfer serialized Avg SignedBeaconBlock (200000 B) 2.4400 us/op 5.7700 us/op 0.42
copy serialized Avg SignedBeaconBlock (200000 B) 21.068 us/op 54.260 us/op 0.39
transfer serialized BlobsSidecar (524380 B) 2.4940 us/op 7.2730 us/op 0.34
copy serialized BlobsSidecar (524380 B) 75.126 us/op 146.55 us/op 0.51
transfer serialized Big SignedBeaconBlock (1000000 B) 3.0380 us/op 5.8070 us/op 0.52
copy serialized Big SignedBeaconBlock (1000000 B) 218.93 us/op 301.76 us/op 0.73
pass gossip attestations to forkchoice per slot 2.5997 ms/op 4.5358 ms/op 0.57
forkChoice updateHead vc 100000 bc 64 eq 0 435.57 us/op 1.2012 ms/op 0.36
forkChoice updateHead vc 600000 bc 64 eq 0 2.6284 ms/op 4.4277 ms/op 0.59
forkChoice updateHead vc 1000000 bc 64 eq 0 3.9661 ms/op 7.0573 ms/op 0.56
forkChoice updateHead vc 600000 bc 320 eq 0 2.5386 ms/op 4.1550 ms/op 0.61
forkChoice updateHead vc 600000 bc 1200 eq 0 2.6218 ms/op 4.2791 ms/op 0.61
forkChoice updateHead vc 600000 bc 7200 eq 0 2.9517 ms/op 4.4792 ms/op 0.66
forkChoice updateHead vc 600000 bc 64 eq 1000 9.0040 ms/op 11.708 ms/op 0.77
forkChoice updateHead vc 600000 bc 64 eq 10000 9.4417 ms/op 13.119 ms/op 0.72
forkChoice updateHead vc 600000 bc 64 eq 300000 11.481 ms/op 23.660 ms/op 0.49
computeDeltas 500000 validators 300 proto nodes 2.9761 ms/op 4.2643 ms/op 0.70
computeDeltas 500000 validators 1200 proto nodes 2.9932 ms/op 4.1202 ms/op 0.73
computeDeltas 500000 validators 7200 proto nodes 3.1047 ms/op 4.3026 ms/op 0.72
computeDeltas 750000 validators 300 proto nodes 4.4994 ms/op 6.1369 ms/op 0.73
computeDeltas 750000 validators 1200 proto nodes 4.3273 ms/op 6.0803 ms/op 0.71
computeDeltas 750000 validators 7200 proto nodes 4.5000 ms/op 5.8363 ms/op 0.77
computeDeltas 1400000 validators 300 proto nodes 8.2794 ms/op 11.020 ms/op 0.75
computeDeltas 1400000 validators 1200 proto nodes 8.2727 ms/op 10.955 ms/op 0.76
computeDeltas 1400000 validators 7200 proto nodes 7.9259 ms/op 11.694 ms/op 0.68
computeDeltas 2100000 validators 300 proto nodes 11.967 ms/op 17.973 ms/op 0.67
computeDeltas 2100000 validators 1200 proto nodes 12.131 ms/op 17.177 ms/op 0.71
computeDeltas 2100000 validators 7200 proto nodes 12.153 ms/op 19.354 ms/op 0.63
altair processAttestation - 250000 vs - 7PWei normalcase 1.3771 ms/op 2.3556 ms/op 0.58
altair processAttestation - 250000 vs - 7PWei worstcase 2.0449 ms/op 3.5006 ms/op 0.58
altair processAttestation - setStatus - 1/6 committees join 61.461 us/op 119.06 us/op 0.52
altair processAttestation - setStatus - 1/3 committees join 118.88 us/op 196.73 us/op 0.60
altair processAttestation - setStatus - 1/2 committees join 174.48 us/op 280.83 us/op 0.62
altair processAttestation - setStatus - 2/3 committees join 231.86 us/op 355.98 us/op 0.65
altair processAttestation - setStatus - 4/5 committees join 356.03 us/op 523.62 us/op 0.68
altair processAttestation - setStatus - 100% committees join 426.00 us/op 678.28 us/op 0.63
altair processBlock - 250000 vs - 7PWei normalcase 3.0878 ms/op 4.9941 ms/op 0.62
altair processBlock - 250000 vs - 7PWei normalcase hashState 24.955 ms/op 29.083 ms/op 0.86
altair processBlock - 250000 vs - 7PWei worstcase 39.763 ms/op 49.195 ms/op 0.81
altair processBlock - 250000 vs - 7PWei worstcase hashState 74.930 ms/op 89.631 ms/op 0.84
phase0 processBlock - 250000 vs - 7PWei normalcase 1.6032 ms/op 2.4626 ms/op 0.65
phase0 processBlock - 250000 vs - 7PWei worstcase 24.060 ms/op 34.022 ms/op 0.71
altair processEth1Data - 250000 vs - 7PWei normalcase 255.15 us/op 503.26 us/op 0.51
getExpectedWithdrawals 250000 eb:1,eth1:1,we:0,wn:0,smpl:15 5.0820 us/op 8.0200 us/op 0.63
getExpectedWithdrawals 250000 eb:0.95,eth1:0.1,we:0.05,wn:0,smpl:219 25.794 us/op 31.392 us/op 0.82
getExpectedWithdrawals 250000 eb:0.95,eth1:0.3,we:0.05,wn:0,smpl:42 7.1440 us/op 11.253 us/op 0.63
getExpectedWithdrawals 250000 eb:0.95,eth1:0.7,we:0.05,wn:0,smpl:18 5.5820 us/op 7.8270 us/op 0.71
getExpectedWithdrawals 250000 eb:0.1,eth1:0.1,we:0,wn:0,smpl:1020 79.396 us/op 144.02 us/op 0.55
getExpectedWithdrawals 250000 eb:0.03,eth1:0.03,we:0,wn:0,smpl:11777 787.46 us/op 922.50 us/op 0.85
getExpectedWithdrawals 250000 eb:0.01,eth1:0.01,we:0,wn:0,smpl:16384 1.0135 ms/op 1.4238 ms/op 0.71
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,smpl:16384 692.80 us/op 1.3314 ms/op 0.52
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,nocache,smpl:16384 2.1336 ms/op 4.0120 ms/op 0.53
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,smpl:16384 1.2068 ms/op 2.2789 ms/op 0.53
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,nocache,smpl:16384 3.0992 ms/op 5.1304 ms/op 0.60
Tree 40 250000 create 189.43 ms/op 424.93 ms/op 0.45
Tree 40 250000 get(125000) 113.50 ns/op 180.06 ns/op 0.63
Tree 40 250000 set(125000) 571.59 ns/op 1.4649 us/op 0.39
Tree 40 250000 toArray() 12.250 ms/op 25.382 ms/op 0.48
Tree 40 250000 iterate all - toArray() + loop 10.871 ms/op 26.159 ms/op 0.42
Tree 40 250000 iterate all - get(i) 44.262 ms/op 69.395 ms/op 0.64
MutableVector 250000 create 8.8392 ms/op 18.284 ms/op 0.48
MutableVector 250000 get(125000) 5.6440 ns/op 7.0600 ns/op 0.80
MutableVector 250000 set(125000) 168.61 ns/op 512.37 ns/op 0.33
MutableVector 250000 toArray() 2.8988 ms/op 5.7566 ms/op 0.50
MutableVector 250000 iterate all - toArray() + loop 2.9007 ms/op 6.6884 ms/op 0.43
MutableVector 250000 iterate all - get(i) 1.4456 ms/op 2.4736 ms/op 0.58
Array 250000 create 3.4377 ms/op 5.8563 ms/op 0.59
Array 250000 clone - spread 1.1468 ms/op 3.6818 ms/op 0.31
Array 250000 get(125000) 0.57300 ns/op 0.54800 ns/op 1.05
Array 250000 set(125000) 0.57600 ns/op 0.54300 ns/op 1.06
Array 250000 iterate all - loop 74.205 us/op 102.72 us/op 0.72
effectiveBalanceIncrements clone Uint8Array 300000 21.013 us/op 66.013 us/op 0.32
effectiveBalanceIncrements clone MutableVector 300000 305.00 ns/op 145.00 ns/op 2.10
effectiveBalanceIncrements rw all Uint8Array 300000 161.03 us/op 218.78 us/op 0.74
effectiveBalanceIncrements rw all MutableVector 300000 52.322 ms/op 147.11 ms/op 0.36
phase0 afterProcessEpoch - 250000 vs - 7PWei 76.356 ms/op 109.56 ms/op 0.70
phase0 beforeProcessEpoch - 250000 vs - 7PWei 43.139 ms/op 47.133 ms/op 0.92
altair processEpoch - mainnet_e81889 404.81 ms/op 463.62 ms/op 0.87
mainnet_e81889 - altair beforeProcessEpoch 63.319 ms/op 94.145 ms/op 0.67
mainnet_e81889 - altair processJustificationAndFinalization 12.854 us/op 25.267 us/op 0.51
mainnet_e81889 - altair processInactivityUpdates 6.6672 ms/op 8.0442 ms/op 0.83
mainnet_e81889 - altair processRewardsAndPenalties 51.138 ms/op 58.536 ms/op 0.87
mainnet_e81889 - altair processRegistryUpdates 2.7250 us/op 4.0870 us/op 0.67
mainnet_e81889 - altair processSlashings 887.00 ns/op 1.5760 us/op 0.56
mainnet_e81889 - altair processEth1DataReset 801.00 ns/op 1.1920 us/op 0.67
mainnet_e81889 - altair processEffectiveBalanceUpdates 902.76 us/op 2.5204 ms/op 0.36
mainnet_e81889 - altair processSlashingsReset 3.4510 us/op 10.387 us/op 0.33
mainnet_e81889 - altair processRandaoMixesReset 6.4910 us/op 9.4080 us/op 0.69
mainnet_e81889 - altair processHistoricalRootsUpdate 1.0690 us/op 2.3490 us/op 0.46
mainnet_e81889 - altair processParticipationFlagUpdates 2.3920 us/op 6.1760 us/op 0.39
mainnet_e81889 - altair processSyncCommitteeUpdates 1.1050 us/op 1.3290 us/op 0.83
mainnet_e81889 - altair afterProcessEpoch 82.029 ms/op 99.544 ms/op 0.82
capella processEpoch - mainnet_e217614 1.3079 s/op 1.4783 s/op 0.88
mainnet_e217614 - capella beforeProcessEpoch 275.13 ms/op 275.04 ms/op 1.00
mainnet_e217614 - capella processJustificationAndFinalization 16.173 us/op 18.837 us/op 0.86
mainnet_e217614 - capella processInactivityUpdates 17.534 ms/op 21.892 ms/op 0.80
mainnet_e217614 - capella processRewardsAndPenalties 252.02 ms/op 260.03 ms/op 0.97
mainnet_e217614 - capella processRegistryUpdates 13.245 us/op 14.845 us/op 0.89
mainnet_e217614 - capella processSlashings 768.00 ns/op 432.00 ns/op 1.78
mainnet_e217614 - capella processEth1DataReset 760.00 ns/op 446.00 ns/op 1.70
mainnet_e217614 - capella processEffectiveBalanceUpdates 4.2653 ms/op 5.2770 ms/op 0.81
mainnet_e217614 - capella processSlashingsReset 3.6910 us/op 4.4960 us/op 0.82
mainnet_e217614 - capella processRandaoMixesReset 9.9080 us/op 9.1790 us/op 1.08
mainnet_e217614 - capella processHistoricalRootsUpdate 959.00 ns/op 525.00 ns/op 1.83
mainnet_e217614 - capella processParticipationFlagUpdates 2.0510 us/op 2.2720 us/op 0.90
mainnet_e217614 - capella afterProcessEpoch 213.52 ms/op 236.46 ms/op 0.90
phase0 processEpoch - mainnet_e58758 379.55 ms/op 421.84 ms/op 0.90
mainnet_e58758 - phase0 beforeProcessEpoch 113.45 ms/op 122.99 ms/op 0.92
mainnet_e58758 - phase0 processJustificationAndFinalization 12.660 us/op 14.702 us/op 0.86
mainnet_e58758 - phase0 processRewardsAndPenalties 25.190 ms/op 32.658 ms/op 0.77
mainnet_e58758 - phase0 processRegistryUpdates 9.8780 us/op 11.083 us/op 0.89
mainnet_e58758 - phase0 processSlashings 925.00 ns/op 414.00 ns/op 2.23
mainnet_e58758 - phase0 processEth1DataReset 822.00 ns/op 414.00 ns/op 1.99
mainnet_e58758 - phase0 processEffectiveBalanceUpdates 1.2110 ms/op 1.1819 ms/op 1.02
mainnet_e58758 - phase0 processSlashingsReset 3.1250 us/op 4.4470 us/op 0.70
mainnet_e58758 - phase0 processRandaoMixesReset 2.8660 us/op 7.6930 us/op 0.37
mainnet_e58758 - phase0 processHistoricalRootsUpdate 765.00 ns/op 605.00 ns/op 1.26
mainnet_e58758 - phase0 processParticipationRecordUpdates 3.3630 us/op 4.0820 us/op 0.82
mainnet_e58758 - phase0 afterProcessEpoch 70.735 ms/op 81.646 ms/op 0.87
phase0 processEffectiveBalanceUpdates - 250000 normalcase 1.4252 ms/op 1.2902 ms/op 1.10
phase0 processEffectiveBalanceUpdates - 250000 worstcase 0.5 1.1239 ms/op 2.4218 ms/op 0.46
altair processInactivityUpdates - 250000 normalcase 18.687 ms/op 18.841 ms/op 0.99
altair processInactivityUpdates - 250000 worstcase 16.916 ms/op 20.328 ms/op 0.83
phase0 processRegistryUpdates - 250000 normalcase 8.9540 us/op 8.5410 us/op 1.05
phase0 processRegistryUpdates - 250000 badcase_full_deposits 332.69 us/op 347.45 us/op 0.96
phase0 processRegistryUpdates - 250000 worstcase 0.5 96.026 ms/op 132.66 ms/op 0.72
altair processRewardsAndPenalties - 250000 normalcase 35.978 ms/op 42.689 ms/op 0.84
altair processRewardsAndPenalties - 250000 worstcase 44.158 ms/op 44.144 ms/op 1.00
phase0 getAttestationDeltas - 250000 normalcase 5.6211 ms/op 8.1239 ms/op 0.69
phase0 getAttestationDeltas - 250000 worstcase 6.2946 ms/op 11.369 ms/op 0.55
phase0 processSlashings - 250000 worstcase 84.020 us/op 133.50 us/op 0.63
altair processSyncCommitteeUpdates - 250000 109.04 ms/op 142.11 ms/op 0.77
BeaconState.hashTreeRoot - No change 793.00 ns/op 400.00 ns/op 1.98
BeaconState.hashTreeRoot - 1 full validator 152.79 us/op 125.36 us/op 1.22
BeaconState.hashTreeRoot - 32 full validator 1.3549 ms/op 1.2021 ms/op 1.13
BeaconState.hashTreeRoot - 512 full validator 9.7613 ms/op 16.624 ms/op 0.59
BeaconState.hashTreeRoot - 1 validator.effectiveBalance 97.239 us/op 200.87 us/op 0.48
BeaconState.hashTreeRoot - 32 validator.effectiveBalance 1.3020 ms/op 2.9524 ms/op 0.44
BeaconState.hashTreeRoot - 512 validator.effectiveBalance 27.785 ms/op 27.771 ms/op 1.00
BeaconState.hashTreeRoot - 1 balances 122.21 us/op 106.69 us/op 1.15
BeaconState.hashTreeRoot - 32 balances 940.04 us/op 1.0699 ms/op 0.88
BeaconState.hashTreeRoot - 512 balances 12.467 ms/op 8.7333 ms/op 1.43
BeaconState.hashTreeRoot - 250000 balances 225.10 ms/op 161.71 ms/op 1.39
aggregationBits - 2048 els - zipIndexesInBitList 38.121 us/op 26.095 us/op 1.46
byteArrayEquals 32 49.313 ns/op 55.844 ns/op 0.88
Buffer.compare 32 39.763 ns/op 47.600 ns/op 0.84
byteArrayEquals 1024 1.3215 us/op 1.6925 us/op 0.78
Buffer.compare 1024 48.893 ns/op 55.305 ns/op 0.88
byteArrayEquals 16384 21.246 us/op 26.314 us/op 0.81
Buffer.compare 16384 242.50 ns/op 233.46 ns/op 1.04
byteArrayEquals 123687377 156.25 ms/op 204.15 ms/op 0.77
Buffer.compare 123687377 7.5604 ms/op 8.4187 ms/op 0.90
byteArrayEquals 32 - diff last byte 47.960 ns/op 53.241 ns/op 0.90
Buffer.compare 32 - diff last byte 37.586 ns/op 46.554 ns/op 0.81
byteArrayEquals 1024 - diff last byte 1.2409 us/op 1.6272 us/op 0.76
Buffer.compare 1024 - diff last byte 43.006 ns/op 57.729 ns/op 0.74
byteArrayEquals 16384 - diff last byte 19.830 us/op 25.835 us/op 0.77
Buffer.compare 16384 - diff last byte 226.13 ns/op 241.02 ns/op 0.94
byteArrayEquals 123687377 - diff last byte 153.68 ms/op 196.04 ms/op 0.78
Buffer.compare 123687377 - diff last byte 5.1907 ms/op 9.4690 ms/op 0.55
byteArrayEquals 32 - random bytes 5.1220 ns/op 5.3600 ns/op 0.96
Buffer.compare 32 - random bytes 43.606 ns/op 52.804 ns/op 0.83
byteArrayEquals 1024 - random bytes 5.1000 ns/op 6.1880 ns/op 0.82
Buffer.compare 1024 - random bytes 40.414 ns/op 72.878 ns/op 0.55
byteArrayEquals 16384 - random bytes 5.0140 ns/op 5.3430 ns/op 0.94
Buffer.compare 16384 - random bytes 39.918 ns/op 47.067 ns/op 0.85
byteArrayEquals 123687377 - random bytes 7.9300 ns/op 6.8200 ns/op 1.16
Buffer.compare 123687377 - random bytes 45.420 ns/op 49.290 ns/op 0.92
regular array get 100000 times 31.368 us/op 39.101 us/op 0.80
wrappedArray get 100000 times 31.890 us/op 37.257 us/op 0.86
arrayWithProxy get 100000 times 9.6834 ms/op 13.795 ms/op 0.70
ssz.Root.equals 40.327 ns/op 47.506 ns/op 0.85
byteArrayEquals 43.305 ns/op 45.966 ns/op 0.94
Buffer.compare 9.3690 ns/op 10.766 ns/op 0.87
shuffle list - 16384 els 5.5771 ms/op 6.5849 ms/op 0.85
shuffle list - 250000 els 83.126 ms/op 97.032 ms/op 0.86
processSlot - 1 slots 9.4630 us/op 18.104 us/op 0.52
processSlot - 32 slots 1.8029 ms/op 3.7351 ms/op 0.48
getEffectiveBalanceIncrementsZeroInactive - 250000 vs - 7PWei 36.115 ms/op 42.176 ms/op 0.86
getCommitteeAssignments - req 1 vs - 250000 vc 1.8252 ms/op 2.4603 ms/op 0.74
getCommitteeAssignments - req 100 vs - 250000 vc 3.5021 ms/op 4.3459 ms/op 0.81
getCommitteeAssignments - req 1000 vs - 250000 vc 3.7391 ms/op 4.7061 ms/op 0.79
findModifiedValidators - 10000 modified validators 263.60 ms/op 363.05 ms/op 0.73
findModifiedValidators - 1000 modified validators 185.50 ms/op 217.02 ms/op 0.85
findModifiedValidators - 100 modified validators 167.02 ms/op 218.68 ms/op 0.76
findModifiedValidators - 10 modified validators 188.66 ms/op 190.57 ms/op 0.99
findModifiedValidators - 1 modified validators 148.18 ms/op 209.29 ms/op 0.71
findModifiedValidators - no difference 139.14 ms/op 195.10 ms/op 0.71
compare ViewDUs 3.0187 s/op 3.4229 s/op 0.88
compare each validator Uint8Array 1.4926 s/op 1.3861 s/op 1.08
compare ViewDU to Uint8Array 775.57 ms/op 1.2857 s/op 0.60
migrate state 1000000 validators, 24 modified, 0 new 515.15 ms/op 667.79 ms/op 0.77
migrate state 1000000 validators, 1700 modified, 1000 new 755.60 ms/op 929.29 ms/op 0.81
migrate state 1000000 validators, 3400 modified, 2000 new 991.24 ms/op 1.2863 s/op 0.77
migrate state 1500000 validators, 24 modified, 0 new 643.10 ms/op 685.41 ms/op 0.94
migrate state 1500000 validators, 1700 modified, 1000 new 717.25 ms/op 897.44 ms/op 0.80
migrate state 1500000 validators, 3400 modified, 2000 new 1.0561 s/op 1.2037 s/op 0.88
RootCache.getBlockRootAtSlot - 250000 vs - 7PWei 6.4500 ns/op 4.9700 ns/op 1.30
state getBlockRootAtSlot - 250000 vs - 7PWei 566.72 ns/op 645.78 ns/op 0.88
computeProposers - vc 250000 6.4085 ms/op 8.2298 ms/op 0.78
computeEpochShuffling - vc 250000 79.772 ms/op 100.41 ms/op 0.79
getNextSyncCommittee - vc 250000 95.601 ms/op 132.46 ms/op 0.72
computeSigningRoot for AttestationData 22.958 us/op 19.842 us/op 1.16
hash AttestationData serialized data then Buffer.toString(base64) 1.2073 us/op 1.5721 us/op 0.77
toHexString serialized data 749.81 ns/op 979.23 ns/op 0.77
Buffer.toString(base64) 142.00 ns/op 206.21 ns/op 0.69

by benchmarkbot/action

Copy link

codecov bot commented Jun 12, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 62.76%. Comparing base (3be656b) to head (962f5dd).
Report is 1 commits behind head on unstable.

Additional details and impacted files
@@            Coverage Diff            @@
##           unstable    #6878   +/-   ##
=========================================
  Coverage     62.76%   62.76%           
=========================================
  Files           578      578           
  Lines         61273    61273           
  Branches       2122     2114    -8     
=========================================
  Hits          38455    38455           
- Misses        22779    22780    +1     
+ Partials         39       38    -1     

Copy link
Contributor

@ensi321 ensi321 left a comment

Choose a reason for hiding this comment

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

lgtm. Is there anymore endpoint that requires similar treatment?

@nflaig
Copy link
Member Author

nflaig commented Jun 13, 2024

Is there anymore endpoint that requires similar treatment?

Any POST endpoint that takes an array as filter, we might wanna apply the same to rewards endpoints

getAttestationsRewards: Endpoint<

getSyncCommitteeRewards: Endpoint<

@nflaig
Copy link
Member Author

nflaig commented Jun 13, 2024

Also noticed validation is too strict for rewards routes (see #6881), I think we should also update those and ignore empty []. This is generally better UX and avoids some edge cases, and there is really never the case where a user would want to call this, apply a empty filter and always get no data.

@nflaig nflaig merged commit f4460cd into unstable Jun 13, 2024
20 checks passed
@nflaig nflaig deleted the nflaig/fix-validator-balances branch June 13, 2024 10:37
@wemeetagain
Copy link
Member

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

3 participants