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

feat: asyncAggregateWithRandomness #7204

Merged
merged 5 commits into from
Oct 29, 2024

Conversation

matthewkeil
Copy link
Member

Motivation

Resolves #7197

Moves signature checks and aggregation for unaggregated attestations off main thread. Will help clear up thread congestion when subscribing to all subnets.

@matthewkeil matthewkeil requested a review from a team as a code owner October 29, 2024 04:15
Copy link

codecov bot commented Oct 29, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Please upload report for BASE (unstable@3cd2f16). Learn more about missing BASE report.
Report is 1 commits behind head on unstable.

Additional details and impacted files
@@             Coverage Diff             @@
##             unstable    #7204   +/-   ##
===========================================
  Coverage            ?   49.22%           
===========================================
  Files               ?      598           
  Lines               ?    39789           
  Branches            ?     2103           
===========================================
  Hits                ?    19588           
  Misses              ?    20161           
  Partials            ?       40           

Copy link
Contributor

github-actions bot commented Oct 29, 2024

Performance Report

✔️ no performance regression detected

Full benchmark results
Benchmark suite Current: 176405e Previous: 3cd2f16 Ratio
getPubkeys - index2pubkey - req 1000 vs - 250000 vc 2.3080 ms/op 2.6886 ms/op 0.86
getPubkeys - validatorsArr - req 1000 vs - 250000 vc 71.895 us/op 110.29 us/op 0.65
BLS verify - blst 1.0259 ms/op 1.0872 ms/op 0.94
BLS verifyMultipleSignatures 3 - blst 1.3538 ms/op 1.7034 ms/op 0.79
BLS verifyMultipleSignatures 8 - blst 2.0815 ms/op 2.7961 ms/op 0.74
BLS verifyMultipleSignatures 32 - blst 5.9865 ms/op 8.0926 ms/op 0.74
BLS verifyMultipleSignatures 64 - blst 11.373 ms/op 12.872 ms/op 0.88
BLS verifyMultipleSignatures 128 - blst 18.474 ms/op 20.877 ms/op 0.88
BLS deserializing 10000 signatures 710.63 ms/op 784.33 ms/op 0.91
BLS deserializing 100000 signatures 7.2071 s/op 7.7536 s/op 0.93
BLS verifyMultipleSignatures - same message - 3 - blst 1.1427 ms/op 1.1561 ms/op 0.99
BLS verifyMultipleSignatures - same message - 8 - blst 1.1895 ms/op 1.0966 ms/op 1.08
BLS verifyMultipleSignatures - same message - 32 - blst 1.8533 ms/op 1.8907 ms/op 0.98
BLS verifyMultipleSignatures - same message - 64 - blst 2.8287 ms/op 3.0104 ms/op 0.94
BLS verifyMultipleSignatures - same message - 128 - blst 4.5275 ms/op 5.0213 ms/op 0.90
BLS aggregatePubkeys 32 - blst 20.149 us/op 22.863 us/op 0.88
BLS aggregatePubkeys 128 - blst 73.350 us/op 82.292 us/op 0.89
notSeenSlots=1 numMissedVotes=1 numBadVotes=10 77.108 ms/op 72.798 ms/op 1.06
notSeenSlots=1 numMissedVotes=0 numBadVotes=4 62.325 ms/op 68.337 ms/op 0.91
notSeenSlots=2 numMissedVotes=1 numBadVotes=10 52.444 ms/op 57.367 ms/op 0.91
getSlashingsAndExits - default max 167.21 us/op 141.89 us/op 1.18
getSlashingsAndExits - 2k 408.06 us/op 364.17 us/op 1.12
proposeBlockBody type=full, size=empty 8.7044 ms/op 8.1510 ms/op 1.07
isKnown best case - 1 super set check 692.00 ns/op 605.00 ns/op 1.14
isKnown normal case - 2 super set checks 639.00 ns/op 564.00 ns/op 1.13
isKnown worse case - 16 super set checks 615.00 ns/op 560.00 ns/op 1.10
InMemoryCheckpointStateCache - add get delete 4.1630 us/op 3.8630 us/op 1.08
updateUnfinalizedPubkeys - updating 10 pubkeys 1.7889 ms/op 1.6403 ms/op 1.09
updateUnfinalizedPubkeys - updating 100 pubkeys 5.5233 ms/op 5.2385 ms/op 1.05
updateUnfinalizedPubkeys - updating 1000 pubkeys 63.057 ms/op 64.428 ms/op 0.98
validate api signedAggregateAndProof - struct 1.8226 ms/op 1.6569 ms/op 1.10
validate gossip signedAggregateAndProof - struct 1.6550 ms/op 1.6256 ms/op 1.02
batch validate gossip attestation - vc 640000 - chunk 32 158.60 us/op 151.70 us/op 1.05
batch validate gossip attestation - vc 640000 - chunk 64 137.55 us/op 134.96 us/op 1.02
batch validate gossip attestation - vc 640000 - chunk 128 131.48 us/op 119.72 us/op 1.10
batch validate gossip attestation - vc 640000 - chunk 256 122.23 us/op 108.46 us/op 1.13
pickEth1Vote - no votes 1.4283 ms/op 1.0802 ms/op 1.32
pickEth1Vote - max votes 8.9763 ms/op 6.8801 ms/op 1.30
pickEth1Vote - Eth1Data hashTreeRoot value x2048 16.834 ms/op 17.954 ms/op 0.94
pickEth1Vote - Eth1Data hashTreeRoot tree x2048 26.855 ms/op 23.917 ms/op 1.12
pickEth1Vote - Eth1Data fastSerialize value x2048 606.62 us/op 460.46 us/op 1.32
pickEth1Vote - Eth1Data fastSerialize tree x2048 3.8091 ms/op 2.9892 ms/op 1.27
bytes32 toHexString 791.00 ns/op 447.00 ns/op 1.77
bytes32 Buffer.toString(hex) 279.00 ns/op 249.00 ns/op 1.12
bytes32 Buffer.toString(hex) from Uint8Array 509.00 ns/op 377.00 ns/op 1.35
bytes32 Buffer.toString(hex) + 0x 284.00 ns/op 243.00 ns/op 1.17
Object access 1 prop 0.21100 ns/op 0.12900 ns/op 1.64
Map access 1 prop 0.14900 ns/op 0.12600 ns/op 1.18
Object get x1000 6.3570 ns/op 5.8640 ns/op 1.08
Map get x1000 6.7710 ns/op 6.3340 ns/op 1.07
Object set x1000 48.861 ns/op 32.519 ns/op 1.50
Map set x1000 33.573 ns/op 21.717 ns/op 1.55
Return object 10000 times 0.32160 ns/op 0.28480 ns/op 1.13
Throw Error 10000 times 3.5174 us/op 3.2482 us/op 1.08
toHex 179.42 ns/op 136.10 ns/op 1.32
Buffer.from 166.09 ns/op 131.06 ns/op 1.27
shared Buffer 97.466 ns/op 90.772 ns/op 1.07
fastMsgIdFn sha256 / 200 bytes 2.4180 us/op 2.2050 us/op 1.10
fastMsgIdFn h32 xxhash / 200 bytes 296.00 ns/op 222.00 ns/op 1.33
fastMsgIdFn h64 xxhash / 200 bytes 287.00 ns/op 271.00 ns/op 1.06
fastMsgIdFn sha256 / 1000 bytes 7.6820 us/op 7.1330 us/op 1.08
fastMsgIdFn h32 xxhash / 1000 bytes 438.00 ns/op 347.00 ns/op 1.26
fastMsgIdFn h64 xxhash / 1000 bytes 357.00 ns/op 343.00 ns/op 1.04
fastMsgIdFn sha256 / 10000 bytes 66.128 us/op 63.354 us/op 1.04
fastMsgIdFn h32 xxhash / 10000 bytes 1.9750 us/op 1.8240 us/op 1.08
fastMsgIdFn h64 xxhash / 10000 bytes 1.2830 us/op 1.2080 us/op 1.06
send data - 1000 256B messages 14.516 ms/op 12.818 ms/op 1.13
send data - 1000 512B messages 19.625 ms/op 18.438 ms/op 1.06
send data - 1000 1024B messages 30.019 ms/op 25.868 ms/op 1.16
send data - 1000 1200B messages 24.681 ms/op 27.459 ms/op 0.90
send data - 1000 2048B messages 36.239 ms/op 33.402 ms/op 1.08
send data - 1000 4096B messages 35.728 ms/op 32.102 ms/op 1.11
send data - 1000 16384B messages 76.464 ms/op 77.082 ms/op 0.99
send data - 1000 65536B messages 237.36 ms/op 217.84 ms/op 1.09
enrSubnets - fastDeserialize 64 bits 1.4230 us/op 1.0640 us/op 1.34
enrSubnets - ssz BitVector 64 bits 478.00 ns/op 352.00 ns/op 1.36
enrSubnets - fastDeserialize 4 bits 216.00 ns/op 140.00 ns/op 1.54
enrSubnets - ssz BitVector 4 bits 482.00 ns/op 351.00 ns/op 1.37
prioritizePeers score -10:0 att 32-0.1 sync 2-0 202.95 us/op 161.67 us/op 1.26
prioritizePeers score 0:0 att 32-0.25 sync 2-0.25 185.75 us/op 178.87 us/op 1.04
prioritizePeers score 0:0 att 32-0.5 sync 2-0.5 342.32 us/op 299.05 us/op 1.14
prioritizePeers score 0:0 att 64-0.75 sync 4-0.75 524.95 us/op 691.11 us/op 0.76
prioritizePeers score 0:0 att 64-1 sync 4-1 888.87 us/op 899.16 us/op 0.99
array of 16000 items push then shift 1.7083 us/op 1.6704 us/op 1.02
LinkedList of 16000 items push then shift 7.9120 ns/op 7.0690 ns/op 1.12
array of 16000 items push then pop 141.13 ns/op 123.26 ns/op 1.14
LinkedList of 16000 items push then pop 7.8370 ns/op 6.7790 ns/op 1.16
array of 24000 items push then shift 2.5079 us/op 2.3460 us/op 1.07
LinkedList of 24000 items push then shift 8.3600 ns/op 6.8570 ns/op 1.22
array of 24000 items push then pop 185.28 ns/op 147.62 ns/op 1.26
LinkedList of 24000 items push then pop 7.5380 ns/op 7.1490 ns/op 1.05
intersect bitArray bitLen 8 6.5570 ns/op 6.3300 ns/op 1.04
intersect array and set length 8 63.467 ns/op 47.224 ns/op 1.34
intersect bitArray bitLen 128 30.537 ns/op 29.379 ns/op 1.04
intersect array and set length 128 873.77 ns/op 680.42 ns/op 1.28
bitArray.getTrueBitIndexes() bitLen 128 2.3760 us/op 2.8440 us/op 0.84
bitArray.getTrueBitIndexes() bitLen 248 4.2120 us/op 3.7400 us/op 1.13
bitArray.getTrueBitIndexes() bitLen 512 10.334 us/op 8.5590 us/op 1.21
Buffer.concat 32 items 1.0570 us/op 916.00 ns/op 1.15
Uint8Array.set 32 items 2.0840 us/op 1.5690 us/op 1.33
Buffer.copy 2.1270 us/op 1.8850 us/op 1.13
Uint8Array.set - with subarray 3.2350 us/op 2.6290 us/op 1.23
Uint8Array.set - without subarray 1.5800 us/op 1.4940 us/op 1.06
getUint32 - dataview 272.00 ns/op 236.00 ns/op 1.15
getUint32 - manual 246.00 ns/op 158.00 ns/op 1.56
Set add up to 64 items then delete first 2.4600 us/op 2.2088 us/op 1.11
OrderedSet add up to 64 items then delete first 3.6294 us/op 3.3062 us/op 1.10
Set add up to 64 items then delete last 2.7155 us/op 2.5124 us/op 1.08
OrderedSet add up to 64 items then delete last 3.8392 us/op 3.9086 us/op 0.98
Set add up to 64 items then delete middle 3.0681 us/op 2.5592 us/op 1.20
OrderedSet add up to 64 items then delete middle 5.9982 us/op 5.2892 us/op 1.13
Set add up to 128 items then delete first 5.8948 us/op 5.0081 us/op 1.18
OrderedSet add up to 128 items then delete first 8.8163 us/op 7.4302 us/op 1.19
Set add up to 128 items then delete last 5.3863 us/op 5.0542 us/op 1.07
OrderedSet add up to 128 items then delete last 8.1481 us/op 7.7331 us/op 1.05
Set add up to 128 items then delete middle 5.3409 us/op 4.9155 us/op 1.09
OrderedSet add up to 128 items then delete middle 14.822 us/op 13.598 us/op 1.09
Set add up to 256 items then delete first 11.606 us/op 10.225 us/op 1.14
OrderedSet add up to 256 items then delete first 18.183 us/op 15.266 us/op 1.19
Set add up to 256 items then delete last 10.823 us/op 9.9713 us/op 1.09
OrderedSet add up to 256 items then delete last 16.588 us/op 15.559 us/op 1.07
Set add up to 256 items then delete middle 11.239 us/op 10.302 us/op 1.09
OrderedSet add up to 256 items then delete middle 46.639 us/op 40.061 us/op 1.16
transfer serialized Status (84 B) 1.4420 us/op 1.3760 us/op 1.05
copy serialized Status (84 B) 1.3390 us/op 1.2350 us/op 1.08
transfer serialized SignedVoluntaryExit (112 B) 1.4940 us/op 1.6020 us/op 0.93
copy serialized SignedVoluntaryExit (112 B) 1.3640 us/op 1.2750 us/op 1.07
transfer serialized ProposerSlashing (416 B) 2.3530 us/op 2.3600 us/op 1.00
copy serialized ProposerSlashing (416 B) 2.3200 us/op 1.9840 us/op 1.17
transfer serialized Attestation (485 B) 2.1810 us/op 2.2800 us/op 0.96
copy serialized Attestation (485 B) 2.0970 us/op 2.0430 us/op 1.03
transfer serialized AttesterSlashing (33232 B) 2.0950 us/op 2.1610 us/op 0.97
copy serialized AttesterSlashing (33232 B) 6.9210 us/op 6.0140 us/op 1.15
transfer serialized Small SignedBeaconBlock (128000 B) 2.9760 us/op 3.0890 us/op 0.96
copy serialized Small SignedBeaconBlock (128000 B) 16.168 us/op 24.793 us/op 0.65
transfer serialized Avg SignedBeaconBlock (200000 B) 3.3320 us/op 3.0960 us/op 1.08
copy serialized Avg SignedBeaconBlock (200000 B) 22.574 us/op 21.674 us/op 1.04
transfer serialized BlobsSidecar (524380 B) 3.0350 us/op 2.3220 us/op 1.31
copy serialized BlobsSidecar (524380 B) 74.204 us/op 94.792 us/op 0.78
transfer serialized Big SignedBeaconBlock (1000000 B) 3.5280 us/op 3.1990 us/op 1.10
copy serialized Big SignedBeaconBlock (1000000 B) 375.28 us/op 149.67 us/op 2.51
pass gossip attestations to forkchoice per slot 2.8731 ms/op 2.8831 ms/op 1.00
forkChoice updateHead vc 100000 bc 64 eq 0 459.82 us/op 462.54 us/op 0.99
forkChoice updateHead vc 600000 bc 64 eq 0 3.0751 ms/op 2.8468 ms/op 1.08
forkChoice updateHead vc 1000000 bc 64 eq 0 5.0483 ms/op 5.0345 ms/op 1.00
forkChoice updateHead vc 600000 bc 320 eq 0 2.8694 ms/op 3.1983 ms/op 0.90
forkChoice updateHead vc 600000 bc 1200 eq 0 3.0392 ms/op 3.0559 ms/op 0.99
forkChoice updateHead vc 600000 bc 7200 eq 0 3.5320 ms/op 3.5995 ms/op 0.98
forkChoice updateHead vc 600000 bc 64 eq 1000 10.469 ms/op 10.614 ms/op 0.99
forkChoice updateHead vc 600000 bc 64 eq 10000 10.586 ms/op 10.753 ms/op 0.98
forkChoice updateHead vc 600000 bc 64 eq 300000 14.457 ms/op 14.469 ms/op 1.00
computeDeltas 500000 validators 300 proto nodes 4.2293 ms/op 4.1131 ms/op 1.03
computeDeltas 500000 validators 1200 proto nodes 4.1791 ms/op 4.4210 ms/op 0.95
computeDeltas 500000 validators 7200 proto nodes 4.5587 ms/op 4.4820 ms/op 1.02
computeDeltas 750000 validators 300 proto nodes 6.5289 ms/op 6.4577 ms/op 1.01
computeDeltas 750000 validators 1200 proto nodes 6.4664 ms/op 6.7307 ms/op 0.96
computeDeltas 750000 validators 7200 proto nodes 6.1832 ms/op 6.8135 ms/op 0.91
computeDeltas 1400000 validators 300 proto nodes 11.170 ms/op 17.275 ms/op 0.65
computeDeltas 1400000 validators 1200 proto nodes 11.356 ms/op 22.124 ms/op 0.51
computeDeltas 1400000 validators 7200 proto nodes 11.221 ms/op 17.641 ms/op 0.64
computeDeltas 2100000 validators 300 proto nodes 17.235 ms/op 25.796 ms/op 0.67
computeDeltas 2100000 validators 1200 proto nodes 17.478 ms/op 30.385 ms/op 0.58
computeDeltas 2100000 validators 7200 proto nodes 18.154 ms/op 33.208 ms/op 0.55
altair processAttestation - 250000 vs - 7PWei normalcase 1.8858 ms/op 5.4890 ms/op 0.34
altair processAttestation - 250000 vs - 7PWei worstcase 3.1888 ms/op 6.2265 ms/op 0.51
altair processAttestation - setStatus - 1/6 committees join 101.38 us/op 221.32 us/op 0.46
altair processAttestation - setStatus - 1/3 committees join 199.09 us/op 385.24 us/op 0.52
altair processAttestation - setStatus - 1/2 committees join 266.36 us/op 516.67 us/op 0.52
altair processAttestation - setStatus - 2/3 committees join 340.09 us/op 614.39 us/op 0.55
altair processAttestation - setStatus - 4/5 committees join 499.64 us/op 840.45 us/op 0.59
altair processAttestation - setStatus - 100% committees join 587.59 us/op 912.75 us/op 0.64
altair processBlock - 250000 vs - 7PWei normalcase 4.5739 ms/op 9.4550 ms/op 0.48
altair processBlock - 250000 vs - 7PWei normalcase hashState 28.760 ms/op 34.757 ms/op 0.83
altair processBlock - 250000 vs - 7PWei worstcase 38.099 ms/op 45.823 ms/op 0.83
altair processBlock - 250000 vs - 7PWei worstcase hashState 78.790 ms/op 93.822 ms/op 0.84
phase0 processBlock - 250000 vs - 7PWei normalcase 2.1341 ms/op 3.6948 ms/op 0.58
phase0 processBlock - 250000 vs - 7PWei worstcase 24.683 ms/op 31.132 ms/op 0.79
altair processEth1Data - 250000 vs - 7PWei normalcase 361.73 us/op 610.20 us/op 0.59
getExpectedWithdrawals 250000 eb:1,eth1:1,we:0,wn:0,smpl:15 6.0920 us/op 6.9500 us/op 0.88
getExpectedWithdrawals 250000 eb:0.95,eth1:0.1,we:0.05,wn:0,smpl:219 54.040 us/op 33.115 us/op 1.63
getExpectedWithdrawals 250000 eb:0.95,eth1:0.3,we:0.05,wn:0,smpl:42 17.787 us/op 10.558 us/op 1.68
getExpectedWithdrawals 250000 eb:0.95,eth1:0.7,we:0.05,wn:0,smpl:18 8.3860 us/op 6.5420 us/op 1.28
getExpectedWithdrawals 250000 eb:0.1,eth1:0.1,we:0,wn:0,smpl:1020 188.35 us/op 173.35 us/op 1.09
getExpectedWithdrawals 250000 eb:0.03,eth1:0.03,we:0,wn:0,smpl:11777 1.4094 ms/op 1.5165 ms/op 0.93
getExpectedWithdrawals 250000 eb:0.01,eth1:0.01,we:0,wn:0,smpl:16384 2.0507 ms/op 1.7147 ms/op 1.20
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,smpl:16384 1.6290 ms/op 1.9481 ms/op 0.84
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,nocache,smpl:16384 4.3027 ms/op 4.0827 ms/op 1.05
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,smpl:16384 2.0338 ms/op 2.1220 ms/op 0.96
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,nocache,smpl:16384 4.9776 ms/op 4.2102 ms/op 1.18
Tree 40 250000 create 332.69 ms/op 262.57 ms/op 1.27
Tree 40 250000 get(125000) 167.38 ns/op 160.05 ns/op 1.05
Tree 40 250000 set(125000) 859.54 ns/op 796.01 ns/op 1.08
Tree 40 250000 toArray() 23.382 ms/op 20.929 ms/op 1.12
Tree 40 250000 iterate all - toArray() + loop 21.656 ms/op 19.876 ms/op 1.09
Tree 40 250000 iterate all - get(i) 60.078 ms/op 52.648 ms/op 1.14
Array 250000 create 3.7878 ms/op 3.4292 ms/op 1.10
Array 250000 clone - spread 1.4388 ms/op 1.9668 ms/op 0.73
Array 250000 get(125000) 0.46600 ns/op 0.43600 ns/op 1.07
Array 250000 set(125000) 0.49000 ns/op 0.45500 ns/op 1.08
Array 250000 iterate all - loop 109.94 us/op 90.784 us/op 1.21
phase0 afterProcessEpoch - 250000 vs - 7PWei 54.319 ms/op 53.464 ms/op 1.02
Array.fill - length 1000000 5.8432 ms/op 4.1676 ms/op 1.40
Array push - length 1000000 22.090 ms/op 18.240 ms/op 1.21
Array.get 0.31301 ns/op 0.29119 ns/op 1.07
Uint8Array.get 0.44465 ns/op 0.43793 ns/op 1.02
phase0 beforeProcessEpoch - 250000 vs - 7PWei 21.942 ms/op 17.561 ms/op 1.25
altair processEpoch - mainnet_e81889 301.15 ms/op 275.44 ms/op 1.09
mainnet_e81889 - altair beforeProcessEpoch 22.043 ms/op 20.441 ms/op 1.08
mainnet_e81889 - altair processJustificationAndFinalization 17.319 us/op 12.692 us/op 1.36
mainnet_e81889 - altair processInactivityUpdates 7.4860 ms/op 6.0316 ms/op 1.24
mainnet_e81889 - altair processRewardsAndPenalties 54.096 ms/op 48.220 ms/op 1.12
mainnet_e81889 - altair processRegistryUpdates 3.9090 us/op 2.2080 us/op 1.77
mainnet_e81889 - altair processSlashings 1.1120 us/op 639.00 ns/op 1.74
mainnet_e81889 - altair processEth1DataReset 685.00 ns/op 519.00 ns/op 1.32
mainnet_e81889 - altair processEffectiveBalanceUpdates 1.9834 ms/op 1.9446 ms/op 1.02
mainnet_e81889 - altair processSlashingsReset 6.2910 us/op 3.4660 us/op 1.82
mainnet_e81889 - altair processRandaoMixesReset 11.644 us/op 5.5250 us/op 2.11
mainnet_e81889 - altair processHistoricalRootsUpdate 986.00 ns/op 778.00 ns/op 1.27
mainnet_e81889 - altair processParticipationFlagUpdates 4.7700 us/op 2.8570 us/op 1.67
mainnet_e81889 - altair processSyncCommitteeUpdates 727.00 ns/op 559.00 ns/op 1.30
mainnet_e81889 - altair afterProcessEpoch 54.212 ms/op 57.339 ms/op 0.95
capella processEpoch - mainnet_e217614 1.2054 s/op 1.0811 s/op 1.11
mainnet_e217614 - capella beforeProcessEpoch 82.435 ms/op 80.182 ms/op 1.03
mainnet_e217614 - capella processJustificationAndFinalization 19.169 us/op 22.067 us/op 0.87
mainnet_e217614 - capella processInactivityUpdates 19.481 ms/op 20.062 ms/op 0.97
mainnet_e217614 - capella processRewardsAndPenalties 247.77 ms/op 260.36 ms/op 0.95
mainnet_e217614 - capella processRegistryUpdates 16.598 us/op 18.583 us/op 0.89
mainnet_e217614 - capella processSlashings 682.00 ns/op 527.00 ns/op 1.29
mainnet_e217614 - capella processEth1DataReset 803.00 ns/op 364.00 ns/op 2.21
mainnet_e217614 - capella processEffectiveBalanceUpdates 18.594 ms/op 15.896 ms/op 1.17
mainnet_e217614 - capella processSlashingsReset 6.2950 us/op 8.9770 us/op 0.70
mainnet_e217614 - capella processRandaoMixesReset 6.9970 us/op 7.7190 us/op 0.91
mainnet_e217614 - capella processHistoricalRootsUpdate 1.0150 us/op 1.0730 us/op 0.95
mainnet_e217614 - capella processParticipationFlagUpdates 3.4360 us/op 3.3660 us/op 1.02
mainnet_e217614 - capella afterProcessEpoch 135.47 ms/op 131.87 ms/op 1.03
phase0 processEpoch - mainnet_e58758 414.05 ms/op 388.36 ms/op 1.07
mainnet_e58758 - phase0 beforeProcessEpoch 103.60 ms/op 91.588 ms/op 1.13
mainnet_e58758 - phase0 processJustificationAndFinalization 33.762 us/op 17.445 us/op 1.94
mainnet_e58758 - phase0 processRewardsAndPenalties 42.435 ms/op 40.491 ms/op 1.05
mainnet_e58758 - phase0 processRegistryUpdates 16.938 us/op 7.9590 us/op 2.13
mainnet_e58758 - phase0 processSlashings 598.00 ns/op 341.00 ns/op 1.75
mainnet_e58758 - phase0 processEth1DataReset 685.00 ns/op 878.00 ns/op 0.78
mainnet_e58758 - phase0 processEffectiveBalanceUpdates 2.0204 ms/op 1.4455 ms/op 1.40
mainnet_e58758 - phase0 processSlashingsReset 11.552 us/op 2.2760 us/op 5.08
mainnet_e58758 - phase0 processRandaoMixesReset 14.584 us/op 4.3540 us/op 3.35
mainnet_e58758 - phase0 processHistoricalRootsUpdate 1.5910 us/op 338.00 ns/op 4.71
mainnet_e58758 - phase0 processParticipationRecordUpdates 11.829 us/op 4.9600 us/op 2.38
mainnet_e58758 - phase0 afterProcessEpoch 50.476 ms/op 44.717 ms/op 1.13
phase0 processEffectiveBalanceUpdates - 250000 normalcase 2.1926 ms/op 1.6064 ms/op 1.36
phase0 processEffectiveBalanceUpdates - 250000 worstcase 0.5 6.3100 ms/op 2.6582 ms/op 2.37
altair processInactivityUpdates - 250000 normalcase 19.938 ms/op 21.978 ms/op 0.91
altair processInactivityUpdates - 250000 worstcase 20.821 ms/op 21.600 ms/op 0.96
phase0 processRegistryUpdates - 250000 normalcase 18.708 us/op 8.2800 us/op 2.26
phase0 processRegistryUpdates - 250000 badcase_full_deposits 536.57 us/op 354.98 us/op 1.51
phase0 processRegistryUpdates - 250000 worstcase 0.5 172.71 ms/op 136.42 ms/op 1.27
altair processRewardsAndPenalties - 250000 normalcase 49.562 ms/op 45.830 ms/op 1.08
altair processRewardsAndPenalties - 250000 worstcase 46.833 ms/op 53.039 ms/op 0.88
phase0 getAttestationDeltas - 250000 normalcase 9.4614 ms/op 8.2600 ms/op 1.15
phase0 getAttestationDeltas - 250000 worstcase 8.3777 ms/op 7.5129 ms/op 1.12
phase0 processSlashings - 250000 worstcase 124.03 us/op 124.48 us/op 1.00
altair processSyncCommitteeUpdates - 250000 140.75 ms/op 130.35 ms/op 1.08
BeaconState.hashTreeRoot - No change 395.00 ns/op 258.00 ns/op 1.53
BeaconState.hashTreeRoot - 1 full validator 137.40 us/op 114.41 us/op 1.20
BeaconState.hashTreeRoot - 32 full validator 1.2365 ms/op 1.1002 ms/op 1.12
BeaconState.hashTreeRoot - 512 full validator 12.616 ms/op 11.751 ms/op 1.07
BeaconState.hashTreeRoot - 1 validator.effectiveBalance 146.94 us/op 141.64 us/op 1.04
BeaconState.hashTreeRoot - 32 validator.effectiveBalance 2.2206 ms/op 2.1349 ms/op 1.04
BeaconState.hashTreeRoot - 512 validator.effectiveBalance 27.892 ms/op 25.949 ms/op 1.07
BeaconState.hashTreeRoot - 1 balances 124.62 us/op 129.17 us/op 0.96
BeaconState.hashTreeRoot - 32 balances 869.20 us/op 867.94 us/op 1.00
BeaconState.hashTreeRoot - 512 balances 7.7559 ms/op 8.2139 ms/op 0.94
BeaconState.hashTreeRoot - 250000 balances 190.39 ms/op 202.10 ms/op 0.94
aggregationBits - 2048 els - zipIndexesInBitList 25.432 us/op 25.458 us/op 1.00
byteArrayEquals 32 54.264 ns/op 53.858 ns/op 1.01
Buffer.compare 32 17.213 ns/op 17.315 ns/op 0.99
byteArrayEquals 1024 1.5968 us/op 1.5920 us/op 1.00
Buffer.compare 1024 25.852 ns/op 25.959 ns/op 1.00
byteArrayEquals 16384 25.745 us/op 25.330 us/op 1.02
Buffer.compare 16384 300.76 ns/op 199.93 ns/op 1.50
byteArrayEquals 123687377 194.83 ms/op 197.75 ms/op 0.99
Buffer.compare 123687377 7.4918 ms/op 6.6857 ms/op 1.12
byteArrayEquals 32 - diff last byte 53.246 ns/op 52.782 ns/op 1.01
Buffer.compare 32 - diff last byte 17.604 ns/op 17.850 ns/op 0.99
byteArrayEquals 1024 - diff last byte 1.6196 us/op 1.5774 us/op 1.03
Buffer.compare 1024 - diff last byte 26.316 ns/op 26.049 ns/op 1.01
byteArrayEquals 16384 - diff last byte 25.751 us/op 25.149 us/op 1.02
Buffer.compare 16384 - diff last byte 207.02 ns/op 203.99 ns/op 1.01
byteArrayEquals 123687377 - diff last byte 199.44 ms/op 191.95 ms/op 1.04
Buffer.compare 123687377 - diff last byte 10.387 ms/op 8.5519 ms/op 1.21
byteArrayEquals 32 - random bytes 5.6780 ns/op 5.4530 ns/op 1.04
Buffer.compare 32 - random bytes 18.671 ns/op 18.012 ns/op 1.04
byteArrayEquals 1024 - random bytes 5.6810 ns/op 5.4790 ns/op 1.04
Buffer.compare 1024 - random bytes 18.679 ns/op 20.475 ns/op 0.91
byteArrayEquals 16384 - random bytes 5.6460 ns/op 5.5290 ns/op 1.02
Buffer.compare 16384 - random bytes 18.679 ns/op 19.135 ns/op 0.98
byteArrayEquals 123687377 - random bytes 7.0800 ns/op 6.6200 ns/op 1.07
Buffer.compare 123687377 - random bytes 20.290 ns/op 19.580 ns/op 1.04
regular array get 100000 times 36.531 us/op 43.928 us/op 0.83
wrappedArray get 100000 times 36.597 us/op 34.570 us/op 1.06
arrayWithProxy get 100000 times 14.443 ms/op 14.241 ms/op 1.01
ssz.Root.equals 50.243 ns/op 49.154 ns/op 1.02
byteArrayEquals 49.645 ns/op 47.567 ns/op 1.04
Buffer.compare 11.347 ns/op 11.120 ns/op 1.02
processSlot - 1 slots 17.731 us/op 15.526 us/op 1.14
processSlot - 32 slots 3.8771 ms/op 2.9314 ms/op 1.32
getEffectiveBalanceIncrementsZeroInactive - 250000 vs - 7PWei 41.055 ms/op 40.612 ms/op 1.01
getCommitteeAssignments - req 1 vs - 250000 vc 2.2343 ms/op 2.2868 ms/op 0.98
getCommitteeAssignments - req 100 vs - 250000 vc 4.4066 ms/op 4.3287 ms/op 1.02
getCommitteeAssignments - req 1000 vs - 250000 vc 4.5875 ms/op 4.6550 ms/op 0.99
findModifiedValidators - 10000 modified validators 313.67 ms/op 254.21 ms/op 1.23
findModifiedValidators - 1000 modified validators 275.47 ms/op 180.59 ms/op 1.53
findModifiedValidators - 100 modified validators 343.20 ms/op 159.32 ms/op 2.15
findModifiedValidators - 10 modified validators 315.39 ms/op 176.88 ms/op 1.78
findModifiedValidators - 1 modified validators 276.08 ms/op 172.06 ms/op 1.60
findModifiedValidators - no difference 252.54 ms/op 183.84 ms/op 1.37
compare ViewDUs 4.0147 s/op 3.5378 s/op 1.13
compare each validator Uint8Array 1.7767 s/op 1.6422 s/op 1.08
compare ViewDU to Uint8Array 1.5645 s/op 1.4105 s/op 1.11
migrate state 1000000 validators, 24 modified, 0 new 950.46 ms/op 779.25 ms/op 1.22
migrate state 1000000 validators, 1700 modified, 1000 new 1.0913 s/op 1.0732 s/op 1.02
migrate state 1000000 validators, 3400 modified, 2000 new 1.2811 s/op 1.2023 s/op 1.07
migrate state 1500000 validators, 24 modified, 0 new 757.62 ms/op 860.03 ms/op 0.88
migrate state 1500000 validators, 1700 modified, 1000 new 887.09 ms/op 1.2822 s/op 0.69
migrate state 1500000 validators, 3400 modified, 2000 new 1.2808 s/op 1.4975 s/op 0.86
RootCache.getBlockRootAtSlot - 250000 vs - 7PWei 4.5200 ns/op 6.6100 ns/op 0.68
state getBlockRootAtSlot - 250000 vs - 7PWei 1.0257 us/op 1.0633 us/op 0.96
computeProposers - vc 250000 8.2806 ms/op 13.233 ms/op 0.63
computeEpochShuffling - vc 250000 41.739 ms/op 59.308 ms/op 0.70
getNextSyncCommittee - vc 250000 147.61 ms/op 194.17 ms/op 0.76
computeSigningRoot for AttestationData 26.639 us/op 31.926 us/op 0.83
hash AttestationData serialized data then Buffer.toString(base64) 1.5590 us/op 2.1449 us/op 0.73
toHexString serialized data 893.30 ns/op 1.5362 us/op 0.58
Buffer.toString(base64) 179.92 ns/op 277.56 ns/op 0.65
nodejs block root to RootHex using toHex 166.67 ns/op 221.59 ns/op 0.75
nodejs block root to RootHex using toRootHex 93.878 ns/op 126.28 ns/op 0.74
browser block root to RootHex using the deprecated toHexString 228.44 ns/op 356.56 ns/op 0.64
browser block root to RootHex using toHex 181.51 ns/op 296.71 ns/op 0.61
browser block root to RootHex using toRootHex 161.75 ns/op 200.04 ns/op 0.81

by benchmarkbot/action

@twoeths
Copy link
Contributor

twoeths commented Oct 29, 2024

there are big improvement of this PR, missed attestations + target were reduced from ~10% to 3-4% on a 1k subscribing to all subnets

Screenshot 2024-10-29 at 17 35 39

wemeetagain
wemeetagain previously approved these changes Oct 29, 2024
@matthewkeil matthewkeil added the status-do-not-merge Merging this issue will break the build. Do not merge! label Oct 29, 2024
@matthewkeil
Copy link
Member Author

there are big improvement of this PR, missed attestations + target were reduced from ~10% to 3-4% on a 1k subscribing to all subnets

Screenshot 2024-10-29 at 17 35 39

Great news! Can we let the metrics soak a bit more before we merge? Just incase anything wonky shows up

@wemeetagain
Copy link
Member

Oky, will wait until later today to get more data. I'm hoping to cut a new RC by my end of day today and want to include this.

@matthewkeil matthewkeil removed the status-do-not-merge Merging this issue will break the build. Do not merge! label Oct 29, 2024
@matthewkeil
Copy link
Member Author

Everything across the board looks healthier from attestations to scrape duration. The one thing that did stand out though is mesh peers are not as good. Not sure if that is just a function of the node still being relatively fresh and that will stabilize over the next several hours or not... CPU utilization is up a bit but i suppose its just working more efficiently with the multithreading.

Wondering if we can tune that even further by changing the number of libuv threads. Can play with that in another PR though.

@wemeetagain
Copy link
Member

The one thing that did stand out though is mesh peers are not as good.

I don't think that is an apples-to-apples comparison. your test is using subscribe-all-subnets and other comparable nodes aren't.

@wemeetagain wemeetagain merged commit e31d535 into unstable Oct 29, 2024
21 checks passed
@wemeetagain wemeetagain deleted the mkeil/async-aggregate-with-randomness branch October 29, 2024 18:48
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.

aggregateWithRandomness performance issue when subscribing to all subnets
3 participants