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

Track beacon health from vc #4939

Merged
merged 1 commit into from
Dec 24, 2022
Merged

Track beacon health from vc #4939

merged 1 commit into from
Dec 24, 2022

Conversation

dapplion
Copy link
Contributor

@dapplion dapplion commented Dec 24, 2022

Motivation

Description

Adds metric vc_beacon_health to track the health of the "current" connected beacon node. Note that retry logic of the multi-endpoint REST client apply, but should represent the current URL that the validator client is attempting to pull duties from.

Performance wise, for the beacon node serving a GET /node/health request is practically free. This PR could be implemented too by inspecting errors from existing API calls to duties. However depending on the lifecycle of imported keys the validator behavior is not constant. Having a constant every slot poll ensure that the metric vc_beacon_health accurately reflects the status of the beacon node.

Closes #4637

@dapplion dapplion requested a review from a team as a code owner December 24, 2022 04:27
@github-actions
Copy link
Contributor

Performance Report

✔️ no performance regression detected

Full benchmark results
Benchmark suite Current: 34dcd09 Previous: 6a37cca Ratio
getPubkeys - index2pubkey - req 1000 vs - 250000 vc 907.72 us/op 1.1646 ms/op 0.78
getPubkeys - validatorsArr - req 1000 vs - 250000 vc 59.407 us/op 69.167 us/op 0.86
BLS verify - blst-native 2.1789 ms/op 1.8654 ms/op 1.17
BLS verifyMultipleSignatures 3 - blst-native 4.4977 ms/op 3.8101 ms/op 1.18
BLS verifyMultipleSignatures 8 - blst-native 9.7463 ms/op 8.1963 ms/op 1.19
BLS verifyMultipleSignatures 32 - blst-native 35.264 ms/op 29.791 ms/op 1.18
BLS aggregatePubkeys 32 - blst-native 46.398 us/op 40.441 us/op 1.15
BLS aggregatePubkeys 128 - blst-native 182.56 us/op 158.75 us/op 1.15
getAttestationsForBlock 74.915 ms/op 87.424 ms/op 0.86
isKnown best case - 1 super set check 437.00 ns/op 420.00 ns/op 1.04
isKnown normal case - 2 super set checks 429.00 ns/op 407.00 ns/op 1.05
isKnown worse case - 16 super set checks 425.00 ns/op 408.00 ns/op 1.04
CheckpointStateCache - add get delete 8.2940 us/op 8.4910 us/op 0.98
validate gossip signedAggregateAndProof - struct 5.0219 ms/op 4.2682 ms/op 1.18
validate gossip attestation - struct 2.3611 ms/op 2.0262 ms/op 1.17
pickEth1Vote - no votes 2.1165 ms/op 2.1119 ms/op 1.00
pickEth1Vote - max votes 15.212 ms/op 16.138 ms/op 0.94
pickEth1Vote - Eth1Data hashTreeRoot value x2048 12.944 ms/op 11.789 ms/op 1.10
pickEth1Vote - Eth1Data hashTreeRoot tree x2048 20.253 ms/op 20.113 ms/op 1.01
pickEth1Vote - Eth1Data fastSerialize value x2048 1.0444 ms/op 1.1891 ms/op 0.88
pickEth1Vote - Eth1Data fastSerialize tree x2048 9.1777 ms/op 9.2393 ms/op 0.99
bytes32 toHexString 802.00 ns/op 1.0010 us/op 0.80
bytes32 Buffer.toString(hex) 531.00 ns/op 574.00 ns/op 0.93
bytes32 Buffer.toString(hex) from Uint8Array 965.00 ns/op 860.00 ns/op 1.12
bytes32 Buffer.toString(hex) + 0x 527.00 ns/op 634.00 ns/op 0.83
Object access 1 prop 0.26200 ns/op 0.27900 ns/op 0.94
Map access 1 prop 0.24600 ns/op 0.25500 ns/op 0.96
Object get x1000 10.811 ns/op 16.253 ns/op 0.67
Map get x1000 0.90600 ns/op 0.99700 ns/op 0.91
Object set x1000 66.549 ns/op 108.48 ns/op 0.61
Map set x1000 40.923 ns/op 67.941 ns/op 0.60
Return object 10000 times 0.42760 ns/op 0.37350 ns/op 1.14
Throw Error 10000 times 6.6871 us/op 6.7617 us/op 0.99
fastMsgIdFn sha256 / 200 bytes 4.8200 us/op 4.3140 us/op 1.12
fastMsgIdFn h32 xxhash / 200 bytes 445.00 ns/op 460.00 ns/op 0.97
fastMsgIdFn h64 xxhash / 200 bytes 603.00 ns/op 638.00 ns/op 0.95
fastMsgIdFn sha256 / 1000 bytes 15.467 us/op 13.540 us/op 1.14
fastMsgIdFn h32 xxhash / 1000 bytes 618.00 ns/op 612.00 ns/op 1.01
fastMsgIdFn h64 xxhash / 1000 bytes 702.00 ns/op 728.00 ns/op 0.96
fastMsgIdFn sha256 / 10000 bytes 137.06 us/op 116.77 us/op 1.17
fastMsgIdFn h32 xxhash / 10000 bytes 2.5110 us/op 2.3310 us/op 1.08
fastMsgIdFn h64 xxhash / 10000 bytes 1.7310 us/op 1.6650 us/op 1.04
enrSubnets - fastDeserialize 64 bits 2.0800 us/op 2.2820 us/op 0.91
enrSubnets - ssz BitVector 64 bits 766.00 ns/op 803.00 ns/op 0.95
enrSubnets - fastDeserialize 4 bits 265.00 ns/op 286.00 ns/op 0.93
enrSubnets - ssz BitVector 4 bits 766.00 ns/op 815.00 ns/op 0.94
prioritizePeers score -10:0 att 32-0.1 sync 2-0 75.096 us/op 95.213 us/op 0.79
prioritizePeers score 0:0 att 32-0.25 sync 2-0.25 111.79 us/op 134.50 us/op 0.83
prioritizePeers score 0:0 att 32-0.5 sync 2-0.5 186.62 us/op 260.64 us/op 0.72
prioritizePeers score 0:0 att 64-0.75 sync 4-0.75 319.14 us/op 400.83 us/op 0.80
prioritizePeers score 0:0 att 64-1 sync 4-1 387.58 us/op 511.91 us/op 0.76
array of 16000 items push then shift 51.598 us/op 2.7895 us/op 18.50
LinkedList of 16000 items push then shift 12.033 ns/op 17.229 ns/op 0.70
array of 16000 items push then pop 170.81 ns/op 207.68 ns/op 0.82
LinkedList of 16000 items push then pop 11.775 ns/op 16.504 ns/op 0.71
array of 24000 items push then shift 77.354 us/op 3.9893 us/op 19.39
LinkedList of 24000 items push then shift 12.312 ns/op 20.373 ns/op 0.60
array of 24000 items push then pop 195.96 ns/op 209.43 ns/op 0.94
LinkedList of 24000 items push then pop 11.779 ns/op 17.958 ns/op 0.66
intersect bitArray bitLen 8 21.654 ns/op 29.601 ns/op 0.73
intersect array and set length 8 118.81 ns/op 167.59 ns/op 0.71
intersect bitArray bitLen 128 71.046 ns/op 118.98 ns/op 0.60
intersect array and set length 128 1.6021 us/op 2.2687 us/op 0.71
Buffer.concat 32 items 4.5530 us/op 5.1480 us/op 0.88
Uint8Array.set 32 items 3.5120 us/op 4.1170 us/op 0.85
pass gossip attestations to forkchoice per slot 3.6868 ms/op 4.3031 ms/op 0.86
computeDeltas 4.2497 ms/op 6.0377 ms/op 0.70
computeProposerBoostScoreFromBalances 2.4840 ms/op 2.8370 ms/op 0.88
altair processAttestation - 250000 vs - 7PWei normalcase 3.3977 ms/op 3.8108 ms/op 0.89
altair processAttestation - 250000 vs - 7PWei worstcase 5.7507 ms/op 6.4499 ms/op 0.89
altair processAttestation - setStatus - 1/6 committees join 174.70 us/op 207.91 us/op 0.84
altair processAttestation - setStatus - 1/3 committees join 350.31 us/op 398.87 us/op 0.88
altair processAttestation - setStatus - 1/2 committees join 511.05 us/op 563.57 us/op 0.91
altair processAttestation - setStatus - 2/3 committees join 669.39 us/op 719.85 us/op 0.93
altair processAttestation - setStatus - 4/5 committees join 928.03 us/op 1.0003 ms/op 0.93
altair processAttestation - setStatus - 100% committees join 1.1139 ms/op 1.1898 ms/op 0.94
altair processBlock - 250000 vs - 7PWei normalcase 22.495 ms/op 26.855 ms/op 0.84
altair processBlock - 250000 vs - 7PWei normalcase hashState 42.144 ms/op 33.554 ms/op 1.26
altair processBlock - 250000 vs - 7PWei worstcase 76.057 ms/op 77.794 ms/op 0.98
altair processBlock - 250000 vs - 7PWei worstcase hashState 99.751 ms/op 109.74 ms/op 0.91
phase0 processBlock - 250000 vs - 7PWei normalcase 3.0581 ms/op 3.4955 ms/op 0.87
phase0 processBlock - 250000 vs - 7PWei worstcase 49.733 ms/op 46.085 ms/op 1.08
altair processEth1Data - 250000 vs - 7PWei normalcase 639.29 us/op 761.30 us/op 0.84
vc - 250000 eb 1 eth1 1 we 0 wn 0 - smpl 15 15.011 us/op 10.045 us/op 1.49
vc - 250000 eb 0.95 eth1 0.1 we 0.05 wn 0 - smpl 219 45.038 us/op 36.925 us/op 1.22
vc - 250000 eb 0.95 eth1 0.3 we 0.05 wn 0 - smpl 42 22.163 us/op 12.216 us/op 1.81
vc - 250000 eb 0.95 eth1 0.7 we 0.05 wn 0 - smpl 18 17.484 us/op 11.692 us/op 1.50
vc - 250000 eb 0.1 eth1 0.1 we 0 wn 0 - smpl 1020 184.50 us/op 111.66 us/op 1.65
vc - 250000 eb 0.03 eth1 0.03 we 0 wn 0 - smpl 11777 1.1044 ms/op 1.0119 ms/op 1.09
vc - 250000 eb 0.01 eth1 0.01 we 0 wn 0 - smpl 16384 1.4092 ms/op 1.3997 ms/op 1.01
vc - 250000 eb 0 eth1 0 we 0 wn 0 - smpl 16384 1.4530 ms/op 1.3269 ms/op 1.09
vc - 250000 eb 0 eth1 0 we 0 wn 0 nocache - smpl 16384 4.2940 ms/op 4.3616 ms/op 0.98
vc - 250000 eb 0 eth1 1 we 0 wn 0 - smpl 16384 2.4161 ms/op 2.9525 ms/op 0.82
vc - 250000 eb 0 eth1 1 we 0 wn 0 nocache - smpl 16384 6.9945 ms/op 7.1564 ms/op 0.98
Tree 40 250000 create 587.95 ms/op 706.12 ms/op 0.83
Tree 40 250000 get(125000) 217.10 ns/op 297.80 ns/op 0.73
Tree 40 250000 set(125000) 1.7588 us/op 2.2193 us/op 0.79
Tree 40 250000 toArray() 24.763 ms/op 31.459 ms/op 0.79
Tree 40 250000 iterate all - toArray() + loop 24.531 ms/op 31.462 ms/op 0.78
Tree 40 250000 iterate all - get(i) 108.33 ms/op 107.04 ms/op 1.01
MutableVector 250000 create 12.452 ms/op 15.497 ms/op 0.80
MutableVector 250000 get(125000) 10.545 ns/op 13.132 ns/op 0.80
MutableVector 250000 set(125000) 474.89 ns/op 620.00 ns/op 0.77
MutableVector 250000 toArray() 5.4687 ms/op 7.1862 ms/op 0.76
MutableVector 250000 iterate all - toArray() + loop 5.5436 ms/op 6.3622 ms/op 0.87
MutableVector 250000 iterate all - get(i) 2.7727 ms/op 3.9031 ms/op 0.71
Array 250000 create 5.5738 ms/op 5.9461 ms/op 0.94
Array 250000 clone - spread 2.5146 ms/op 2.1140 ms/op 1.19
Array 250000 get(125000) 1.1530 ns/op 0.91600 ns/op 1.26
Array 250000 set(125000) 1.1610 ns/op 0.92500 ns/op 1.26
Array 250000 iterate all - loop 151.80 us/op 167.75 us/op 0.90
effectiveBalanceIncrements clone Uint8Array 300000 39.360 us/op 70.063 us/op 0.56
effectiveBalanceIncrements clone MutableVector 300000 765.00 ns/op 567.00 ns/op 1.35
effectiveBalanceIncrements rw all Uint8Array 300000 243.90 us/op 252.71 us/op 0.97
effectiveBalanceIncrements rw all MutableVector 300000 151.57 ms/op 163.39 ms/op 0.93
phase0 afterProcessEpoch - 250000 vs - 7PWei 186.12 ms/op 186.11 ms/op 1.00
phase0 beforeProcessEpoch - 250000 vs - 7PWei 56.898 ms/op 71.258 ms/op 0.80
altair processEpoch - mainnet_e81889 531.36 ms/op 492.22 ms/op 1.08
mainnet_e81889 - altair beforeProcessEpoch 119.55 ms/op 133.78 ms/op 0.89
mainnet_e81889 - altair processJustificationAndFinalization 34.075 us/op 27.789 us/op 1.23
mainnet_e81889 - altair processInactivityUpdates 8.6679 ms/op 10.315 ms/op 0.84
mainnet_e81889 - altair processRewardsAndPenalties 114.20 ms/op 88.873 ms/op 1.28
mainnet_e81889 - altair processRegistryUpdates 4.4090 us/op 3.2510 us/op 1.36
mainnet_e81889 - altair processSlashings 1.1280 us/op 774.00 ns/op 1.46
mainnet_e81889 - altair processEth1DataReset 1.0320 us/op 823.00 ns/op 1.25
mainnet_e81889 - altair processEffectiveBalanceUpdates 2.3450 ms/op 2.3331 ms/op 1.01
mainnet_e81889 - altair processSlashingsReset 7.5410 us/op 4.6940 us/op 1.61
mainnet_e81889 - altair processRandaoMixesReset 8.5540 us/op 6.0680 us/op 1.41
mainnet_e81889 - altair processHistoricalRootsUpdate 1.4070 us/op 871.00 ns/op 1.62
mainnet_e81889 - altair processParticipationFlagUpdates 5.0170 us/op 3.4290 us/op 1.46
mainnet_e81889 - altair processSyncCommitteeUpdates 1.3310 us/op 921.00 ns/op 1.45
mainnet_e81889 - altair afterProcessEpoch 195.38 ms/op 195.23 ms/op 1.00
phase0 processEpoch - mainnet_e58758 472.58 ms/op 525.36 ms/op 0.90
mainnet_e58758 - phase0 beforeProcessEpoch 173.24 ms/op 224.12 ms/op 0.77
mainnet_e58758 - phase0 processJustificationAndFinalization 31.220 us/op 21.713 us/op 1.44
mainnet_e58758 - phase0 processRewardsAndPenalties 100.97 ms/op 121.30 ms/op 0.83
mainnet_e58758 - phase0 processRegistryUpdates 14.623 us/op 13.480 us/op 1.08
mainnet_e58758 - phase0 processSlashings 1.0670 us/op 1.0420 us/op 1.02
mainnet_e58758 - phase0 processEth1DataReset 1.2750 us/op 980.00 ns/op 1.30
mainnet_e58758 - phase0 processEffectiveBalanceUpdates 1.7694 ms/op 1.9373 ms/op 0.91
mainnet_e58758 - phase0 processSlashingsReset 7.1370 us/op 6.1540 us/op 1.16
mainnet_e58758 - phase0 processRandaoMixesReset 7.7160 us/op 5.8890 us/op 1.31
mainnet_e58758 - phase0 processHistoricalRootsUpdate 1.1780 us/op 868.00 ns/op 1.36
mainnet_e58758 - phase0 processParticipationRecordUpdates 7.5360 us/op 4.1270 us/op 1.83
mainnet_e58758 - phase0 afterProcessEpoch 160.99 ms/op 160.62 ms/op 1.00
phase0 processEffectiveBalanceUpdates - 250000 normalcase 2.1813 ms/op 2.8891 ms/op 0.76
phase0 processEffectiveBalanceUpdates - 250000 worstcase 0.5 2.6003 ms/op 3.3012 ms/op 0.79
altair processInactivityUpdates - 250000 normalcase 32.122 ms/op 39.111 ms/op 0.82
altair processInactivityUpdates - 250000 worstcase 39.397 ms/op 38.489 ms/op 1.02
phase0 processRegistryUpdates - 250000 normalcase 11.305 us/op 8.6140 us/op 1.31
phase0 processRegistryUpdates - 250000 badcase_full_deposits 624.43 us/op 452.71 us/op 1.38
phase0 processRegistryUpdates - 250000 worstcase 0.5 171.72 ms/op 210.84 ms/op 0.81
altair processRewardsAndPenalties - 250000 normalcase 103.47 ms/op 122.35 ms/op 0.85
altair processRewardsAndPenalties - 250000 worstcase 71.358 ms/op 82.245 ms/op 0.87
phase0 getAttestationDeltas - 250000 normalcase 11.263 ms/op 12.547 ms/op 0.90
phase0 getAttestationDeltas - 250000 worstcase 11.587 ms/op 12.809 ms/op 0.90
phase0 processSlashings - 250000 worstcase 5.2620 ms/op 6.0159 ms/op 0.87
altair processSyncCommitteeUpdates - 250000 281.04 ms/op 272.27 ms/op 1.03
BeaconState.hashTreeRoot - No change 461.00 ns/op 431.00 ns/op 1.07
BeaconState.hashTreeRoot - 1 full validator 71.261 us/op 61.476 us/op 1.16
BeaconState.hashTreeRoot - 32 full validator 650.28 us/op 745.12 us/op 0.87
BeaconState.hashTreeRoot - 512 full validator 8.7501 ms/op 5.9197 ms/op 1.48
BeaconState.hashTreeRoot - 1 validator.effectiveBalance 86.089 us/op 78.998 us/op 1.09
BeaconState.hashTreeRoot - 32 validator.effectiveBalance 1.2056 ms/op 1.1687 ms/op 1.03
BeaconState.hashTreeRoot - 512 validator.effectiveBalance 16.217 ms/op 15.229 ms/op 1.06
BeaconState.hashTreeRoot - 1 balances 68.227 us/op 58.704 us/op 1.16
BeaconState.hashTreeRoot - 32 balances 623.24 us/op 469.86 us/op 1.33
BeaconState.hashTreeRoot - 512 balances 6.1874 ms/op 5.5230 ms/op 1.12
BeaconState.hashTreeRoot - 250000 balances 98.516 ms/op 96.782 ms/op 1.02
aggregationBits - 2048 els - zipIndexesInBitList 23.296 us/op 27.193 us/op 0.86
regular array get 100000 times 60.500 us/op 67.319 us/op 0.90
wrappedArray get 100000 times 60.540 us/op 67.674 us/op 0.89
arrayWithProxy get 100000 times 26.261 ms/op 28.325 ms/op 0.93
ssz.Root.equals 918.00 ns/op 1.0450 us/op 0.88
byteArrayEquals 906.00 ns/op 1.0470 us/op 0.87
shuffle list - 16384 els 11.379 ms/op 11.325 ms/op 1.00
shuffle list - 250000 els 167.01 ms/op 168.63 ms/op 0.99
processSlot - 1 slots 12.807 us/op 12.021 us/op 1.07
processSlot - 32 slots 1.9576 ms/op 1.7538 ms/op 1.12
getEffectiveBalanceIncrementsZeroInactive - 250000 vs - 7PWei 307.82 us/op 336.86 us/op 0.91
getCommitteeAssignments - req 1 vs - 250000 vc 5.4582 ms/op 5.6026 ms/op 0.97
getCommitteeAssignments - req 100 vs - 250000 vc 7.9831 ms/op 7.5654 ms/op 1.06
getCommitteeAssignments - req 1000 vs - 250000 vc 8.5096 ms/op 8.0198 ms/op 1.06
RootCache.getBlockRootAtSlot - 250000 vs - 7PWei 7.5700 ns/op 9.6400 ns/op 0.79
state getBlockRootAtSlot - 250000 vs - 7PWei 1.0472 us/op 1.1558 us/op 0.91
computeProposers - vc 250000 16.790 ms/op 16.249 ms/op 1.03
computeEpochShuffling - vc 250000 170.45 ms/op 170.45 ms/op 1.00
getNextSyncCommittee - vc 250000 278.88 ms/op 269.87 ms/op 1.03

by benchmarkbot/action

@wemeetagain wemeetagain merged commit 6c04f0e into unstable Dec 24, 2022
@wemeetagain wemeetagain deleted the dapplion/4637 branch December 24, 2022 15:14
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.

Metric vc track beacon node health
2 participants