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: update rimraf imports to fix eslint warnings #5518

Merged
merged 1 commit into from May 23, 2023

Conversation

nflaig
Copy link
Member

@nflaig nflaig commented May 22, 2023

Motivation

Current rimraf imports are inconsistent and cause a lot of noisy eslint warnings

2:8  warning  Using exported name 'rimraf' as identifier for default export  import/no-named-as-default
16:3  warning  Unexpected use of Mocha `before` hook outside of a test suite  mocha/no-top-level-hooks

Description

Update rimraf imports to be consistent and fix eslint warnings

@nflaig nflaig requested a review from a team as a code owner May 22, 2023 12:24
@github-actions
Copy link
Contributor

Performance Report

✔️ no performance regression detected

Full benchmark results
Benchmark suite Current: 646f5dd Previous: 402c46f Ratio
getPubkeys - index2pubkey - req 1000 vs - 250000 vc 583.27 us/op 538.02 us/op 1.08
getPubkeys - validatorsArr - req 1000 vs - 250000 vc 49.441 us/op 46.888 us/op 1.05
BLS verify - blst-native 1.2646 ms/op 1.2840 ms/op 0.98
BLS verifyMultipleSignatures 3 - blst-native 2.5827 ms/op 2.5627 ms/op 1.01
BLS verifyMultipleSignatures 8 - blst-native 5.5253 ms/op 5.7667 ms/op 0.96
BLS verifyMultipleSignatures 32 - blst-native 20.168 ms/op 20.371 ms/op 0.99
BLS aggregatePubkeys 32 - blst-native 26.949 us/op 26.720 us/op 1.01
BLS aggregatePubkeys 128 - blst-native 105.18 us/op 104.01 us/op 1.01
getAttestationsForBlock 63.010 ms/op 60.285 ms/op 1.05
isKnown best case - 1 super set check 264.00 ns/op 283.00 ns/op 0.93
isKnown normal case - 2 super set checks 261.00 ns/op 276.00 ns/op 0.95
isKnown worse case - 16 super set checks 257.00 ns/op 272.00 ns/op 0.94
CheckpointStateCache - add get delete 5.8950 us/op 5.1070 us/op 1.15
validate gossip signedAggregateAndProof - struct 2.8536 ms/op 2.8112 ms/op 1.02
validate gossip attestation - struct 1.5174 ms/op 1.3523 ms/op 1.12
pickEth1Vote - no votes 1.4579 ms/op 1.2675 ms/op 1.15
pickEth1Vote - max votes 11.321 ms/op 11.364 ms/op 1.00
pickEth1Vote - Eth1Data hashTreeRoot value x2048 9.5521 ms/op 9.3008 ms/op 1.03
pickEth1Vote - Eth1Data hashTreeRoot tree x2048 17.607 ms/op 19.063 ms/op 0.92
pickEth1Vote - Eth1Data fastSerialize value x2048 736.14 us/op 703.60 us/op 1.05
pickEth1Vote - Eth1Data fastSerialize tree x2048 8.2742 ms/op 8.4191 ms/op 0.98
bytes32 toHexString 697.00 ns/op 541.00 ns/op 1.29
bytes32 Buffer.toString(hex) 422.00 ns/op 360.00 ns/op 1.17
bytes32 Buffer.toString(hex) from Uint8Array 658.00 ns/op 571.00 ns/op 1.15
bytes32 Buffer.toString(hex) + 0x 431.00 ns/op 365.00 ns/op 1.18
Object access 1 prop 0.19500 ns/op 0.17000 ns/op 1.15
Map access 1 prop 0.16900 ns/op 0.16400 ns/op 1.03
Object get x1000 7.9250 ns/op 7.7710 ns/op 1.02
Map get x1000 0.70600 ns/op 0.62700 ns/op 1.13
Object set x1000 72.646 ns/op 54.890 ns/op 1.32
Map set x1000 52.590 ns/op 44.222 ns/op 1.19
Return object 10000 times 0.27270 ns/op 0.23740 ns/op 1.15
Throw Error 10000 times 4.5286 us/op 4.3994 us/op 1.03
fastMsgIdFn sha256 / 200 bytes 3.6730 us/op 3.4960 us/op 1.05
fastMsgIdFn h32 xxhash / 200 bytes 315.00 ns/op 285.00 ns/op 1.11
fastMsgIdFn h64 xxhash / 200 bytes 445.00 ns/op 403.00 ns/op 1.10
fastMsgIdFn sha256 / 1000 bytes 12.205 us/op 12.154 us/op 1.00
fastMsgIdFn h32 xxhash / 1000 bytes 456.00 ns/op 416.00 ns/op 1.10
fastMsgIdFn h64 xxhash / 1000 bytes 560.00 ns/op 480.00 ns/op 1.17
fastMsgIdFn sha256 / 10000 bytes 109.15 us/op 110.00 us/op 0.99
fastMsgIdFn h32 xxhash / 10000 bytes 2.1030 us/op 1.9050 us/op 1.10
fastMsgIdFn h64 xxhash / 10000 bytes 1.5000 us/op 1.3590 us/op 1.10
enrSubnets - fastDeserialize 64 bits 1.6430 us/op 1.4700 us/op 1.12
enrSubnets - ssz BitVector 64 bits 605.00 ns/op 528.00 ns/op 1.15
enrSubnets - fastDeserialize 4 bits 208.00 ns/op 187.00 ns/op 1.11
enrSubnets - ssz BitVector 4 bits 601.00 ns/op 531.00 ns/op 1.13
prioritizePeers score -10:0 att 32-0.1 sync 2-0 121.27 us/op 132.47 us/op 0.92
prioritizePeers score 0:0 att 32-0.25 sync 2-0.25 165.59 us/op 155.23 us/op 1.07
prioritizePeers score 0:0 att 32-0.5 sync 2-0.5 204.70 us/op 185.78 us/op 1.10
prioritizePeers score 0:0 att 64-0.75 sync 4-0.75 388.26 us/op 347.10 us/op 1.12
prioritizePeers score 0:0 att 64-1 sync 4-1 451.71 us/op 423.08 us/op 1.07
array of 16000 items push then shift 1.8556 us/op 1.8020 us/op 1.03
LinkedList of 16000 items push then shift 11.429 ns/op 9.3190 ns/op 1.23
array of 16000 items push then pop 116.22 ns/op 103.91 ns/op 1.12
LinkedList of 16000 items push then pop 9.4440 ns/op 9.2920 ns/op 1.02
array of 24000 items push then shift 2.4808 us/op 2.5588 us/op 0.97
LinkedList of 24000 items push then shift 9.3620 ns/op 10.657 ns/op 0.88
array of 24000 items push then pop 91.449 ns/op 90.347 ns/op 1.01
LinkedList of 24000 items push then pop 9.0700 ns/op 9.1430 ns/op 0.99
intersect bitArray bitLen 8 18.882 ns/op 14.387 ns/op 1.31
intersect array and set length 8 92.672 ns/op 80.082 ns/op 1.16
intersect bitArray bitLen 128 65.598 ns/op 47.058 ns/op 1.39
intersect array and set length 128 1.3270 us/op 1.1052 us/op 1.20
Buffer.concat 32 items 3.2010 us/op 2.7820 us/op 1.15
Uint8Array.set 32 items 2.4360 us/op 3.3110 us/op 0.74
pass gossip attestations to forkchoice per slot 3.0084 ms/op 3.0591 ms/op 0.98
computeDeltas 3.1635 ms/op 3.6506 ms/op 0.87
computeProposerBoostScoreFromBalances 1.8469 ms/op 1.9103 ms/op 0.97
altair processAttestation - 250000 vs - 7PWei normalcase 2.2333 ms/op 2.5318 ms/op 0.88
altair processAttestation - 250000 vs - 7PWei worstcase 3.4505 ms/op 4.2942 ms/op 0.80
altair processAttestation - setStatus - 1/6 committees join 146.49 us/op 150.22 us/op 0.98
altair processAttestation - setStatus - 1/3 committees join 297.34 us/op 297.90 us/op 1.00
altair processAttestation - setStatus - 1/2 committees join 381.87 us/op 396.41 us/op 0.96
altair processAttestation - setStatus - 2/3 committees join 482.44 us/op 495.11 us/op 0.97
altair processAttestation - setStatus - 4/5 committees join 660.05 us/op 697.61 us/op 0.95
altair processAttestation - setStatus - 100% committees join 778.59 us/op 802.53 us/op 0.97
altair processBlock - 250000 vs - 7PWei normalcase 27.165 ms/op 20.020 ms/op 1.36
altair processBlock - 250000 vs - 7PWei normalcase hashState 48.972 ms/op 29.547 ms/op 1.66
altair processBlock - 250000 vs - 7PWei worstcase 81.048 ms/op 61.079 ms/op 1.33
altair processBlock - 250000 vs - 7PWei worstcase hashState 100.60 ms/op 82.583 ms/op 1.22
phase0 processBlock - 250000 vs - 7PWei normalcase 3.5435 ms/op 1.9907 ms/op 1.78
phase0 processBlock - 250000 vs - 7PWei worstcase 47.259 ms/op 29.550 ms/op 1.60
altair processEth1Data - 250000 vs - 7PWei normalcase 773.30 us/op 491.20 us/op 1.57
vc - 250000 eb 1 eth1 1 we 0 wn 0 - smpl 15 11.579 us/op 6.6270 us/op 1.75
vc - 250000 eb 0.95 eth1 0.1 we 0.05 wn 0 - smpl 219 27.993 us/op 32.558 us/op 0.86
vc - 250000 eb 0.95 eth1 0.3 we 0.05 wn 0 - smpl 42 12.106 us/op 9.8520 us/op 1.23
vc - 250000 eb 0.95 eth1 0.7 we 0.05 wn 0 - smpl 18 8.9140 us/op 7.9560 us/op 1.12
vc - 250000 eb 0.1 eth1 0.1 we 0 wn 0 - smpl 1020 116.08 us/op 106.86 us/op 1.09
vc - 250000 eb 0.03 eth1 0.03 we 0 wn 0 - smpl 11777 700.81 us/op 1.0674 ms/op 0.66
vc - 250000 eb 0.01 eth1 0.01 we 0 wn 0 - smpl 16384 929.88 us/op 1.3692 ms/op 0.68
vc - 250000 eb 0 eth1 0 we 0 wn 0 - smpl 16384 919.96 us/op 1.6843 ms/op 0.55
vc - 250000 eb 0 eth1 0 we 0 wn 0 nocache - smpl 16384 2.5460 ms/op 2.2918 ms/op 1.11
vc - 250000 eb 0 eth1 1 we 0 wn 0 - smpl 16384 1.7854 ms/op 1.9564 ms/op 0.91
vc - 250000 eb 0 eth1 1 we 0 wn 0 nocache - smpl 16384 4.3400 ms/op 3.9485 ms/op 1.10
Tree 40 250000 create 367.34 ms/op 362.63 ms/op 1.01
Tree 40 250000 get(125000) 203.55 ns/op 205.38 ns/op 0.99
Tree 40 250000 set(125000) 1.6953 us/op 1.0223 us/op 1.66
Tree 40 250000 toArray() 29.879 ms/op 23.395 ms/op 1.28
Tree 40 250000 iterate all - toArray() + loop 29.179 ms/op 23.508 ms/op 1.24
Tree 40 250000 iterate all - get(i) 85.538 ms/op 79.218 ms/op 1.08
MutableVector 250000 create 15.193 ms/op 11.464 ms/op 1.33
MutableVector 250000 get(125000) 9.2680 ns/op 7.3000 ns/op 1.27
MutableVector 250000 set(125000) 498.87 ns/op 291.12 ns/op 1.71
MutableVector 250000 toArray() 4.4113 ms/op 2.9808 ms/op 1.48
MutableVector 250000 iterate all - toArray() + loop 4.6325 ms/op 4.0881 ms/op 1.13
MutableVector 250000 iterate all - get(i) 1.9803 ms/op 1.7181 ms/op 1.15
Array 250000 create 3.9580 ms/op 3.1401 ms/op 1.26
Array 250000 clone - spread 1.5377 ms/op 1.1597 ms/op 1.33
Array 250000 get(125000) 1.1150 ns/op 0.57100 ns/op 1.95
Array 250000 set(125000) 1.1190 ns/op 0.65400 ns/op 1.71
Array 250000 iterate all - loop 112.50 us/op 86.237 us/op 1.30
effectiveBalanceIncrements clone Uint8Array 300000 59.668 us/op 36.489 us/op 1.64
effectiveBalanceIncrements clone MutableVector 300000 493.00 ns/op 357.00 ns/op 1.38
effectiveBalanceIncrements rw all Uint8Array 300000 263.42 us/op 190.30 us/op 1.38
effectiveBalanceIncrements rw all MutableVector 300000 170.84 ms/op 84.220 ms/op 2.03
phase0 afterProcessEpoch - 250000 vs - 7PWei 141.48 ms/op 125.87 ms/op 1.12
phase0 beforeProcessEpoch - 250000 vs - 7PWei 60.104 ms/op 45.726 ms/op 1.31
altair processEpoch - mainnet_e81889 390.36 ms/op 354.80 ms/op 1.10
mainnet_e81889 - altair beforeProcessEpoch 88.582 ms/op 70.077 ms/op 1.26
mainnet_e81889 - altair processJustificationAndFinalization 34.574 us/op 18.386 us/op 1.88
mainnet_e81889 - altair processInactivityUpdates 8.2422 ms/op 5.9956 ms/op 1.37
mainnet_e81889 - altair processRewardsAndPenalties 79.399 ms/op 73.829 ms/op 1.08
mainnet_e81889 - altair processRegistryUpdates 6.2860 us/op 3.3790 us/op 1.86
mainnet_e81889 - altair processSlashings 1.3150 us/op 584.00 ns/op 2.25
mainnet_e81889 - altair processEth1DataReset 1.7180 us/op 659.00 ns/op 2.61
mainnet_e81889 - altair processEffectiveBalanceUpdates 2.9210 ms/op 1.5996 ms/op 1.83
mainnet_e81889 - altair processSlashingsReset 8.9280 us/op 4.9610 us/op 1.80
mainnet_e81889 - altair processRandaoMixesReset 11.690 us/op 9.9240 us/op 1.18
mainnet_e81889 - altair processHistoricalRootsUpdate 2.4640 us/op 1.6410 us/op 1.50
mainnet_e81889 - altair processParticipationFlagUpdates 6.4710 us/op 2.9730 us/op 2.18
mainnet_e81889 - altair processSyncCommitteeUpdates 1.6090 us/op 1.0110 us/op 1.59
mainnet_e81889 - altair afterProcessEpoch 164.37 ms/op 138.14 ms/op 1.19
phase0 processEpoch - mainnet_e58758 465.32 ms/op 420.21 ms/op 1.11
mainnet_e58758 - phase0 beforeProcessEpoch 167.55 ms/op 170.01 ms/op 0.99
mainnet_e58758 - phase0 processJustificationAndFinalization 35.171 us/op 17.118 us/op 2.05
mainnet_e58758 - phase0 processRewardsAndPenalties 66.567 ms/op 77.875 ms/op 0.85
mainnet_e58758 - phase0 processRegistryUpdates 16.344 us/op 12.271 us/op 1.33
mainnet_e58758 - phase0 processSlashings 1.3800 us/op 943.00 ns/op 1.46
mainnet_e58758 - phase0 processEth1DataReset 1.4800 us/op 940.00 ns/op 1.57
mainnet_e58758 - phase0 processEffectiveBalanceUpdates 2.0043 ms/op 1.8743 ms/op 1.07
mainnet_e58758 - phase0 processSlashingsReset 8.0520 us/op 6.1960 us/op 1.30
mainnet_e58758 - phase0 processRandaoMixesReset 11.925 us/op 6.7240 us/op 1.77
mainnet_e58758 - phase0 processHistoricalRootsUpdate 1.8370 us/op 1.0680 us/op 1.72
mainnet_e58758 - phase0 processParticipationRecordUpdates 13.131 us/op 5.4060 us/op 2.43
mainnet_e58758 - phase0 afterProcessEpoch 118.82 ms/op 103.73 ms/op 1.15
phase0 processEffectiveBalanceUpdates - 250000 normalcase 2.8734 ms/op 2.0270 ms/op 1.42
phase0 processEffectiveBalanceUpdates - 250000 worstcase 0.5 2.3332 ms/op 2.7191 ms/op 0.86
altair processInactivityUpdates - 250000 normalcase 35.797 ms/op 32.460 ms/op 1.10
altair processInactivityUpdates - 250000 worstcase 31.156 ms/op 31.045 ms/op 1.00
phase0 processRegistryUpdates - 250000 normalcase 15.810 us/op 10.862 us/op 1.46
phase0 processRegistryUpdates - 250000 badcase_full_deposits 348.59 us/op 313.32 us/op 1.11
phase0 processRegistryUpdates - 250000 worstcase 0.5 163.85 ms/op 149.98 ms/op 1.09
altair processRewardsAndPenalties - 250000 normalcase 65.681 ms/op 73.676 ms/op 0.89
altair processRewardsAndPenalties - 250000 worstcase 66.659 ms/op 77.709 ms/op 0.86
phase0 getAttestationDeltas - 250000 normalcase 8.7503 ms/op 6.9273 ms/op 1.26
phase0 getAttestationDeltas - 250000 worstcase 11.847 ms/op 7.2137 ms/op 1.64
phase0 processSlashings - 250000 worstcase 5.2948 ms/op 3.7554 ms/op 1.41
altair processSyncCommitteeUpdates - 250000 212.05 ms/op 177.67 ms/op 1.19
BeaconState.hashTreeRoot - No change 324.00 ns/op 275.00 ns/op 1.18
BeaconState.hashTreeRoot - 1 full validator 61.498 us/op 74.442 us/op 0.83
BeaconState.hashTreeRoot - 32 full validator 725.26 us/op 620.91 us/op 1.17
BeaconState.hashTreeRoot - 512 full validator 6.6639 ms/op 5.2543 ms/op 1.27
BeaconState.hashTreeRoot - 1 validator.effectiveBalance 77.697 us/op 74.045 us/op 1.05
BeaconState.hashTreeRoot - 32 validator.effectiveBalance 1.1792 ms/op 953.91 us/op 1.24
BeaconState.hashTreeRoot - 512 validator.effectiveBalance 19.425 ms/op 14.303 ms/op 1.36
BeaconState.hashTreeRoot - 1 balances 61.337 us/op 52.647 us/op 1.17
BeaconState.hashTreeRoot - 32 balances 626.67 us/op 542.19 us/op 1.16
BeaconState.hashTreeRoot - 512 balances 6.0148 ms/op 4.9071 ms/op 1.23
BeaconState.hashTreeRoot - 250000 balances 102.52 ms/op 81.205 ms/op 1.26
aggregationBits - 2048 els - zipIndexesInBitList 30.151 us/op 16.642 us/op 1.81
regular array get 100000 times 45.745 us/op 32.763 us/op 1.40
wrappedArray get 100000 times 53.827 us/op 33.872 us/op 1.59
arrayWithProxy get 100000 times 19.445 ms/op 16.357 ms/op 1.19
ssz.Root.equals 793.00 ns/op 573.00 ns/op 1.38
byteArrayEquals 910.00 ns/op 571.00 ns/op 1.59
shuffle list - 16384 els 8.5992 ms/op 7.1891 ms/op 1.20
shuffle list - 250000 els 135.46 ms/op 105.30 ms/op 1.29
processSlot - 1 slots 12.244 us/op 9.4630 us/op 1.29
processSlot - 32 slots 1.5919 ms/op 1.4061 ms/op 1.13
getEffectiveBalanceIncrementsZeroInactive - 250000 vs - 7PWei 44.882 ms/op 41.560 ms/op 1.08
getCommitteeAssignments - req 1 vs - 250000 vc 3.5789 ms/op 3.1148 ms/op 1.15
getCommitteeAssignments - req 100 vs - 250000 vc 4.9064 ms/op 4.3136 ms/op 1.14
getCommitteeAssignments - req 1000 vs - 250000 vc 5.3199 ms/op 4.7387 ms/op 1.12
RootCache.getBlockRootAtSlot - 250000 vs - 7PWei 6.7700 ns/op 5.3000 ns/op 1.28
state getBlockRootAtSlot - 250000 vs - 7PWei 1.0750 us/op 943.93 ns/op 1.14
computeProposers - vc 250000 12.983 ms/op 10.583 ms/op 1.23
computeEpochShuffling - vc 250000 129.38 ms/op 104.16 ms/op 1.24
getNextSyncCommittee - vc 250000 208.31 ms/op 188.50 ms/op 1.11
computeSigningRoot for AttestationData 16.829 us/op 13.349 us/op 1.26
hash AttestationData serialized data then Buffer.toString(base64) 2.7706 us/op 2.4202 us/op 1.14
toHexString serialized data 2.2114 us/op 1.0795 us/op 2.05
Buffer.toString(base64) 462.70 ns/op 320.34 ns/op 1.44

by benchmarkbot/action

@nflaig nflaig merged commit 0b9ad0b into unstable May 23, 2023
11 checks passed
@nflaig nflaig deleted the nflaig/rimraf-imports branch May 23, 2023 21:01
@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.

None yet

3 participants