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

Apply peer action when there are gossip validation errors #3781

Merged
merged 4 commits into from
Feb 25, 2022

Conversation

twoeths
Copy link
Contributor

@twoeths twoeths commented Feb 22, 2022

Motivation

  • if a node keeps receiving invalid messages from another node, right now it only decreases gossip score of peer, we also should decrease score at lodestar side, and in the end disconnect the peer

Description

Closes #3772

@codecov
Copy link

codecov bot commented Feb 22, 2022

Codecov Report

Merging #3781 (0508f2d) into master (a222e42) will increase coverage by 0.05%.
The diff coverage is n/a.

❗ Current head 0508f2d differs from pull request most recent head 1bc05d7. Consider uploading reports for the commit 1bc05d7 to get more accurate results

@@            Coverage Diff             @@
##           master    #3781      +/-   ##
==========================================
+ Coverage   36.77%   36.83%   +0.05%     
==========================================
  Files         322      322              
  Lines        8812     8827      +15     
  Branches     1371     1372       +1     
==========================================
+ Hits         3241     3251      +10     
- Misses       5429     5434       +5     
  Partials      142      142              

@github-actions
Copy link
Contributor

github-actions bot commented Feb 22, 2022

Performance Report

✔️ no performance regression detected

Full benchmark results
Benchmark suite Current: 0508f2d Previous: 8502b30 Ratio
BeaconState.hashTreeRoot - No change 689.00 ns/op 669.00 ns/op 1.03
BeaconState.hashTreeRoot - 1 full validator 96.707 us/op 170.25 us/op 0.57
BeaconState.hashTreeRoot - 32 full validator 1.4407 ms/op 2.4532 ms/op 0.59
BeaconState.hashTreeRoot - 512 full validator 18.816 ms/op 32.595 ms/op 0.58
BeaconState.hashTreeRoot - 1 validator.effectiveBalance 98.897 us/op 160.87 us/op 0.61
BeaconState.hashTreeRoot - 32 validator.effectiveBalance 1.7168 ms/op 2.8745 ms/op 0.60
BeaconState.hashTreeRoot - 512 validator.effectiveBalance 22.404 ms/op 35.725 ms/op 0.63
BeaconState.hashTreeRoot - 1 balances 74.362 us/op 117.02 us/op 0.64
BeaconState.hashTreeRoot - 32 balances 593.10 us/op 944.93 us/op 0.63
BeaconState.hashTreeRoot - 512 balances 5.6174 ms/op 9.3228 ms/op 0.60
BeaconState.hashTreeRoot - 250000 balances 116.12 ms/op 169.79 ms/op 0.68
processSlot - 1 slots 47.260 us/op 70.265 us/op 0.67
processSlot - 32 slots 2.6078 ms/op 3.8085 ms/op 0.68
getCommitteeAssignments - req 1 vs - 250000 vc 6.3438 ms/op 5.4942 ms/op 1.15
getCommitteeAssignments - req 100 vs - 250000 vc 8.7684 ms/op 7.9262 ms/op 1.11
getCommitteeAssignments - req 1000 vs - 250000 vc 9.4471 ms/op 8.5035 ms/op 1.11
computeProposers - vc 250000 24.333 ms/op 27.137 ms/op 0.90
computeEpochShuffling - vc 250000 225.58 ms/op 215.05 ms/op 1.05
getNextSyncCommittee - vc 250000 411.69 ms/op 431.43 ms/op 0.95
altair processAttestation - 250000 vs - 7PWei normalcase 35.614 ms/op 41.505 ms/op 0.86
altair processAttestation - 250000 vs - 7PWei worstcase 41.611 ms/op 47.404 ms/op 0.88
altair processAttestation - setStatus - 1/6 committees join 14.718 ms/op 14.403 ms/op 1.02
altair processAttestation - setStatus - 1/3 committees join 29.428 ms/op 28.749 ms/op 1.02
altair processAttestation - setStatus - 1/2 committees join 44.379 ms/op 47.272 ms/op 0.94
altair processAttestation - setStatus - 2/3 committees join 64.394 ms/op 60.242 ms/op 1.07
altair processAttestation - setStatus - 4/5 committees join 66.355 ms/op 71.133 ms/op 0.93
altair processAttestation - setStatus - 100% committees join 82.218 ms/op 89.921 ms/op 0.91
altair processAttestation - updateEpochParticipants - 1/6 committees join 14.459 ms/op 15.828 ms/op 0.91
altair processAttestation - updateEpochParticipants - 1/3 committees join 28.409 ms/op 31.409 ms/op 0.90
altair processAttestation - updateEpochParticipants - 1/2 committees join 24.074 ms/op 20.603 ms/op 1.17
altair processAttestation - updateEpochParticipants - 2/3 committees join 25.860 ms/op 22.070 ms/op 1.17
altair processAttestation - updateEpochParticipants - 4/5 committees join 26.695 ms/op 24.472 ms/op 1.09
altair processAttestation - updateEpochParticipants - 100% committees join 32.746 ms/op 27.581 ms/op 1.19
altair processAttestation - updateAllStatus 23.086 ms/op 22.177 ms/op 1.04
altair processBlock - 250000 vs - 7PWei normalcase 38.118 ms/op 40.969 ms/op 0.93
altair processBlock - 250000 vs - 7PWei worstcase 121.38 ms/op 132.45 ms/op 0.92
altair processEpoch - mainnet_e81889 924.23 ms/op 906.71 ms/op 1.02
mainnet_e81889 - altair beforeProcessEpoch 357.66 ms/op 385.59 ms/op 0.93
mainnet_e81889 - altair processJustificationAndFinalization 71.510 us/op 118.31 us/op 0.60
mainnet_e81889 - altair processInactivityUpdates 22.281 ms/op 20.168 ms/op 1.10
mainnet_e81889 - altair processRewardsAndPenalties 160.00 ms/op 109.16 ms/op 1.47
mainnet_e81889 - altair processRegistryUpdates 10.568 us/op 21.130 us/op 0.50
mainnet_e81889 - altair processSlashings 3.4160 us/op 6.9910 us/op 0.49
mainnet_e81889 - altair processEth1DataReset 3.1340 us/op 6.4170 us/op 0.49
mainnet_e81889 - altair processEffectiveBalanceUpdates 7.5174 ms/op 6.9517 ms/op 1.08
mainnet_e81889 - altair processSlashingsReset 13.706 us/op 35.031 us/op 0.39
mainnet_e81889 - altair processRandaoMixesReset 16.731 us/op 42.410 us/op 0.39
mainnet_e81889 - altair processHistoricalRootsUpdate 4.5900 us/op 8.0900 us/op 0.57
mainnet_e81889 - altair processParticipationFlagUpdates 80.860 ms/op 91.663 ms/op 0.88
mainnet_e81889 - altair processSyncCommitteeUpdates 3.1470 us/op 5.8630 us/op 0.54
mainnet_e81889 - altair afterProcessEpoch 266.29 ms/op 259.56 ms/op 1.03
altair processInactivityUpdates - 250000 normalcase 88.065 ms/op 90.454 ms/op 0.97
altair processInactivityUpdates - 250000 worstcase 86.148 ms/op 81.024 ms/op 1.06
altair processParticipationFlagUpdates - 250000 anycase 73.912 ms/op 65.925 ms/op 1.12
altair processRewardsAndPenalties - 250000 normalcase 121.35 ms/op 107.98 ms/op 1.12
altair processRewardsAndPenalties - 250000 worstcase 109.36 ms/op 114.57 ms/op 0.95
altair processSyncCommitteeUpdates - 250000 418.22 ms/op 456.86 ms/op 0.92
Tree 40 250000 create 803.84 ms/op 879.73 ms/op 0.91
Tree 40 250000 get(125000) 387.73 ns/op 334.37 ns/op 1.16
Tree 40 250000 set(125000) 2.3976 us/op 2.4505 us/op 0.98
Tree 40 250000 toArray() 45.102 ms/op 47.577 ms/op 0.95
Tree 40 250000 iterate all - toArray() + loop 45.857 ms/op 45.983 ms/op 1.00
Tree 40 250000 iterate all - get(i) 141.18 ms/op 135.22 ms/op 1.04
MutableVector 250000 create 24.256 ms/op 24.300 ms/op 1.00
MutableVector 250000 get(125000) 15.706 ns/op 15.565 ns/op 1.01
MutableVector 250000 set(125000) 645.91 ns/op 671.47 ns/op 0.96
MutableVector 250000 toArray() 10.291 ms/op 9.9760 ms/op 1.03
MutableVector 250000 iterate all - toArray() + loop 10.742 ms/op 10.232 ms/op 1.05
MutableVector 250000 iterate all - get(i) 4.7504 ms/op 4.2872 ms/op 1.11
Array 250000 create 6.9561 ms/op 6.3676 ms/op 1.09
Array 250000 clone - spread 2.7168 ms/op 2.6611 ms/op 1.02
Array 250000 get(125000) 1.3030 ns/op 1.2980 ns/op 1.00
Array 250000 set(125000) 1.3120 ns/op 1.2170 ns/op 1.08
Array 250000 iterate all - loop 200.30 us/op 146.95 us/op 1.36
effectiveBalanceIncrements clone Uint8Array 300000 123.37 us/op 205.82 us/op 0.60
effectiveBalanceIncrements clone MutableVector 300000 632.00 ns/op 565.00 ns/op 1.12
effectiveBalanceIncrements rw all Uint8Array 300000 355.41 us/op 201.44 us/op 1.76
effectiveBalanceIncrements rw all MutableVector 300000 198.12 ms/op 214.56 ms/op 0.92
aggregationBits - 2048 els - readonlyValues 218.08 us/op 216.76 us/op 1.01
aggregationBits - 2048 els - zipIndexesInBitList 37.367 us/op 38.833 us/op 0.96
regular array get 100000 times 81.018 us/op 59.631 us/op 1.36
wrappedArray get 100000 times 80.574 us/op 60.501 us/op 1.33
arrayWithProxy get 100000 times 39.212 ms/op 43.377 ms/op 0.90
ssz.Root.equals 1.2780 us/op 1.3290 us/op 0.96
ssz.Root.equals with valueOf() 1.5290 us/op 1.5720 us/op 0.97
byteArrayEquals with valueOf() 1.5710 us/op 1.4850 us/op 1.06
phase0 processBlock - 250000 vs - 7PWei normalcase 9.3532 ms/op 10.653 ms/op 0.88
phase0 processBlock - 250000 vs - 7PWei worstcase 86.323 ms/op 95.249 ms/op 0.91
phase0 afterProcessEpoch - 250000 vs - 7PWei 255.00 ms/op 229.98 ms/op 1.11
phase0 beforeProcessEpoch - 250000 vs - 7PWei 655.76 ms/op 708.87 ms/op 0.93
phase0 processEpoch - mainnet_e58758 910.55 ms/op 990.47 ms/op 0.92
mainnet_e58758 - phase0 beforeProcessEpoch 516.46 ms/op 628.89 ms/op 0.82
mainnet_e58758 - phase0 processJustificationAndFinalization 61.183 us/op 117.98 us/op 0.52
mainnet_e58758 - phase0 processRewardsAndPenalties 110.12 ms/op 89.663 ms/op 1.23
mainnet_e58758 - phase0 processRegistryUpdates 47.537 us/op 84.139 us/op 0.56
mainnet_e58758 - phase0 processSlashings 3.2510 us/op 7.3910 us/op 0.44
mainnet_e58758 - phase0 processEth1DataReset 2.5300 us/op 5.3760 us/op 0.47
mainnet_e58758 - phase0 processEffectiveBalanceUpdates 6.1936 ms/op 5.7809 ms/op 1.07
mainnet_e58758 - phase0 processSlashingsReset 12.071 us/op 28.407 us/op 0.42
mainnet_e58758 - phase0 processRandaoMixesReset 18.972 us/op 41.250 us/op 0.46
mainnet_e58758 - phase0 processHistoricalRootsUpdate 3.7530 us/op 7.5760 us/op 0.50
mainnet_e58758 - phase0 processParticipationRecordUpdates 13.724 us/op 28.708 us/op 0.48
mainnet_e58758 - phase0 afterProcessEpoch 224.71 ms/op 198.81 ms/op 1.13
phase0 processEffectiveBalanceUpdates - 250000 normalcase 7.1364 ms/op 6.5999 ms/op 1.08
phase0 processEffectiveBalanceUpdates - 250000 worstcase 0.5 7.6710 ms/op 8.0112 ms/op 0.96
phase0 processRegistryUpdates - 250000 normalcase 49.435 us/op 88.345 us/op 0.56
phase0 processRegistryUpdates - 250000 badcase_full_deposits 3.4321 ms/op 3.9196 ms/op 0.88
phase0 processRegistryUpdates - 250000 worstcase 0.5 2.0105 s/op 2.1722 s/op 0.93
phase0 getAttestationDeltas - 250000 normalcase 15.172 ms/op 16.166 ms/op 0.94
phase0 getAttestationDeltas - 250000 worstcase 15.137 ms/op 14.490 ms/op 1.04
phase0 processSlashings - 250000 worstcase 40.015 ms/op 42.732 ms/op 0.94
shuffle list - 16384 els 15.478 ms/op 14.557 ms/op 1.06
shuffle list - 250000 els 220.17 ms/op 204.05 ms/op 1.08
getEffectiveBalanceIncrementsZeroInactive - 250000 vs - 7PWei 540.10 us/op 590.63 us/op 0.91
pass gossip attestations to forkchoice per slot 17.898 ms/op 23.414 ms/op 0.76
computeDeltas 4.0248 ms/op 3.9483 ms/op 1.02
computeProposerBoostScoreFromBalances 600.51 us/op 497.78 us/op 1.21
getPubkeys - index2pubkey - req 1000 vs - 250000 vc 2.1852 ms/op 2.2111 ms/op 0.99
getPubkeys - validatorsArr - req 1000 vs - 250000 vc 875.89 us/op 840.24 us/op 1.04
BLS verify - blst-native 2.2395 ms/op 2.2862 ms/op 0.98
BLS verifyMultipleSignatures 3 - blst-native 4.6008 ms/op 4.7677 ms/op 0.97
BLS verifyMultipleSignatures 8 - blst-native 9.9349 ms/op 10.594 ms/op 0.94
BLS verifyMultipleSignatures 32 - blst-native 36.004 ms/op 38.058 ms/op 0.95
BLS aggregatePubkeys 32 - blst-native 48.812 us/op 52.282 us/op 0.93
BLS aggregatePubkeys 128 - blst-native 184.83 us/op 196.39 us/op 0.94
getAttestationsForBlock 75.425 ms/op 72.224 ms/op 1.04
CheckpointStateCache - add get delete 21.640 us/op 24.207 us/op 0.89
validate gossip signedAggregateAndProof - struct 5.3021 ms/op 5.9257 ms/op 0.89
validate gossip signedAggregateAndProof - treeBacked 5.2407 ms/op 5.6690 ms/op 0.92
validate gossip attestation - struct 2.4805 ms/op 2.6511 ms/op 0.94
validate gossip attestation - treeBacked 2.5132 ms/op 2.7473 ms/op 0.91
pickEth1Vote - no votes 10.957 ms/op 11.562 ms/op 0.95
pickEth1Vote - max votes 58.693 ms/op 59.046 ms/op 0.99
pickEth1Vote - Eth1Data hashTreeRoot value x2048 29.837 ms/op 31.236 ms/op 0.96
pickEth1Vote - Eth1Data hashTreeRoot tree x2048 11.415 ms/op 11.063 ms/op 1.03
pickEth1Vote - Eth1Data fastSerialize value x2048 6.7759 ms/op 6.3292 ms/op 1.07
pickEth1Vote - Eth1Data fastSerialize tree x2048 27.915 ms/op 28.192 ms/op 0.99
bytes32 toHexString 2.1210 us/op 1.9900 us/op 1.07
bytes32 Buffer.toString(hex) 842.00 ns/op 868.00 ns/op 0.97
bytes32 Buffer.toString(hex) from Uint8Array 1.1470 us/op 1.2350 us/op 0.93
bytes32 Buffer.toString(hex) + 0x 814.00 ns/op 847.00 ns/op 0.96
Object access 1 prop 0.41500 ns/op 0.42000 ns/op 0.99
Map access 1 prop 0.34700 ns/op 0.37000 ns/op 0.94
Object get x1000 21.190 ns/op 17.402 ns/op 1.22
Map get x1000 1.2730 ns/op 1.0010 ns/op 1.27
Object set x1000 129.82 ns/op 117.19 ns/op 1.11
Map set x1000 80.902 ns/op 79.004 ns/op 1.02
Return object 10000 times 0.46390 ns/op 0.43630 ns/op 1.06
Throw Error 10000 times 7.3038 us/op 7.3730 us/op 0.99
enrSubnets - fastDeserialize 64 bits 1.5080 us/op 1.6500 us/op 0.91
enrSubnets - ssz BitVector 64 bits 19.599 us/op 19.366 us/op 1.01
enrSubnets - fastDeserialize 4 bits 545.00 ns/op 584.00 ns/op 0.93
enrSubnets - ssz BitVector 4 bits 3.4300 us/op 3.6320 us/op 0.94
RateTracker 1000000 limit, 1 obj count per request 215.19 ns/op 243.67 ns/op 0.88
RateTracker 1000000 limit, 2 obj count per request 160.55 ns/op 174.44 ns/op 0.92
RateTracker 1000000 limit, 4 obj count per request 132.15 ns/op 138.43 ns/op 0.95
RateTracker 1000000 limit, 8 obj count per request 119.29 ns/op 118.23 ns/op 1.01
RateTracker with prune 4.6830 us/op 5.0650 us/op 0.92
array of 16000 items push then shift 3.7707 us/op 5.4358 us/op 0.69
LinkedList of 16000 items push then shift 19.236 ns/op 20.416 ns/op 0.94
array of 16000 items push then pop 261.13 ns/op 241.58 ns/op 1.08
LinkedList of 16000 items push then pop 17.936 ns/op 17.370 ns/op 1.03
array of 24000 items push then shift 5.4142 us/op 8.0207 us/op 0.68
LinkedList of 24000 items push then shift 21.817 ns/op 18.985 ns/op 1.15
array of 24000 items push then pop 250.42 ns/op 224.47 ns/op 1.12
LinkedList of 24000 items push then pop 19.558 ns/op 19.399 ns/op 1.01

by benchmarkbot/action

@twoeths
Copy link
Contributor Author

twoeths commented Feb 23, 2022

I leave the test node for 24h, Gossip peer score is increased, number of mesh peers are increased as well

Screen Shot 2022-02-23 at 10 08 54

dapplion
dapplion previously approved these changes Feb 25, 2022
Copy link
Contributor

@dapplion dapplion left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@dapplion dapplion merged commit 060918e into master Feb 25, 2022
@dapplion dapplion deleted the tuyen/gossip_penalize_peer branch February 25, 2022 16:28
twoeths added a commit that referenced this pull request Mar 5, 2022
twoeths added a commit that referenced this pull request Mar 8, 2022
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.

Apply peer action when there are gossip validation errors
2 participants