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

chore: add eslint rule to restrict global fetch #6500

Merged
merged 3 commits into from
Feb 29, 2024

Conversation

nflaig
Copy link
Member

@nflaig nflaig commented Feb 28, 2024

Motivation

We should make sure that we don't accidentally use native fetch without error wrapper.

Description

Add eslint rule to restrict global fetch

Related #6497

@nflaig nflaig requested a review from a team as a code owner February 28, 2024 19:20
Copy link

codecov bot commented Feb 28, 2024

Codecov Report

Merging #6500 (1dfb686) into unstable (6675739) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Additional details and impacted files
@@            Coverage Diff            @@
##           unstable    #6500   +/-   ##
=========================================
  Coverage     61.72%   61.72%           
=========================================
  Files           555      555           
  Lines         58204    58206    +2     
  Branches       1843     1844    +1     
=========================================
+ Hits          35926    35929    +3     
+ Misses        22239    22238    -1     
  Partials         39       39           

Copy link
Contributor

github-actions bot commented Feb 28, 2024

Performance Report

✔️ no performance regression detected

Full benchmark results
Benchmark suite Current: 78efee2 Previous: 6675739 Ratio
getPubkeys - index2pubkey - req 1000 vs - 250000 vc 938.64 us/op 757.16 us/op 1.24
getPubkeys - validatorsArr - req 1000 vs - 250000 vc 148.83 us/op 179.45 us/op 0.83
BLS verify - blst-native 1.4485 ms/op 1.3862 ms/op 1.04
BLS verifyMultipleSignatures 3 - blst-native 3.0968 ms/op 2.9397 ms/op 1.05
BLS verifyMultipleSignatures 8 - blst-native 7.0933 ms/op 6.7566 ms/op 1.05
BLS verifyMultipleSignatures 32 - blst-native 26.419 ms/op 24.250 ms/op 1.09
BLS verifyMultipleSignatures 64 - blst-native 53.327 ms/op 49.201 ms/op 1.08
BLS verifyMultipleSignatures 128 - blst-native 101.13 ms/op 108.90 ms/op 0.93
BLS deserializing 10000 signatures 1.0770 s/op 991.14 ms/op 1.09
BLS deserializing 100000 signatures 10.492 s/op 9.1570 s/op 1.15
BLS verifyMultipleSignatures - same message - 3 - blst-native 1.4965 ms/op 1.4837 ms/op 1.01
BLS verifyMultipleSignatures - same message - 8 - blst-native 1.7023 ms/op 1.5447 ms/op 1.10
BLS verifyMultipleSignatures - same message - 32 - blst-native 2.6264 ms/op 2.4032 ms/op 1.09
BLS verifyMultipleSignatures - same message - 64 - blst-native 3.8125 ms/op 3.5443 ms/op 1.08
BLS verifyMultipleSignatures - same message - 128 - blst-native 6.0127 ms/op 5.6694 ms/op 1.06
BLS aggregatePubkeys 32 - blst-native 29.355 us/op 26.180 us/op 1.12
BLS aggregatePubkeys 128 - blst-native 116.11 us/op 101.38 us/op 1.15
notSeenSlots=1 numMissedVotes=1 numBadVotes=10 81.986 ms/op 63.669 ms/op 1.29
notSeenSlots=1 numMissedVotes=0 numBadVotes=4 94.511 ms/op 55.744 ms/op 1.70
notSeenSlots=2 numMissedVotes=1 numBadVotes=10 54.596 ms/op 46.464 ms/op 1.18
getSlashingsAndExits - default max 280.18 us/op 298.90 us/op 0.94
getSlashingsAndExits - 2k 800.54 us/op 586.30 us/op 1.37
proposeBlockBody type=full, size=empty 8.1933 ms/op 6.7576 ms/op 1.21
isKnown best case - 1 super set check 777.00 ns/op 603.00 ns/op 1.29
isKnown normal case - 2 super set checks 885.00 ns/op 660.00 ns/op 1.34
isKnown worse case - 16 super set checks 911.00 ns/op 636.00 ns/op 1.43
CheckpointStateCache - add get delete 19.489 us/op 6.7500 us/op 2.89
validate api signedAggregateAndProof - struct 3.4958 ms/op 2.9278 ms/op 1.19
validate gossip signedAggregateAndProof - struct 3.3112 ms/op 2.9100 ms/op 1.14
validate gossip attestation - vc 640000 1.6665 ms/op 1.4562 ms/op 1.14
batch validate gossip attestation - vc 640000 - chunk 32 203.17 us/op 177.20 us/op 1.15
batch validate gossip attestation - vc 640000 - chunk 64 179.61 us/op 155.73 us/op 1.15
batch validate gossip attestation - vc 640000 - chunk 128 154.01 us/op 151.09 us/op 1.02
batch validate gossip attestation - vc 640000 - chunk 256 161.39 us/op 146.68 us/op 1.10
pickEth1Vote - no votes 1.5759 ms/op 1.2724 ms/op 1.24
pickEth1Vote - max votes 13.317 ms/op 12.208 ms/op 1.09
pickEth1Vote - Eth1Data hashTreeRoot value x2048 26.402 ms/op 21.625 ms/op 1.22
pickEth1Vote - Eth1Data hashTreeRoot tree x2048 38.784 ms/op 29.769 ms/op 1.30
pickEth1Vote - Eth1Data fastSerialize value x2048 851.81 us/op 692.41 us/op 1.23
pickEth1Vote - Eth1Data fastSerialize tree x2048 6.7771 ms/op 4.8067 ms/op 1.41
bytes32 toHexString 931.00 ns/op 600.00 ns/op 1.55
bytes32 Buffer.toString(hex) 364.00 ns/op 312.00 ns/op 1.17
bytes32 Buffer.toString(hex) from Uint8Array 625.00 ns/op 526.00 ns/op 1.19
bytes32 Buffer.toString(hex) + 0x 353.00 ns/op 323.00 ns/op 1.09
Object access 1 prop 0.28400 ns/op 0.18300 ns/op 1.55
Map access 1 prop 0.18200 ns/op 0.15200 ns/op 1.20
Object get x1000 9.0280 ns/op 7.1670 ns/op 1.26
Map get x1000 1.1280 ns/op 0.82000 ns/op 1.38
Object set x1000 85.013 ns/op 53.412 ns/op 1.59
Map set x1000 63.361 ns/op 44.014 ns/op 1.44
Return object 10000 times 0.32710 ns/op 0.24650 ns/op 1.33
Throw Error 10000 times 4.9894 us/op 3.9677 us/op 1.26
fastMsgIdFn sha256 / 200 bytes 4.0030 us/op 3.3440 us/op 1.20
fastMsgIdFn h32 xxhash / 200 bytes 411.00 ns/op 327.00 ns/op 1.26
fastMsgIdFn h64 xxhash / 200 bytes 449.00 ns/op 387.00 ns/op 1.16
fastMsgIdFn sha256 / 1000 bytes 13.989 us/op 11.784 us/op 1.19
fastMsgIdFn h32 xxhash / 1000 bytes 586.00 ns/op 477.00 ns/op 1.23
fastMsgIdFn h64 xxhash / 1000 bytes 547.00 ns/op 455.00 ns/op 1.20
fastMsgIdFn sha256 / 10000 bytes 121.44 us/op 106.72 us/op 1.14
fastMsgIdFn h32 xxhash / 10000 bytes 2.3050 us/op 2.0700 us/op 1.11
fastMsgIdFn h64 xxhash / 10000 bytes 1.5800 us/op 1.4370 us/op 1.10
send data - 1000 256B messages 25.000 ms/op 20.379 ms/op 1.23
send data - 1000 512B messages 35.260 ms/op 28.337 ms/op 1.24
send data - 1000 1024B messages 52.751 ms/op 42.255 ms/op 1.25
send data - 1000 1200B messages 46.279 ms/op 42.679 ms/op 1.08
send data - 1000 2048B messages 58.882 ms/op 48.745 ms/op 1.21
send data - 1000 4096B messages 57.259 ms/op 46.813 ms/op 1.22
send data - 1000 16384B messages 161.11 ms/op 124.51 ms/op 1.29
send data - 1000 65536B messages 538.85 ms/op 525.41 ms/op 1.03
enrSubnets - fastDeserialize 64 bits 2.3880 us/op 1.5860 us/op 1.51
enrSubnets - ssz BitVector 64 bits 610.00 ns/op 551.00 ns/op 1.11
enrSubnets - fastDeserialize 4 bits 304.00 ns/op 237.00 ns/op 1.28
enrSubnets - ssz BitVector 4 bits 736.00 ns/op 553.00 ns/op 1.33
prioritizePeers score -10:0 att 32-0.1 sync 2-0 144.27 us/op 129.74 us/op 1.11
prioritizePeers score 0:0 att 32-0.25 sync 2-0.25 251.75 us/op 162.19 us/op 1.55
prioritizePeers score 0:0 att 32-0.5 sync 2-0.5 319.90 us/op 224.72 us/op 1.42
prioritizePeers score 0:0 att 64-0.75 sync 4-0.75 628.79 us/op 387.45 us/op 1.62
prioritizePeers score 0:0 att 64-1 sync 4-1 639.30 us/op 447.22 us/op 1.43
array of 16000 items push then shift 2.4707 us/op 2.2528 us/op 1.10
LinkedList of 16000 items push then shift 15.940 ns/op 12.713 ns/op 1.25
array of 16000 items push then pop 225.40 ns/op 136.69 ns/op 1.65
LinkedList of 16000 items push then pop 17.874 ns/op 10.771 ns/op 1.66
array of 24000 items push then shift 4.1358 us/op 2.8742 us/op 1.44
LinkedList of 24000 items push then shift 20.461 ns/op 11.508 ns/op 1.78
array of 24000 items push then pop 346.96 ns/op 178.53 ns/op 1.94
LinkedList of 24000 items push then pop 15.554 ns/op 10.945 ns/op 1.42
intersect bitArray bitLen 8 7.9210 ns/op 6.9010 ns/op 1.15
intersect array and set length 8 166.04 ns/op 96.072 ns/op 1.73
intersect bitArray bitLen 128 51.099 ns/op 39.030 ns/op 1.31
intersect array and set length 128 1.8105 us/op 1.3896 us/op 1.30
bitArray.getTrueBitIndexes() bitLen 128 4.1990 us/op 2.0620 us/op 2.04
bitArray.getTrueBitIndexes() bitLen 248 5.5870 us/op 3.5250 us/op 1.58
bitArray.getTrueBitIndexes() bitLen 512 10.427 us/op 6.8790 us/op 1.52
Buffer.concat 32 items 2.1450 us/op 1.1210 us/op 1.91
Uint8Array.set 32 items 2.5870 us/op 2.4880 us/op 1.04
Set add up to 64 items then delete first 6.3645 us/op 5.0722 us/op 1.25
OrderedSet add up to 64 items then delete first 8.1903 us/op 6.8496 us/op 1.20
Set add up to 64 items then delete last 6.4292 us/op 5.7123 us/op 1.13
OrderedSet add up to 64 items then delete last 8.1577 us/op 7.2624 us/op 1.12
Set add up to 64 items then delete middle 6.1854 us/op 5.5551 us/op 1.11
OrderedSet add up to 64 items then delete middle 9.7994 us/op 8.6158 us/op 1.14
Set add up to 128 items then delete first 12.260 us/op 11.505 us/op 1.07
OrderedSet add up to 128 items then delete first 17.269 us/op 17.056 us/op 1.01
Set add up to 128 items then delete last 12.415 us/op 11.262 us/op 1.10
OrderedSet add up to 128 items then delete last 16.844 us/op 15.261 us/op 1.10
Set add up to 128 items then delete middle 12.966 us/op 11.640 us/op 1.11
OrderedSet add up to 128 items then delete middle 23.911 us/op 20.842 us/op 1.15
Set add up to 256 items then delete first 26.424 us/op 23.063 us/op 1.15
OrderedSet add up to 256 items then delete first 38.127 us/op 32.618 us/op 1.17
Set add up to 256 items then delete last 26.687 us/op 23.370 us/op 1.14
OrderedSet add up to 256 items then delete last 36.120 us/op 31.128 us/op 1.16
Set add up to 256 items then delete middle 27.665 us/op 22.991 us/op 1.20
OrderedSet add up to 256 items then delete middle 82.602 us/op 54.892 us/op 1.50
transfer serialized Status (84 B) 2.6330 us/op 2.4260 us/op 1.09
copy serialized Status (84 B) 1.8590 us/op 1.6350 us/op 1.14
transfer serialized SignedVoluntaryExit (112 B) 2.4760 us/op 2.4040 us/op 1.03
copy serialized SignedVoluntaryExit (112 B) 2.0440 us/op 2.2470 us/op 0.91
transfer serialized ProposerSlashing (416 B) 4.2160 us/op 3.4510 us/op 1.22
copy serialized ProposerSlashing (416 B) 3.1230 us/op 3.1060 us/op 1.01
transfer serialized Attestation (485 B) 3.5270 us/op 3.0300 us/op 1.16
copy serialized Attestation (485 B) 3.5630 us/op 2.9720 us/op 1.20
transfer serialized AttesterSlashing (33232 B) 2.8450 us/op 3.4560 us/op 0.82
copy serialized AttesterSlashing (33232 B) 9.8460 us/op 17.676 us/op 0.56
transfer serialized Small SignedBeaconBlock (128000 B) 2.9950 us/op 4.8540 us/op 0.62
copy serialized Small SignedBeaconBlock (128000 B) 27.977 us/op 39.581 us/op 0.71
transfer serialized Avg SignedBeaconBlock (200000 B) 4.0250 us/op 3.6840 us/op 1.09
copy serialized Avg SignedBeaconBlock (200000 B) 66.924 us/op 53.688 us/op 1.25
transfer serialized BlobsSidecar (524380 B) 6.4510 us/op 5.6470 us/op 1.14
copy serialized BlobsSidecar (524380 B) 109.75 us/op 260.68 us/op 0.42
transfer serialized Big SignedBeaconBlock (1000000 B) 5.8550 us/op 5.7450 us/op 1.02
copy serialized Big SignedBeaconBlock (1000000 B) 241.76 us/op 478.99 us/op 0.50
pass gossip attestations to forkchoice per slot 6.2794 ms/op 4.1934 ms/op 1.50
forkChoice updateHead vc 100000 bc 64 eq 0 880.93 us/op 725.78 us/op 1.21
forkChoice updateHead vc 600000 bc 64 eq 0 7.6061 ms/op 4.6407 ms/op 1.64
forkChoice updateHead vc 1000000 bc 64 eq 0 8.9297 ms/op 8.0277 ms/op 1.11
forkChoice updateHead vc 600000 bc 320 eq 0 5.3250 ms/op 4.7606 ms/op 1.12
forkChoice updateHead vc 600000 bc 1200 eq 0 6.2540 ms/op 4.7439 ms/op 1.32
forkChoice updateHead vc 600000 bc 7200 eq 0 7.0667 ms/op 5.6388 ms/op 1.25
forkChoice updateHead vc 600000 bc 64 eq 1000 14.791 ms/op 12.117 ms/op 1.22
forkChoice updateHead vc 600000 bc 64 eq 10000 14.664 ms/op 13.169 ms/op 1.11
forkChoice updateHead vc 600000 bc 64 eq 300000 20.806 ms/op 21.915 ms/op 0.95
computeDeltas 500000 validators 300 proto nodes 7.9828 ms/op 7.5134 ms/op 1.06
computeDeltas 500000 validators 1200 proto nodes 8.1779 ms/op 8.2616 ms/op 0.99
computeDeltas 500000 validators 7200 proto nodes 7.6457 ms/op 7.6798 ms/op 1.00
computeDeltas 750000 validators 300 proto nodes 11.983 ms/op 11.062 ms/op 1.08
computeDeltas 750000 validators 1200 proto nodes 12.008 ms/op 11.118 ms/op 1.08
computeDeltas 750000 validators 7200 proto nodes 11.308 ms/op 10.422 ms/op 1.09
computeDeltas 1400000 validators 300 proto nodes 22.669 ms/op 20.674 ms/op 1.10
computeDeltas 1400000 validators 1200 proto nodes 22.576 ms/op 21.141 ms/op 1.07
computeDeltas 1400000 validators 7200 proto nodes 22.403 ms/op 20.394 ms/op 1.10
computeDeltas 2100000 validators 300 proto nodes 33.765 ms/op 30.240 ms/op 1.12
computeDeltas 2100000 validators 1200 proto nodes 32.822 ms/op 30.540 ms/op 1.07
computeDeltas 2100000 validators 7200 proto nodes 32.900 ms/op 31.472 ms/op 1.05
altair processAttestation - 250000 vs - 7PWei normalcase 3.8888 ms/op 2.7128 ms/op 1.43
altair processAttestation - 250000 vs - 7PWei worstcase 5.5943 ms/op 4.9741 ms/op 1.12
altair processAttestation - setStatus - 1/6 committees join 218.24 us/op 212.32 us/op 1.03
altair processAttestation - setStatus - 1/3 committees join 368.33 us/op 388.84 us/op 0.95
altair processAttestation - setStatus - 1/2 committees join 546.00 us/op 495.79 us/op 1.10
altair processAttestation - setStatus - 2/3 committees join 681.06 us/op 609.41 us/op 1.12
altair processAttestation - setStatus - 4/5 committees join 901.87 us/op 856.35 us/op 1.05
altair processAttestation - setStatus - 100% committees join 1.1093 ms/op 1.0061 ms/op 1.10
altair processBlock - 250000 vs - 7PWei normalcase 11.747 ms/op 12.006 ms/op 0.98
altair processBlock - 250000 vs - 7PWei normalcase hashState 40.863 ms/op 36.628 ms/op 1.12
altair processBlock - 250000 vs - 7PWei worstcase 47.085 ms/op 42.875 ms/op 1.10
altair processBlock - 250000 vs - 7PWei worstcase hashState 105.37 ms/op 94.588 ms/op 1.11
phase0 processBlock - 250000 vs - 7PWei normalcase 3.7985 ms/op 2.7122 ms/op 1.40
phase0 processBlock - 250000 vs - 7PWei worstcase 40.126 ms/op 33.574 ms/op 1.20
altair processEth1Data - 250000 vs - 7PWei normalcase 822.07 us/op 692.33 us/op 1.19
getExpectedWithdrawals 250000 eb:1,eth1:1,we:0,wn:0,smpl:15 13.421 us/op 10.430 us/op 1.29
getExpectedWithdrawals 250000 eb:0.95,eth1:0.1,we:0.05,wn:0,smpl:219 98.085 us/op 72.723 us/op 1.35
getExpectedWithdrawals 250000 eb:0.95,eth1:0.3,we:0.05,wn:0,smpl:42 39.059 us/op 14.363 us/op 2.72
getExpectedWithdrawals 250000 eb:0.95,eth1:0.7,we:0.05,wn:0,smpl:18 20.360 us/op 12.732 us/op 1.60
getExpectedWithdrawals 250000 eb:0.1,eth1:0.1,we:0,wn:0,smpl:1020 265.48 us/op 173.93 us/op 1.53
getExpectedWithdrawals 250000 eb:0.03,eth1:0.03,we:0,wn:0,smpl:11777 1.6643 ms/op 1.3561 ms/op 1.23
getExpectedWithdrawals 250000 eb:0.01,eth1:0.01,we:0,wn:0,smpl:16384 2.4774 ms/op 1.9619 ms/op 1.26
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,smpl:16384 2.1511 ms/op 2.1028 ms/op 1.02
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,nocache,smpl:16384 4.3236 ms/op 4.6146 ms/op 0.94
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,smpl:16384 3.4647 ms/op 3.1841 ms/op 1.09
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,nocache,smpl:16384 9.6732 ms/op 7.4284 ms/op 1.30
Tree 40 250000 create 1.1208 s/op 830.56 ms/op 1.35
Tree 40 250000 get(125000) 261.95 ns/op 230.55 ns/op 1.14
Tree 40 250000 set(125000) 3.6538 us/op 2.6068 us/op 1.40
Tree 40 250000 toArray() 33.044 ms/op 30.503 ms/op 1.08
Tree 40 250000 iterate all - toArray() + loop 36.649 ms/op 25.474 ms/op 1.44
Tree 40 250000 iterate all - get(i) 95.913 ms/op 79.700 ms/op 1.20
MutableVector 250000 create 23.567 ms/op 18.615 ms/op 1.27
MutableVector 250000 get(125000) 8.3850 ns/op 7.0330 ns/op 1.19
MutableVector 250000 set(125000) 859.46 ns/op 714.90 ns/op 1.20
MutableVector 250000 toArray() 6.1872 ms/op 4.8762 ms/op 1.27
MutableVector 250000 iterate all - toArray() + loop 6.2705 ms/op 5.4138 ms/op 1.16
MutableVector 250000 iterate all - get(i) 1.8715 ms/op 1.6235 ms/op 1.15
Array 250000 create 5.5358 ms/op 4.3544 ms/op 1.27
Array 250000 clone - spread 6.5801 ms/op 2.2759 ms/op 2.89
Array 250000 get(125000) 3.4570 ns/op 2.5700 ns/op 1.35
Array 250000 set(125000) 7.1840 ns/op 6.2110 ns/op 1.16
Array 250000 iterate all - loop 221.79 us/op 189.85 us/op 1.17
effectiveBalanceIncrements clone Uint8Array 300000 107.31 us/op 74.795 us/op 1.43
effectiveBalanceIncrements clone MutableVector 300000 2.6010 us/op 644.00 ns/op 4.04
effectiveBalanceIncrements rw all Uint8Array 300000 281.82 us/op 219.92 us/op 1.28
effectiveBalanceIncrements rw all MutableVector 300000 261.28 ms/op 222.55 ms/op 1.17
phase0 afterProcessEpoch - 250000 vs - 7PWei 140.04 ms/op 144.81 ms/op 0.97
phase0 beforeProcessEpoch - 250000 vs - 7PWei 88.911 ms/op 54.077 ms/op 1.64
altair processEpoch - mainnet_e81889 677.34 ms/op 696.69 ms/op 0.97
mainnet_e81889 - altair beforeProcessEpoch 116.10 ms/op 131.01 ms/op 0.89
mainnet_e81889 - altair processJustificationAndFinalization 30.098 us/op 33.596 us/op 0.90
mainnet_e81889 - altair processInactivityUpdates 9.7141 ms/op 10.091 ms/op 0.96
mainnet_e81889 - altair processRewardsAndPenalties 77.732 ms/op 84.959 ms/op 0.91
mainnet_e81889 - altair processRegistryUpdates 5.8940 us/op 6.5360 us/op 0.90
mainnet_e81889 - altair processSlashings 1.0720 us/op 951.00 ns/op 1.13
mainnet_e81889 - altair processEth1DataReset 1.1910 us/op 1.1840 us/op 1.01
mainnet_e81889 - altair processEffectiveBalanceUpdates 1.7448 ms/op 2.1945 ms/op 0.80
mainnet_e81889 - altair processSlashingsReset 6.3820 us/op 8.2410 us/op 0.77
mainnet_e81889 - altair processRandaoMixesReset 10.886 us/op 12.617 us/op 0.86
mainnet_e81889 - altair processHistoricalRootsUpdate 1.3720 us/op 1.1910 us/op 1.15
mainnet_e81889 - altair processParticipationFlagUpdates 4.7670 us/op 3.2360 us/op 1.47
mainnet_e81889 - altair processSyncCommitteeUpdates 1.0880 us/op 864.00 ns/op 1.26
mainnet_e81889 - altair afterProcessEpoch 147.46 ms/op 133.21 ms/op 1.11
capella processEpoch - mainnet_e217614 3.6560 s/op 3.4680 s/op 1.05
mainnet_e217614 - capella beforeProcessEpoch 976.62 ms/op 576.65 ms/op 1.69
mainnet_e217614 - capella processJustificationAndFinalization 39.608 us/op 21.192 us/op 1.87
mainnet_e217614 - capella processInactivityUpdates 57.987 ms/op 24.678 ms/op 2.35
mainnet_e217614 - capella processRewardsAndPenalties 849.38 ms/op 532.83 ms/op 1.59
mainnet_e217614 - capella processRegistryUpdates 83.182 us/op 38.779 us/op 2.15
mainnet_e217614 - capella processSlashings 1.8530 us/op 956.00 ns/op 1.94
mainnet_e217614 - capella processEth1DataReset 1.7870 us/op 754.00 ns/op 2.37
mainnet_e217614 - capella processEffectiveBalanceUpdates 23.930 ms/op 5.9759 ms/op 4.00
mainnet_e217614 - capella processSlashingsReset 7.9240 us/op 5.2140 us/op 1.52
mainnet_e217614 - capella processRandaoMixesReset 12.322 us/op 8.4150 us/op 1.46
mainnet_e217614 - capella processHistoricalRootsUpdate 1.4780 us/op 1.1180 us/op 1.32
mainnet_e217614 - capella processParticipationFlagUpdates 6.6020 us/op 4.6680 us/op 1.41
mainnet_e217614 - capella afterProcessEpoch 407.30 ms/op 331.76 ms/op 1.23
phase0 processEpoch - mainnet_e58758 649.61 ms/op 488.76 ms/op 1.33
mainnet_e58758 - phase0 beforeProcessEpoch 276.41 ms/op 162.76 ms/op 1.70
mainnet_e58758 - phase0 processJustificationAndFinalization 32.455 us/op 22.349 us/op 1.45
mainnet_e58758 - phase0 processRewardsAndPenalties 68.352 ms/op 66.732 ms/op 1.02
mainnet_e58758 - phase0 processRegistryUpdates 19.422 us/op 22.821 us/op 0.85
mainnet_e58758 - phase0 processSlashings 1.2360 us/op 831.00 ns/op 1.49
mainnet_e58758 - phase0 processEth1DataReset 860.00 ns/op 1.0260 us/op 0.84
mainnet_e58758 - phase0 processEffectiveBalanceUpdates 1.7578 ms/op 1.9292 ms/op 0.91
mainnet_e58758 - phase0 processSlashingsReset 6.8800 us/op 6.9510 us/op 0.99
mainnet_e58758 - phase0 processRandaoMixesReset 9.0010 us/op 9.9830 us/op 0.90
mainnet_e58758 - phase0 processHistoricalRootsUpdate 1.4300 us/op 1.0800 us/op 1.32
mainnet_e58758 - phase0 processParticipationRecordUpdates 8.5640 us/op 9.7010 us/op 0.88
mainnet_e58758 - phase0 afterProcessEpoch 124.97 ms/op 114.43 ms/op 1.09
phase0 processEffectiveBalanceUpdates - 250000 normalcase 1.9272 ms/op 2.3909 ms/op 0.81
phase0 processEffectiveBalanceUpdates - 250000 worstcase 0.5 1.8778 ms/op 2.7490 ms/op 0.68
altair processInactivityUpdates - 250000 normalcase 41.783 ms/op 41.049 ms/op 1.02
altair processInactivityUpdates - 250000 worstcase 35.190 ms/op 42.925 ms/op 0.82
phase0 processRegistryUpdates - 250000 normalcase 12.643 us/op 25.903 us/op 0.49
phase0 processRegistryUpdates - 250000 badcase_full_deposits 564.25 us/op 689.67 us/op 0.82
phase0 processRegistryUpdates - 250000 worstcase 0.5 211.58 ms/op 228.58 ms/op 0.93
altair processRewardsAndPenalties - 250000 normalcase 83.635 ms/op 68.078 ms/op 1.23
altair processRewardsAndPenalties - 250000 worstcase 71.247 ms/op 77.278 ms/op 0.92
phase0 getAttestationDeltas - 250000 normalcase 13.470 ms/op 13.321 ms/op 1.01
phase0 getAttestationDeltas - 250000 worstcase 14.903 ms/op 13.035 ms/op 1.14
phase0 processSlashings - 250000 worstcase 119.55 us/op 140.96 us/op 0.85
altair processSyncCommitteeUpdates - 250000 190.23 ms/op 181.79 ms/op 1.05
BeaconState.hashTreeRoot - No change 742.00 ns/op 832.00 ns/op 0.89
BeaconState.hashTreeRoot - 1 full validator 157.10 us/op 170.18 us/op 0.92
BeaconState.hashTreeRoot - 32 full validator 1.4057 ms/op 1.9683 ms/op 0.71
BeaconState.hashTreeRoot - 512 full validator 21.285 ms/op 20.288 ms/op 1.05
BeaconState.hashTreeRoot - 1 validator.effectiveBalance 196.27 us/op 194.69 us/op 1.01
BeaconState.hashTreeRoot - 32 validator.effectiveBalance 2.5198 ms/op 2.7560 ms/op 0.91
BeaconState.hashTreeRoot - 512 validator.effectiveBalance 45.234 ms/op 39.202 ms/op 1.15
BeaconState.hashTreeRoot - 1 balances 164.82 us/op 181.48 us/op 0.91
BeaconState.hashTreeRoot - 32 balances 1.4232 ms/op 1.8353 ms/op 0.78
BeaconState.hashTreeRoot - 512 balances 15.539 ms/op 17.283 ms/op 0.90
BeaconState.hashTreeRoot - 250000 balances 218.93 ms/op 268.58 ms/op 0.82
aggregationBits - 2048 els - zipIndexesInBitList 21.399 us/op 28.436 us/op 0.75
byteArrayEquals 32 80.438 ns/op 80.230 ns/op 1.00
Buffer.compare 32 61.450 ns/op 59.680 ns/op 1.03
byteArrayEquals 1024 2.1998 us/op 2.4619 us/op 0.89
Buffer.compare 1024 76.085 ns/op 76.744 ns/op 0.99
byteArrayEquals 16384 35.677 us/op 40.569 us/op 0.88
Buffer.compare 16384 296.93 ns/op 294.93 ns/op 1.01
byteArrayEquals 123687377 286.83 ms/op 264.93 ms/op 1.08
Buffer.compare 123687377 14.007 ms/op 9.8345 ms/op 1.42
byteArrayEquals 32 - diff last byte 109.31 ns/op 83.283 ns/op 1.31
Buffer.compare 32 - diff last byte 69.857 ns/op 60.758 ns/op 1.15
byteArrayEquals 1024 - diff last byte 2.2970 us/op 2.1176 us/op 1.08
Buffer.compare 1024 - diff last byte 85.219 ns/op 76.146 ns/op 1.12
byteArrayEquals 16384 - diff last byte 41.505 us/op 34.723 us/op 1.20
Buffer.compare 16384 - diff last byte 354.37 ns/op 292.00 ns/op 1.21
byteArrayEquals 123687377 - diff last byte 288.74 ms/op 279.17 ms/op 1.03
Buffer.compare 123687377 - diff last byte 10.196 ms/op 12.230 ms/op 0.83
byteArrayEquals 32 - random bytes 7.3880 ns/op 7.0680 ns/op 1.05
Buffer.compare 32 - random bytes 73.262 ns/op 68.712 ns/op 1.07
byteArrayEquals 1024 - random bytes 7.3630 ns/op 6.9350 ns/op 1.06
Buffer.compare 1024 - random bytes 79.178 ns/op 67.521 ns/op 1.17
byteArrayEquals 16384 - random bytes 7.8270 ns/op 7.2940 ns/op 1.07
Buffer.compare 16384 - random bytes 74.029 ns/op 65.389 ns/op 1.13
byteArrayEquals 123687377 - random bytes 19.710 ns/op 10.460 ns/op 1.88
Buffer.compare 123687377 - random bytes 97.550 ns/op 83.810 ns/op 1.16
regular array get 100000 times 52.880 us/op 48.780 us/op 1.08
wrappedArray get 100000 times 57.595 us/op 48.566 us/op 1.19
arrayWithProxy get 100000 times 18.904 ms/op 14.897 ms/op 1.27
ssz.Root.equals 70.188 ns/op 56.826 ns/op 1.24
byteArrayEquals 70.170 ns/op 56.422 ns/op 1.24
Buffer.compare 14.142 ns/op 12.636 ns/op 1.12
shuffle list - 16384 els 8.1554 ms/op 7.4680 ms/op 1.09
shuffle list - 250000 els 119.30 ms/op 111.49 ms/op 1.07
processSlot - 1 slots 31.145 us/op 19.537 us/op 1.59
processSlot - 32 slots 5.2895 ms/op 4.3820 ms/op 1.21
getEffectiveBalanceIncrementsZeroInactive - 250000 vs - 7PWei 78.048 ms/op 64.649 ms/op 1.21
getCommitteeAssignments - req 1 vs - 250000 vc 3.1123 ms/op 2.7683 ms/op 1.12
getCommitteeAssignments - req 100 vs - 250000 vc 4.8305 ms/op 3.8945 ms/op 1.24
getCommitteeAssignments - req 1000 vs - 250000 vc 5.6170 ms/op 4.3041 ms/op 1.31
findModifiedValidators - 10000 modified validators 779.84 ms/op 572.33 ms/op 1.36
findModifiedValidators - 1000 modified validators 528.32 ms/op 478.97 ms/op 1.10
findModifiedValidators - 100 modified validators 497.87 ms/op 545.89 ms/op 0.91
findModifiedValidators - 10 modified validators 485.95 ms/op 513.32 ms/op 0.95
findModifiedValidators - 1 modified validators 447.65 ms/op 491.18 ms/op 0.91
findModifiedValidators - no difference 472.93 ms/op 491.96 ms/op 0.96
compare ViewDUs 4.7629 s/op 5.1229 s/op 0.93
compare each validator Uint8Array 2.0070 s/op 2.0263 s/op 0.99
compare ViewDU to Uint8Array 1.4774 s/op 1.5932 s/op 0.93
migrate state 1000000 validators, 24 modified, 0 new 976.89 ms/op 1.0353 s/op 0.94
migrate state 1000000 validators, 1700 modified, 1000 new 1.3146 s/op 1.3377 s/op 0.98
migrate state 1000000 validators, 3400 modified, 2000 new 1.4959 s/op 1.6171 s/op 0.93
migrate state 1500000 validators, 24 modified, 0 new 921.84 ms/op 1.0201 s/op 0.90
migrate state 1500000 validators, 1700 modified, 1000 new 1.5183 s/op 1.2659 s/op 1.20
migrate state 1500000 validators, 3400 modified, 2000 new 1.5156 s/op 1.6838 s/op 0.90
RootCache.getBlockRootAtSlot - 250000 vs - 7PWei 4.8000 ns/op 4.9600 ns/op 0.97
state getBlockRootAtSlot - 250000 vs - 7PWei 613.58 ns/op 963.42 ns/op 0.64
computeProposers - vc 250000 9.8579 ms/op 11.647 ms/op 0.85
computeEpochShuffling - vc 250000 115.72 ms/op 112.52 ms/op 1.03
getNextSyncCommittee - vc 250000 162.35 ms/op 185.56 ms/op 0.87
computeSigningRoot for AttestationData 29.933 us/op 32.016 us/op 0.93
hash AttestationData serialized data then Buffer.toString(base64) 2.4138 us/op 2.4480 us/op 0.99
toHexString serialized data 1.2025 us/op 1.4097 us/op 0.85
Buffer.toString(base64) 236.01 ns/op 258.19 ns/op 0.91

by benchmarkbot/action

@@ -5,6 +5,7 @@
*/
async function wrappedFetch(url: string | URL, init?: RequestInit): Promise<Response> {
try {
// eslint-disable-next-line no-restricted-globals
Copy link
Contributor

Choose a reason for hiding this comment

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

Please add a comment here which explains why disabling this rule is important here. I believe that's the only place we need to use native fetch.

Copy link
Member Author

Choose a reason for hiding this comment

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

I added a comment but obviously the function can't call itself, so I thought it is kinda self explanatory here

@nazarhussain nazarhussain merged commit 6ad9740 into unstable Feb 29, 2024
20 checks passed
@nazarhussain nazarhussain deleted the nflaig/restrict-global-fetch branch February 29, 2024 15:03
@wemeetagain
Copy link
Member

🎉 This PR is included in v1.17.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.

3 participants