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(validator): add bucket labels to db metrics #5436

Merged
merged 1 commit into from
Apr 29, 2023

Conversation

nflaig
Copy link
Member

@nflaig nflaig commented Apr 29, 2023

Motivation

Without bucket labels it is hard to investigate issues such as #5356.

Description

Adds bucket labels to validator db metrics. This makes it more consistent with BN db metrics and allows to better investigate issues.

Before

image

After

image

@nflaig nflaig added the scope-metrics All issues with regards to the exposed metrics. label Apr 29, 2023
@nflaig nflaig requested a review from a team as a code owner April 29, 2023 13:46
@github-actions
Copy link
Contributor

github-actions bot commented Apr 29, 2023

Performance Report

✔️ no performance regression detected

Full benchmark results
Benchmark suite Current: 42bf561 Previous: b60b43c Ratio
getPubkeys - index2pubkey - req 1000 vs - 250000 vc 677.61 us/op 486.26 us/op 1.39
getPubkeys - validatorsArr - req 1000 vs - 250000 vc 46.145 us/op 46.504 us/op 0.99
BLS verify - blst-native 1.2158 ms/op 1.2282 ms/op 0.99
BLS verifyMultipleSignatures 3 - blst-native 2.4702 ms/op 2.4877 ms/op 0.99
BLS verifyMultipleSignatures 8 - blst-native 5.2495 ms/op 5.3485 ms/op 0.98
BLS verifyMultipleSignatures 32 - blst-native 18.610 ms/op 19.286 ms/op 0.96
BLS aggregatePubkeys 32 - blst-native 24.931 us/op 26.013 us/op 0.96
BLS aggregatePubkeys 128 - blst-native 97.546 us/op 101.43 us/op 0.96
getAttestationsForBlock 53.458 ms/op 54.047 ms/op 0.99
isKnown best case - 1 super set check 252.00 ns/op 259.00 ns/op 0.97
isKnown normal case - 2 super set checks 249.00 ns/op 249.00 ns/op 1.00
isKnown worse case - 16 super set checks 248.00 ns/op 253.00 ns/op 0.98
CheckpointStateCache - add get delete 5.2680 us/op 5.1290 us/op 1.03
validate gossip signedAggregateAndProof - struct 2.8878 ms/op 2.7816 ms/op 1.04
validate gossip attestation - struct 1.3926 ms/op 1.3220 ms/op 1.05
pickEth1Vote - no votes 1.3619 ms/op 1.3410 ms/op 1.02
pickEth1Vote - max votes 10.825 ms/op 12.744 ms/op 0.85
pickEth1Vote - Eth1Data hashTreeRoot value x2048 8.9551 ms/op 8.5965 ms/op 1.04
pickEth1Vote - Eth1Data hashTreeRoot tree x2048 14.313 ms/op 15.613 ms/op 0.92
pickEth1Vote - Eth1Data fastSerialize value x2048 642.70 us/op 668.36 us/op 0.96
pickEth1Vote - Eth1Data fastSerialize tree x2048 4.6054 ms/op 5.1614 ms/op 0.89
bytes32 toHexString 483.00 ns/op 532.00 ns/op 0.91
bytes32 Buffer.toString(hex) 350.00 ns/op 374.00 ns/op 0.94
bytes32 Buffer.toString(hex) from Uint8Array 544.00 ns/op 585.00 ns/op 0.93
bytes32 Buffer.toString(hex) + 0x 347.00 ns/op 374.00 ns/op 0.93
Object access 1 prop 0.15900 ns/op 0.17400 ns/op 0.91
Map access 1 prop 0.15300 ns/op 0.16400 ns/op 0.93
Object get x1000 6.8030 ns/op 7.0240 ns/op 0.97
Map get x1000 0.61700 ns/op 0.64700 ns/op 0.95
Object set x1000 52.487 ns/op 55.711 ns/op 0.94
Map set x1000 45.926 ns/op 45.653 ns/op 1.01
Return object 10000 times 0.24270 ns/op 0.24520 ns/op 0.99
Throw Error 10000 times 4.1937 us/op 4.3226 us/op 0.97
fastMsgIdFn sha256 / 200 bytes 3.4360 us/op 3.6030 us/op 0.95
fastMsgIdFn h32 xxhash / 200 bytes 274.00 ns/op 314.00 ns/op 0.87
fastMsgIdFn h64 xxhash / 200 bytes 388.00 ns/op 439.00 ns/op 0.88
fastMsgIdFn sha256 / 1000 bytes 11.540 us/op 12.012 us/op 0.96
fastMsgIdFn h32 xxhash / 1000 bytes 412.00 ns/op 449.00 ns/op 0.92
fastMsgIdFn h64 xxhash / 1000 bytes 467.00 ns/op 514.00 ns/op 0.91
fastMsgIdFn sha256 / 10000 bytes 103.29 us/op 105.62 us/op 0.98
fastMsgIdFn h32 xxhash / 10000 bytes 1.9410 us/op 1.9760 us/op 0.98
fastMsgIdFn h64 xxhash / 10000 bytes 1.5180 us/op 1.4160 us/op 1.07
enrSubnets - fastDeserialize 64 bits 1.4210 us/op 1.3570 us/op 1.05
enrSubnets - ssz BitVector 64 bits 511.00 ns/op 522.00 ns/op 0.98
enrSubnets - fastDeserialize 4 bits 186.00 ns/op 180.00 ns/op 1.03
enrSubnets - ssz BitVector 4 bits 513.00 ns/op 518.00 ns/op 0.99
prioritizePeers score -10:0 att 32-0.1 sync 2-0 110.03 us/op 111.41 us/op 0.99
prioritizePeers score 0:0 att 32-0.25 sync 2-0.25 138.37 us/op 149.34 us/op 0.93
prioritizePeers score 0:0 att 32-0.5 sync 2-0.5 188.39 us/op 193.23 us/op 0.97
prioritizePeers score 0:0 att 64-0.75 sync 4-0.75 307.71 us/op 347.31 us/op 0.89
prioritizePeers score 0:0 att 64-1 sync 4-1 390.58 us/op 420.29 us/op 0.93
array of 16000 items push then shift 1.6193 us/op 1.7082 us/op 0.95
LinkedList of 16000 items push then shift 8.7680 ns/op 9.0760 ns/op 0.97
array of 16000 items push then pop 79.551 ns/op 109.49 ns/op 0.73
LinkedList of 16000 items push then pop 8.4850 ns/op 8.8810 ns/op 0.96
array of 24000 items push then shift 2.3264 us/op 2.3860 us/op 0.98
LinkedList of 24000 items push then shift 8.7460 ns/op 8.9830 ns/op 0.97
array of 24000 items push then pop 97.022 ns/op 85.526 ns/op 1.13
LinkedList of 24000 items push then pop 8.6300 ns/op 9.6220 ns/op 0.90
intersect bitArray bitLen 8 13.710 ns/op 13.694 ns/op 1.00
intersect array and set length 8 82.752 ns/op 83.002 ns/op 1.00
intersect bitArray bitLen 128 44.520 ns/op 44.224 ns/op 1.01
intersect array and set length 128 1.0368 us/op 1.1660 us/op 0.89
Buffer.concat 32 items 2.6010 us/op 3.0340 us/op 0.86
Uint8Array.set 32 items 2.6730 us/op 2.8780 us/op 0.93
pass gossip attestations to forkchoice per slot 3.0314 ms/op 3.0446 ms/op 1.00
computeDeltas 2.9711 ms/op 2.9121 ms/op 1.02
computeProposerBoostScoreFromBalances 1.7981 ms/op 1.7996 ms/op 1.00
altair processAttestation - 250000 vs - 7PWei normalcase 2.4014 ms/op 2.1964 ms/op 1.09
altair processAttestation - 250000 vs - 7PWei worstcase 3.4649 ms/op 3.3689 ms/op 1.03
altair processAttestation - setStatus - 1/6 committees join 143.99 us/op 144.28 us/op 1.00
altair processAttestation - setStatus - 1/3 committees join 270.54 us/op 281.81 us/op 0.96
altair processAttestation - setStatus - 1/2 committees join 372.11 us/op 378.42 us/op 0.98
altair processAttestation - setStatus - 2/3 committees join 463.22 us/op 472.87 us/op 0.98
altair processAttestation - setStatus - 4/5 committees join 644.75 us/op 672.09 us/op 0.96
altair processAttestation - setStatus - 100% committees join 758.43 us/op 784.29 us/op 0.97
altair processBlock - 250000 vs - 7PWei normalcase 17.664 ms/op 18.939 ms/op 0.93
altair processBlock - 250000 vs - 7PWei normalcase hashState 26.189 ms/op 28.021 ms/op 0.93
altair processBlock - 250000 vs - 7PWei worstcase 53.024 ms/op 56.724 ms/op 0.93
altair processBlock - 250000 vs - 7PWei worstcase hashState 71.197 ms/op 78.725 ms/op 0.90
phase0 processBlock - 250000 vs - 7PWei normalcase 1.9577 ms/op 2.1338 ms/op 0.92
phase0 processBlock - 250000 vs - 7PWei worstcase 27.731 ms/op 28.672 ms/op 0.97
altair processEth1Data - 250000 vs - 7PWei normalcase 464.30 us/op 532.07 us/op 0.87
vc - 250000 eb 1 eth1 1 we 0 wn 0 - smpl 15 6.6850 us/op 8.0730 us/op 0.83
vc - 250000 eb 0.95 eth1 0.1 we 0.05 wn 0 - smpl 219 19.410 us/op 25.039 us/op 0.78
vc - 250000 eb 0.95 eth1 0.3 we 0.05 wn 0 - smpl 42 8.2110 us/op 10.697 us/op 0.77
vc - 250000 eb 0.95 eth1 0.7 we 0.05 wn 0 - smpl 18 6.6730 us/op 8.5310 us/op 0.78
vc - 250000 eb 0.1 eth1 0.1 we 0 wn 0 - smpl 1020 75.509 us/op 107.21 us/op 0.70
vc - 250000 eb 0.03 eth1 0.03 we 0 wn 0 - smpl 11777 599.66 us/op 824.39 us/op 0.73
vc - 250000 eb 0.01 eth1 0.01 we 0 wn 0 - smpl 16384 898.27 us/op 1.0866 ms/op 0.83
vc - 250000 eb 0 eth1 0 we 0 wn 0 - smpl 16384 880.83 us/op 999.26 us/op 0.88
vc - 250000 eb 0 eth1 0 we 0 wn 0 nocache - smpl 16384 2.1675 ms/op 2.3457 ms/op 0.92
vc - 250000 eb 0 eth1 1 we 0 wn 0 - smpl 16384 1.6902 ms/op 2.3281 ms/op 0.73
vc - 250000 eb 0 eth1 1 we 0 wn 0 nocache - smpl 16384 3.8529 ms/op 3.9690 ms/op 0.97
Tree 40 250000 create 289.31 ms/op 304.99 ms/op 0.95
Tree 40 250000 get(125000) 175.35 ns/op 199.43 ns/op 0.88
Tree 40 250000 set(125000) 865.47 ns/op 952.46 ns/op 0.91
Tree 40 250000 toArray() 16.403 ms/op 20.841 ms/op 0.79
Tree 40 250000 iterate all - toArray() + loop 16.578 ms/op 21.113 ms/op 0.79
Tree 40 250000 iterate all - get(i) 64.807 ms/op 74.780 ms/op 0.87
MutableVector 250000 create 9.7981 ms/op 13.024 ms/op 0.75
MutableVector 250000 get(125000) 6.2260 ns/op 6.6410 ns/op 0.94
MutableVector 250000 set(125000) 256.81 ns/op 253.08 ns/op 1.01
MutableVector 250000 toArray() 3.0466 ms/op 3.0138 ms/op 1.01
MutableVector 250000 iterate all - toArray() + loop 2.9369 ms/op 2.8708 ms/op 1.02
MutableVector 250000 iterate all - get(i) 1.4946 ms/op 1.5401 ms/op 0.97
Array 250000 create 2.4908 ms/op 2.7312 ms/op 0.91
Array 250000 clone - spread 1.0631 ms/op 1.1152 ms/op 0.95
Array 250000 get(125000) 0.51200 ns/op 0.57200 ns/op 0.90
Array 250000 set(125000) 0.58000 ns/op 0.64600 ns/op 0.90
Array 250000 iterate all - loop 91.258 us/op 83.980 us/op 1.09
effectiveBalanceIncrements clone Uint8Array 300000 25.361 us/op 29.152 us/op 0.87
effectiveBalanceIncrements clone MutableVector 300000 332.00 ns/op 352.00 ns/op 0.94
effectiveBalanceIncrements rw all Uint8Array 300000 165.86 us/op 168.75 us/op 0.98
effectiveBalanceIncrements rw all MutableVector 300000 76.711 ms/op 83.646 ms/op 0.92
phase0 afterProcessEpoch - 250000 vs - 7PWei 113.33 ms/op 116.20 ms/op 0.98
phase0 beforeProcessEpoch - 250000 vs - 7PWei 42.188 ms/op 44.578 ms/op 0.95
altair processEpoch - mainnet_e81889 306.59 ms/op 315.75 ms/op 0.97
mainnet_e81889 - altair beforeProcessEpoch 64.268 ms/op 51.807 ms/op 1.24
mainnet_e81889 - altair processJustificationAndFinalization 16.095 us/op 17.841 us/op 0.90
mainnet_e81889 - altair processInactivityUpdates 5.6159 ms/op 6.0971 ms/op 0.92
mainnet_e81889 - altair processRewardsAndPenalties 68.936 ms/op 79.797 ms/op 0.86
mainnet_e81889 - altair processRegistryUpdates 2.9020 us/op 2.4480 us/op 1.19
mainnet_e81889 - altair processSlashings 482.00 ns/op 628.00 ns/op 0.77
mainnet_e81889 - altair processEth1DataReset 568.00 ns/op 575.00 ns/op 0.99
mainnet_e81889 - altair processEffectiveBalanceUpdates 1.2450 ms/op 1.4749 ms/op 0.84
mainnet_e81889 - altair processSlashingsReset 5.2910 us/op 7.4740 us/op 0.71
mainnet_e81889 - altair processRandaoMixesReset 6.1100 us/op 6.1950 us/op 0.99
mainnet_e81889 - altair processHistoricalRootsUpdate 685.00 ns/op 913.00 ns/op 0.75
mainnet_e81889 - altair processParticipationFlagUpdates 3.7140 us/op 3.2070 us/op 1.16
mainnet_e81889 - altair processSyncCommitteeUpdates 818.00 ns/op 714.00 ns/op 1.15
mainnet_e81889 - altair afterProcessEpoch 128.63 ms/op 125.50 ms/op 1.02
phase0 processEpoch - mainnet_e58758 353.42 ms/op 386.82 ms/op 0.91
mainnet_e58758 - phase0 beforeProcessEpoch 131.81 ms/op 147.52 ms/op 0.89
mainnet_e58758 - phase0 processJustificationAndFinalization 17.295 us/op 24.588 us/op 0.70
mainnet_e58758 - phase0 processRewardsAndPenalties 62.898 ms/op 60.854 ms/op 1.03
mainnet_e58758 - phase0 processRegistryUpdates 7.4680 us/op 9.4050 us/op 0.79
mainnet_e58758 - phase0 processSlashings 436.00 ns/op 482.00 ns/op 0.90
mainnet_e58758 - phase0 processEth1DataReset 899.00 ns/op 510.00 ns/op 1.76
mainnet_e58758 - phase0 processEffectiveBalanceUpdates 1.4602 ms/op 990.38 us/op 1.47
mainnet_e58758 - phase0 processSlashingsReset 8.6610 us/op 4.2190 us/op 2.05
mainnet_e58758 - phase0 processRandaoMixesReset 12.870 us/op 4.6190 us/op 2.79
mainnet_e58758 - phase0 processHistoricalRootsUpdate 663.00 ns/op 605.00 ns/op 1.10
mainnet_e58758 - phase0 processParticipationRecordUpdates 3.8550 us/op 3.4100 us/op 1.13
mainnet_e58758 - phase0 afterProcessEpoch 98.870 ms/op 96.529 ms/op 1.02
phase0 processEffectiveBalanceUpdates - 250000 normalcase 1.2573 ms/op 2.3621 ms/op 0.53
phase0 processEffectiveBalanceUpdates - 250000 worstcase 0.5 1.4625 ms/op 1.5070 ms/op 0.97
altair processInactivityUpdates - 250000 normalcase 25.202 ms/op 29.297 ms/op 0.86
altair processInactivityUpdates - 250000 worstcase 27.703 ms/op 28.562 ms/op 0.97
phase0 processRegistryUpdates - 250000 normalcase 6.9600 us/op 5.7630 us/op 1.21
phase0 processRegistryUpdates - 250000 badcase_full_deposits 262.30 us/op 274.61 us/op 0.96
phase0 processRegistryUpdates - 250000 worstcase 0.5 127.81 ms/op 143.63 ms/op 0.89
altair processRewardsAndPenalties - 250000 normalcase 68.313 ms/op 77.410 ms/op 0.88
altair processRewardsAndPenalties - 250000 worstcase 68.427 ms/op 77.747 ms/op 0.88
phase0 getAttestationDeltas - 250000 normalcase 6.7125 ms/op 6.6961 ms/op 1.00
phase0 getAttestationDeltas - 250000 worstcase 6.7951 ms/op 6.4798 ms/op 1.05
phase0 processSlashings - 250000 worstcase 3.6872 ms/op 3.4389 ms/op 1.07
altair processSyncCommitteeUpdates - 250000 184.44 ms/op 177.15 ms/op 1.04
BeaconState.hashTreeRoot - No change 270.00 ns/op 264.00 ns/op 1.02
BeaconState.hashTreeRoot - 1 full validator 53.044 us/op 60.293 us/op 0.88
BeaconState.hashTreeRoot - 32 full validator 485.87 us/op 623.72 us/op 0.78
BeaconState.hashTreeRoot - 512 full validator 5.0908 ms/op 6.5736 ms/op 0.77
BeaconState.hashTreeRoot - 1 validator.effectiveBalance 65.651 us/op 60.703 us/op 1.08
BeaconState.hashTreeRoot - 32 validator.effectiveBalance 919.27 us/op 861.83 us/op 1.07
BeaconState.hashTreeRoot - 512 validator.effectiveBalance 12.518 ms/op 11.223 ms/op 1.12
BeaconState.hashTreeRoot - 1 balances 49.574 us/op 48.235 us/op 1.03
BeaconState.hashTreeRoot - 32 balances 458.75 us/op 516.35 us/op 0.89
BeaconState.hashTreeRoot - 512 balances 4.2896 ms/op 5.1071 ms/op 0.84
BeaconState.hashTreeRoot - 250000 balances 76.223 ms/op 78.698 ms/op 0.97
aggregationBits - 2048 els - zipIndexesInBitList 16.307 us/op 15.917 us/op 1.02
regular array get 100000 times 33.158 us/op 33.180 us/op 1.00
wrappedArray get 100000 times 33.211 us/op 33.086 us/op 1.00
arrayWithProxy get 100000 times 16.564 ms/op 16.168 ms/op 1.02
ssz.Root.equals 550.00 ns/op 551.00 ns/op 1.00
byteArrayEquals 557.00 ns/op 543.00 ns/op 1.03
shuffle list - 16384 els 6.9340 ms/op 6.7857 ms/op 1.02
shuffle list - 250000 els 101.75 ms/op 99.655 ms/op 1.02
processSlot - 1 slots 9.1450 us/op 10.241 us/op 0.89
processSlot - 32 slots 1.3230 ms/op 1.3171 ms/op 1.00
getEffectiveBalanceIncrementsZeroInactive - 250000 vs - 7PWei 37.741 ms/op 39.911 ms/op 0.95
getCommitteeAssignments - req 1 vs - 250000 vc 2.9955 ms/op 2.9163 ms/op 1.03
getCommitteeAssignments - req 100 vs - 250000 vc 4.2461 ms/op 4.1366 ms/op 1.03
getCommitteeAssignments - req 1000 vs - 250000 vc 4.5883 ms/op 4.5422 ms/op 1.01
RootCache.getBlockRootAtSlot - 250000 vs - 7PWei 5.2500 ns/op 4.8000 ns/op 1.09
state getBlockRootAtSlot - 250000 vs - 7PWei 907.02 ns/op 680.57 ns/op 1.33
computeProposers - vc 250000 11.341 ms/op 10.236 ms/op 1.11
computeEpochShuffling - vc 250000 107.00 ms/op 105.15 ms/op 1.02
getNextSyncCommittee - vc 250000 194.30 ms/op 169.75 ms/op 1.14
computeSigningRoot for AttestationData 15.017 us/op 12.729 us/op 1.18
hash AttestationData serialized data then Buffer.toString(base64) 2.4863 us/op 2.4549 us/op 1.01
toHexString serialized data 1.0995 us/op 1.1112 us/op 0.99
Buffer.toString(base64) 328.21 ns/op 351.55 ns/op 0.93

by benchmarkbot/action

@nflaig nflaig force-pushed the nflaig/vc-db-metrics-bucket-labels branch from 15351bf to c38e951 Compare April 29, 2023 14:33
@nflaig nflaig merged commit 2fbf178 into unstable Apr 29, 2023
@nflaig nflaig deleted the nflaig/vc-db-metrics-bucket-labels branch April 29, 2023 16:51
@wemeetagain
Copy link
Member

🎉 This PR is included in v1.8.0 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scope-metrics All issues with regards to the exposed metrics.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants