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

Remove unnecessary I prefix interfaces #5145

Merged
merged 5 commits into from
Feb 20, 2023
Merged

Conversation

dapplion
Copy link
Contributor

@dapplion dapplion commented Feb 14, 2023

Motivation

Description

Almost all changes are performed automatically with script below. Non script changes:

  • Remove 2 unused interfaces
  • Rename duplicate type Logger imported from winston
#!/bin/bash

# Removes all unnecessary uses of `interface IType`, replacing them for `type Type`
# Skips instances with there's some class that already exists with name Type
# Note: this script takes multiple minutes to execute, and modifies hundreds of files

LODESTAR_DIRECTORY="/home/lion/Code/eth2.0/lodestar"
SRC_DIRECTORY="$LODESTAR_DIRECTORY/packages"

items=$(find "$SRC_DIRECTORY" -name "*.ts" -type f -exec grep -H "interface I" {} \; \
  | sed -E 's/^.+interface[[:space:]]+([[:alnum:]]+).+$/\1/g' \
  | sort -u)

echo Found matches: $items

for item in $items
do
  item_no_prefix=${item:1}  # remove first character
  
  if grep -rl "class $item_no_prefix" --include \*.ts $SRC_DIRECTORY >/dev/null; then
    echo "File(s) containing 'class $item_no_prefix' found, skipping changes for $item"
  else
    echo "replacing $item"
    find "$SRC_DIRECTORY" -name "*.ts" -type f -exec sed -i "s/interface[[:space:]]\+$item[[:space:]]*{/type $item_no_prefix = {/g" {} \;
    find "$SRC_DIRECTORY" -name "*.ts" -type f -exec sed -i "s/$item/$item_no_prefix/g" {} \;
  fi
done

# Format with prettier to add ; to type declarations

$LODESTAR_DIRECTORY/node_modules/.bin/prettier "$SRC_DIRECTORY/**/*.ts" --write

The script output is


Found matches IApiArgs IApiOptions IAttesterStatus IAttnetsService IBatchDepositEvents IBeaconChain IBeaconChainLc IBeaconClock IBeaconDb IBeaconExtraArgs IBeaconNodeInitModules IBeaconNodeModules IBeaconNodeOptions IBeaconParamsArgs IBeaconPaths IBeaconStateTransitionMetrics IBeaconSync IBlockFilterOptions IBlockProposerData IBlsVerifier ICachedGenesis IChainArgs ICliCommand IClock ICounter IDatabaseApiOptions IDatabaseController IDatabaseOptions IDiscv5Events IDistanceEntry IDownloadGenericTestsOptions IDownloadTestsOptions IENRArgs IEpochShuffling IEth1Args IEth1DataWithTimestamp IEth1ForBlockProduction IEth1Provider IEth1Streamer IEthJsonRpcReturnTypes IExecutionBuilder IExecutionEngine IExportArgs IFilterOptions IForkChoice IForkChoiceStore IForkConfig IForkDigestContext IForkInfo IGauge IGenesisBuilder IGenesisBuilderKwargs IGenesisResult IGlobalPaths IGlobalSingleArgs IGossipEvents IGossipModules IGossipTopic IGossipTopicCache IHistogram IHttpClient IImportArgs IIndexAttestationData IInterchangeCompleteV4 IInterchangeLodestar IInterchangeV5 IJsonRpcBackend IJsonRpcHttpClient IKeyValue ILevelDbControllerMetrics ILevelDBOptions ILibp2pOptions ILightClientStore ILogArgs ILogger ILoggerOptions IMarkdownSection IMetadataModules IMetadataOpts IMetricsArgs IMinMaxSurround IMockChainParams InboundRateLimitQuota INetwork INetworkArgs INetworkInitModules INetworkModules INetworkOptions InstanceCodeOptions IPeerRpcScoreStore IPeerRpcScoreStoreModules IPeerSummary IPersistedKeysBackend IProof IQueueMetrics IReadonlyEpochShuffling IReqRespBeaconNode IRequestErrorMetadata IRewardPenaltyItem IRpcPayload IRpcResponse IRpcResponseError ISignedBLStoExecutionChange ISignedVoluntaryExitData ISimpleCase ISimpleStruct ISlashingProtection ISlotRange ISpecTestOptions IStateRegenerator ISubnetsService ISyncArgs ISyncCommitteeJob ISyncModule ISyncModules ITestCase IUncompressState IUser IValidatorEvents IValidatorGeneratorOpts IValidatorMonitor IWinstonInfoArg
replacing IApiArgs
replacing IApiOptions
replacing IAttesterStatus
File(s) containing 'class AttnetsService' found, skipping changes for IAttnetsService
replacing IBatchDepositEvents
File(s) containing 'class BeaconChain' found, skipping changes for IBeaconChain
File(s) containing 'class BeaconChainLc' found, skipping changes for IBeaconChainLc
replacing IBeaconClock
File(s) containing 'class BeaconDb' found, skipping changes for IBeaconDb
replacing IBeaconExtraArgs
replacing IBeaconNodeInitModules
replacing IBeaconNodeModules
File(s) containing 'class BeaconNodeOptions' found, skipping changes for IBeaconNodeOptions
replacing IBeaconParamsArgs
replacing IBeaconPaths
replacing IBeaconStateTransitionMetrics
File(s) containing 'class BeaconSync' found, skipping changes for IBeaconSync
replacing IBlockFilterOptions
replacing IBlockProposerData
File(s) containing 'class BlsVerifier' found, skipping changes for IBlsVerifier
replacing ICachedGenesis
replacing IChainArgs
replacing ICliCommand
File(s) containing 'class Clock' found, skipping changes for IClock
replacing ICounter
replacing IDatabaseApiOptions
replacing IDatabaseController
replacing IDatabaseOptions
replacing IDiscv5Events
replacing IDistanceEntry
replacing IDownloadGenericTestsOptions
replacing IDownloadTestsOptions
replacing IENRArgs
replacing IEpochShuffling
replacing IEth1Args
replacing IEth1DataWithTimestamp
File(s) containing 'class Eth1ForBlockProduction' found, skipping changes for IEth1ForBlockProduction
File(s) containing 'class Eth1Provider' found, skipping changes for IEth1Provider
replacing IEth1Streamer
replacing IEthJsonRpcReturnTypes
File(s) containing 'class ExecutionBuilder' found, skipping changes for IExecutionBuilder
File(s) containing 'class ExecutionEngine' found, skipping changes for IExecutionEngine
replacing IExportArgs
replacing IFilterOptions
File(s) containing 'class ForkChoice' found, skipping changes for IForkChoice
File(s) containing 'class ForkChoiceStore' found, skipping changes for IForkChoiceStore
replacing IForkConfig
replacing IForkDigestContext
replacing IForkInfo
File(s) containing 'class Gauge' found, skipping changes for IGauge
File(s) containing 'class GenesisBuilder' found, skipping changes for IGenesisBuilder
replacing IGenesisBuilderKwargs
replacing IGenesisResult
replacing IGlobalPaths
replacing IGlobalSingleArgs
replacing IGossipEvents
replacing IGossipModules
File(s) containing 'class GossipTopic' found, skipping changes for IGossipTopic
File(s) containing 'class GossipTopicCache' found, skipping changes for IGossipTopicCache
File(s) containing 'class Histogram' found, skipping changes for IHistogram
File(s) containing 'class HttpClient' found, skipping changes for IHttpClient
replacing IImportArgs
replacing IIndexAttestationData
replacing IInterchangeCompleteV4
replacing IInterchangeLodestar
replacing IInterchangeV5
replacing IJsonRpcBackend
File(s) containing 'class JsonRpcHttpClient' found, skipping changes for IJsonRpcHttpClient
replacing IKeyValue
replacing ILevelDbControllerMetrics
replacing ILevelDBOptions
replacing ILibp2pOptions
File(s) containing 'class LightClientStore' found, skipping changes for ILightClientStore
replacing ILogArgs
replacing ILogger
replacing ILoggerOptions
replacing IMarkdownSection
replacing IMetadataModules
replacing IMetadataOpts
replacing IMetricsArgs
File(s) containing 'class MinMaxSurround' found, skipping changes for IMinMaxSurround
replacing IMockChainParams
replacing InboundRateLimitQuota
File(s) containing 'class Network' found, skipping changes for INetwork
replacing INetworkArgs
replacing INetworkInitModules
replacing INetworkModules
replacing INetworkOptions
replacing InstanceCodeOptions
File(s) containing 'class PeerRpcScoreStore' found, skipping changes for IPeerRpcScoreStore
replacing IPeerRpcScoreStoreModules
replacing IPeerSummary
File(s) containing 'class PersistedKeysBackend' found, skipping changes for IPersistedKeysBackend
File(s) containing 'class Proof' found, skipping changes for IProof
replacing IQueueMetrics
replacing IReadonlyEpochShuffling
File(s) containing 'class ReqRespBeaconNode' found, skipping changes for IReqRespBeaconNode
replacing IRequestErrorMetadata
replacing IRewardPenaltyItem
replacing IRpcPayload
replacing IRpcResponse
replacing IRpcResponseError
replacing ISignedBLStoExecutionChange
replacing ISignedVoluntaryExitData
replacing ISimpleCase
replacing ISimpleStruct
File(s) containing 'class SlashingProtection' found, skipping changes for ISlashingProtection
replacing ISlotRange
replacing ISpecTestOptions
File(s) containing 'class StateRegenerator' found, skipping changes for IStateRegenerator
replacing ISubnetsService
replacing ISyncArgs
replacing ISyncCommitteeJob
replacing ISyncModule
replacing ISyncModules
replacing ITestCase
replacing IUncompressState
replacing IUser
replacing IValidatorEvents
replacing IValidatorGeneratorOpts
replacing IValidatorMonitor
replacing IWinstonInfoArg
replacing IWinstonInfoArg

@dapplion dapplion requested a review from a team as a code owner February 14, 2023 07:29
@github-actions
Copy link
Contributor

github-actions bot commented Feb 14, 2023

Performance Report

✔️ no performance regression detected

Full benchmark results
Benchmark suite Current: 97df7b7 Previous: f4057cf Ratio
getPubkeys - index2pubkey - req 1000 vs - 250000 vc 1.1780 ms/op 497.22 us/op 2.37
getPubkeys - validatorsArr - req 1000 vs - 250000 vc 62.754 us/op 45.903 us/op 1.37
BLS verify - blst-native 1.2940 ms/op 1.2484 ms/op 1.04
BLS verifyMultipleSignatures 3 - blst-native 2.5692 ms/op 2.5452 ms/op 1.01
BLS verifyMultipleSignatures 8 - blst-native 5.4407 ms/op 5.4653 ms/op 1.00
BLS verifyMultipleSignatures 32 - blst-native 19.644 ms/op 19.650 ms/op 1.00
BLS aggregatePubkeys 32 - blst-native 26.077 us/op 26.175 us/op 1.00
BLS aggregatePubkeys 128 - blst-native 102.72 us/op 102.90 us/op 1.00
getAttestationsForBlock 61.889 ms/op 54.426 ms/op 1.14
isKnown best case - 1 super set check 277.00 ns/op 265.00 ns/op 1.05
isKnown normal case - 2 super set checks 275.00 ns/op 271.00 ns/op 1.01
isKnown worse case - 16 super set checks 273.00 ns/op 261.00 ns/op 1.05
CheckpointStateCache - add get delete 6.2820 us/op 5.1410 us/op 1.22
validate gossip signedAggregateAndProof - struct 2.9541 ms/op 2.7738 ms/op 1.07
validate gossip attestation - struct 1.3731 ms/op 1.3094 ms/op 1.05
pickEth1Vote - no votes 1.3618 ms/op 1.2594 ms/op 1.08
pickEth1Vote - max votes 10.523 ms/op 9.1344 ms/op 1.15
pickEth1Vote - Eth1Data hashTreeRoot value x2048 9.3774 ms/op 9.2591 ms/op 1.01
pickEth1Vote - Eth1Data hashTreeRoot tree x2048 15.799 ms/op 13.808 ms/op 1.14
pickEth1Vote - Eth1Data fastSerialize value x2048 672.22 us/op 682.99 us/op 0.98
pickEth1Vote - Eth1Data fastSerialize tree x2048 7.5746 ms/op 4.8701 ms/op 1.56
bytes32 toHexString 690.00 ns/op 493.00 ns/op 1.40
bytes32 Buffer.toString(hex) 417.00 ns/op 337.00 ns/op 1.24
bytes32 Buffer.toString(hex) from Uint8Array 627.00 ns/op 536.00 ns/op 1.17
bytes32 Buffer.toString(hex) + 0x 459.00 ns/op 342.00 ns/op 1.34
Object access 1 prop 0.24200 ns/op 0.16800 ns/op 1.44
Map access 1 prop 0.18600 ns/op 0.15800 ns/op 1.18
Object get x1000 6.9630 ns/op 6.6710 ns/op 1.04
Map get x1000 0.66000 ns/op 0.59900 ns/op 1.10
Object set x1000 97.665 ns/op 55.416 ns/op 1.76
Map set x1000 61.510 ns/op 44.563 ns/op 1.38
Return object 10000 times 0.30390 ns/op 0.23670 ns/op 1.28
Throw Error 10000 times 5.0937 us/op 4.1557 us/op 1.23
fastMsgIdFn sha256 / 200 bytes 3.8420 us/op 3.3870 us/op 1.13
fastMsgIdFn h32 xxhash / 200 bytes 347.00 ns/op 274.00 ns/op 1.27
fastMsgIdFn h64 xxhash / 200 bytes 496.00 ns/op 377.00 ns/op 1.32
fastMsgIdFn sha256 / 1000 bytes 12.088 us/op 11.479 us/op 1.05
fastMsgIdFn h32 xxhash / 1000 bytes 459.00 ns/op 394.00 ns/op 1.16
fastMsgIdFn h64 xxhash / 1000 bytes 571.00 ns/op 449.00 ns/op 1.27
fastMsgIdFn sha256 / 10000 bytes 107.39 us/op 103.36 us/op 1.04
fastMsgIdFn h32 xxhash / 10000 bytes 2.1060 us/op 1.9290 us/op 1.09
fastMsgIdFn h64 xxhash / 10000 bytes 1.4840 us/op 1.3810 us/op 1.07
enrSubnets - fastDeserialize 64 bits 1.8120 us/op 1.2880 us/op 1.41
enrSubnets - ssz BitVector 64 bits 647.00 ns/op 500.00 ns/op 1.29
enrSubnets - fastDeserialize 4 bits 222.00 ns/op 185.00 ns/op 1.20
enrSubnets - ssz BitVector 4 bits 619.00 ns/op 504.00 ns/op 1.23
prioritizePeers score -10:0 att 32-0.1 sync 2-0 109.39 us/op 98.391 us/op 1.11
prioritizePeers score 0:0 att 32-0.25 sync 2-0.25 136.74 us/op 139.43 us/op 0.98
prioritizePeers score 0:0 att 32-0.5 sync 2-0.5 209.54 us/op 160.74 us/op 1.30
prioritizePeers score 0:0 att 64-0.75 sync 4-0.75 436.96 us/op 304.70 us/op 1.43
prioritizePeers score 0:0 att 64-1 sync 4-1 446.63 us/op 359.59 us/op 1.24
array of 16000 items push then shift 1.9696 us/op 1.6342 us/op 1.21
LinkedList of 16000 items push then shift 9.4840 ns/op 8.8760 ns/op 1.07
array of 16000 items push then pop 127.09 ns/op 85.437 ns/op 1.49
LinkedList of 16000 items push then pop 11.549 ns/op 8.3890 ns/op 1.38
array of 24000 items push then shift 3.0598 us/op 2.2839 us/op 1.34
LinkedList of 24000 items push then shift 10.197 ns/op 8.7570 ns/op 1.16
array of 24000 items push then pop 85.653 ns/op 77.341 ns/op 1.11
LinkedList of 24000 items push then pop 10.182 ns/op 8.4260 ns/op 1.21
intersect bitArray bitLen 8 13.998 ns/op 13.159 ns/op 1.06
intersect array and set length 8 102.10 ns/op 74.279 ns/op 1.37
intersect bitArray bitLen 128 45.837 ns/op 43.581 ns/op 1.05
intersect array and set length 128 1.2151 us/op 1.0238 us/op 1.19
Buffer.concat 32 items 2.8350 us/op 2.6520 us/op 1.07
Uint8Array.set 32 items 3.0180 us/op 2.8890 us/op 1.04
pass gossip attestations to forkchoice per slot 2.4312 ms/op 3.4126 ms/op 0.71
computeDeltas 4.3015 ms/op 2.8730 ms/op 1.50
computeProposerBoostScoreFromBalances 1.8567 ms/op 1.7764 ms/op 1.05
altair processAttestation - 250000 vs - 7PWei normalcase 3.2754 ms/op 2.1198 ms/op 1.55
altair processAttestation - 250000 vs - 7PWei worstcase 4.0080 ms/op 3.2004 ms/op 1.25
altair processAttestation - setStatus - 1/6 committees join 153.38 us/op 136.12 us/op 1.13
altair processAttestation - setStatus - 1/3 committees join 291.06 us/op 278.28 us/op 1.05
altair processAttestation - setStatus - 1/2 committees join 385.12 us/op 368.76 us/op 1.04
altair processAttestation - setStatus - 2/3 committees join 487.77 us/op 478.94 us/op 1.02
altair processAttestation - setStatus - 4/5 committees join 662.08 us/op 666.86 us/op 0.99
altair processAttestation - setStatus - 100% committees join 782.94 us/op 758.03 us/op 1.03
altair processBlock - 250000 vs - 7PWei normalcase 18.022 ms/op 18.033 ms/op 1.00
altair processBlock - 250000 vs - 7PWei normalcase hashState 28.016 ms/op 27.453 ms/op 1.02
altair processBlock - 250000 vs - 7PWei worstcase 49.068 ms/op 52.493 ms/op 0.93
altair processBlock - 250000 vs - 7PWei worstcase hashState 71.335 ms/op 71.401 ms/op 1.00
phase0 processBlock - 250000 vs - 7PWei normalcase 2.3615 ms/op 2.0148 ms/op 1.17
phase0 processBlock - 250000 vs - 7PWei worstcase 31.981 ms/op 27.467 ms/op 1.16
altair processEth1Data - 250000 vs - 7PWei normalcase 506.11 us/op 464.95 us/op 1.09
vc - 250000 eb 1 eth1 1 we 0 wn 0 - smpl 15 8.7880 us/op 8.8870 us/op 0.99
vc - 250000 eb 0.95 eth1 0.1 we 0.05 wn 0 - smpl 219 35.709 us/op 29.326 us/op 1.22
vc - 250000 eb 0.95 eth1 0.3 we 0.05 wn 0 - smpl 42 15.967 us/op 11.579 us/op 1.38
vc - 250000 eb 0.95 eth1 0.7 we 0.05 wn 0 - smpl 18 10.205 us/op 8.3320 us/op 1.22
vc - 250000 eb 0.1 eth1 0.1 we 0 wn 0 - smpl 1020 121.11 us/op 111.71 us/op 1.08
vc - 250000 eb 0.03 eth1 0.03 we 0 wn 0 - smpl 11777 704.57 us/op 656.40 us/op 1.07
vc - 250000 eb 0.01 eth1 0.01 we 0 wn 0 - smpl 16384 936.76 us/op 923.82 us/op 1.01
vc - 250000 eb 0 eth1 0 we 0 wn 0 - smpl 16384 926.91 us/op 897.63 us/op 1.03
vc - 250000 eb 0 eth1 0 we 0 wn 0 nocache - smpl 16384 2.7251 ms/op 2.4060 ms/op 1.13
vc - 250000 eb 0 eth1 1 we 0 wn 0 - smpl 16384 1.6370 ms/op 1.4974 ms/op 1.09
vc - 250000 eb 0 eth1 1 we 0 wn 0 nocache - smpl 16384 4.2885 ms/op 3.9051 ms/op 1.10
Tree 40 250000 create 354.87 ms/op 332.14 ms/op 1.07
Tree 40 250000 get(125000) 196.09 ns/op 190.93 ns/op 1.03
Tree 40 250000 set(125000) 1.1278 us/op 1.0429 us/op 1.08
Tree 40 250000 toArray() 22.018 ms/op 21.603 ms/op 1.02
Tree 40 250000 iterate all - toArray() + loop 22.151 ms/op 22.219 ms/op 1.00
Tree 40 250000 iterate all - get(i) 75.470 ms/op 75.410 ms/op 1.00
MutableVector 250000 create 11.847 ms/op 9.6500 ms/op 1.23
MutableVector 250000 get(125000) 6.4120 ns/op 6.6550 ns/op 0.96
MutableVector 250000 set(125000) 283.31 ns/op 256.35 ns/op 1.11
MutableVector 250000 toArray() 3.6011 ms/op 2.7877 ms/op 1.29
MutableVector 250000 iterate all - toArray() + loop 3.7494 ms/op 2.8295 ms/op 1.33
MutableVector 250000 iterate all - get(i) 1.5522 ms/op 1.5264 ms/op 1.02
Array 250000 create 3.4572 ms/op 2.5284 ms/op 1.37
Array 250000 clone - spread 1.2695 ms/op 1.1035 ms/op 1.15
Array 250000 get(125000) 0.65300 ns/op 0.54000 ns/op 1.21
Array 250000 set(125000) 0.73200 ns/op 0.63700 ns/op 1.15
Array 250000 iterate all - loop 84.777 us/op 112.39 us/op 0.75
effectiveBalanceIncrements clone Uint8Array 300000 37.061 us/op 36.628 us/op 1.01
effectiveBalanceIncrements clone MutableVector 300000 400.00 ns/op 343.00 ns/op 1.17
effectiveBalanceIncrements rw all Uint8Array 300000 169.79 us/op 168.88 us/op 1.01
effectiveBalanceIncrements rw all MutableVector 300000 95.683 ms/op 85.078 ms/op 1.12
phase0 afterProcessEpoch - 250000 vs - 7PWei 152.37 ms/op 116.24 ms/op 1.31
phase0 beforeProcessEpoch - 250000 vs - 7PWei 60.891 ms/op 43.499 ms/op 1.40
altair processEpoch - mainnet_e81889 414.72 ms/op 332.50 ms/op 1.25
mainnet_e81889 - altair beforeProcessEpoch 86.736 ms/op 50.309 ms/op 1.72
mainnet_e81889 - altair processJustificationAndFinalization 31.069 us/op 16.618 us/op 1.87
mainnet_e81889 - altair processInactivityUpdates 6.9482 ms/op 6.0636 ms/op 1.15
mainnet_e81889 - altair processRewardsAndPenalties 54.550 ms/op 54.636 ms/op 1.00
mainnet_e81889 - altair processRegistryUpdates 3.0230 us/op 2.8630 us/op 1.06
mainnet_e81889 - altair processSlashings 1.0210 us/op 439.00 ns/op 2.33
mainnet_e81889 - altair processEth1DataReset 1.0050 us/op 503.00 ns/op 2.00
mainnet_e81889 - altair processEffectiveBalanceUpdates 1.2773 ms/op 1.2740 ms/op 1.00
mainnet_e81889 - altair processSlashingsReset 5.5830 us/op 4.1390 us/op 1.35
mainnet_e81889 - altair processRandaoMixesReset 6.7510 us/op 4.3670 us/op 1.55
mainnet_e81889 - altair processHistoricalRootsUpdate 721.00 ns/op 585.00 ns/op 1.23
mainnet_e81889 - altair processParticipationFlagUpdates 2.9380 us/op 2.5040 us/op 1.17
mainnet_e81889 - altair processSyncCommitteeUpdates 865.00 ns/op 579.00 ns/op 1.49
mainnet_e81889 - altair afterProcessEpoch 132.18 ms/op 121.09 ms/op 1.09
phase0 processEpoch - mainnet_e58758 376.67 ms/op 328.93 ms/op 1.15
mainnet_e58758 - phase0 beforeProcessEpoch 151.37 ms/op 127.91 ms/op 1.18
mainnet_e58758 - phase0 processJustificationAndFinalization 17.863 us/op 16.922 us/op 1.06
mainnet_e58758 - phase0 processRewardsAndPenalties 67.098 ms/op 56.696 ms/op 1.18
mainnet_e58758 - phase0 processRegistryUpdates 17.802 us/op 8.1310 us/op 2.19
mainnet_e58758 - phase0 processSlashings 1.6380 us/op 486.00 ns/op 3.37
mainnet_e58758 - phase0 processEth1DataReset 887.00 ns/op 480.00 ns/op 1.85
mainnet_e58758 - phase0 processEffectiveBalanceUpdates 1.0586 ms/op 1.0088 ms/op 1.05
mainnet_e58758 - phase0 processSlashingsReset 4.4520 us/op 2.8400 us/op 1.57
mainnet_e58758 - phase0 processRandaoMixesReset 5.1350 us/op 4.3020 us/op 1.19
mainnet_e58758 - phase0 processHistoricalRootsUpdate 712.00 ns/op 543.00 ns/op 1.31
mainnet_e58758 - phase0 processParticipationRecordUpdates 5.3210 us/op 3.6860 us/op 1.44
mainnet_e58758 - phase0 afterProcessEpoch 101.63 ms/op 100.01 ms/op 1.02
phase0 processEffectiveBalanceUpdates - 250000 normalcase 1.2827 ms/op 1.2632 ms/op 1.02
phase0 processEffectiveBalanceUpdates - 250000 worstcase 0.5 1.5403 ms/op 1.4388 ms/op 1.07
altair processInactivityUpdates - 250000 normalcase 25.073 ms/op 23.078 ms/op 1.09
altair processInactivityUpdates - 250000 worstcase 26.108 ms/op 25.717 ms/op 1.02
phase0 processRegistryUpdates - 250000 normalcase 9.2760 us/op 6.4550 us/op 1.44
phase0 processRegistryUpdates - 250000 badcase_full_deposits 321.84 us/op 271.36 us/op 1.19
phase0 processRegistryUpdates - 250000 worstcase 0.5 130.48 ms/op 119.75 ms/op 1.09
altair processRewardsAndPenalties - 250000 normalcase 70.066 ms/op 58.211 ms/op 1.20
altair processRewardsAndPenalties - 250000 worstcase 72.479 ms/op 53.159 ms/op 1.36
phase0 getAttestationDeltas - 250000 normalcase 7.4972 ms/op 6.9626 ms/op 1.08
phase0 getAttestationDeltas - 250000 worstcase 6.8777 ms/op 7.0787 ms/op 0.97
phase0 processSlashings - 250000 worstcase 3.3977 ms/op 3.4934 ms/op 0.97
altair processSyncCommitteeUpdates - 250000 181.73 ms/op 191.81 ms/op 0.95
BeaconState.hashTreeRoot - No change 315.00 ns/op 260.00 ns/op 1.21
BeaconState.hashTreeRoot - 1 full validator 53.837 us/op 52.325 us/op 1.03
BeaconState.hashTreeRoot - 32 full validator 543.68 us/op 543.57 us/op 1.00
BeaconState.hashTreeRoot - 512 full validator 5.5584 ms/op 6.0611 ms/op 0.92
BeaconState.hashTreeRoot - 1 validator.effectiveBalance 60.097 us/op 63.338 us/op 0.95
BeaconState.hashTreeRoot - 32 validator.effectiveBalance 965.19 us/op 877.59 us/op 1.10
BeaconState.hashTreeRoot - 512 validator.effectiveBalance 11.950 ms/op 11.924 ms/op 1.00
BeaconState.hashTreeRoot - 1 balances 52.990 us/op 49.133 us/op 1.08
BeaconState.hashTreeRoot - 32 balances 472.45 us/op 472.53 us/op 1.00
BeaconState.hashTreeRoot - 512 balances 4.7181 ms/op 4.5311 ms/op 1.04
BeaconState.hashTreeRoot - 250000 balances 74.906 ms/op 72.907 ms/op 1.03
aggregationBits - 2048 els - zipIndexesInBitList 17.036 us/op 18.560 us/op 0.92
regular array get 100000 times 41.477 us/op 33.198 us/op 1.25
wrappedArray get 100000 times 34.413 us/op 33.089 us/op 1.04
arrayWithProxy get 100000 times 21.408 ms/op 16.205 ms/op 1.32
ssz.Root.equals 746.00 ns/op 581.00 ns/op 1.28
byteArrayEquals 808.00 ns/op 565.00 ns/op 1.43
shuffle list - 16384 els 9.3423 ms/op 7.0423 ms/op 1.33
shuffle list - 250000 els 131.27 ms/op 102.84 ms/op 1.28
processSlot - 1 slots 16.758 us/op 9.0720 us/op 1.85
processSlot - 32 slots 1.7715 ms/op 1.4258 ms/op 1.24
getEffectiveBalanceIncrementsZeroInactive - 250000 vs - 7PWei 406.70 us/op 213.91 us/op 1.90
getCommitteeAssignments - req 1 vs - 250000 vc 3.2351 ms/op 2.9941 ms/op 1.08
getCommitteeAssignments - req 100 vs - 250000 vc 4.2429 ms/op 4.2663 ms/op 0.99
getCommitteeAssignments - req 1000 vs - 250000 vc 4.6955 ms/op 4.6977 ms/op 1.00
RootCache.getBlockRootAtSlot - 250000 vs - 7PWei 5.2900 ns/op 4.8400 ns/op 1.09
state getBlockRootAtSlot - 250000 vs - 7PWei 748.12 ns/op 613.86 ns/op 1.22
computeProposers - vc 250000 12.668 ms/op 11.021 ms/op 1.15
computeEpochShuffling - vc 250000 109.35 ms/op 106.71 ms/op 1.02
getNextSyncCommittee - vc 250000 184.79 ms/op 178.72 ms/op 1.03

by benchmarkbot/action

nflaig
nflaig previously approved these changes Feb 14, 2023
Copy link
Member

@nflaig nflaig 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 to me, just some minor inconsistency in metric types we might wanna fix, see comment

nice script btw

dbWriteItems: ICounter<"bucket">;
}
export type LevelDbControllerMetrics = {
dbReadReq: Counter<"bucket">;
Copy link
Member

@nflaig nflaig Feb 14, 2023

Choose a reason for hiding this comment

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

There is an inconsistency how metric interfaces outside of the beacon-node are defined. ICounter is updated to Counter whereas others such as IHistogram is not because it is implemented by a class in the beacon-node but not the actual package where it is used.

All the metric types defined in state-transition metrics could remove the I-prefix. But maybe for consistency should always use interface with I-prefix for metrics

@nflaig
Copy link
Member

nflaig commented Feb 16, 2023

need to rebase against unstable and re-run script before merging

dapplion and others added 3 commits February 20, 2023 07:59
- some values were incorrectly updated InboundRateLimitQuota --> nboundRateLimitQuota
- few I-prefixed types such as IChainConfig were missed
- updated names of types in comments as this was not done by script
@dapplion
Copy link
Contributor Author

Screenshot from 2023-02-20 16-17-08

I have manually double checked all files 🤣 all good but damn..

twoeths
twoeths previously approved these changes Feb 20, 2023
@dapplion dapplion enabled auto-merge (squash) February 20, 2023 08:29
g11tech
g11tech previously approved these changes Feb 20, 2023
@nflaig
Copy link
Member

nflaig commented Feb 20, 2023

same, was kinda painful 😂 but load all file diffs was a life saver

P.S: should not merge yet, there are few missing changes need to pull in from last commit of #5174

image

@dapplion dapplion dismissed stale reviews from g11tech and twoeths via 85640b5 February 20, 2023 09:17
@dapplion dapplion enabled auto-merge (squash) February 20, 2023 09:17
@nflaig nflaig mentioned this pull request Feb 20, 2023
@dapplion dapplion merged commit 5396d1f into unstable Feb 20, 2023
@dapplion dapplion deleted the dapplion/remove-i-prefix branch February 20, 2023 09:54
@wemeetagain
Copy link
Member

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

5 participants