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

Call deliverMessage before gossip queue #3812

Merged
merged 1 commit into from
Feb 28, 2022

Conversation

dapplion
Copy link
Contributor

Motivation

See #3811

Description

  • Call deliverMessage before gossip queue

Todo

Is there any security risk with this approach? Unless it's high, I think we must adopt this change while queue times are long. In the future this change can be reverted

Closes #3811

@codecov
Copy link

codecov bot commented Feb 28, 2022

Codecov Report

Merging #3812 (e5a45ba) into master (62b2092) will decrease coverage by 0.00%.
The diff coverage is n/a.

❗ Current head e5a45ba differs from pull request most recent head 9f1a194. Consider uploading reports for the commit 9f1a194 to get more accurate results

@@            Coverage Diff             @@
##           master    #3812      +/-   ##
==========================================
- Coverage   36.82%   36.81%   -0.01%     
==========================================
  Files         324      324              
  Lines        8870     8871       +1     
  Branches     1385     1385              
==========================================
  Hits         3266     3266              
- Misses       5461     5462       +1     
  Partials      143      143              

@github-actions
Copy link
Contributor

Performance Report

✔️ no performance regression detected

Full benchmark results
Benchmark suite Current: e5a45ba Previous: 62b2092 Ratio
BeaconState.hashTreeRoot - No change 633.00 ns/op 562.00 ns/op 1.13
BeaconState.hashTreeRoot - 1 full validator 106.42 us/op 81.271 us/op 1.31
BeaconState.hashTreeRoot - 32 full validator 1.4981 ms/op 1.1895 ms/op 1.26
BeaconState.hashTreeRoot - 512 full validator 19.850 ms/op 17.471 ms/op 1.14
BeaconState.hashTreeRoot - 1 validator.effectiveBalance 102.99 us/op 80.984 us/op 1.27
BeaconState.hashTreeRoot - 32 validator.effectiveBalance 1.6746 ms/op 1.3887 ms/op 1.21
BeaconState.hashTreeRoot - 512 validator.effectiveBalance 21.775 ms/op 18.332 ms/op 1.19
BeaconState.hashTreeRoot - 1 balances 73.486 us/op 59.220 us/op 1.24
BeaconState.hashTreeRoot - 32 balances 620.82 us/op 497.13 us/op 1.25
BeaconState.hashTreeRoot - 512 balances 5.6819 ms/op 4.8882 ms/op 1.16
BeaconState.hashTreeRoot - 250000 balances 122.21 ms/op 96.845 ms/op 1.26
processSlot - 1 slots 59.932 us/op 43.318 us/op 1.38
processSlot - 32 slots 2.9734 ms/op 2.1533 ms/op 1.38
getCommitteeAssignments - req 1 vs - 250000 vc 5.6027 ms/op 5.2866 ms/op 1.06
getCommitteeAssignments - req 100 vs - 250000 vc 8.2697 ms/op 7.3384 ms/op 1.13
getCommitteeAssignments - req 1000 vs - 250000 vc 8.5055 ms/op 7.8890 ms/op 1.08
computeProposers - vc 250000 27.378 ms/op 22.211 ms/op 1.23
computeEpochShuffling - vc 250000 220.62 ms/op 191.95 ms/op 1.15
getNextSyncCommittee - vc 250000 453.42 ms/op 352.23 ms/op 1.29
altair processAttestation - 250000 vs - 7PWei normalcase 35.537 ms/op 37.511 ms/op 0.95
altair processAttestation - 250000 vs - 7PWei worstcase 52.827 ms/op 37.850 ms/op 1.40
altair processAttestation - setStatus - 1/6 committees join 14.716 ms/op 11.871 ms/op 1.24
altair processAttestation - setStatus - 1/3 committees join 27.786 ms/op 25.186 ms/op 1.10
altair processAttestation - setStatus - 1/2 committees join 44.170 ms/op 35.759 ms/op 1.24
altair processAttestation - setStatus - 2/3 committees join 57.530 ms/op 47.907 ms/op 1.20
altair processAttestation - setStatus - 4/5 committees join 71.964 ms/op 57.922 ms/op 1.24
altair processAttestation - setStatus - 100% committees join 90.475 ms/op 75.789 ms/op 1.19
altair processAttestation - updateEpochParticipants - 1/6 committees join 15.788 ms/op 12.424 ms/op 1.27
altair processAttestation - updateEpochParticipants - 1/3 committees join 32.896 ms/op 25.407 ms/op 1.29
altair processAttestation - updateEpochParticipants - 1/2 committees join 25.359 ms/op 21.373 ms/op 1.19
altair processAttestation - updateEpochParticipants - 2/3 committees join 28.595 ms/op 23.335 ms/op 1.23
altair processAttestation - updateEpochParticipants - 4/5 committees join 25.594 ms/op 24.490 ms/op 1.05
altair processAttestation - updateEpochParticipants - 100% committees join 26.554 ms/op 25.625 ms/op 1.04
altair processAttestation - updateAllStatus 21.732 ms/op 22.953 ms/op 0.95
altair processBlock - 250000 vs - 7PWei normalcase 38.867 ms/op 35.744 ms/op 1.09
altair processBlock - 250000 vs - 7PWei worstcase 141.61 ms/op 103.88 ms/op 1.36
altair processEpoch - mainnet_e81889 946.33 ms/op 801.30 ms/op 1.18
mainnet_e81889 - altair beforeProcessEpoch 379.87 ms/op 324.39 ms/op 1.17
mainnet_e81889 - altair processJustificationAndFinalization 117.22 us/op 104.11 us/op 1.13
mainnet_e81889 - altair processInactivityUpdates 20.003 ms/op 18.157 ms/op 1.10
mainnet_e81889 - altair processRewardsAndPenalties 107.31 ms/op 94.012 ms/op 1.14
mainnet_e81889 - altair processRegistryUpdates 22.909 us/op 10.438 us/op 2.19
mainnet_e81889 - altair processSlashings 6.9720 us/op 1.9920 us/op 3.50
mainnet_e81889 - altair processEth1DataReset 7.1720 us/op 2.4790 us/op 2.89
mainnet_e81889 - altair processEffectiveBalanceUpdates 7.1437 ms/op 6.7748 ms/op 1.05
mainnet_e81889 - altair processSlashingsReset 38.378 us/op 18.977 us/op 2.02
mainnet_e81889 - altair processRandaoMixesReset 45.125 us/op 23.972 us/op 1.88
mainnet_e81889 - altair processHistoricalRootsUpdate 8.3130 us/op 3.0600 us/op 2.72
mainnet_e81889 - altair processParticipationFlagUpdates 91.072 ms/op 71.300 ms/op 1.28
mainnet_e81889 - altair processSyncCommitteeUpdates 6.1010 us/op 2.6650 us/op 2.29
mainnet_e81889 - altair afterProcessEpoch 251.92 ms/op 237.46 ms/op 1.06
altair processInactivityUpdates - 250000 normalcase 82.575 ms/op 75.427 ms/op 1.09
altair processInactivityUpdates - 250000 worstcase 78.313 ms/op 69.217 ms/op 1.13
altair processParticipationFlagUpdates - 250000 anycase 63.680 ms/op 62.765 ms/op 1.01
altair processRewardsAndPenalties - 250000 normalcase 90.232 ms/op 103.80 ms/op 0.87
altair processRewardsAndPenalties - 250000 worstcase 94.480 ms/op 117.93 ms/op 0.80
altair processSyncCommitteeUpdates - 250000 439.40 ms/op 344.46 ms/op 1.28
Tree 40 250000 create 841.69 ms/op 603.95 ms/op 1.39
Tree 40 250000 get(125000) 360.90 ns/op 322.78 ns/op 1.12
Tree 40 250000 set(125000) 2.6005 us/op 1.9563 us/op 1.33
Tree 40 250000 toArray() 45.694 ms/op 39.686 ms/op 1.15
Tree 40 250000 iterate all - toArray() + loop 45.165 ms/op 39.379 ms/op 1.15
Tree 40 250000 iterate all - get(i) 131.57 ms/op 120.23 ms/op 1.09
MutableVector 250000 create 24.008 ms/op 20.285 ms/op 1.18
MutableVector 250000 get(125000) 15.307 ns/op 12.787 ns/op 1.20
MutableVector 250000 set(125000) 621.10 ns/op 508.82 ns/op 1.22
MutableVector 250000 toArray() 9.5287 ms/op 8.5638 ms/op 1.11
MutableVector 250000 iterate all - toArray() + loop 10.341 ms/op 8.5714 ms/op 1.21
MutableVector 250000 iterate all - get(i) 3.7933 ms/op 3.3406 ms/op 1.14
Array 250000 create 5.3899 ms/op 5.0596 ms/op 1.07
Array 250000 clone - spread 2.1560 ms/op 2.2963 ms/op 0.94
Array 250000 get(125000) 1.1240 ns/op 1.0740 ns/op 1.05
Array 250000 set(125000) 1.1050 ns/op 1.0660 ns/op 1.04
Array 250000 iterate all - loop 149.12 us/op 169.03 us/op 0.88
effectiveBalanceIncrements clone Uint8Array 300000 296.32 us/op 142.71 us/op 2.08
effectiveBalanceIncrements clone MutableVector 300000 638.00 ns/op 508.00 ns/op 1.26
effectiveBalanceIncrements rw all Uint8Array 300000 192.81 us/op 301.82 us/op 0.64
effectiveBalanceIncrements rw all MutableVector 300000 210.47 ms/op 164.37 ms/op 1.28
aggregationBits - 2048 els - readonlyValues 203.16 us/op 173.24 us/op 1.17
aggregationBits - 2048 els - zipIndexesInBitList 33.578 us/op 33.357 us/op 1.01
regular array get 100000 times 57.985 us/op 67.397 us/op 0.86
wrappedArray get 100000 times 56.983 us/op 67.392 us/op 0.85
arrayWithProxy get 100000 times 42.385 ms/op 33.357 ms/op 1.27
ssz.Root.equals 1.2180 us/op 1.0520 us/op 1.16
ssz.Root.equals with valueOf() 1.4550 us/op 1.2380 us/op 1.18
byteArrayEquals with valueOf() 1.4670 us/op 1.2200 us/op 1.20
phase0 processBlock - 250000 vs - 7PWei normalcase 10.465 ms/op 7.6206 ms/op 1.37
phase0 processBlock - 250000 vs - 7PWei worstcase 91.590 ms/op 71.464 ms/op 1.28
phase0 afterProcessEpoch - 250000 vs - 7PWei 222.52 ms/op 205.91 ms/op 1.08
phase0 beforeProcessEpoch - 250000 vs - 7PWei 692.36 ms/op 540.74 ms/op 1.28
phase0 processEpoch - mainnet_e58758 942.81 ms/op 770.18 ms/op 1.22
mainnet_e58758 - phase0 beforeProcessEpoch 551.74 ms/op 423.64 ms/op 1.30
mainnet_e58758 - phase0 processJustificationAndFinalization 119.64 us/op 96.929 us/op 1.23
mainnet_e58758 - phase0 processRewardsAndPenalties 90.877 ms/op 120.55 ms/op 0.75
mainnet_e58758 - phase0 processRegistryUpdates 91.711 us/op 64.163 us/op 1.43
mainnet_e58758 - phase0 processSlashings 8.0720 us/op 2.1940 us/op 3.68
mainnet_e58758 - phase0 processEth1DataReset 5.8560 us/op 2.2630 us/op 2.59
mainnet_e58758 - phase0 processEffectiveBalanceUpdates 5.8209 ms/op 5.4288 ms/op 1.07
mainnet_e58758 - phase0 processSlashingsReset 31.562 us/op 13.995 us/op 2.26
mainnet_e58758 - phase0 processRandaoMixesReset 43.266 us/op 21.303 us/op 2.03
mainnet_e58758 - phase0 processHistoricalRootsUpdate 7.3840 us/op 3.2820 us/op 2.25
mainnet_e58758 - phase0 processParticipationRecordUpdates 30.368 us/op 16.747 us/op 1.81
mainnet_e58758 - phase0 afterProcessEpoch 197.19 ms/op 180.64 ms/op 1.09
phase0 processEffectiveBalanceUpdates - 250000 normalcase 6.4839 ms/op 6.1665 ms/op 1.05
phase0 processEffectiveBalanceUpdates - 250000 worstcase 0.5 6.8906 ms/op 6.4797 ms/op 1.06
phase0 processRegistryUpdates - 250000 normalcase 94.364 us/op 59.042 us/op 1.60
phase0 processRegistryUpdates - 250000 badcase_full_deposits 3.9669 ms/op 2.9693 ms/op 1.34
phase0 processRegistryUpdates - 250000 worstcase 0.5 2.2753 s/op 1.5579 s/op 1.46
phase0 getAttestationDeltas - 250000 normalcase 14.374 ms/op 13.222 ms/op 1.09
phase0 getAttestationDeltas - 250000 worstcase 14.219 ms/op 13.422 ms/op 1.06
phase0 processSlashings - 250000 worstcase 39.010 ms/op 36.187 ms/op 1.08
shuffle list - 16384 els 14.469 ms/op 13.186 ms/op 1.10
shuffle list - 250000 els 196.62 ms/op 188.02 ms/op 1.05
getEffectiveBalanceIncrementsZeroInactive - 250000 vs - 7PWei 564.96 us/op 469.45 us/op 1.20
pass gossip attestations to forkchoice per slot 22.861 ms/op 14.708 ms/op 1.55
computeDeltas 3.8252 ms/op 3.7790 ms/op 1.01
computeProposerBoostScoreFromBalances 496.16 us/op 503.31 us/op 0.99
getPubkeys - index2pubkey - req 1000 vs - 250000 vc 2.0770 ms/op 2.0574 ms/op 1.01
getPubkeys - validatorsArr - req 1000 vs - 250000 vc 802.10 us/op 732.95 us/op 1.09
BLS verify - blst-native 2.3533 ms/op 1.8613 ms/op 1.26
BLS verifyMultipleSignatures 3 - blst-native 4.6965 ms/op 3.8196 ms/op 1.23
BLS verifyMultipleSignatures 8 - blst-native 10.112 ms/op 8.2360 ms/op 1.23
BLS verifyMultipleSignatures 32 - blst-native 38.879 ms/op 29.905 ms/op 1.30
BLS aggregatePubkeys 32 - blst-native 52.369 us/op 40.582 us/op 1.29
BLS aggregatePubkeys 128 - blst-native 199.58 us/op 155.83 us/op 1.28
getAttestationsForBlock 71.426 ms/op 61.235 ms/op 1.17
CheckpointStateCache - add get delete 23.221 us/op 18.604 us/op 1.25
validate gossip signedAggregateAndProof - struct 5.7676 ms/op 4.4529 ms/op 1.30
validate gossip signedAggregateAndProof - treeBacked 5.4239 ms/op 4.4006 ms/op 1.23
validate gossip attestation - struct 2.6273 ms/op 2.0988 ms/op 1.25
validate gossip attestation - treeBacked 2.6342 ms/op 2.1011 ms/op 1.25
pickEth1Vote - no votes 9.5913 ms/op 8.3667 ms/op 1.15
pickEth1Vote - max votes 58.240 ms/op 47.530 ms/op 1.23
pickEth1Vote - Eth1Data hashTreeRoot value x2048 31.363 ms/op 24.239 ms/op 1.29
pickEth1Vote - Eth1Data hashTreeRoot tree x2048 11.171 ms/op 9.4719 ms/op 1.18
pickEth1Vote - Eth1Data fastSerialize value x2048 5.6337 ms/op 5.0515 ms/op 1.12
pickEth1Vote - Eth1Data fastSerialize tree x2048 29.276 ms/op 21.897 ms/op 1.34
bytes32 toHexString 1.9880 us/op 1.5900 us/op 1.25
bytes32 Buffer.toString(hex) 892.00 ns/op 790.00 ns/op 1.13
bytes32 Buffer.toString(hex) from Uint8Array 1.2050 us/op 1.0170 us/op 1.18
bytes32 Buffer.toString(hex) + 0x 865.00 ns/op 687.00 ns/op 1.26
Object access 1 prop 0.41300 ns/op 0.30400 ns/op 1.36
Map access 1 prop 0.37000 ns/op 0.28400 ns/op 1.30
Object get x1000 17.564 ns/op 17.051 ns/op 1.03
Map get x1000 1.0890 ns/op 0.97500 ns/op 1.12
Object set x1000 109.77 ns/op 100.39 ns/op 1.09
Map set x1000 77.294 ns/op 60.870 ns/op 1.27
Return object 10000 times 0.43120 ns/op 0.37180 ns/op 1.16
Throw Error 10000 times 7.0437 us/op 5.8736 us/op 1.20
enrSubnets - fastDeserialize 64 bits 1.6150 us/op 1.1440 us/op 1.41
enrSubnets - ssz BitVector 64 bits 19.279 us/op 16.331 us/op 1.18
enrSubnets - fastDeserialize 4 bits 539.00 ns/op 422.00 ns/op 1.28
enrSubnets - ssz BitVector 4 bits 3.4050 us/op 2.7900 us/op 1.22
RateTracker 1000000 limit, 1 obj count per request 220.86 ns/op 174.44 ns/op 1.27
RateTracker 1000000 limit, 2 obj count per request 160.50 ns/op 129.07 ns/op 1.24
RateTracker 1000000 limit, 4 obj count per request 124.72 ns/op 106.39 ns/op 1.17
RateTracker 1000000 limit, 8 obj count per request 110.51 ns/op 95.492 ns/op 1.16
RateTracker with prune 4.6280 us/op 3.6710 us/op 1.26
array of 16000 items push then shift 5.4576 us/op 3.1524 us/op 1.73
LinkedList of 16000 items push then shift 17.293 ns/op 17.581 ns/op 0.98
array of 16000 items push then pop 243.93 ns/op 207.94 ns/op 1.17
LinkedList of 16000 items push then pop 16.341 ns/op 15.889 ns/op 1.03
array of 24000 items push then shift 8.0128 us/op 4.5566 us/op 1.76
LinkedList of 24000 items push then shift 17.599 ns/op 19.407 ns/op 0.91
array of 24000 items push then pop 213.40 ns/op 181.09 ns/op 1.18
LinkedList of 24000 items push then pop 16.786 ns/op 17.717 ns/op 0.95

by benchmarkbot/action

Copy link
Member

@wemeetagain wemeetagain left a comment

Choose a reason for hiding this comment

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

LGTM

@wemeetagain wemeetagain merged commit 4b62955 into master Feb 28, 2022
@wemeetagain wemeetagain deleted the dapplion/gossip-resolve-iwant-promise branch February 28, 2022 19:59
dapplion added a commit that referenced this pull request Mar 1, 2022
wemeetagain pushed a commit that referenced this pull request Mar 1, 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.

Gossip P7 penalty causes peers to have very low scores
2 participants