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: track attestationInBlockParticipants #5749

Merged
merged 1 commit into from
Jul 12, 2023

Conversation

dapplion
Copy link
Contributor

Motivation

It's useful to know how many participants are in block inclusion attestations. Lower values indicate issues in our end where few participants shared our view of the chain at the time.

Description

Add metric

name: "validator_monitor_attestation_in_block_participants",
help: "The total participants in attestations of monitored validators included in blocks",

@dapplion dapplion requested a review from a team as a code owner July 12, 2023 10:26
@github-actions
Copy link
Contributor

Performance Report

✔️ no performance regression detected

Full benchmark results
Benchmark suite Current: 95a12f3 Previous: 0640e06 Ratio
getPubkeys - index2pubkey - req 1000 vs - 250000 vc 806.37 us/op 722.55 us/op 1.12
getPubkeys - validatorsArr - req 1000 vs - 250000 vc 44.741 us/op 50.966 us/op 0.88
BLS verify - blst-native 1.1905 ms/op 1.2099 ms/op 0.98
BLS verifyMultipleSignatures 3 - blst-native 2.4219 ms/op 2.4622 ms/op 0.98
BLS verifyMultipleSignatures 8 - blst-native 5.2160 ms/op 5.2961 ms/op 0.98
BLS verifyMultipleSignatures 32 - blst-native 18.853 ms/op 18.973 ms/op 0.99
BLS aggregatePubkeys 32 - blst-native 25.177 us/op 25.404 us/op 0.99
BLS aggregatePubkeys 128 - blst-native 98.009 us/op 99.279 us/op 0.99
getAttestationsForBlock 55.151 ms/op 51.664 ms/op 1.07
isKnown best case - 1 super set check 257.00 ns/op 250.00 ns/op 1.03
isKnown normal case - 2 super set checks 256.00 ns/op 245.00 ns/op 1.04
isKnown worse case - 16 super set checks 246.00 ns/op 242.00 ns/op 1.02
CheckpointStateCache - add get delete 5.3200 us/op 5.2940 us/op 1.00
validate gossip signedAggregateAndProof - struct 2.7862 ms/op 2.7449 ms/op 1.02
validate gossip attestation - struct 1.3177 ms/op 1.3171 ms/op 1.00
pickEth1Vote - no votes 1.3263 ms/op 1.2706 ms/op 1.04
pickEth1Vote - max votes 8.8879 ms/op 8.6658 ms/op 1.03
pickEth1Vote - Eth1Data hashTreeRoot value x2048 8.6275 ms/op 8.5978 ms/op 1.00
pickEth1Vote - Eth1Data hashTreeRoot tree x2048 13.078 ms/op 13.923 ms/op 0.94
pickEth1Vote - Eth1Data fastSerialize value x2048 648.70 us/op 764.24 us/op 0.85
pickEth1Vote - Eth1Data fastSerialize tree x2048 4.7752 ms/op 4.6987 ms/op 1.02
bytes32 toHexString 497.00 ns/op 488.00 ns/op 1.02
bytes32 Buffer.toString(hex) 356.00 ns/op 352.00 ns/op 1.01
bytes32 Buffer.toString(hex) from Uint8Array 559.00 ns/op 547.00 ns/op 1.02
bytes32 Buffer.toString(hex) + 0x 352.00 ns/op 369.00 ns/op 0.95
Object access 1 prop 0.16800 ns/op 0.16300 ns/op 1.03
Map access 1 prop 0.16300 ns/op 0.15400 ns/op 1.06
Object get x1000 6.4630 ns/op 6.4560 ns/op 1.00
Map get x1000 0.56900 ns/op 0.60600 ns/op 0.94
Object set x1000 52.302 ns/op 52.820 ns/op 0.99
Map set x1000 44.239 ns/op 43.186 ns/op 1.02
Return object 10000 times 0.23300 ns/op 0.23750 ns/op 0.98
Throw Error 10000 times 4.3054 us/op 4.2003 us/op 1.03
fastMsgIdFn sha256 / 200 bytes 3.4950 us/op 3.4860 us/op 1.00
fastMsgIdFn h32 xxhash / 200 bytes 291.00 ns/op 279.00 ns/op 1.04
fastMsgIdFn h64 xxhash / 200 bytes 421.00 ns/op 416.00 ns/op 1.01
fastMsgIdFn sha256 / 1000 bytes 11.530 us/op 11.820 us/op 0.98
fastMsgIdFn h32 xxhash / 1000 bytes 417.00 ns/op 430.00 ns/op 0.97
fastMsgIdFn h64 xxhash / 1000 bytes 468.00 ns/op 518.00 ns/op 0.90
fastMsgIdFn sha256 / 10000 bytes 102.03 us/op 102.70 us/op 0.99
fastMsgIdFn h32 xxhash / 10000 bytes 1.9310 us/op 1.9350 us/op 1.00
fastMsgIdFn h64 xxhash / 10000 bytes 1.3310 us/op 1.4120 us/op 0.94
enrSubnets - fastDeserialize 64 bits 1.2920 us/op 1.4150 us/op 0.91
enrSubnets - ssz BitVector 64 bits 471.00 ns/op 508.00 ns/op 0.93
enrSubnets - fastDeserialize 4 bits 170.00 ns/op 167.00 ns/op 1.02
enrSubnets - ssz BitVector 4 bits 485.00 ns/op 504.00 ns/op 0.96
prioritizePeers score -10:0 att 32-0.1 sync 2-0 112.90 us/op 108.56 us/op 1.04
prioritizePeers score 0:0 att 32-0.25 sync 2-0.25 147.85 us/op 149.56 us/op 0.99
prioritizePeers score 0:0 att 32-0.5 sync 2-0.5 181.39 us/op 184.06 us/op 0.99
prioritizePeers score 0:0 att 64-0.75 sync 4-0.75 335.08 us/op 326.56 us/op 1.03
prioritizePeers score 0:0 att 64-1 sync 4-1 384.47 us/op 387.94 us/op 0.99
array of 16000 items push then shift 1.6621 us/op 1.6208 us/op 1.03
LinkedList of 16000 items push then shift 8.9090 ns/op 8.7260 ns/op 1.02
array of 16000 items push then pop 106.52 ns/op 89.386 ns/op 1.19
LinkedList of 16000 items push then pop 8.6330 ns/op 8.5470 ns/op 1.01
array of 24000 items push then shift 2.3637 us/op 2.3338 us/op 1.01
LinkedList of 24000 items push then shift 9.0820 ns/op 8.8320 ns/op 1.03
array of 24000 items push then pop 86.229 ns/op 78.095 ns/op 1.10
LinkedList of 24000 items push then pop 8.6420 ns/op 8.5960 ns/op 1.01
intersect bitArray bitLen 8 13.601 ns/op 12.992 ns/op 1.05
intersect array and set length 8 79.598 ns/op 76.948 ns/op 1.03
intersect bitArray bitLen 128 44.541 ns/op 43.307 ns/op 1.03
intersect array and set length 128 1.0888 us/op 1.0523 us/op 1.03
Buffer.concat 32 items 2.7080 us/op 2.8600 us/op 0.95
Uint8Array.set 32 items 2.7460 us/op 2.6600 us/op 1.03
transfer serialized Status (84 B) 2.1380 us/op 2.1710 us/op 0.98
copy serialized Status (84 B) 1.8170 us/op 1.7290 us/op 1.05
transfer serialized SignedVoluntaryExit (112 B) 2.3140 us/op 2.2310 us/op 1.04
copy serialized SignedVoluntaryExit (112 B) 1.9280 us/op 1.7660 us/op 1.09
transfer serialized ProposerSlashing (416 B) 2.7300 us/op 2.7450 us/op 0.99
copy serialized ProposerSlashing (416 B) 2.6500 us/op 2.9390 us/op 0.90
transfer serialized Attestation (485 B) 2.7160 us/op 2.6330 us/op 1.03
copy serialized Attestation (485 B) 2.2190 us/op 2.8340 us/op 0.78
transfer serialized AttesterSlashing (33232 B) 2.4850 us/op 3.1610 us/op 0.79
copy serialized AttesterSlashing (33232 B) 6.1640 us/op 6.4320 us/op 0.96
transfer serialized Small SignedBeaconBlock (128000 B) 2.7180 us/op 3.3160 us/op 0.82
copy serialized Small SignedBeaconBlock (128000 B) 15.896 us/op 13.398 us/op 1.19
transfer serialized Avg SignedBeaconBlock (200000 B) 3.2100 us/op 3.8530 us/op 0.83
copy serialized Avg SignedBeaconBlock (200000 B) 22.860 us/op 20.728 us/op 1.10
transfer serialized BlobsSidecar (524380 B) 3.4000 us/op 3.1600 us/op 1.08
copy serialized BlobsSidecar (524380 B) 176.69 us/op 162.67 us/op 1.09
transfer serialized Big SignedBeaconBlock (1000000 B) 3.8370 us/op 3.2430 us/op 1.18
copy serialized Big SignedBeaconBlock (1000000 B) 159.44 us/op 334.35 us/op 0.48
pass gossip attestations to forkchoice per slot 2.6811 ms/op 2.7074 ms/op 0.99
forkChoice updateHead vc 100000 bc 64 eq 0 2.0338 ms/op 2.0839 ms/op 0.98
forkChoice updateHead vc 600000 bc 64 eq 0 12.541 ms/op 12.041 ms/op 1.04
forkChoice updateHead vc 1000000 bc 64 eq 0 18.972 ms/op 23.433 ms/op 0.81
forkChoice updateHead vc 600000 bc 320 eq 0 16.177 ms/op 17.425 ms/op 0.93
forkChoice updateHead vc 600000 bc 1200 eq 0 80.416 ms/op 82.391 ms/op 0.98
forkChoice updateHead vc 600000 bc 64 eq 1000 20.360 ms/op 20.712 ms/op 0.98
forkChoice updateHead vc 600000 bc 64 eq 10000 22.881 ms/op 22.637 ms/op 1.01
forkChoice updateHead vc 600000 bc 64 eq 300000 31.708 ms/op 31.471 ms/op 1.01
computeDeltas 3.2661 ms/op 3.4441 ms/op 0.95
computeProposerBoostScoreFromBalances 1.7776 ms/op 1.7941 ms/op 0.99
altair processAttestation - 250000 vs - 7PWei normalcase 2.3920 ms/op 2.2630 ms/op 1.06
altair processAttestation - 250000 vs - 7PWei worstcase 3.6288 ms/op 4.1173 ms/op 0.88
altair processAttestation - setStatus - 1/6 committees join 145.14 us/op 160.38 us/op 0.90
altair processAttestation - setStatus - 1/3 committees join 279.80 us/op 326.01 us/op 0.86
altair processAttestation - setStatus - 1/2 committees join 376.43 us/op 423.07 us/op 0.89
altair processAttestation - setStatus - 2/3 committees join 477.87 us/op 529.87 us/op 0.90
altair processAttestation - setStatus - 4/5 committees join 689.74 us/op 732.29 us/op 0.94
altair processAttestation - setStatus - 100% committees join 774.85 us/op 863.09 us/op 0.90
altair processBlock - 250000 vs - 7PWei normalcase 17.427 ms/op 19.676 ms/op 0.89
altair processBlock - 250000 vs - 7PWei normalcase hashState 28.993 ms/op 27.022 ms/op 1.07
altair processBlock - 250000 vs - 7PWei worstcase 49.941 ms/op 52.374 ms/op 0.95
altair processBlock - 250000 vs - 7PWei worstcase hashState 70.456 ms/op 67.690 ms/op 1.04
phase0 processBlock - 250000 vs - 7PWei normalcase 1.9876 ms/op 2.1362 ms/op 0.93
phase0 processBlock - 250000 vs - 7PWei worstcase 28.829 ms/op 29.766 ms/op 0.97
altair processEth1Data - 250000 vs - 7PWei normalcase 468.04 us/op 591.62 us/op 0.79
getExpectedWithdrawals 250000 eb:1,eth1:1,we:0,wn:0,smpl:15 7.6910 us/op 8.4080 us/op 0.91
getExpectedWithdrawals 250000 eb:0.95,eth1:0.1,we:0.05,wn:0,smpl:219 23.630 us/op 28.059 us/op 0.84
getExpectedWithdrawals 250000 eb:0.95,eth1:0.3,we:0.05,wn:0,smpl:42 9.2970 us/op 11.063 us/op 0.84
getExpectedWithdrawals 250000 eb:0.95,eth1:0.7,we:0.05,wn:0,smpl:18 7.1790 us/op 8.5360 us/op 0.84
getExpectedWithdrawals 250000 eb:0.1,eth1:0.1,we:0,wn:0,smpl:1020 90.559 us/op 103.63 us/op 0.87
getExpectedWithdrawals 250000 eb:0.03,eth1:0.03,we:0,wn:0,smpl:11777 643.57 us/op 738.66 us/op 0.87
getExpectedWithdrawals 250000 eb:0.01,eth1:0.01,we:0,wn:0,smpl:16384 885.03 us/op 945.04 us/op 0.94
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,smpl:16384 880.83 us/op 944.23 us/op 0.93
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,nocache,smpl:16384 2.3349 ms/op 2.5559 ms/op 0.91
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,smpl:16384 1.7035 ms/op 1.7676 ms/op 0.96
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,nocache,smpl:16384 3.9895 ms/op 4.4739 ms/op 0.89
Tree 40 250000 create 298.25 ms/op 337.13 ms/op 0.88
Tree 40 250000 get(125000) 179.00 ns/op 203.34 ns/op 0.88
Tree 40 250000 set(125000) 933.51 ns/op 992.90 ns/op 0.94
Tree 40 250000 toArray() 19.284 ms/op 23.676 ms/op 0.81
Tree 40 250000 iterate all - toArray() + loop 19.364 ms/op 23.708 ms/op 0.82
Tree 40 250000 iterate all - get(i) 71.333 ms/op 81.862 ms/op 0.87
MutableVector 250000 create 10.254 ms/op 11.138 ms/op 0.92
MutableVector 250000 get(125000) 6.2440 ns/op 6.2370 ns/op 1.00
MutableVector 250000 set(125000) 266.30 ns/op 292.70 ns/op 0.91
MutableVector 250000 toArray() 2.7604 ms/op 3.7693 ms/op 0.73
MutableVector 250000 iterate all - toArray() + loop 2.8777 ms/op 3.5122 ms/op 0.82
MutableVector 250000 iterate all - get(i) 1.4994 ms/op 1.5488 ms/op 0.97
Array 250000 create 2.5608 ms/op 3.1029 ms/op 0.83
Array 250000 clone - spread 1.2800 ms/op 1.0942 ms/op 1.17
Array 250000 get(125000) 0.65000 ns/op 0.54600 ns/op 1.19
Array 250000 set(125000) 0.70300 ns/op 0.63500 ns/op 1.11
Array 250000 iterate all - loop 108.56 us/op 105.85 us/op 1.03
effectiveBalanceIncrements clone Uint8Array 300000 31.075 us/op 36.549 us/op 0.85
effectiveBalanceIncrements clone MutableVector 300000 257.00 ns/op 320.00 ns/op 0.80
effectiveBalanceIncrements rw all Uint8Array 300000 167.48 us/op 169.52 us/op 0.99
effectiveBalanceIncrements rw all MutableVector 300000 76.773 ms/op 79.809 ms/op 0.96
phase0 afterProcessEpoch - 250000 vs - 7PWei 113.44 ms/op 115.54 ms/op 0.98
phase0 beforeProcessEpoch - 250000 vs - 7PWei 35.939 ms/op 44.318 ms/op 0.81
altair processEpoch - mainnet_e81889 323.30 ms/op 331.06 ms/op 0.98
mainnet_e81889 - altair beforeProcessEpoch 64.264 ms/op 71.388 ms/op 0.90
mainnet_e81889 - altair processJustificationAndFinalization 15.748 us/op 18.892 us/op 0.83
mainnet_e81889 - altair processInactivityUpdates 5.8125 ms/op 5.1671 ms/op 1.12
mainnet_e81889 - altair processRewardsAndPenalties 47.572 ms/op 49.696 ms/op 0.96
mainnet_e81889 - altair processRegistryUpdates 3.8240 us/op 2.8790 us/op 1.33
mainnet_e81889 - altair processSlashings 465.00 ns/op 638.00 ns/op 0.73
mainnet_e81889 - altair processEth1DataReset 510.00 ns/op 705.00 ns/op 0.72
mainnet_e81889 - altair processEffectiveBalanceUpdates 1.2353 ms/op 1.2588 ms/op 0.98
mainnet_e81889 - altair processSlashingsReset 4.7270 us/op 4.9450 us/op 0.96
mainnet_e81889 - altair processRandaoMixesReset 4.3550 us/op 5.0720 us/op 0.86
mainnet_e81889 - altair processHistoricalRootsUpdate 742.00 ns/op 1.3220 us/op 0.56
mainnet_e81889 - altair processParticipationFlagUpdates 2.6720 us/op 5.1570 us/op 0.52
mainnet_e81889 - altair processSyncCommitteeUpdates 759.00 ns/op 732.00 ns/op 1.04
mainnet_e81889 - altair afterProcessEpoch 123.81 ms/op 126.64 ms/op 0.98
phase0 processEpoch - mainnet_e58758 349.33 ms/op 419.58 ms/op 0.83
mainnet_e58758 - phase0 beforeProcessEpoch 129.48 ms/op 190.70 ms/op 0.68
mainnet_e58758 - phase0 processJustificationAndFinalization 17.537 us/op 32.517 us/op 0.54
mainnet_e58758 - phase0 processRewardsAndPenalties 65.104 ms/op 78.813 ms/op 0.83
mainnet_e58758 - phase0 processRegistryUpdates 7.4770 us/op 15.317 us/op 0.49
mainnet_e58758 - phase0 processSlashings 521.00 ns/op 1.4340 us/op 0.36
mainnet_e58758 - phase0 processEth1DataReset 541.00 ns/op 1.6720 us/op 0.32
mainnet_e58758 - phase0 processEffectiveBalanceUpdates 1.3020 ms/op 1.7791 ms/op 0.73
mainnet_e58758 - phase0 processSlashingsReset 3.5580 us/op 9.8430 us/op 0.36
mainnet_e58758 - phase0 processRandaoMixesReset 4.8620 us/op 11.827 us/op 0.41
mainnet_e58758 - phase0 processHistoricalRootsUpdate 720.00 ns/op 1.8140 us/op 0.40
mainnet_e58758 - phase0 processParticipationRecordUpdates 4.0800 us/op 11.853 us/op 0.34
mainnet_e58758 - phase0 afterProcessEpoch 95.538 ms/op 114.29 ms/op 0.84
phase0 processEffectiveBalanceUpdates - 250000 normalcase 1.2199 ms/op 1.4476 ms/op 0.84
phase0 processEffectiveBalanceUpdates - 250000 worstcase 0.5 1.4664 ms/op 1.6061 ms/op 0.91
altair processInactivityUpdates - 250000 normalcase 19.173 ms/op 32.683 ms/op 0.59
altair processInactivityUpdates - 250000 worstcase 22.395 ms/op 28.364 ms/op 0.79
phase0 processRegistryUpdates - 250000 normalcase 6.9170 us/op 8.0280 us/op 0.86
phase0 processRegistryUpdates - 250000 badcase_full_deposits 255.38 us/op 268.56 us/op 0.95
phase0 processRegistryUpdates - 250000 worstcase 0.5 121.58 ms/op 126.41 ms/op 0.96
altair processRewardsAndPenalties - 250000 normalcase 69.846 ms/op 68.237 ms/op 1.02
altair processRewardsAndPenalties - 250000 worstcase 69.895 ms/op 66.482 ms/op 1.05
phase0 getAttestationDeltas - 250000 normalcase 6.7569 ms/op 6.9815 ms/op 0.97
phase0 getAttestationDeltas - 250000 worstcase 6.8054 ms/op 6.6758 ms/op 1.02
phase0 processSlashings - 250000 worstcase 3.6491 ms/op 4.1016 ms/op 0.89
altair processSyncCommitteeUpdates - 250000 174.02 ms/op 188.68 ms/op 0.92
BeaconState.hashTreeRoot - No change 323.00 ns/op 329.00 ns/op 0.98
BeaconState.hashTreeRoot - 1 full validator 50.719 us/op 54.817 us/op 0.93
BeaconState.hashTreeRoot - 32 full validator 511.00 us/op 511.89 us/op 1.00
BeaconState.hashTreeRoot - 512 full validator 5.3991 ms/op 5.4587 ms/op 0.99
BeaconState.hashTreeRoot - 1 validator.effectiveBalance 62.857 us/op 64.516 us/op 0.97
BeaconState.hashTreeRoot - 32 validator.effectiveBalance 923.50 us/op 917.89 us/op 1.01
BeaconState.hashTreeRoot - 512 validator.effectiveBalance 11.309 ms/op 12.179 ms/op 0.93
BeaconState.hashTreeRoot - 1 balances 48.454 us/op 49.807 us/op 0.97
BeaconState.hashTreeRoot - 32 balances 445.50 us/op 488.40 us/op 0.91
BeaconState.hashTreeRoot - 512 balances 4.3230 ms/op 4.6945 ms/op 0.92
BeaconState.hashTreeRoot - 250000 balances 76.613 ms/op 75.573 ms/op 1.01
aggregationBits - 2048 els - zipIndexesInBitList 16.096 us/op 18.932 us/op 0.85
regular array get 100000 times 43.248 us/op 41.191 us/op 1.05
wrappedArray get 100000 times 41.993 us/op 40.435 us/op 1.04
arrayWithProxy get 100000 times 15.527 ms/op 17.372 ms/op 0.89
ssz.Root.equals 563.00 ns/op 608.00 ns/op 0.93
byteArrayEquals 549.00 ns/op 552.00 ns/op 0.99
shuffle list - 16384 els 6.9586 ms/op 6.8656 ms/op 1.01
shuffle list - 250000 els 101.24 ms/op 102.53 ms/op 0.99
processSlot - 1 slots 8.4060 us/op 8.8260 us/op 0.95
processSlot - 32 slots 1.3125 ms/op 1.3445 ms/op 0.98
getEffectiveBalanceIncrementsZeroInactive - 250000 vs - 7PWei 35.963 ms/op 36.833 ms/op 0.98
getCommitteeAssignments - req 1 vs - 250000 vc 2.8914 ms/op 2.9121 ms/op 0.99
getCommitteeAssignments - req 100 vs - 250000 vc 4.1337 ms/op 4.1207 ms/op 1.00
getCommitteeAssignments - req 1000 vs - 250000 vc 4.6606 ms/op 4.4535 ms/op 1.05
RootCache.getBlockRootAtSlot - 250000 vs - 7PWei 5.0500 ns/op 4.6900 ns/op 1.08
state getBlockRootAtSlot - 250000 vs - 7PWei 947.20 ns/op 608.17 ns/op 1.56
computeProposers - vc 250000 11.611 ms/op 10.644 ms/op 1.09
computeEpochShuffling - vc 250000 104.72 ms/op 102.21 ms/op 1.02
getNextSyncCommittee - vc 250000 185.59 ms/op 175.05 ms/op 1.06
computeSigningRoot for AttestationData 14.150 us/op 13.191 us/op 1.07
hash AttestationData serialized data then Buffer.toString(base64) 2.5197 us/op 2.5016 us/op 1.01
toHexString serialized data 1.1217 us/op 1.1660 us/op 0.96
Buffer.toString(base64) 329.04 ns/op 349.85 ns/op 0.94

by benchmarkbot/action

@dapplion dapplion changed the title Track attestationInBlockParticipants feat: track attestationInBlockParticipants Jul 12, 2023
@dapplion dapplion added the scope-metrics All issues with regards to the exposed metrics. label Jul 12, 2023
@wemeetagain wemeetagain merged commit cf659f4 into unstable Jul 12, 2023
12 of 14 checks passed
@wemeetagain wemeetagain deleted the dapplion/inclusion-bits branch July 12, 2023 16:35
@wemeetagain
Copy link
Member

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

None yet

2 participants