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: restore discv5 metrics #5590

Merged
merged 2 commits into from
May 31, 2023
Merged

Conversation

wemeetagain
Copy link
Member

Motivation

Discv5 metrics were accidentally disabled after the network thread refactor

Description

Reenable discv5 metrics

@wemeetagain wemeetagain requested a review from a team as a code owner May 30, 2023 18:51
@github-actions
Copy link
Contributor

github-actions bot commented May 30, 2023

Performance Report

✔️ no performance regression detected

Full benchmark results
Benchmark suite Current: 9c09705 Previous: 888c599 Ratio
getPubkeys - index2pubkey - req 1000 vs - 250000 vc 968.95 us/op 605.26 us/op 1.60
getPubkeys - validatorsArr - req 1000 vs - 250000 vc 47.664 us/op 50.910 us/op 0.94
BLS verify - blst-native 1.2470 ms/op 1.2682 ms/op 0.98
BLS verifyMultipleSignatures 3 - blst-native 2.6190 ms/op 2.5585 ms/op 1.02
BLS verifyMultipleSignatures 8 - blst-native 5.4671 ms/op 5.5184 ms/op 0.99
BLS verifyMultipleSignatures 32 - blst-native 19.797 ms/op 19.961 ms/op 0.99
BLS aggregatePubkeys 32 - blst-native 27.308 us/op 26.364 us/op 1.04
BLS aggregatePubkeys 128 - blst-native 106.41 us/op 104.29 us/op 1.02
getAttestationsForBlock 61.780 ms/op 63.399 ms/op 0.97
isKnown best case - 1 super set check 292.00 ns/op 277.00 ns/op 1.05
isKnown normal case - 2 super set checks 289.00 ns/op 274.00 ns/op 1.05
isKnown worse case - 16 super set checks 303.00 ns/op 275.00 ns/op 1.10
CheckpointStateCache - add get delete 6.1540 us/op 5.8990 us/op 1.04
validate gossip signedAggregateAndProof - struct 3.0120 ms/op 2.9085 ms/op 1.04
validate gossip attestation - struct 1.3834 ms/op 1.3798 ms/op 1.00
pickEth1Vote - no votes 1.3924 ms/op 1.3757 ms/op 1.01
pickEth1Vote - max votes 13.391 ms/op 12.834 ms/op 1.04
pickEth1Vote - Eth1Data hashTreeRoot value x2048 9.8155 ms/op 10.167 ms/op 0.97
pickEth1Vote - Eth1Data hashTreeRoot tree x2048 18.404 ms/op 16.708 ms/op 1.10
pickEth1Vote - Eth1Data fastSerialize value x2048 780.39 us/op 765.51 us/op 1.02
pickEth1Vote - Eth1Data fastSerialize tree x2048 6.0249 ms/op 7.0074 ms/op 0.86
bytes32 toHexString 742.00 ns/op 646.00 ns/op 1.15
bytes32 Buffer.toString(hex) 440.00 ns/op 434.00 ns/op 1.01
bytes32 Buffer.toString(hex) from Uint8Array 665.00 ns/op 650.00 ns/op 1.02
bytes32 Buffer.toString(hex) + 0x 467.00 ns/op 455.00 ns/op 1.03
Object access 1 prop 0.21900 ns/op 0.21100 ns/op 1.04
Map access 1 prop 0.18400 ns/op 0.17800 ns/op 1.03
Object get x1000 9.1680 ns/op 6.9580 ns/op 1.32
Map get x1000 0.69600 ns/op 0.64400 ns/op 1.08
Object set x1000 81.873 ns/op 65.578 ns/op 1.25
Map set x1000 58.653 ns/op 52.171 ns/op 1.12
Return object 10000 times 0.27440 ns/op 0.24890 ns/op 1.10
Throw Error 10000 times 5.0289 us/op 4.3650 us/op 1.15
fastMsgIdFn sha256 / 200 bytes 3.8120 us/op 3.6200 us/op 1.05
fastMsgIdFn h32 xxhash / 200 bytes 355.00 ns/op 321.00 ns/op 1.11
fastMsgIdFn h64 xxhash / 200 bytes 554.00 ns/op 484.00 ns/op 1.14
fastMsgIdFn sha256 / 1000 bytes 12.962 us/op 12.030 us/op 1.08
fastMsgIdFn h32 xxhash / 1000 bytes 493.00 ns/op 456.00 ns/op 1.08
fastMsgIdFn h64 xxhash / 1000 bytes 602.00 ns/op 553.00 ns/op 1.09
fastMsgIdFn sha256 / 10000 bytes 118.60 us/op 108.60 us/op 1.09
fastMsgIdFn h32 xxhash / 10000 bytes 2.1330 us/op 2.0090 us/op 1.06
fastMsgIdFn h64 xxhash / 10000 bytes 1.5890 us/op 1.4700 us/op 1.08
enrSubnets - fastDeserialize 64 bits 1.9860 us/op 1.4180 us/op 1.40
enrSubnets - ssz BitVector 64 bits 694.00 ns/op 614.00 ns/op 1.13
enrSubnets - fastDeserialize 4 bits 230.00 ns/op 206.00 ns/op 1.12
enrSubnets - ssz BitVector 4 bits 674.00 ns/op 628.00 ns/op 1.07
prioritizePeers score -10:0 att 32-0.1 sync 2-0 130.25 us/op 123.56 us/op 1.05
prioritizePeers score 0:0 att 32-0.25 sync 2-0.25 170.87 us/op 171.25 us/op 1.00
prioritizePeers score 0:0 att 32-0.5 sync 2-0.5 261.41 us/op 193.89 us/op 1.35
prioritizePeers score 0:0 att 64-0.75 sync 4-0.75 358.72 us/op 354.89 us/op 1.01
prioritizePeers score 0:0 att 64-1 sync 4-1 439.54 us/op 425.39 us/op 1.03
array of 16000 items push then shift 1.9255 us/op 1.7209 us/op 1.12
LinkedList of 16000 items push then shift 9.8370 ns/op 9.3430 ns/op 1.05
array of 16000 items push then pop 113.92 ns/op 114.77 ns/op 0.99
LinkedList of 16000 items push then pop 9.4900 ns/op 9.0070 ns/op 1.05
array of 24000 items push then shift 2.7314 us/op 2.4656 us/op 1.11
LinkedList of 24000 items push then shift 9.8360 ns/op 9.4760 ns/op 1.04
array of 24000 items push then pop 104.97 ns/op 85.185 ns/op 1.23
LinkedList of 24000 items push then pop 10.148 ns/op 8.9900 ns/op 1.13
intersect bitArray bitLen 8 15.779 ns/op 13.852 ns/op 1.14
intersect array and set length 8 91.163 ns/op 88.899 ns/op 1.03
intersect bitArray bitLen 128 47.448 ns/op 45.936 ns/op 1.03
intersect array and set length 128 1.2483 us/op 1.2324 us/op 1.01
Buffer.concat 32 items 2.8090 us/op 3.0930 us/op 0.91
Uint8Array.set 32 items 3.4390 us/op 2.8500 us/op 1.21
transfer serialized Status (84 B) 2.2830 us/op 2.2420 us/op 1.02
copy serialized Status (84 B) 1.8060 us/op 1.9310 us/op 0.94
transfer serialized SignedVoluntaryExit (112 B) 2.2460 us/op 2.2600 us/op 0.99
copy serialized SignedVoluntaryExit (112 B) 1.8070 us/op 2.0650 us/op 0.88
transfer serialized ProposerSlashing (416 B) 2.9090 us/op 3.3990 us/op 0.86
copy serialized ProposerSlashing (416 B) 3.3230 us/op 3.4530 us/op 0.96
transfer serialized Attestation (485 B) 3.5710 us/op 3.2000 us/op 1.12
copy serialized Attestation (485 B) 3.5650 us/op 3.4010 us/op 1.05
transfer serialized AttesterSlashing (33232 B) 3.4350 us/op 3.6590 us/op 0.94
copy serialized AttesterSlashing (33232 B) 8.6830 us/op 9.6930 us/op 0.90
transfer serialized Small SignedBeaconBlock (128000 B) 3.7000 us/op 3.8980 us/op 0.95
copy serialized Small SignedBeaconBlock (128000 B) 22.698 us/op 21.207 us/op 1.07
transfer serialized Avg SignedBeaconBlock (200000 B) 3.7990 us/op 4.2380 us/op 0.90
copy serialized Avg SignedBeaconBlock (200000 B) 38.171 us/op 30.059 us/op 1.27
transfer serialized BlobsSidecar (524380 B) 4.4240 us/op 3.9190 us/op 1.13
copy serialized BlobsSidecar (524380 B) 213.65 us/op 141.94 us/op 1.51
transfer serialized Big SignedBeaconBlock (1000000 B) 4.2060 us/op 4.0430 us/op 1.04
copy serialized Big SignedBeaconBlock (1000000 B) 368.22 us/op 297.28 us/op 1.24
pass gossip attestations to forkchoice per slot 2.5997 ms/op 2.4358 ms/op 1.07
computeDeltas 4.1866 ms/op 3.1683 ms/op 1.32
computeProposerBoostScoreFromBalances 1.8405 ms/op 1.8328 ms/op 1.00
altair processAttestation - 250000 vs - 7PWei normalcase 2.8967 ms/op 2.8876 ms/op 1.00
altair processAttestation - 250000 vs - 7PWei worstcase 4.3859 ms/op 3.8862 ms/op 1.13
altair processAttestation - setStatus - 1/6 committees join 144.60 us/op 151.49 us/op 0.95
altair processAttestation - setStatus - 1/3 committees join 304.79 us/op 293.00 us/op 1.04
altair processAttestation - setStatus - 1/2 committees join 390.27 us/op 389.28 us/op 1.00
altair processAttestation - setStatus - 2/3 committees join 484.69 us/op 490.60 us/op 0.99
altair processAttestation - setStatus - 4/5 committees join 677.61 us/op 700.45 us/op 0.97
altair processAttestation - setStatus - 100% committees join 788.83 us/op 810.74 us/op 0.97
altair processBlock - 250000 vs - 7PWei normalcase 18.677 ms/op 19.423 ms/op 0.96
altair processBlock - 250000 vs - 7PWei normalcase hashState 24.945 ms/op 28.500 ms/op 0.88
altair processBlock - 250000 vs - 7PWei worstcase 52.484 ms/op 51.302 ms/op 1.02
altair processBlock - 250000 vs - 7PWei worstcase hashState 73.281 ms/op 74.963 ms/op 0.98
phase0 processBlock - 250000 vs - 7PWei normalcase 2.3481 ms/op 2.4490 ms/op 0.96
phase0 processBlock - 250000 vs - 7PWei worstcase 31.379 ms/op 31.777 ms/op 0.99
altair processEth1Data - 250000 vs - 7PWei normalcase 526.80 us/op 513.76 us/op 1.03
getExpectedWithdrawals 250000 eb:1,eth1:1,we:0,wn:0,smpl:15 12.685 us/op 10.557 us/op 1.20
getExpectedWithdrawals 250000 eb:0.95,eth1:0.1,we:0.05,wn:0,smpl:219 38.488 us/op 33.961 us/op 1.13
getExpectedWithdrawals 250000 eb:0.95,eth1:0.3,we:0.05,wn:0,smpl:42 14.053 us/op 14.197 us/op 0.99
getExpectedWithdrawals 250000 eb:0.95,eth1:0.7,we:0.05,wn:0,smpl:18 10.814 us/op 12.359 us/op 0.87
getExpectedWithdrawals 250000 eb:0.1,eth1:0.1,we:0,wn:0,smpl:1020 131.09 us/op 129.80 us/op 1.01
getExpectedWithdrawals 250000 eb:0.03,eth1:0.03,we:0,wn:0,smpl:11777 692.95 us/op 690.10 us/op 1.00
getExpectedWithdrawals 250000 eb:0.01,eth1:0.01,we:0,wn:0,smpl:16384 953.54 us/op 947.10 us/op 1.01
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,smpl:16384 895.45 us/op 924.14 us/op 0.97
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,nocache,smpl:16384 2.3909 ms/op 2.9332 ms/op 0.82
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,smpl:16384 1.5916 ms/op 1.7519 ms/op 0.91
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,nocache,smpl:16384 4.2106 ms/op 5.3741 ms/op 0.78
Tree 40 250000 create 375.70 ms/op 563.71 ms/op 0.67
Tree 40 250000 get(125000) 201.00 ns/op 205.58 ns/op 0.98
Tree 40 250000 set(125000) 1.0747 us/op 1.4149 us/op 0.76
Tree 40 250000 toArray() 23.691 ms/op 27.382 ms/op 0.87
Tree 40 250000 iterate all - toArray() + loop 23.006 ms/op 28.087 ms/op 0.82
Tree 40 250000 iterate all - get(i) 78.481 ms/op 83.103 ms/op 0.94
MutableVector 250000 create 12.284 ms/op 12.082 ms/op 1.02
MutableVector 250000 get(125000) 6.7080 ns/op 6.9720 ns/op 0.96
MutableVector 250000 set(125000) 286.35 ns/op 312.85 ns/op 0.92
MutableVector 250000 toArray() 3.2680 ms/op 3.9560 ms/op 0.83
MutableVector 250000 iterate all - toArray() + loop 3.2371 ms/op 4.4792 ms/op 0.72
MutableVector 250000 iterate all - get(i) 1.5578 ms/op 1.6305 ms/op 0.96
Array 250000 create 2.6499 ms/op 4.3909 ms/op 0.60
Array 250000 clone - spread 1.1781 ms/op 2.0893 ms/op 0.56
Array 250000 get(125000) 0.60200 ns/op 1.0480 ns/op 0.57
Array 250000 set(125000) 0.69000 ns/op 0.89900 ns/op 0.77
Array 250000 iterate all - loop 111.60 us/op 97.103 us/op 1.15
effectiveBalanceIncrements clone Uint8Array 300000 34.542 us/op 60.634 us/op 0.57
effectiveBalanceIncrements clone MutableVector 300000 387.00 ns/op 457.00 ns/op 0.85
effectiveBalanceIncrements rw all Uint8Array 300000 172.12 us/op 181.63 us/op 0.95
effectiveBalanceIncrements rw all MutableVector 300000 86.232 ms/op 109.70 ms/op 0.79
phase0 afterProcessEpoch - 250000 vs - 7PWei 117.80 ms/op 130.29 ms/op 0.90
phase0 beforeProcessEpoch - 250000 vs - 7PWei 40.840 ms/op 42.245 ms/op 0.97
altair processEpoch - mainnet_e81889 346.14 ms/op 414.58 ms/op 0.83
mainnet_e81889 - altair beforeProcessEpoch 71.071 ms/op 82.014 ms/op 0.87
mainnet_e81889 - altair processJustificationAndFinalization 23.098 us/op 36.343 us/op 0.64
mainnet_e81889 - altair processInactivityUpdates 6.2060 ms/op 7.4393 ms/op 0.83
mainnet_e81889 - altair processRewardsAndPenalties 70.668 ms/op 70.812 ms/op 1.00
mainnet_e81889 - altair processRegistryUpdates 2.8830 us/op 5.8660 us/op 0.49
mainnet_e81889 - altair processSlashings 633.00 ns/op 1.2460 us/op 0.51
mainnet_e81889 - altair processEth1DataReset 843.00 ns/op 1.3410 us/op 0.63
mainnet_e81889 - altair processEffectiveBalanceUpdates 1.2991 ms/op 2.4568 ms/op 0.53
mainnet_e81889 - altair processSlashingsReset 7.5590 us/op 10.435 us/op 0.72
mainnet_e81889 - altair processRandaoMixesReset 7.4270 us/op 11.004 us/op 0.67
mainnet_e81889 - altair processHistoricalRootsUpdate 1.0050 us/op 1.6420 us/op 0.61
mainnet_e81889 - altair processParticipationFlagUpdates 3.0040 us/op 7.0380 us/op 0.43
mainnet_e81889 - altair processSyncCommitteeUpdates 922.00 ns/op 1.5760 us/op 0.59
mainnet_e81889 - altair afterProcessEpoch 146.03 ms/op 159.46 ms/op 0.92
phase0 processEpoch - mainnet_e58758 369.36 ms/op 519.08 ms/op 0.71
mainnet_e58758 - phase0 beforeProcessEpoch 141.59 ms/op 262.58 ms/op 0.54
mainnet_e58758 - phase0 processJustificationAndFinalization 21.198 us/op 48.154 us/op 0.44
mainnet_e58758 - phase0 processRewardsAndPenalties 58.007 ms/op 99.906 ms/op 0.58
mainnet_e58758 - phase0 processRegistryUpdates 14.843 us/op 21.391 us/op 0.69
mainnet_e58758 - phase0 processSlashings 621.00 ns/op 1.5780 us/op 0.39
mainnet_e58758 - phase0 processEth1DataReset 779.00 ns/op 1.7150 us/op 0.45
mainnet_e58758 - phase0 processEffectiveBalanceUpdates 1.0710 ms/op 5.6531 ms/op 0.19
mainnet_e58758 - phase0 processSlashingsReset 3.1150 us/op 8.5680 us/op 0.36
mainnet_e58758 - phase0 processRandaoMixesReset 4.6170 us/op 12.362 us/op 0.37
mainnet_e58758 - phase0 processHistoricalRootsUpdate 894.00 ns/op 1.5500 us/op 0.58
mainnet_e58758 - phase0 processParticipationRecordUpdates 5.4780 us/op 11.843 us/op 0.46
mainnet_e58758 - phase0 afterProcessEpoch 99.780 ms/op 117.41 ms/op 0.85
phase0 processEffectiveBalanceUpdates - 250000 normalcase 1.2589 ms/op 2.0329 ms/op 0.62
phase0 processEffectiveBalanceUpdates - 250000 worstcase 0.5 1.5566 ms/op 2.4277 ms/op 0.64
altair processInactivityUpdates - 250000 normalcase 26.096 ms/op 36.561 ms/op 0.71
altair processInactivityUpdates - 250000 worstcase 19.289 ms/op 33.852 ms/op 0.57
phase0 processRegistryUpdates - 250000 normalcase 6.4210 us/op 12.600 us/op 0.51
phase0 processRegistryUpdates - 250000 badcase_full_deposits 228.42 us/op 317.32 us/op 0.72
phase0 processRegistryUpdates - 250000 worstcase 0.5 130.82 ms/op 143.05 ms/op 0.91
altair processRewardsAndPenalties - 250000 normalcase 68.569 ms/op 73.431 ms/op 0.93
altair processRewardsAndPenalties - 250000 worstcase 62.967 ms/op 79.058 ms/op 0.80
phase0 getAttestationDeltas - 250000 normalcase 6.8369 ms/op 8.3676 ms/op 0.82
phase0 getAttestationDeltas - 250000 worstcase 6.8896 ms/op 7.1219 ms/op 0.97
phase0 processSlashings - 250000 worstcase 3.3630 ms/op 3.9472 ms/op 0.85
altair processSyncCommitteeUpdates - 250000 173.71 ms/op 197.10 ms/op 0.88
BeaconState.hashTreeRoot - No change 332.00 ns/op 361.00 ns/op 0.92
BeaconState.hashTreeRoot - 1 full validator 54.843 us/op 59.010 us/op 0.93
BeaconState.hashTreeRoot - 32 full validator 532.49 us/op 565.08 us/op 0.94
BeaconState.hashTreeRoot - 512 full validator 5.9308 ms/op 5.8568 ms/op 1.01
BeaconState.hashTreeRoot - 1 validator.effectiveBalance 63.028 us/op 65.999 us/op 0.95
BeaconState.hashTreeRoot - 32 validator.effectiveBalance 962.46 us/op 962.78 us/op 1.00
BeaconState.hashTreeRoot - 512 validator.effectiveBalance 13.019 ms/op 12.506 ms/op 1.04
BeaconState.hashTreeRoot - 1 balances 52.610 us/op 54.791 us/op 0.96
BeaconState.hashTreeRoot - 32 balances 488.24 us/op 466.18 us/op 1.05
BeaconState.hashTreeRoot - 512 balances 4.3095 ms/op 4.6598 ms/op 0.92
BeaconState.hashTreeRoot - 250000 balances 73.094 ms/op 75.415 ms/op 0.97
aggregationBits - 2048 els - zipIndexesInBitList 15.418 us/op 17.253 us/op 0.89
regular array get 100000 times 33.377 us/op 35.440 us/op 0.94
wrappedArray get 100000 times 33.496 us/op 35.072 us/op 0.96
arrayWithProxy get 100000 times 16.688 ms/op 16.024 ms/op 1.04
ssz.Root.equals 535.00 ns/op 576.00 ns/op 0.93
byteArrayEquals 545.00 ns/op 577.00 ns/op 0.94
shuffle list - 16384 els 6.9751 ms/op 7.1670 ms/op 0.97
shuffle list - 250000 els 101.09 ms/op 104.76 ms/op 0.96
processSlot - 1 slots 8.9270 us/op 9.5350 us/op 0.94
processSlot - 32 slots 1.3791 ms/op 1.4081 ms/op 0.98
getEffectiveBalanceIncrementsZeroInactive - 250000 vs - 7PWei 35.624 ms/op 35.808 ms/op 0.99
getCommitteeAssignments - req 1 vs - 250000 vc 3.0798 ms/op 2.9745 ms/op 1.04
getCommitteeAssignments - req 100 vs - 250000 vc 4.2099 ms/op 4.2024 ms/op 1.00
getCommitteeAssignments - req 1000 vs - 250000 vc 4.5714 ms/op 4.5591 ms/op 1.00
RootCache.getBlockRootAtSlot - 250000 vs - 7PWei 5.1500 ns/op 4.9300 ns/op 1.04
state getBlockRootAtSlot - 250000 vs - 7PWei 619.32 ns/op 686.19 ns/op 0.90
computeProposers - vc 250000 10.608 ms/op 11.031 ms/op 0.96
computeEpochShuffling - vc 250000 106.88 ms/op 104.19 ms/op 1.03
getNextSyncCommittee - vc 250000 185.93 ms/op 174.45 ms/op 1.07
computeSigningRoot for AttestationData 13.788 us/op 12.912 us/op 1.07
hash AttestationData serialized data then Buffer.toString(base64) 2.5218 us/op 2.5195 us/op 1.00
toHexString serialized data 1.1558 us/op 1.1264 us/op 1.03
Buffer.toString(base64) 365.22 ns/op 359.41 ns/op 1.02

by benchmarkbot/action

@dapplion dapplion enabled auto-merge (squash) May 31, 2023 09:12
@dapplion dapplion merged commit 951fda6 into unstable May 31, 2023
@dapplion dapplion deleted the cayman/restore-discv5-metrics branch May 31, 2023 09:29
@wemeetagain
Copy link
Member Author

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