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

Use network.reportPeer #3798

Merged
merged 1 commit into from
Feb 28, 2022
Merged

Use network.reportPeer #3798

merged 1 commit into from
Feb 28, 2022

Conversation

dapplion
Copy link
Contributor

Motivation

Better logic encapsulation in Network class

Description

  • Use network.reportPeer
  • Make network.peerRpcScores private

@codecov
Copy link

codecov bot commented Feb 27, 2022

Codecov Report

Merging #3798 (fe7601f) into master (a222e42) will decrease coverage by 1.05%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##           master    #3798      +/-   ##
==========================================
- Coverage   36.77%   35.72%   -1.06%     
==========================================
  Files         322      322              
  Lines        8812     9186     +374     
  Branches     1371     1494     +123     
==========================================
+ Hits         3241     3282      +41     
- Misses       5429     5762     +333     
  Partials      142      142              

@github-actions
Copy link
Contributor

Performance Report

✔️ no performance regression detected

Full benchmark results
Benchmark suite Current: 63c1049 Previous: 060918e Ratio
BeaconState.hashTreeRoot - No change 699.00 ns/op 545.00 ns/op 1.28
BeaconState.hashTreeRoot - 1 full validator 101.84 us/op 75.993 us/op 1.34
BeaconState.hashTreeRoot - 32 full validator 1.3935 ms/op 1.2114 ms/op 1.15
BeaconState.hashTreeRoot - 512 full validator 19.397 ms/op 16.099 ms/op 1.20
BeaconState.hashTreeRoot - 1 validator.effectiveBalance 100.09 us/op 86.932 us/op 1.15
BeaconState.hashTreeRoot - 32 validator.effectiveBalance 1.9189 ms/op 1.3614 ms/op 1.41
BeaconState.hashTreeRoot - 512 validator.effectiveBalance 23.982 ms/op 17.776 ms/op 1.35
BeaconState.hashTreeRoot - 1 balances 75.002 us/op 56.555 us/op 1.33
BeaconState.hashTreeRoot - 32 balances 615.93 us/op 489.16 us/op 1.26
BeaconState.hashTreeRoot - 512 balances 6.2764 ms/op 4.7713 ms/op 1.32
BeaconState.hashTreeRoot - 250000 balances 110.99 ms/op 102.80 ms/op 1.08
processSlot - 1 slots 49.922 us/op 43.946 us/op 1.14
processSlot - 32 slots 2.5303 ms/op 2.1780 ms/op 1.16
getCommitteeAssignments - req 1 vs - 250000 vc 6.4910 ms/op 5.2880 ms/op 1.23
getCommitteeAssignments - req 100 vs - 250000 vc 9.0093 ms/op 7.3698 ms/op 1.22
getCommitteeAssignments - req 1000 vs - 250000 vc 9.6053 ms/op 7.8740 ms/op 1.22
computeProposers - vc 250000 25.932 ms/op 21.583 ms/op 1.20
computeEpochShuffling - vc 250000 226.05 ms/op 188.03 ms/op 1.20
getNextSyncCommittee - vc 250000 424.52 ms/op 347.33 ms/op 1.22
altair processAttestation - 250000 vs - 7PWei normalcase 43.466 ms/op 33.964 ms/op 1.28
altair processAttestation - 250000 vs - 7PWei worstcase 45.654 ms/op 33.838 ms/op 1.35
altair processAttestation - setStatus - 1/6 committees join 15.406 ms/op 11.525 ms/op 1.34
altair processAttestation - setStatus - 1/3 committees join 32.656 ms/op 23.821 ms/op 1.37
altair processAttestation - setStatus - 1/2 committees join 46.847 ms/op 37.025 ms/op 1.27
altair processAttestation - setStatus - 2/3 committees join 61.905 ms/op 49.312 ms/op 1.26
altair processAttestation - setStatus - 4/5 committees join 75.939 ms/op 60.425 ms/op 1.26
altair processAttestation - setStatus - 100% committees join 93.856 ms/op 64.138 ms/op 1.46
altair processAttestation - updateEpochParticipants - 1/6 committees join 16.749 ms/op 10.586 ms/op 1.58
altair processAttestation - updateEpochParticipants - 1/3 committees join 34.513 ms/op 23.189 ms/op 1.49
altair processAttestation - updateEpochParticipants - 1/2 committees join 29.791 ms/op 19.321 ms/op 1.54
altair processAttestation - updateEpochParticipants - 2/3 committees join 27.789 ms/op 21.800 ms/op 1.27
altair processAttestation - updateEpochParticipants - 4/5 committees join 29.411 ms/op 21.400 ms/op 1.37
altair processAttestation - updateEpochParticipants - 100% committees join 30.838 ms/op 26.728 ms/op 1.15
altair processAttestation - updateAllStatus 23.382 ms/op 18.324 ms/op 1.28
altair processBlock - 250000 vs - 7PWei normalcase 37.907 ms/op 30.860 ms/op 1.23
altair processBlock - 250000 vs - 7PWei worstcase 124.15 ms/op 107.01 ms/op 1.16
altair processEpoch - mainnet_e81889 958.11 ms/op 782.26 ms/op 1.22
mainnet_e81889 - altair beforeProcessEpoch 382.95 ms/op 281.27 ms/op 1.36
mainnet_e81889 - altair processJustificationAndFinalization 72.360 us/op 57.022 us/op 1.27
mainnet_e81889 - altair processInactivityUpdates 21.687 ms/op 16.919 ms/op 1.28
mainnet_e81889 - altair processRewardsAndPenalties 115.62 ms/op 136.04 ms/op 0.85
mainnet_e81889 - altair processRegistryUpdates 12.014 us/op 7.5860 us/op 1.58
mainnet_e81889 - altair processSlashings 3.3300 us/op 1.5630 us/op 2.13
mainnet_e81889 - altair processEth1DataReset 3.5440 us/op 2.0410 us/op 1.74
mainnet_e81889 - altair processEffectiveBalanceUpdates 7.9109 ms/op 6.5531 ms/op 1.21
mainnet_e81889 - altair processSlashingsReset 18.764 us/op 12.706 us/op 1.48
mainnet_e81889 - altair processRandaoMixesReset 25.273 us/op 13.065 us/op 1.93
mainnet_e81889 - altair processHistoricalRootsUpdate 5.3740 us/op 2.0440 us/op 2.63
mainnet_e81889 - altair processParticipationFlagUpdates 86.672 ms/op 68.685 ms/op 1.26
mainnet_e81889 - altair processSyncCommitteeUpdates 2.9640 us/op 1.9990 us/op 1.48
mainnet_e81889 - altair afterProcessEpoch 272.45 ms/op 195.47 ms/op 1.39
altair processInactivityUpdates - 250000 normalcase 91.198 ms/op 64.724 ms/op 1.41
altair processInactivityUpdates - 250000 worstcase 82.330 ms/op 70.287 ms/op 1.17
altair processParticipationFlagUpdates - 250000 anycase 67.690 ms/op 60.155 ms/op 1.13
altair processRewardsAndPenalties - 250000 normalcase 128.35 ms/op 111.48 ms/op 1.15
altair processRewardsAndPenalties - 250000 worstcase 104.12 ms/op 84.558 ms/op 1.23
altair processSyncCommitteeUpdates - 250000 436.29 ms/op 338.78 ms/op 1.29
Tree 40 250000 create 951.72 ms/op 646.93 ms/op 1.47
Tree 40 250000 get(125000) 406.66 ns/op 331.02 ns/op 1.23
Tree 40 250000 set(125000) 2.8557 us/op 2.1229 us/op 1.35
Tree 40 250000 toArray() 47.484 ms/op 42.038 ms/op 1.13
Tree 40 250000 iterate all - toArray() + loop 47.410 ms/op 40.642 ms/op 1.17
Tree 40 250000 iterate all - get(i) 142.65 ms/op 121.23 ms/op 1.18
MutableVector 250000 create 31.779 ms/op 21.855 ms/op 1.45
MutableVector 250000 get(125000) 15.599 ns/op 11.589 ns/op 1.35
MutableVector 250000 set(125000) 680.79 ns/op 528.20 ns/op 1.29
MutableVector 250000 toArray() 10.760 ms/op 9.9911 ms/op 1.08
MutableVector 250000 iterate all - toArray() + loop 11.010 ms/op 8.9847 ms/op 1.23
MutableVector 250000 iterate all - get(i) 4.0054 ms/op 3.3227 ms/op 1.21
Array 250000 create 7.1403 ms/op 5.7361 ms/op 1.24
Array 250000 clone - spread 3.0742 ms/op 1.8835 ms/op 1.63
Array 250000 get(125000) 1.5530 ns/op 0.92600 ns/op 1.68
Array 250000 set(125000) 1.4990 ns/op 0.92900 ns/op 1.61
Array 250000 iterate all - loop 202.78 us/op 167.86 us/op 1.21
effectiveBalanceIncrements clone Uint8Array 300000 90.337 us/op 71.308 us/op 1.27
effectiveBalanceIncrements clone MutableVector 300000 829.00 ns/op 560.00 ns/op 1.48
effectiveBalanceIncrements rw all Uint8Array 300000 362.28 us/op 303.24 us/op 1.19
effectiveBalanceIncrements rw all MutableVector 300000 255.07 ms/op 170.69 ms/op 1.49
aggregationBits - 2048 els - readonlyValues 223.08 us/op 186.82 us/op 1.19
aggregationBits - 2048 els - zipIndexesInBitList 45.699 us/op 34.226 us/op 1.34
regular array get 100000 times 80.912 us/op 67.526 us/op 1.20
wrappedArray get 100000 times 81.121 us/op 67.666 us/op 1.20
arrayWithProxy get 100000 times 34.609 ms/op 27.684 ms/op 1.25
ssz.Root.equals 1.3070 us/op 1.1340 us/op 1.15
ssz.Root.equals with valueOf() 1.5910 us/op 1.3240 us/op 1.20
byteArrayEquals with valueOf() 1.5660 us/op 1.2770 us/op 1.23
phase0 processBlock - 250000 vs - 7PWei normalcase 9.9088 ms/op 7.8438 ms/op 1.26
phase0 processBlock - 250000 vs - 7PWei worstcase 90.870 ms/op 71.340 ms/op 1.27
phase0 afterProcessEpoch - 250000 vs - 7PWei 248.49 ms/op 186.54 ms/op 1.33
phase0 beforeProcessEpoch - 250000 vs - 7PWei 682.04 ms/op 528.04 ms/op 1.29
phase0 processEpoch - mainnet_e58758 955.11 ms/op 731.27 ms/op 1.31
mainnet_e58758 - phase0 beforeProcessEpoch 582.17 ms/op 475.32 ms/op 1.22
mainnet_e58758 - phase0 processJustificationAndFinalization 77.521 us/op 51.570 us/op 1.50
mainnet_e58758 - phase0 processRewardsAndPenalties 98.099 ms/op 80.209 ms/op 1.22
mainnet_e58758 - phase0 processRegistryUpdates 49.829 us/op 35.305 us/op 1.41
mainnet_e58758 - phase0 processSlashings 3.3220 us/op 1.9890 us/op 1.67
mainnet_e58758 - phase0 processEth1DataReset 3.1660 us/op 1.7340 us/op 1.83
mainnet_e58758 - phase0 processEffectiveBalanceUpdates 6.4269 ms/op 4.8128 ms/op 1.34
mainnet_e58758 - phase0 processSlashingsReset 16.219 us/op 12.256 us/op 1.32
mainnet_e58758 - phase0 processRandaoMixesReset 21.779 us/op 17.798 us/op 1.22
mainnet_e58758 - phase0 processHistoricalRootsUpdate 4.7360 us/op 2.4840 us/op 1.91
mainnet_e58758 - phase0 processParticipationRecordUpdates 14.644 us/op 12.956 us/op 1.13
mainnet_e58758 - phase0 afterProcessEpoch 226.68 ms/op 182.44 ms/op 1.24
phase0 processEffectiveBalanceUpdates - 250000 normalcase 8.2615 ms/op 6.1948 ms/op 1.33
phase0 processEffectiveBalanceUpdates - 250000 worstcase 0.5 7.6903 ms/op 7.0207 ms/op 1.10
phase0 processRegistryUpdates - 250000 normalcase 54.166 us/op 36.205 us/op 1.50
phase0 processRegistryUpdates - 250000 badcase_full_deposits 3.5619 ms/op 2.8047 ms/op 1.27
phase0 processRegistryUpdates - 250000 worstcase 0.5 2.1349 s/op 1.5232 s/op 1.40
phase0 getAttestationDeltas - 250000 normalcase 16.518 ms/op 13.394 ms/op 1.23
phase0 getAttestationDeltas - 250000 worstcase 15.578 ms/op 13.566 ms/op 1.15
phase0 processSlashings - 250000 worstcase 48.006 ms/op 32.315 ms/op 1.49
shuffle list - 16384 els 15.728 ms/op 11.528 ms/op 1.36
shuffle list - 250000 els 224.64 ms/op 165.13 ms/op 1.36
getEffectiveBalanceIncrementsZeroInactive - 250000 vs - 7PWei 579.97 us/op 421.62 us/op 1.38
pass gossip attestations to forkchoice per slot 19.075 ms/op 13.718 ms/op 1.39
computeDeltas 4.3308 ms/op 3.2060 ms/op 1.35
computeProposerBoostScoreFromBalances 603.74 us/op 443.81 us/op 1.36
getPubkeys - index2pubkey - req 1000 vs - 250000 vc 2.6524 ms/op 1.8647 ms/op 1.42
getPubkeys - validatorsArr - req 1000 vs - 250000 vc 943.74 us/op 734.50 us/op 1.28
BLS verify - blst-native 2.2240 ms/op 1.8612 ms/op 1.19
BLS verifyMultipleSignatures 3 - blst-native 4.5661 ms/op 3.8151 ms/op 1.20
BLS verifyMultipleSignatures 8 - blst-native 9.8553 ms/op 8.2535 ms/op 1.19
BLS verifyMultipleSignatures 32 - blst-native 35.740 ms/op 29.885 ms/op 1.20
BLS aggregatePubkeys 32 - blst-native 47.228 us/op 39.587 us/op 1.19
BLS aggregatePubkeys 128 - blst-native 184.34 us/op 153.98 us/op 1.20
getAttestationsForBlock 84.789 ms/op 59.370 ms/op 1.43
CheckpointStateCache - add get delete 22.227 us/op 18.681 us/op 1.19
validate gossip signedAggregateAndProof - struct 5.3744 ms/op 3.9431 ms/op 1.36
validate gossip signedAggregateAndProof - treeBacked 5.3090 ms/op 3.9024 ms/op 1.36
validate gossip attestation - struct 2.5082 ms/op 1.8525 ms/op 1.35
validate gossip attestation - treeBacked 2.5323 ms/op 1.8545 ms/op 1.37
pickEth1Vote - no votes 12.453 ms/op 8.5220 ms/op 1.46
pickEth1Vote - max votes 63.923 ms/op 50.780 ms/op 1.26
pickEth1Vote - Eth1Data hashTreeRoot value x2048 30.240 ms/op 24.783 ms/op 1.22
pickEth1Vote - Eth1Data hashTreeRoot tree x2048 11.593 ms/op 9.0033 ms/op 1.29
pickEth1Vote - Eth1Data fastSerialize value x2048 6.8250 ms/op 4.8157 ms/op 1.42
pickEth1Vote - Eth1Data fastSerialize tree x2048 28.756 ms/op 21.533 ms/op 1.34
bytes32 toHexString 2.1840 us/op 1.4610 us/op 1.49
bytes32 Buffer.toString(hex) 893.00 ns/op 611.00 ns/op 1.46
bytes32 Buffer.toString(hex) from Uint8Array 1.2310 us/op 820.00 ns/op 1.50
bytes32 Buffer.toString(hex) + 0x 888.00 ns/op 597.00 ns/op 1.49
Object access 1 prop 0.41500 ns/op 0.29600 ns/op 1.40
Map access 1 prop 0.36100 ns/op 0.26200 ns/op 1.38
Object get x1000 20.593 ns/op 15.204 ns/op 1.35
Map get x1000 1.1790 ns/op 0.86000 ns/op 1.37
Object set x1000 129.90 ns/op 98.490 ns/op 1.32
Map set x1000 80.840 ns/op 59.129 ns/op 1.37
Return object 10000 times 0.45020 ns/op 0.33100 ns/op 1.36
Throw Error 10000 times 6.9553 us/op 5.1133 us/op 1.36
enrSubnets - fastDeserialize 64 bits 1.5090 us/op 1.1240 us/op 1.34
enrSubnets - ssz BitVector 64 bits 19.745 us/op 14.560 us/op 1.36
enrSubnets - fastDeserialize 4 bits 544.00 ns/op 409.00 ns/op 1.33
enrSubnets - ssz BitVector 4 bits 3.5140 us/op 2.5680 us/op 1.37
RateTracker 1000000 limit, 1 obj count per request 216.81 ns/op 158.87 ns/op 1.36
RateTracker 1000000 limit, 2 obj count per request 162.07 ns/op 117.59 ns/op 1.38
RateTracker 1000000 limit, 4 obj count per request 135.03 ns/op 98.219 ns/op 1.37
RateTracker 1000000 limit, 8 obj count per request 121.60 ns/op 88.235 ns/op 1.38
RateTracker with prune 5.0690 us/op 3.4840 us/op 1.45
array of 16000 items push then shift 3.7045 us/op 2.9300 us/op 1.26
LinkedList of 16000 items push then shift 19.396 ns/op 15.514 ns/op 1.25
array of 16000 items push then pop 247.22 ns/op 206.84 ns/op 1.20
LinkedList of 16000 items push then pop 19.232 ns/op 15.257 ns/op 1.26
array of 24000 items push then shift 5.4644 us/op 4.5595 us/op 1.20
LinkedList of 24000 items push then shift 23.137 ns/op 19.382 ns/op 1.19
array of 24000 items push then pop 266.18 ns/op 191.73 ns/op 1.39
LinkedList of 24000 items push then pop 21.137 ns/op 17.123 ns/op 1.23

by benchmarkbot/action

@dapplion dapplion merged commit fe72a38 into master Feb 28, 2022
@dapplion dapplion deleted the dapplion/report-peer branch February 28, 2022 05:51
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.

2 participants