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

feat: add option to configure REST API server header limit #5594

Merged
merged 1 commit into from
May 31, 2023

Conversation

nflaig
Copy link
Member

@nflaig nflaig commented May 31, 2023

Motivation

Closes #5554

Description

Adds --rest.headerLimit CLI flag to configure REST API server header limit (default: 16384 bytes).

@nflaig nflaig requested a review from a team as a code owner May 31, 2023 10:19
@github-actions
Copy link
Contributor

github-actions bot commented May 31, 2023

Performance Report

✔️ no performance regression detected

Full benchmark results
Benchmark suite Current: 065c989 Previous: 951fda6 Ratio
getPubkeys - index2pubkey - req 1000 vs - 250000 vc 1.0443 ms/op 584.72 us/op 1.79
getPubkeys - validatorsArr - req 1000 vs - 250000 vc 69.081 us/op 52.460 us/op 1.32
BLS verify - blst-native 1.4094 ms/op 1.2319 ms/op 1.14
BLS verifyMultipleSignatures 3 - blst-native 2.8080 ms/op 2.5107 ms/op 1.12
BLS verifyMultipleSignatures 8 - blst-native 6.2227 ms/op 5.4157 ms/op 1.15
BLS verifyMultipleSignatures 32 - blst-native 22.263 ms/op 19.974 ms/op 1.11
BLS aggregatePubkeys 32 - blst-native 30.686 us/op 26.921 us/op 1.14
BLS aggregatePubkeys 128 - blst-native 112.39 us/op 104.47 us/op 1.08
getAttestationsForBlock 89.596 ms/op 63.777 ms/op 1.40
isKnown best case - 1 super set check 312.00 ns/op 265.00 ns/op 1.18
isKnown normal case - 2 super set checks 376.00 ns/op 257.00 ns/op 1.46
isKnown worse case - 16 super set checks 300.00 ns/op 252.00 ns/op 1.19
CheckpointStateCache - add get delete 6.8020 us/op 5.7070 us/op 1.19
validate gossip signedAggregateAndProof - struct 3.5518 ms/op 2.8365 ms/op 1.25
validate gossip attestation - struct 1.5627 ms/op 1.3348 ms/op 1.17
pickEth1Vote - no votes 1.8669 ms/op 1.3773 ms/op 1.36
pickEth1Vote - max votes 14.602 ms/op 14.177 ms/op 1.03
pickEth1Vote - Eth1Data hashTreeRoot value x2048 10.537 ms/op 9.9159 ms/op 1.06
pickEth1Vote - Eth1Data hashTreeRoot tree x2048 20.842 ms/op 14.493 ms/op 1.44
pickEth1Vote - Eth1Data fastSerialize value x2048 980.67 us/op 646.03 us/op 1.52
pickEth1Vote - Eth1Data fastSerialize tree x2048 6.4839 ms/op 9.2358 ms/op 0.70
bytes32 toHexString 861.00 ns/op 751.00 ns/op 1.15
bytes32 Buffer.toString(hex) 489.00 ns/op 452.00 ns/op 1.08
bytes32 Buffer.toString(hex) from Uint8Array 685.00 ns/op 653.00 ns/op 1.05
bytes32 Buffer.toString(hex) + 0x 478.00 ns/op 464.00 ns/op 1.03
Object access 1 prop 0.24200 ns/op 0.21600 ns/op 1.12
Map access 1 prop 0.19100 ns/op 0.16900 ns/op 1.13
Object get x1000 10.809 ns/op 6.8690 ns/op 1.57
Map get x1000 0.79400 ns/op 0.68100 ns/op 1.17
Object set x1000 91.223 ns/op 69.595 ns/op 1.31
Map set x1000 70.379 ns/op 60.748 ns/op 1.16
Return object 10000 times 0.42540 ns/op 0.29680 ns/op 1.43
Throw Error 10000 times 4.9674 us/op 4.5989 us/op 1.08
fastMsgIdFn sha256 / 200 bytes 3.8520 us/op 3.7290 us/op 1.03
fastMsgIdFn h32 xxhash / 200 bytes 365.00 ns/op 340.00 ns/op 1.07
fastMsgIdFn h64 xxhash / 200 bytes 559.00 ns/op 490.00 ns/op 1.14
fastMsgIdFn sha256 / 1000 bytes 12.741 us/op 12.116 us/op 1.05
fastMsgIdFn h32 xxhash / 1000 bytes 503.00 ns/op 457.00 ns/op 1.10
fastMsgIdFn h64 xxhash / 1000 bytes 603.00 ns/op 567.00 ns/op 1.06
fastMsgIdFn sha256 / 10000 bytes 116.21 us/op 106.62 us/op 1.09
fastMsgIdFn h32 xxhash / 10000 bytes 2.1640 us/op 2.0420 us/op 1.06
fastMsgIdFn h64 xxhash / 10000 bytes 1.6240 us/op 1.4510 us/op 1.12
enrSubnets - fastDeserialize 64 bits 2.0270 us/op 1.6440 us/op 1.23
enrSubnets - ssz BitVector 64 bits 735.00 ns/op 516.00 ns/op 1.42
enrSubnets - fastDeserialize 4 bits 250.00 ns/op 173.00 ns/op 1.45
enrSubnets - ssz BitVector 4 bits 698.00 ns/op 491.00 ns/op 1.42
prioritizePeers score -10:0 att 32-0.1 sync 2-0 158.31 us/op 136.58 us/op 1.16
prioritizePeers score 0:0 att 32-0.25 sync 2-0.25 191.03 us/op 155.68 us/op 1.23
prioritizePeers score 0:0 att 32-0.5 sync 2-0.5 227.79 us/op 183.38 us/op 1.24
prioritizePeers score 0:0 att 64-0.75 sync 4-0.75 398.41 us/op 331.80 us/op 1.20
prioritizePeers score 0:0 att 64-1 sync 4-1 572.84 us/op 382.33 us/op 1.50
array of 16000 items push then shift 2.0745 us/op 1.7188 us/op 1.21
LinkedList of 16000 items push then shift 15.231 ns/op 8.9220 ns/op 1.71
array of 16000 items push then pop 131.48 ns/op 85.031 ns/op 1.55
LinkedList of 16000 items push then pop 12.767 ns/op 8.4330 ns/op 1.51
array of 24000 items push then shift 3.0450 us/op 2.3325 us/op 1.31
LinkedList of 24000 items push then shift 14.927 ns/op 8.5900 ns/op 1.74
array of 24000 items push then pop 97.271 ns/op 74.576 ns/op 1.30
LinkedList of 24000 items push then pop 14.100 ns/op 8.3490 ns/op 1.69
intersect bitArray bitLen 8 21.336 ns/op 12.901 ns/op 1.65
intersect array and set length 8 142.89 ns/op 73.224 ns/op 1.95
intersect bitArray bitLen 128 69.033 ns/op 43.257 ns/op 1.60
intersect array and set length 128 1.8645 us/op 1.0229 us/op 1.82
Buffer.concat 32 items 4.9020 us/op 2.5790 us/op 1.90
Uint8Array.set 32 items 3.5670 us/op 2.4670 us/op 1.45
transfer serialized Status (84 B) 2.8860 us/op 1.9990 us/op 1.44
copy serialized Status (84 B) 2.0260 us/op 1.7560 us/op 1.15
transfer serialized SignedVoluntaryExit (112 B) 2.6100 us/op 2.1410 us/op 1.22
copy serialized SignedVoluntaryExit (112 B) 2.0920 us/op 1.7090 us/op 1.22
transfer serialized ProposerSlashing (416 B) 3.2320 us/op 2.5580 us/op 1.26
copy serialized ProposerSlashing (416 B) 3.2640 us/op 3.0540 us/op 1.07
transfer serialized Attestation (485 B) 3.6130 us/op 2.7680 us/op 1.31
copy serialized Attestation (485 B) 3.3210 us/op 2.8060 us/op 1.18
transfer serialized AttesterSlashing (33232 B) 4.1330 us/op 2.6960 us/op 1.53
copy serialized AttesterSlashing (33232 B) 11.223 us/op 5.4400 us/op 2.06
transfer serialized Small SignedBeaconBlock (128000 B) 4.3350 us/op 2.8290 us/op 1.53
copy serialized Small SignedBeaconBlock (128000 B) 27.003 us/op 12.892 us/op 2.09
transfer serialized Avg SignedBeaconBlock (200000 B) 5.2320 us/op 3.0900 us/op 1.69
copy serialized Avg SignedBeaconBlock (200000 B) 44.234 us/op 17.648 us/op 2.51
transfer serialized BlobsSidecar (524380 B) 5.3340 us/op 3.0410 us/op 1.75
copy serialized BlobsSidecar (524380 B) 228.34 us/op 150.39 us/op 1.52
transfer serialized Big SignedBeaconBlock (1000000 B) 5.6440 us/op 3.1140 us/op 1.81
copy serialized Big SignedBeaconBlock (1000000 B) 403.16 us/op 282.04 us/op 1.43
pass gossip attestations to forkchoice per slot 3.6890 ms/op 2.2667 ms/op 1.63
computeDeltas 4.7503 ms/op 3.1679 ms/op 1.50
computeProposerBoostScoreFromBalances 2.0972 ms/op 1.7744 ms/op 1.18
altair processAttestation - 250000 vs - 7PWei normalcase 4.3720 ms/op 2.1834 ms/op 2.00
altair processAttestation - 250000 vs - 7PWei worstcase 5.8459 ms/op 3.9633 ms/op 1.47
altair processAttestation - setStatus - 1/6 committees join 162.43 us/op 144.45 us/op 1.12
altair processAttestation - setStatus - 1/3 committees join 326.91 us/op 275.41 us/op 1.19
altair processAttestation - setStatus - 1/2 committees join 473.52 us/op 372.90 us/op 1.27
altair processAttestation - setStatus - 2/3 committees join 534.02 us/op 466.19 us/op 1.15
altair processAttestation - setStatus - 4/5 committees join 766.34 us/op 653.33 us/op 1.17
altair processAttestation - setStatus - 100% committees join 887.04 us/op 765.08 us/op 1.16
altair processBlock - 250000 vs - 7PWei normalcase 22.420 ms/op 18.525 ms/op 1.21
altair processBlock - 250000 vs - 7PWei normalcase hashState 35.275 ms/op 24.721 ms/op 1.43
altair processBlock - 250000 vs - 7PWei worstcase 60.032 ms/op 50.975 ms/op 1.18
altair processBlock - 250000 vs - 7PWei worstcase hashState 86.764 ms/op 66.999 ms/op 1.30
phase0 processBlock - 250000 vs - 7PWei normalcase 4.0655 ms/op 2.0498 ms/op 1.98
phase0 processBlock - 250000 vs - 7PWei worstcase 36.861 ms/op 28.997 ms/op 1.27
altair processEth1Data - 250000 vs - 7PWei normalcase 695.38 us/op 489.74 us/op 1.42
getExpectedWithdrawals 250000 eb:1,eth1:1,we:0,wn:0,smpl:15 14.783 us/op 8.6080 us/op 1.72
getExpectedWithdrawals 250000 eb:0.95,eth1:0.1,we:0.05,wn:0,smpl:219 38.583 us/op 26.108 us/op 1.48
getExpectedWithdrawals 250000 eb:0.95,eth1:0.3,we:0.05,wn:0,smpl:42 18.392 us/op 10.827 us/op 1.70
getExpectedWithdrawals 250000 eb:0.95,eth1:0.7,we:0.05,wn:0,smpl:18 14.762 us/op 9.4890 us/op 1.56
getExpectedWithdrawals 250000 eb:0.1,eth1:0.1,we:0,wn:0,smpl:1020 142.59 us/op 106.73 us/op 1.34
getExpectedWithdrawals 250000 eb:0.03,eth1:0.03,we:0,wn:0,smpl:11777 1.0630 ms/op 658.76 us/op 1.61
getExpectedWithdrawals 250000 eb:0.01,eth1:0.01,we:0,wn:0,smpl:16384 1.1820 ms/op 911.81 us/op 1.30
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,smpl:16384 1.7479 ms/op 903.07 us/op 1.94
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,nocache,smpl:16384 5.6690 ms/op 2.4446 ms/op 2.32
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,smpl:16384 2.7299 ms/op 1.7223 ms/op 1.59
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,nocache,smpl:16384 6.8515 ms/op 3.9182 ms/op 1.75
Tree 40 250000 create 722.94 ms/op 313.01 ms/op 2.31
Tree 40 250000 get(125000) 227.03 ns/op 196.72 ns/op 1.15
Tree 40 250000 set(125000) 1.7886 us/op 1.0651 us/op 1.68
Tree 40 250000 toArray() 34.772 ms/op 21.322 ms/op 1.63
Tree 40 250000 iterate all - toArray() + loop 30.565 ms/op 20.879 ms/op 1.46
Tree 40 250000 iterate all - get(i) 86.210 ms/op 70.151 ms/op 1.23
MutableVector 250000 create 16.039 ms/op 10.920 ms/op 1.47
MutableVector 250000 get(125000) 7.2820 ns/op 6.5750 ns/op 1.11
MutableVector 250000 set(125000) 439.77 ns/op 266.92 ns/op 1.65
MutableVector 250000 toArray() 4.4184 ms/op 3.2267 ms/op 1.37
MutableVector 250000 iterate all - toArray() + loop 4.6295 ms/op 3.0721 ms/op 1.51
MutableVector 250000 iterate all - get(i) 1.7002 ms/op 1.5042 ms/op 1.13
Array 250000 create 4.2173 ms/op 2.6054 ms/op 1.62
Array 250000 clone - spread 1.4020 ms/op 1.2539 ms/op 1.12
Array 250000 get(125000) 1.0790 ns/op 0.61100 ns/op 1.77
Array 250000 set(125000) 1.6250 ns/op 0.69800 ns/op 2.33
Array 250000 iterate all - loop 196.13 us/op 82.480 us/op 2.38
effectiveBalanceIncrements clone Uint8Array 300000 73.399 us/op 33.047 us/op 2.22
effectiveBalanceIncrements clone MutableVector 300000 1.0190 us/op 412.00 ns/op 2.47
effectiveBalanceIncrements rw all Uint8Array 300000 222.60 us/op 168.77 us/op 1.32
effectiveBalanceIncrements rw all MutableVector 300000 209.40 ms/op 91.607 ms/op 2.29
phase0 afterProcessEpoch - 250000 vs - 7PWei 158.72 ms/op 115.29 ms/op 1.38
phase0 beforeProcessEpoch - 250000 vs - 7PWei 61.799 ms/op 34.285 ms/op 1.80
altair processEpoch - mainnet_e81889 450.21 ms/op 318.46 ms/op 1.41
mainnet_e81889 - altair beforeProcessEpoch 98.762 ms/op 62.775 ms/op 1.57
mainnet_e81889 - altair processJustificationAndFinalization 35.852 us/op 18.205 us/op 1.97
mainnet_e81889 - altair processInactivityUpdates 8.1743 ms/op 5.9148 ms/op 1.38
mainnet_e81889 - altair processRewardsAndPenalties 95.579 ms/op 49.217 ms/op 1.94
mainnet_e81889 - altair processRegistryUpdates 6.8900 us/op 2.5750 us/op 2.68
mainnet_e81889 - altair processSlashings 1.7030 us/op 467.00 ns/op 3.65
mainnet_e81889 - altair processEth1DataReset 1.8360 us/op 544.00 ns/op 3.38
mainnet_e81889 - altair processEffectiveBalanceUpdates 6.7071 ms/op 1.2339 ms/op 5.44
mainnet_e81889 - altair processSlashingsReset 12.506 us/op 4.7130 us/op 2.65
mainnet_e81889 - altair processRandaoMixesReset 12.820 us/op 4.5120 us/op 2.84
mainnet_e81889 - altair processHistoricalRootsUpdate 2.3140 us/op 1.0320 us/op 2.24
mainnet_e81889 - altair processParticipationFlagUpdates 6.8430 us/op 3.2070 us/op 2.13
mainnet_e81889 - altair processSyncCommitteeUpdates 1.7540 us/op 715.00 ns/op 2.45
mainnet_e81889 - altair afterProcessEpoch 146.47 ms/op 125.24 ms/op 1.17
phase0 processEpoch - mainnet_e58758 363.57 ms/op 353.70 ms/op 1.03
mainnet_e58758 - phase0 beforeProcessEpoch 122.79 ms/op 138.16 ms/op 0.89
mainnet_e58758 - phase0 processJustificationAndFinalization 16.313 us/op 17.490 us/op 0.93
mainnet_e58758 - phase0 processRewardsAndPenalties 50.130 ms/op 59.603 ms/op 0.84
mainnet_e58758 - phase0 processRegistryUpdates 9.7620 us/op 8.1360 us/op 1.20
mainnet_e58758 - phase0 processSlashings 1.2030 us/op 539.00 ns/op 2.23
mainnet_e58758 - phase0 processEth1DataReset 642.00 ns/op 584.00 ns/op 1.10
mainnet_e58758 - phase0 processEffectiveBalanceUpdates 1.3387 ms/op 940.76 us/op 1.42
mainnet_e58758 - phase0 processSlashingsReset 8.0870 us/op 3.4330 us/op 2.36
mainnet_e58758 - phase0 processRandaoMixesReset 8.5870 us/op 4.8940 us/op 1.75
mainnet_e58758 - phase0 processHistoricalRootsUpdate 1.4710 us/op 537.00 ns/op 2.74
mainnet_e58758 - phase0 processParticipationRecordUpdates 10.021 us/op 3.9870 us/op 2.51
mainnet_e58758 - phase0 afterProcessEpoch 100.66 ms/op 94.833 ms/op 1.06
phase0 processEffectiveBalanceUpdates - 250000 normalcase 1.3167 ms/op 1.2114 ms/op 1.09
phase0 processEffectiveBalanceUpdates - 250000 worstcase 0.5 2.1706 ms/op 1.4933 ms/op 1.45
altair processInactivityUpdates - 250000 normalcase 23.987 ms/op 25.899 ms/op 0.93
altair processInactivityUpdates - 250000 worstcase 26.112 ms/op 26.572 ms/op 0.98
phase0 processRegistryUpdates - 250000 normalcase 9.4860 us/op 6.1910 us/op 1.53
phase0 processRegistryUpdates - 250000 badcase_full_deposits 344.93 us/op 249.79 us/op 1.38
phase0 processRegistryUpdates - 250000 worstcase 0.5 146.92 ms/op 127.30 ms/op 1.15
altair processRewardsAndPenalties - 250000 normalcase 76.405 ms/op 69.044 ms/op 1.11
altair processRewardsAndPenalties - 250000 worstcase 81.470 ms/op 68.849 ms/op 1.18
phase0 getAttestationDeltas - 250000 normalcase 9.4711 ms/op 6.6837 ms/op 1.42
phase0 getAttestationDeltas - 250000 worstcase 10.026 ms/op 6.6202 ms/op 1.51
phase0 processSlashings - 250000 worstcase 3.7747 ms/op 3.6709 ms/op 1.03
altair processSyncCommitteeUpdates - 250000 196.36 ms/op 177.81 ms/op 1.10
BeaconState.hashTreeRoot - No change 310.00 ns/op 333.00 ns/op 0.93
BeaconState.hashTreeRoot - 1 full validator 59.991 us/op 52.475 us/op 1.14
BeaconState.hashTreeRoot - 32 full validator 575.34 us/op 548.39 us/op 1.05
BeaconState.hashTreeRoot - 512 full validator 6.1232 ms/op 5.3164 ms/op 1.15
BeaconState.hashTreeRoot - 1 validator.effectiveBalance 70.560 us/op 61.077 us/op 1.16
BeaconState.hashTreeRoot - 32 validator.effectiveBalance 977.67 us/op 883.81 us/op 1.11
BeaconState.hashTreeRoot - 512 validator.effectiveBalance 14.920 ms/op 11.379 ms/op 1.31
BeaconState.hashTreeRoot - 1 balances 57.618 us/op 48.446 us/op 1.19
BeaconState.hashTreeRoot - 32 balances 499.76 us/op 490.16 us/op 1.02
BeaconState.hashTreeRoot - 512 balances 5.6153 ms/op 4.4740 ms/op 1.26
BeaconState.hashTreeRoot - 250000 balances 86.480 ms/op 76.532 ms/op 1.13
aggregationBits - 2048 els - zipIndexesInBitList 20.729 us/op 16.183 us/op 1.28
regular array get 100000 times 46.326 us/op 33.117 us/op 1.40
wrappedArray get 100000 times 34.896 us/op 33.231 us/op 1.05
arrayWithProxy get 100000 times 17.922 ms/op 16.120 ms/op 1.11
ssz.Root.equals 648.00 ns/op 559.00 ns/op 1.16
byteArrayEquals 642.00 ns/op 548.00 ns/op 1.17
shuffle list - 16384 els 7.3659 ms/op 6.8167 ms/op 1.08
shuffle list - 250000 els 105.79 ms/op 101.09 ms/op 1.05
processSlot - 1 slots 10.035 us/op 8.8300 us/op 1.14
processSlot - 32 slots 1.5709 ms/op 1.3560 ms/op 1.16
getEffectiveBalanceIncrementsZeroInactive - 250000 vs - 7PWei 39.038 ms/op 37.458 ms/op 1.04
getCommitteeAssignments - req 1 vs - 250000 vc 3.0164 ms/op 2.9299 ms/op 1.03
getCommitteeAssignments - req 100 vs - 250000 vc 4.3121 ms/op 4.1584 ms/op 1.04
getCommitteeAssignments - req 1000 vs - 250000 vc 4.7655 ms/op 4.5138 ms/op 1.06
RootCache.getBlockRootAtSlot - 250000 vs - 7PWei 5.5100 ns/op 4.8700 ns/op 1.13
state getBlockRootAtSlot - 250000 vs - 7PWei 702.31 ns/op 897.73 ns/op 0.78
computeProposers - vc 250000 11.262 ms/op 10.981 ms/op 1.03
computeEpochShuffling - vc 250000 108.50 ms/op 103.95 ms/op 1.04
getNextSyncCommittee - vc 250000 186.09 ms/op 177.93 ms/op 1.05
computeSigningRoot for AttestationData 15.085 us/op 14.110 us/op 1.07
hash AttestationData serialized data then Buffer.toString(base64) 2.5819 us/op 2.4643 us/op 1.05
toHexString serialized data 1.2341 us/op 1.0724 us/op 1.15
Buffer.toString(base64) 371.14 ns/op 345.82 ns/op 1.07

by benchmarkbot/action

@nflaig nflaig merged commit fb6a57a into unstable May 31, 2023
@nflaig nflaig deleted the nflaig/rest-api-server-header-limit branch May 31, 2023 11:52
@wemeetagain
Copy link
Member

🎉 This PR is included in v1.9.0 🎉

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.

Configurable URL length limit
3 participants