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

Increase default timeout of api instances except for validator duties #3684

Merged
merged 2 commits into from
Feb 1, 2022

Conversation

g11tech
Copy link
Contributor

@g11tech g11tech commented Jan 31, 2022

Motivation
A user reported over discord that lodestar was timing out doing a wss state fetch from infura. On a bit of digging through, figured out that lodestar uses timeout of 12 seconds, which is fine for validator calling beacon api, but could be relaxed else where, as discussed with @dapplion here on discord

Description
This PR raises the default api timeout from 12 seconds to 40 seconds, which should be a comfortable range for downloading the mainnet sync state and adds couple of comments to enure/highlight validator using a strict 1 slot timeout.

@codeclimate
Copy link

codeclimate bot commented Jan 31, 2022

Code Climate has analyzed commit 3bd7241 and detected 0 issues on this pull request.

View more on Code Climate.

@codecov
Copy link

codecov bot commented Jan 31, 2022

Codecov Report

Merging #3684 (3bd7241) into master (52032f8) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master    #3684   +/-   ##
=======================================
  Coverage   37.20%   37.20%           
=======================================
  Files         322      322           
  Lines        8717     8717           
  Branches     1349     1349           
=======================================
  Hits         3243     3243           
  Misses       5332     5332           
  Partials      142      142           

@github-actions
Copy link
Contributor

github-actions bot commented Jan 31, 2022

Performance Report

✔️ no performance regression detected

Full benchmark results
Benchmark suite Current: 15518be Previous: 52032f8 Ratio
BeaconState.hashTreeRoot - No change 600.00 ns/op 459.00 ns/op 1.31
BeaconState.hashTreeRoot - 1 full validator 146.60 us/op 119.54 us/op 1.23
BeaconState.hashTreeRoot - 32 full validator 2.1908 ms/op 1.6142 ms/op 1.36
BeaconState.hashTreeRoot - 512 full validator 29.149 ms/op 21.199 ms/op 1.38
BeaconState.hashTreeRoot - 1 validator.effectiveBalance 144.84 us/op 114.92 us/op 1.26
BeaconState.hashTreeRoot - 32 validator.effectiveBalance 2.3284 ms/op 1.8303 ms/op 1.27
BeaconState.hashTreeRoot - 512 validator.effectiveBalance 30.636 ms/op 24.288 ms/op 1.26
BeaconState.hashTreeRoot - 1 balances 103.68 us/op 90.823 us/op 1.14
BeaconState.hashTreeRoot - 32 balances 872.72 us/op 699.99 us/op 1.25
BeaconState.hashTreeRoot - 512 balances 9.0110 ms/op 6.4099 ms/op 1.41
BeaconState.hashTreeRoot - 250000 balances 153.60 ms/op 130.19 ms/op 1.18
processSlot - 1 slots 55.415 us/op 42.485 us/op 1.30
processSlot - 32 slots 3.2738 ms/op 2.7116 ms/op 1.21
getCommitteeAssignments - req 1 vs - 250000 vc 6.0867 ms/op 4.5003 ms/op 1.35
getCommitteeAssignments - req 100 vs - 250000 vc 8.4051 ms/op 6.3586 ms/op 1.32
getCommitteeAssignments - req 1000 vs - 250000 vc 8.7268 ms/op 6.6776 ms/op 1.31
computeProposers - vc 250000 23.353 ms/op 17.569 ms/op 1.33
computeEpochShuffling - vc 250000 221.85 ms/op 155.20 ms/op 1.43
getNextSyncCommittee - vc 250000 367.86 ms/op 287.40 ms/op 1.28
altair processAttestation - 250000 vs - 7PWei normalcase 48.607 ms/op 41.547 ms/op 1.17
altair processAttestation - 250000 vs - 7PWei worstcase 46.734 ms/op 41.234 ms/op 1.13
altair processAttestation - setStatus - 1/6 committees join 11.156 ms/op 8.2089 ms/op 1.36
altair processAttestation - setStatus - 1/3 committees join 23.845 ms/op 18.702 ms/op 1.27
altair processAttestation - setStatus - 1/2 committees join 37.070 ms/op 28.477 ms/op 1.30
altair processAttestation - setStatus - 2/3 committees join 52.674 ms/op 38.715 ms/op 1.36
altair processAttestation - setStatus - 4/5 committees join 61.448 ms/op 45.828 ms/op 1.34
altair processAttestation - setStatus - 100% committees join 90.349 ms/op 61.495 ms/op 1.47
altair processAttestation - updateEpochParticipants - 1/6 committees join 13.634 ms/op 9.6705 ms/op 1.41
altair processAttestation - updateEpochParticipants - 1/3 committees join 26.790 ms/op 20.499 ms/op 1.31
altair processAttestation - updateEpochParticipants - 1/2 committees join 94.303 ms/op 69.434 ms/op 1.36
altair processAttestation - updateEpochParticipants - 2/3 committees join 28.127 ms/op 24.073 ms/op 1.17
altair processAttestation - updateEpochParticipants - 4/5 committees join 32.396 ms/op 24.759 ms/op 1.31
altair processAttestation - updateEpochParticipants - 100% committees join 33.478 ms/op 28.344 ms/op 1.18
altair processAttestation - updateAllStatus 23.659 ms/op 19.884 ms/op 1.19
altair processBlock - 250000 vs - 7PWei normalcase 49.105 ms/op 45.081 ms/op 1.09
altair processBlock - 250000 vs - 7PWei worstcase 126.96 ms/op 113.09 ms/op 1.12
altair processEpoch - mainnet_e81889 1.2621 s/op 1.0446 s/op 1.21
mainnet_e81889 - altair beforeProcessEpoch 290.22 ms/op 270.21 ms/op 1.07
mainnet_e81889 - altair processJustificationAndFinalization 71.092 us/op 114.38 us/op 0.62
mainnet_e81889 - altair processInactivityUpdates 20.811 ms/op 15.352 ms/op 1.36
mainnet_e81889 - altair processRewardsAndPenalties 358.79 ms/op 245.52 ms/op 1.46
mainnet_e81889 - altair processRegistryUpdates 12.633 us/op 11.040 us/op 1.14
mainnet_e81889 - altair processSlashings 3.5390 us/op 2.5330 us/op 1.40
mainnet_e81889 - altair processEth1DataReset 3.5090 us/op 2.1130 us/op 1.66
mainnet_e81889 - altair processEffectiveBalanceUpdates 12.237 ms/op 12.072 ms/op 1.01
mainnet_e81889 - altair processSlashingsReset 21.133 us/op 17.163 us/op 1.23
mainnet_e81889 - altair processRandaoMixesReset 27.521 us/op 24.986 us/op 1.10
mainnet_e81889 - altair processHistoricalRootsUpdate 3.9390 us/op 2.4540 us/op 1.61
mainnet_e81889 - altair processParticipationFlagUpdates 112.90 ms/op 129.29 ms/op 0.87
mainnet_e81889 - altair processSyncCommitteeUpdates 2.8650 us/op 1.7710 us/op 1.62
mainnet_e81889 - altair afterProcessEpoch 241.95 ms/op 218.70 ms/op 1.11
altair processInactivityUpdates - 250000 normalcase 75.128 ms/op 59.047 ms/op 1.27
altair processInactivityUpdates - 250000 worstcase 78.598 ms/op 61.189 ms/op 1.28
altair processParticipationFlagUpdates - 250000 anycase 105.71 ms/op 87.069 ms/op 1.21
altair processRewardsAndPenalties - 250000 normalcase 258.12 ms/op 213.94 ms/op 1.21
altair processRewardsAndPenalties - 250000 worstcase 262.37 ms/op 242.88 ms/op 1.08
altair processSyncCommitteeUpdates - 250000 417.33 ms/op 303.21 ms/op 1.38
Tree 40 250000 create 740.46 ms/op 557.26 ms/op 1.33
Tree 40 250000 get(125000) 382.11 ns/op 272.30 ns/op 1.40
Tree 40 250000 set(125000) 2.3392 us/op 1.7373 us/op 1.35
Tree 40 250000 toArray() 45.637 ms/op 32.249 ms/op 1.42
Tree 40 250000 iterate all - toArray() + loop 47.370 ms/op 33.170 ms/op 1.43
Tree 40 250000 iterate all - get(i) 139.84 ms/op 99.432 ms/op 1.41
MutableVector 250000 create 28.744 ms/op 22.480 ms/op 1.28
MutableVector 250000 get(125000) 16.123 ns/op 11.539 ns/op 1.40
MutableVector 250000 set(125000) 576.19 ns/op 460.66 ns/op 1.25
MutableVector 250000 toArray() 10.212 ms/op 7.8415 ms/op 1.30
MutableVector 250000 iterate all - toArray() + loop 10.558 ms/op 7.0594 ms/op 1.50
MutableVector 250000 iterate all - get(i) 4.0212 ms/op 2.9306 ms/op 1.37
Array 250000 create 6.3401 ms/op 4.7171 ms/op 1.34
Array 250000 clone - spread 2.7216 ms/op 2.1283 ms/op 1.28
Array 250000 get(125000) 1.1910 ns/op 1.0280 ns/op 1.16
Array 250000 set(125000) 1.2320 ns/op 1.0180 ns/op 1.21
Array 250000 iterate all - loop 198.44 us/op 168.79 us/op 1.18
aggregationBits - 2048 els - readonlyValues 278.20 us/op 233.26 us/op 1.19
aggregationBits - 2048 els - zipIndexesInBitList 51.050 us/op 39.256 us/op 1.30
regular array get 100000 times 76.182 us/op 67.401 us/op 1.13
wrappedArray get 100000 times 75.548 us/op 67.405 us/op 1.12
arrayWithProxy get 100000 times 32.082 ms/op 28.384 ms/op 1.13
ssz.Root.equals 1.3430 us/op 1.0450 us/op 1.29
ssz.Root.equals with valueOf() 1.5660 us/op 1.2210 us/op 1.28
byteArrayEquals with valueOf() 1.5610 us/op 1.2450 us/op 1.25
phase0 processBlock - 250000 vs - 7PWei normalcase 12.167 ms/op 10.161 ms/op 1.20
phase0 processBlock - 250000 vs - 7PWei worstcase 86.750 ms/op 73.096 ms/op 1.19
phase0 afterProcessEpoch - 250000 vs - 7PWei 240.78 ms/op 202.06 ms/op 1.19
phase0 beforeProcessEpoch - 250000 vs - 7PWei 662.08 ms/op 552.49 ms/op 1.20
phase0 processEpoch - mainnet_e58758 936.81 ms/op 796.05 ms/op 1.18
mainnet_e58758 - phase0 beforeProcessEpoch 475.44 ms/op 400.57 ms/op 1.19
mainnet_e58758 - phase0 processJustificationAndFinalization 104.89 us/op 109.10 us/op 0.96
mainnet_e58758 - phase0 processRewardsAndPenalties 162.35 ms/op 139.01 ms/op 1.17
mainnet_e58758 - phase0 processRegistryUpdates 45.633 us/op 71.956 us/op 0.63
mainnet_e58758 - phase0 processSlashings 2.9680 us/op 2.6440 us/op 1.12
mainnet_e58758 - phase0 processEth1DataReset 2.7780 us/op 1.7650 us/op 1.57
mainnet_e58758 - phase0 processEffectiveBalanceUpdates 11.216 ms/op 9.9046 ms/op 1.13
mainnet_e58758 - phase0 processSlashingsReset 13.234 us/op 15.071 us/op 0.88
mainnet_e58758 - phase0 processRandaoMixesReset 18.256 us/op 25.337 us/op 0.72
mainnet_e58758 - phase0 processHistoricalRootsUpdate 3.6590 us/op 2.8800 us/op 1.27
mainnet_e58758 - phase0 processParticipationRecordUpdates 13.398 us/op 17.851 us/op 0.75
mainnet_e58758 - phase0 afterProcessEpoch 208.28 ms/op 176.54 ms/op 1.18
phase0 processEffectiveBalanceUpdates - 250000 normalcase 13.044 ms/op 10.929 ms/op 1.19
phase0 processEffectiveBalanceUpdates - 250000 worstcase 0.5 1.5038 s/op 1.2208 s/op 1.23
phase0 processRegistryUpdates - 250000 normalcase 46.312 us/op 73.436 us/op 0.63
phase0 processRegistryUpdates - 250000 badcase_full_deposits 3.1699 ms/op 2.9192 ms/op 1.09
phase0 processRegistryUpdates - 250000 worstcase 0.5 1.6370 s/op 1.6337 s/op 1.00
phase0 getAttestationDeltas - 250000 normalcase 104.95 ms/op 85.672 ms/op 1.23
phase0 getAttestationDeltas - 250000 worstcase 105.96 ms/op 86.084 ms/op 1.23
phase0 processSlashings - 250000 worstcase 42.464 ms/op 33.164 ms/op 1.28
shuffle list - 16384 els 14.872 ms/op 12.414 ms/op 1.20
shuffle list - 250000 els 208.02 ms/op 178.82 ms/op 1.16
getEffectiveBalances - 250000 vs - 7PWei 13.702 ms/op 9.8422 ms/op 1.39
pass gossip attestations to forkchoice per slot 23.541 ms/op 18.253 ms/op 1.29
computeDeltas 3.5991 ms/op 3.2430 ms/op 1.11
computeProposerBoostScoreFromBalances 377.55 us/op 337.43 us/op 1.12
getPubkeys - index2pubkey - req 1000 vs - 250000 vc 2.3459 ms/op 1.8950 ms/op 1.24
getPubkeys - validatorsArr - req 1000 vs - 250000 vc 827.38 us/op 689.93 us/op 1.20
BLS verify - blst-native 2.0644 ms/op 1.8596 ms/op 1.11
BLS verifyMultipleSignatures 3 - blst-native 4.3556 ms/op 3.8180 ms/op 1.14
BLS verifyMultipleSignatures 8 - blst-native 9.2784 ms/op 8.2345 ms/op 1.13
BLS verifyMultipleSignatures 32 - blst-native 33.914 ms/op 29.884 ms/op 1.13
BLS aggregatePubkeys 32 - blst-native 45.059 us/op 39.940 us/op 1.13
BLS aggregatePubkeys 128 - blst-native 175.82 us/op 153.93 us/op 1.14
getAttestationsForBlock 90.418 ms/op 77.669 ms/op 1.16
CheckpointStateCache - add get delete 20.455 us/op 17.047 us/op 1.20
validate gossip signedAggregateAndProof - struct 5.1295 ms/op 4.4499 ms/op 1.15
validate gossip signedAggregateAndProof - treeBacked 5.1225 ms/op 4.3957 ms/op 1.17
validate gossip attestation - struct 2.3956 ms/op 2.0965 ms/op 1.14
validate gossip attestation - treeBacked 2.4335 ms/op 2.1146 ms/op 1.15
bytes32 toHexString 1.7930 us/op 1.5300 us/op 1.17
bytes32 Buffer.toString(hex) 786.00 ns/op 683.00 ns/op 1.15
bytes32 Buffer.toString(hex) from Uint8Array 1.0860 us/op 887.00 ns/op 1.22
bytes32 Buffer.toString(hex) + 0x 791.00 ns/op 677.00 ns/op 1.17
Object access 1 prop 0.35600 ns/op 0.31200 ns/op 1.14
Map access 1 prop 0.31100 ns/op 0.28800 ns/op 1.08
Object get x1000 20.586 ns/op 17.891 ns/op 1.15
Map get x1000 1.0870 ns/op 0.98300 ns/op 1.11
Object set x1000 124.90 ns/op 98.363 ns/op 1.27
Map set x1000 72.128 ns/op 58.384 ns/op 1.24
Return object 10000 times 0.42120 ns/op 0.36960 ns/op 1.14
Throw Error 10000 times 6.6444 us/op 5.9089 us/op 1.12
enrSubnets - fastDeserialize 64 bits 1.3550 us/op 1.1420 us/op 1.19
enrSubnets - ssz BitVector 64 bits 17.664 us/op 16.416 us/op 1.08
enrSubnets - fastDeserialize 4 bits 474.00 ns/op 402.00 ns/op 1.18
enrSubnets - ssz BitVector 4 bits 3.0560 us/op 2.7980 us/op 1.09
RateTracker 1000000 limit, 1 obj count per request 205.14 ns/op 172.55 ns/op 1.19
RateTracker 1000000 limit, 2 obj count per request 153.71 ns/op 127.50 ns/op 1.21
RateTracker 1000000 limit, 4 obj count per request 124.74 ns/op 104.74 ns/op 1.19
RateTracker 1000000 limit, 8 obj count per request 111.99 ns/op 93.562 ns/op 1.20
RateTracker with prune 4.2120 us/op 3.3710 us/op 1.25

by benchmarkbot/action

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.

Looks good!

@wemeetagain wemeetagain merged commit c9b5350 into master Feb 1, 2022
@wemeetagain wemeetagain deleted the g11tech/apitimeouts branch February 1, 2022 17:17
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.

None yet

3 participants