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

Start network before sync #4581

Merged
merged 1 commit into from Sep 24, 2022
Merged

Conversation

twoeths
Copy link
Contributor

@twoeths twoeths commented Sep 21, 2022

Motivation

Sometimes the sync is too fast and it tries to subscribe to core topics while network is not ready

Description

Start network before sync

Closes #4543

@twoeths twoeths requested a review from a team as a code owner September 21, 2022 03:52
@github-actions
Copy link
Contributor

Performance Report

✔️ no performance regression detected

Full benchmark results
Benchmark suite Current: 12fdad9 Previous: 34305f3 Ratio
getPubkeys - index2pubkey - req 1000 vs - 250000 vc 2.4709 ms/op 2.4055 ms/op 1.03
getPubkeys - validatorsArr - req 1000 vs - 250000 vc 88.186 us/op 77.069 us/op 1.14
BLS verify - blst-native 2.2056 ms/op 1.8493 ms/op 1.19
BLS verifyMultipleSignatures 3 - blst-native 4.5553 ms/op 3.7914 ms/op 1.20
BLS verifyMultipleSignatures 8 - blst-native 9.6803 ms/op 8.1698 ms/op 1.18
BLS verifyMultipleSignatures 32 - blst-native 35.382 ms/op 29.603 ms/op 1.20
BLS aggregatePubkeys 32 - blst-native 46.696 us/op 39.453 us/op 1.18
BLS aggregatePubkeys 128 - blst-native 182.77 us/op 152.89 us/op 1.20
getAttestationsForBlock 97.735 ms/op 97.877 ms/op 1.00
isKnown best case - 1 super set check 507.00 ns/op 435.00 ns/op 1.17
isKnown normal case - 2 super set checks 493.00 ns/op 422.00 ns/op 1.17
isKnown worse case - 16 super set checks 490.00 ns/op 416.00 ns/op 1.18
CheckpointStateCache - add get delete 10.163 us/op 9.1140 us/op 1.12
validate gossip signedAggregateAndProof - struct 5.0989 ms/op 4.2843 ms/op 1.19
validate gossip attestation - struct 2.3906 ms/op 2.0356 ms/op 1.17
pickEth1Vote - no votes 2.5575 ms/op 2.2423 ms/op 1.14
pickEth1Vote - max votes 22.659 ms/op 22.403 ms/op 1.01
pickEth1Vote - Eth1Data hashTreeRoot value x2048 12.300 ms/op 11.614 ms/op 1.06
pickEth1Vote - Eth1Data hashTreeRoot tree x2048 22.909 ms/op 21.620 ms/op 1.06
pickEth1Vote - Eth1Data fastSerialize value x2048 1.7055 ms/op 1.5878 ms/op 1.07
pickEth1Vote - Eth1Data fastSerialize tree x2048 14.728 ms/op 15.149 ms/op 0.97
bytes32 toHexString 1.1540 us/op 1.1350 us/op 1.02
bytes32 Buffer.toString(hex) 819.00 ns/op 724.00 ns/op 1.13
bytes32 Buffer.toString(hex) from Uint8Array 1.1320 us/op 995.00 ns/op 1.14
bytes32 Buffer.toString(hex) + 0x 806.00 ns/op 728.00 ns/op 1.11
Object access 1 prop 0.38600 ns/op 0.38700 ns/op 1.00
Map access 1 prop 0.34600 ns/op 0.29300 ns/op 1.18
Object get x1000 20.424 ns/op 17.850 ns/op 1.14
Map get x1000 1.3330 ns/op 1.1840 ns/op 1.13
Object set x1000 131.09 ns/op 130.35 ns/op 1.01
Map set x1000 81.694 ns/op 77.044 ns/op 1.06
Return object 10000 times 0.42560 ns/op 0.36880 ns/op 1.15
Throw Error 10000 times 6.8359 us/op 6.0928 us/op 1.12
enrSubnets - fastDeserialize 64 bits 3.1230 us/op 2.9570 us/op 1.06
enrSubnets - ssz BitVector 64 bits 862.00 ns/op 769.00 ns/op 1.12
enrSubnets - fastDeserialize 4 bits 444.00 ns/op 410.00 ns/op 1.08
enrSubnets - ssz BitVector 4 bits 861.00 ns/op 752.00 ns/op 1.14
prioritizePeers score -10:0 att 32-0.1 sync 2-0 115.41 us/op 101.40 us/op 1.14
prioritizePeers score 0:0 att 32-0.25 sync 2-0.25 147.67 us/op 138.75 us/op 1.06
prioritizePeers score 0:0 att 32-0.5 sync 2-0.5 245.75 us/op 252.97 us/op 0.97
prioritizePeers score 0:0 att 64-0.75 sync 4-0.75 532.42 us/op 393.59 us/op 1.35
prioritizePeers score 0:0 att 64-1 sync 4-1 549.75 us/op 463.64 us/op 1.19
RateTracker 1000000 limit, 1 obj count per request 238.14 ns/op 215.51 ns/op 1.11
RateTracker 1000000 limit, 2 obj count per request 176.47 ns/op 167.32 ns/op 1.05
RateTracker 1000000 limit, 4 obj count per request 150.94 ns/op 139.55 ns/op 1.08
RateTracker 1000000 limit, 8 obj count per request 139.72 ns/op 129.10 ns/op 1.08
RateTracker with prune 4.7900 us/op 4.9240 us/op 0.97
array of 16000 items push then shift 3.6490 us/op 3.1706 us/op 1.15
LinkedList of 16000 items push then shift 20.353 ns/op 19.380 ns/op 1.05
array of 16000 items push then pop 274.16 ns/op 258.96 ns/op 1.06
LinkedList of 16000 items push then pop 19.195 ns/op 17.055 ns/op 1.13
array of 24000 items push then shift 5.3153 us/op 4.5764 us/op 1.16
LinkedList of 24000 items push then shift 23.653 ns/op 24.203 ns/op 0.98
array of 24000 items push then pop 238.94 ns/op 204.55 ns/op 1.17
LinkedList of 24000 items push then pop 20.733 ns/op 19.792 ns/op 1.05
intersect bitArray bitLen 8 13.683 ns/op 11.450 ns/op 1.20
intersect array and set length 8 183.17 ns/op 173.53 ns/op 1.06
intersect bitArray bitLen 128 70.374 ns/op 71.950 ns/op 0.98
intersect array and set length 128 2.6047 us/op 2.3368 us/op 1.11
Buffer.concat 32 items 2.6000 ns/op 2.2970 ns/op 1.13
pass gossip attestations to forkchoice per slot 7.1405 ms/op 3.2062 ms/op 2.23
computeDeltas 3.9080 ms/op 3.7635 ms/op 1.04
computeProposerBoostScoreFromBalances 1.0757 ms/op 907.93 us/op 1.18
altair processAttestation - 250000 vs - 7PWei normalcase 4.5483 ms/op 4.2819 ms/op 1.06
altair processAttestation - 250000 vs - 7PWei worstcase 6.7745 ms/op 7.2580 ms/op 0.93
altair processAttestation - setStatus - 1/6 committees join 248.78 us/op 211.34 us/op 1.18
altair processAttestation - setStatus - 1/3 committees join 451.50 us/op 402.97 us/op 1.12
altair processAttestation - setStatus - 1/2 committees join 646.58 us/op 566.19 us/op 1.14
altair processAttestation - setStatus - 2/3 committees join 834.61 us/op 719.17 us/op 1.16
altair processAttestation - setStatus - 4/5 committees join 1.1700 ms/op 1.0028 ms/op 1.17
altair processAttestation - setStatus - 100% committees join 1.3836 ms/op 1.1922 ms/op 1.16
altair processBlock - 250000 vs - 7PWei normalcase 32.799 ms/op 28.875 ms/op 1.14
altair processBlock - 250000 vs - 7PWei normalcase hashState 44.950 ms/op 40.447 ms/op 1.11
altair processBlock - 250000 vs - 7PWei worstcase 94.830 ms/op 87.016 ms/op 1.09
altair processBlock - 250000 vs - 7PWei worstcase hashState 118.06 ms/op 100.97 ms/op 1.17
phase0 processBlock - 250000 vs - 7PWei normalcase 5.1140 ms/op 3.8661 ms/op 1.32
phase0 processBlock - 250000 vs - 7PWei worstcase 59.588 ms/op 47.730 ms/op 1.25
altair processEth1Data - 250000 vs - 7PWei normalcase 962.00 us/op 971.09 us/op 0.99
Tree 40 250000 create 950.28 ms/op 868.31 ms/op 1.09
Tree 40 250000 get(125000) 346.43 ns/op 291.58 ns/op 1.19
Tree 40 250000 set(125000) 3.1138 us/op 2.8469 us/op 1.09
Tree 40 250000 toArray() 38.119 ms/op 34.503 ms/op 1.10
Tree 40 250000 iterate all - toArray() + loop 38.551 ms/op 34.561 ms/op 1.12
Tree 40 250000 iterate all - get(i) 134.73 ms/op 113.62 ms/op 1.19
MutableVector 250000 create 21.304 ms/op 16.928 ms/op 1.26
MutableVector 250000 get(125000) 15.716 ns/op 14.800 ns/op 1.06
MutableVector 250000 set(125000) 720.12 ns/op 759.32 ns/op 0.95
MutableVector 250000 toArray() 8.7865 ms/op 8.0895 ms/op 1.09
MutableVector 250000 iterate all - toArray() + loop 9.3293 ms/op 8.3882 ms/op 1.11
MutableVector 250000 iterate all - get(i) 4.2319 ms/op 3.2879 ms/op 1.29
Array 250000 create 8.2802 ms/op 7.6719 ms/op 1.08
Array 250000 clone - spread 4.6184 ms/op 2.8441 ms/op 1.62
Array 250000 get(125000) 1.9680 ns/op 1.1420 ns/op 1.72
Array 250000 set(125000) 1.9690 ns/op 1.1520 ns/op 1.71
Array 250000 iterate all - loop 198.68 us/op 167.86 us/op 1.18
effectiveBalanceIncrements clone Uint8Array 300000 104.33 us/op 80.352 us/op 1.30
effectiveBalanceIncrements clone MutableVector 300000 1.4140 us/op 748.00 ns/op 1.89
effectiveBalanceIncrements rw all Uint8Array 300000 303.47 us/op 252.53 us/op 1.20
effectiveBalanceIncrements rw all MutableVector 300000 247.48 ms/op 196.35 ms/op 1.26
phase0 afterProcessEpoch - 250000 vs - 7PWei 224.57 ms/op 185.79 ms/op 1.21
phase0 beforeProcessEpoch - 250000 vs - 7PWei 104.77 ms/op 84.067 ms/op 1.25
altair processEpoch - mainnet_e81889 706.08 ms/op 608.00 ms/op 1.16
mainnet_e81889 - altair beforeProcessEpoch 183.54 ms/op 173.05 ms/op 1.06
mainnet_e81889 - altair processJustificationAndFinalization 41.936 us/op 21.960 us/op 1.91
mainnet_e81889 - altair processInactivityUpdates 12.317 ms/op 11.691 ms/op 1.05
mainnet_e81889 - altair processRewardsAndPenalties 106.67 ms/op 150.96 ms/op 0.71
mainnet_e81889 - altair processRegistryUpdates 7.8520 us/op 4.0720 us/op 1.93
mainnet_e81889 - altair processSlashings 2.1760 us/op 1.1540 us/op 1.89
mainnet_e81889 - altair processEth1DataReset 1.9090 us/op 1.1550 us/op 1.65
mainnet_e81889 - altair processEffectiveBalanceUpdates 2.9701 ms/op 2.5637 ms/op 1.16
mainnet_e81889 - altair processSlashingsReset 13.886 us/op 8.1360 us/op 1.71
mainnet_e81889 - altair processRandaoMixesReset 11.967 us/op 8.7720 us/op 1.36
mainnet_e81889 - altair processHistoricalRootsUpdate 2.1090 us/op 1.2200 us/op 1.73
mainnet_e81889 - altair processParticipationFlagUpdates 7.6820 us/op 4.2890 us/op 1.79
mainnet_e81889 - altair processSyncCommitteeUpdates 1.6300 us/op 1.2020 us/op 1.36
mainnet_e81889 - altair afterProcessEpoch 236.20 ms/op 222.48 ms/op 1.06
phase0 processEpoch - mainnet_e58758 628.77 ms/op 622.24 ms/op 1.01
mainnet_e58758 - phase0 beforeProcessEpoch 265.62 ms/op 238.48 ms/op 1.11
mainnet_e58758 - phase0 processJustificationAndFinalization 38.777 us/op 24.560 us/op 1.58
mainnet_e58758 - phase0 processRewardsAndPenalties 162.12 ms/op 133.75 ms/op 1.21
mainnet_e58758 - phase0 processRegistryUpdates 18.658 us/op 9.8450 us/op 1.90
mainnet_e58758 - phase0 processSlashings 1.9360 us/op 808.00 ns/op 2.40
mainnet_e58758 - phase0 processEth1DataReset 2.2360 us/op 762.00 ns/op 2.93
mainnet_e58758 - phase0 processEffectiveBalanceUpdates 2.5666 ms/op 1.8955 ms/op 1.35
mainnet_e58758 - phase0 processSlashingsReset 8.6620 us/op 5.3600 us/op 1.62
mainnet_e58758 - phase0 processRandaoMixesReset 15.318 us/op 5.6140 us/op 2.73
mainnet_e58758 - phase0 processHistoricalRootsUpdate 2.5530 us/op 854.00 ns/op 2.99
mainnet_e58758 - phase0 processParticipationRecordUpdates 13.028 us/op 6.2930 us/op 2.07
mainnet_e58758 - phase0 afterProcessEpoch 185.11 ms/op 162.66 ms/op 1.14
phase0 processEffectiveBalanceUpdates - 250000 normalcase 3.2441 ms/op 2.7101 ms/op 1.20
phase0 processEffectiveBalanceUpdates - 250000 worstcase 0.5 4.1651 ms/op 3.2447 ms/op 1.28
altair processInactivityUpdates - 250000 normalcase 44.116 ms/op 42.124 ms/op 1.05
altair processInactivityUpdates - 250000 worstcase 53.197 ms/op 51.855 ms/op 1.03
phase0 processRegistryUpdates - 250000 normalcase 16.856 us/op 12.775 us/op 1.32
phase0 processRegistryUpdates - 250000 badcase_full_deposits 524.44 us/op 406.81 us/op 1.29
phase0 processRegistryUpdates - 250000 worstcase 0.5 246.98 ms/op 213.84 ms/op 1.15
altair processRewardsAndPenalties - 250000 normalcase 148.79 ms/op 146.83 ms/op 1.01
altair processRewardsAndPenalties - 250000 worstcase 98.929 ms/op 88.582 ms/op 1.12
phase0 getAttestationDeltas - 250000 normalcase 15.530 ms/op 13.301 ms/op 1.17
phase0 getAttestationDeltas - 250000 worstcase 15.954 ms/op 13.332 ms/op 1.20
phase0 processSlashings - 250000 worstcase 6.3985 ms/op 5.4561 ms/op 1.17
altair processSyncCommitteeUpdates - 250000 324.88 ms/op 274.02 ms/op 1.19
BeaconState.hashTreeRoot - No change 547.00 ns/op 504.00 ns/op 1.09
BeaconState.hashTreeRoot - 1 full validator 75.725 us/op 63.853 us/op 1.19
BeaconState.hashTreeRoot - 32 full validator 789.78 us/op 762.54 us/op 1.04
BeaconState.hashTreeRoot - 512 full validator 8.8510 ms/op 6.4917 ms/op 1.36
BeaconState.hashTreeRoot - 1 validator.effectiveBalance 87.982 us/op 78.516 us/op 1.12
BeaconState.hashTreeRoot - 32 validator.effectiveBalance 1.3664 ms/op 1.1720 ms/op 1.17
BeaconState.hashTreeRoot - 512 validator.effectiveBalance 18.218 ms/op 15.446 ms/op 1.18
BeaconState.hashTreeRoot - 1 balances 71.357 us/op 63.049 us/op 1.13
BeaconState.hashTreeRoot - 32 balances 666.30 us/op 557.91 us/op 1.19
BeaconState.hashTreeRoot - 512 balances 6.6467 ms/op 5.8760 ms/op 1.13
BeaconState.hashTreeRoot - 250000 balances 106.39 ms/op 92.393 ms/op 1.15
aggregationBits - 2048 els - zipIndexesInBitList 33.563 us/op 29.857 us/op 1.12
regular array get 100000 times 81.016 us/op 67.456 us/op 1.20
wrappedArray get 100000 times 78.660 us/op 67.484 us/op 1.17
arrayWithProxy get 100000 times 34.309 ms/op 29.016 ms/op 1.18
ssz.Root.equals 517.00 ns/op 450.00 ns/op 1.15
byteArrayEquals 499.00 ns/op 450.00 ns/op 1.11
shuffle list - 16384 els 12.799 ms/op 11.117 ms/op 1.15
shuffle list - 250000 els 190.81 ms/op 166.28 ms/op 1.15
processSlot - 1 slots 13.867 us/op 12.644 us/op 1.10
processSlot - 32 slots 2.0637 ms/op 1.7181 ms/op 1.20
getEffectiveBalanceIncrementsZeroInactive - 250000 vs - 7PWei 484.68 us/op 379.56 us/op 1.28
getCommitteeAssignments - req 1 vs - 250000 vc 6.1791 ms/op 5.3370 ms/op 1.16
getCommitteeAssignments - req 100 vs - 250000 vc 8.5435 ms/op 7.3234 ms/op 1.17
getCommitteeAssignments - req 1000 vs - 250000 vc 9.0365 ms/op 7.7798 ms/op 1.16
RootCache.getBlockRootAtSlot - 250000 vs - 7PWei 11.950 ns/op 9.7900 ns/op 1.22
state getBlockRootAtSlot - 250000 vs - 7PWei 1.3749 us/op 1.0954 us/op 1.26
computeProposers - vc 250000 18.840 ms/op 16.687 ms/op 1.13
computeEpochShuffling - vc 250000 201.68 ms/op 170.92 ms/op 1.18
getNextSyncCommittee - vc 250000 320.19 ms/op 280.87 ms/op 1.14

by benchmarkbot/action

@wemeetagain wemeetagain merged commit a2d1c91 into unstable Sep 24, 2022
@wemeetagain wemeetagain deleted the tuyen/start-network-before-sync branch September 24, 2022 14:49
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.

Pubsub has not started
2 participants