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

Use newer @multiformats/multiaddr #4704

Merged
merged 1 commit into from
Oct 30, 2022
Merged

Conversation

wemeetagain
Copy link
Member

Motivation

Better alternative to #4701

Description

Update multiaddr to the latest. Should be updated again after multiformats/js-multiaddr#281 is released

@wemeetagain wemeetagain requested a review from a team as a code owner October 30, 2022 00:05
@github-actions
Copy link
Contributor

Performance Report

✔️ no performance regression detected

Full benchmark results
Benchmark suite Current: 49693d1 Previous: 03034ff Ratio
getPubkeys - index2pubkey - req 1000 vs - 250000 vc 1.6888 ms/op 2.6633 ms/op 0.63
getPubkeys - validatorsArr - req 1000 vs - 250000 vc 64.289 us/op 88.729 us/op 0.72
BLS verify - blst-native 2.1641 ms/op 2.0315 ms/op 1.07
BLS verifyMultipleSignatures 3 - blst-native 4.4761 ms/op 4.2187 ms/op 1.06
BLS verifyMultipleSignatures 8 - blst-native 9.6629 ms/op 8.8473 ms/op 1.09
BLS verifyMultipleSignatures 32 - blst-native 35.125 ms/op 32.038 ms/op 1.10
BLS aggregatePubkeys 32 - blst-native 46.469 us/op 45.464 us/op 1.02
BLS aggregatePubkeys 128 - blst-native 182.53 us/op 173.25 us/op 1.05
getAttestationsForBlock 77.088 ms/op 104.90 ms/op 0.73
isKnown best case - 1 super set check 482.00 ns/op 475.00 ns/op 1.01
isKnown normal case - 2 super set checks 469.00 ns/op 448.00 ns/op 1.05
isKnown worse case - 16 super set checks 474.00 ns/op 454.00 ns/op 1.04
CheckpointStateCache - add get delete 8.6750 us/op 10.342 us/op 0.84
validate gossip signedAggregateAndProof - struct 5.0181 ms/op 4.7645 ms/op 1.05
validate gossip attestation - struct 2.3641 ms/op 2.2500 ms/op 1.05
pickEth1Vote - no votes 2.1221 ms/op 2.2044 ms/op 0.96
pickEth1Vote - max votes 18.521 ms/op 23.368 ms/op 0.79
pickEth1Vote - Eth1Data hashTreeRoot value x2048 12.138 ms/op 13.354 ms/op 0.91
pickEth1Vote - Eth1Data hashTreeRoot tree x2048 19.590 ms/op 23.282 ms/op 0.84
pickEth1Vote - Eth1Data fastSerialize value x2048 1.4344 ms/op 1.6636 ms/op 0.86
pickEth1Vote - Eth1Data fastSerialize tree x2048 12.914 ms/op 14.958 ms/op 0.86
bytes32 toHexString 1.0690 us/op 1.1340 us/op 0.94
bytes32 Buffer.toString(hex) 779.00 ns/op 749.00 ns/op 1.04
bytes32 Buffer.toString(hex) from Uint8Array 994.00 ns/op 1.0480 us/op 0.95
bytes32 Buffer.toString(hex) + 0x 759.00 ns/op 761.00 ns/op 1.00
Object access 1 prop 0.38400 ns/op 0.37300 ns/op 1.03
Map access 1 prop 0.30200 ns/op 0.33400 ns/op 0.90
Object get x1000 11.993 ns/op 15.228 ns/op 0.79
Map get x1000 1.0230 ns/op 0.93200 ns/op 1.10
Object set x1000 71.114 ns/op 115.42 ns/op 0.62
Map set x1000 46.211 ns/op 79.539 ns/op 0.58
Return object 10000 times 0.44150 ns/op 0.39280 ns/op 1.12
Throw Error 10000 times 5.8996 us/op 7.5995 us/op 0.78
fastMsgIdFn sha256 / 200 bytes 4.9870 us/op 4.8810 us/op 1.02
fastMsgIdFn h32 xxhash / 200 bytes 641.00 ns/op 584.00 ns/op 1.10
fastMsgIdFn h64 xxhash / 200 bytes 830.00 ns/op 847.00 ns/op 0.98
fastMsgIdFn sha256 / 1000 bytes 15.608 us/op 15.259 us/op 1.02
fastMsgIdFn h32 xxhash / 1000 bytes 806.00 ns/op 764.00 ns/op 1.05
fastMsgIdFn h64 xxhash / 1000 bytes 859.00 ns/op 986.00 ns/op 0.87
fastMsgIdFn sha256 / 10000 bytes 135.11 us/op 132.54 us/op 1.02
fastMsgIdFn h32 xxhash / 10000 bytes 2.8560 us/op 2.6330 us/op 1.08
fastMsgIdFn h64 xxhash / 10000 bytes 2.1150 us/op 1.9540 us/op 1.08
enrSubnets - fastDeserialize 64 bits 2.6610 us/op 3.1120 us/op 0.86
enrSubnets - ssz BitVector 64 bits 832.00 ns/op 825.00 ns/op 1.01
enrSubnets - fastDeserialize 4 bits 437.00 ns/op 462.00 ns/op 0.95
enrSubnets - ssz BitVector 4 bits 840.00 ns/op 856.00 ns/op 0.98
prioritizePeers score -10:0 att 32-0.1 sync 2-0 84.128 us/op 109.94 us/op 0.77
prioritizePeers score 0:0 att 32-0.25 sync 2-0.25 114.93 us/op 138.05 us/op 0.83
prioritizePeers score 0:0 att 32-0.5 sync 2-0.5 203.08 us/op 282.16 us/op 0.72
prioritizePeers score 0:0 att 64-0.75 sync 4-0.75 401.30 us/op 579.39 us/op 0.69
prioritizePeers score 0:0 att 64-1 sync 4-1 407.88 us/op 557.59 us/op 0.73
RateTracker 1000000 limit, 1 obj count per request 178.61 ns/op 195.17 ns/op 0.92
RateTracker 1000000 limit, 2 obj count per request 128.44 ns/op 145.82 ns/op 0.88
RateTracker 1000000 limit, 4 obj count per request 105.18 ns/op 121.97 ns/op 0.86
RateTracker 1000000 limit, 8 obj count per request 93.697 ns/op 113.06 ns/op 0.83
RateTracker with prune 3.9560 us/op 5.5340 us/op 0.71
array of 16000 items push then shift 51.585 us/op 4.9256 us/op 10.47
LinkedList of 16000 items push then shift 12.138 ns/op 20.702 ns/op 0.59
array of 16000 items push then pop 205.22 ns/op 252.38 ns/op 0.81
LinkedList of 16000 items push then pop 11.746 ns/op 19.088 ns/op 0.62
array of 24000 items push then shift 77.332 us/op 7.4436 us/op 10.39
LinkedList of 24000 items push then shift 12.411 ns/op 21.514 ns/op 0.58
array of 24000 items push then pop 182.40 ns/op 218.80 ns/op 0.83
LinkedList of 24000 items push then pop 11.790 ns/op 18.841 ns/op 0.63
intersect bitArray bitLen 8 10.816 ns/op 11.986 ns/op 0.90
intersect array and set length 8 133.49 ns/op 207.38 ns/op 0.64
intersect bitArray bitLen 128 55.236 ns/op 67.573 ns/op 0.82
intersect array and set length 128 1.7444 us/op 2.4040 us/op 0.73
Buffer.concat 32 items 2.0580 ns/op 2.2660 ns/op 0.91
pass gossip attestations to forkchoice per slot 3.5570 ms/op 4.2201 ms/op 0.84
computeDeltas 4.4586 ms/op 5.2885 ms/op 0.84
computeProposerBoostScoreFromBalances 803.98 us/op 830.59 us/op 0.97
altair processAttestation - 250000 vs - 7PWei normalcase 3.2863 ms/op 5.5975 ms/op 0.59
altair processAttestation - 250000 vs - 7PWei worstcase 5.1027 ms/op 8.4704 ms/op 0.60
altair processAttestation - setStatus - 1/6 committees join 178.88 us/op 229.54 us/op 0.78
altair processAttestation - setStatus - 1/3 committees join 350.63 us/op 481.02 us/op 0.73
altair processAttestation - setStatus - 1/2 committees join 501.89 us/op 648.91 us/op 0.77
altair processAttestation - setStatus - 2/3 committees join 659.69 us/op 867.19 us/op 0.76
altair processAttestation - setStatus - 4/5 committees join 927.48 us/op 1.2517 ms/op 0.74
altair processAttestation - setStatus - 100% committees join 1.1173 ms/op 1.4553 ms/op 0.77
altair processBlock - 250000 vs - 7PWei normalcase 27.016 ms/op 31.807 ms/op 0.85
altair processBlock - 250000 vs - 7PWei normalcase hashState 35.803 ms/op 41.229 ms/op 0.87
altair processBlock - 250000 vs - 7PWei worstcase 79.164 ms/op 104.57 ms/op 0.76
altair processBlock - 250000 vs - 7PWei worstcase hashState 100.34 ms/op 113.20 ms/op 0.89
phase0 processBlock - 250000 vs - 7PWei normalcase 3.1028 ms/op 4.3620 ms/op 0.71
phase0 processBlock - 250000 vs - 7PWei worstcase 51.206 ms/op 52.956 ms/op 0.97
altair processEth1Data - 250000 vs - 7PWei normalcase 712.64 us/op 1.0078 ms/op 0.71
Tree 40 250000 create 693.59 ms/op 974.87 ms/op 0.71
Tree 40 250000 get(125000) 233.02 ns/op 304.58 ns/op 0.77
Tree 40 250000 set(125000) 2.0998 us/op 3.2776 us/op 0.64
Tree 40 250000 toArray() 27.269 ms/op 35.079 ms/op 0.78
Tree 40 250000 iterate all - toArray() + loop 29.240 ms/op 36.582 ms/op 0.80
Tree 40 250000 iterate all - get(i) 111.02 ms/op 124.32 ms/op 0.89
MutableVector 250000 create 13.100 ms/op 20.347 ms/op 0.64
MutableVector 250000 get(125000) 10.637 ns/op 12.875 ns/op 0.83
MutableVector 250000 set(125000) 510.52 ns/op 866.23 ns/op 0.59
MutableVector 250000 toArray() 5.7666 ms/op 7.8247 ms/op 0.74
MutableVector 250000 iterate all - toArray() + loop 5.7438 ms/op 7.8867 ms/op 0.73
MutableVector 250000 iterate all - get(i) 2.6000 ms/op 3.4756 ms/op 0.75
Array 250000 create 5.6190 ms/op 8.4728 ms/op 0.66
Array 250000 clone - spread 3.1423 ms/op 4.7555 ms/op 0.66
Array 250000 get(125000) 1.4720 ns/op 2.0140 ns/op 0.73
Array 250000 set(125000) 1.4760 ns/op 1.9500 ns/op 0.76
Array 250000 iterate all - loop 151.03 us/op 165.05 us/op 0.92
effectiveBalanceIncrements clone Uint8Array 300000 45.186 us/op 132.98 us/op 0.34
effectiveBalanceIncrements clone MutableVector 300000 1.0270 us/op 1.4770 us/op 0.70
effectiveBalanceIncrements rw all Uint8Array 300000 247.32 us/op 318.93 us/op 0.78
effectiveBalanceIncrements rw all MutableVector 300000 164.76 ms/op 326.42 ms/op 0.50
phase0 afterProcessEpoch - 250000 vs - 7PWei 189.68 ms/op 210.43 ms/op 0.90
phase0 beforeProcessEpoch - 250000 vs - 7PWei 75.498 ms/op 131.01 ms/op 0.58
altair processEpoch - mainnet_e81889 569.30 ms/op 717.42 ms/op 0.79
mainnet_e81889 - altair beforeProcessEpoch 112.75 ms/op 117.03 ms/op 0.96
mainnet_e81889 - altair processJustificationAndFinalization 19.244 us/op 79.490 us/op 0.24
mainnet_e81889 - altair processInactivityUpdates 8.6333 ms/op 12.572 ms/op 0.69
mainnet_e81889 - altair processRewardsAndPenalties 77.803 ms/op 200.02 ms/op 0.39
mainnet_e81889 - altair processRegistryUpdates 2.7510 us/op 13.819 us/op 0.20
mainnet_e81889 - altair processSlashings 591.00 ns/op 4.0540 us/op 0.15
mainnet_e81889 - altair processEth1DataReset 943.00 ns/op 4.2790 us/op 0.22
mainnet_e81889 - altair processEffectiveBalanceUpdates 1.9863 ms/op 2.9820 ms/op 0.67
mainnet_e81889 - altair processSlashingsReset 6.9230 us/op 21.448 us/op 0.32
mainnet_e81889 - altair processRandaoMixesReset 5.5790 us/op 22.909 us/op 0.24
mainnet_e81889 - altair processHistoricalRootsUpdate 879.00 ns/op 3.5440 us/op 0.25
mainnet_e81889 - altair processParticipationFlagUpdates 6.5140 us/op 15.137 us/op 0.43
mainnet_e81889 - altair processSyncCommitteeUpdates 1.0240 us/op 3.2410 us/op 0.32
mainnet_e81889 - altair afterProcessEpoch 220.03 ms/op 191.54 ms/op 1.15
phase0 processEpoch - mainnet_e58758 624.02 ms/op 687.64 ms/op 0.91
mainnet_e58758 - phase0 beforeProcessEpoch 221.21 ms/op 245.94 ms/op 0.90
mainnet_e58758 - phase0 processJustificationAndFinalization 29.054 us/op 59.405 us/op 0.49
mainnet_e58758 - phase0 processRewardsAndPenalties 124.18 ms/op 144.78 ms/op 0.86
mainnet_e58758 - phase0 processRegistryUpdates 13.296 us/op 34.610 us/op 0.38
mainnet_e58758 - phase0 processSlashings 972.00 ns/op 3.6850 us/op 0.26
mainnet_e58758 - phase0 processEth1DataReset 536.00 ns/op 3.8630 us/op 0.14
mainnet_e58758 - phase0 processEffectiveBalanceUpdates 2.0972 ms/op 2.2820 ms/op 0.92
mainnet_e58758 - phase0 processSlashingsReset 4.2320 us/op 18.009 us/op 0.23
mainnet_e58758 - phase0 processRandaoMixesReset 4.4080 us/op 22.324 us/op 0.20
mainnet_e58758 - phase0 processHistoricalRootsUpdate 640.00 ns/op 3.7900 us/op 0.17
mainnet_e58758 - phase0 processParticipationRecordUpdates 4.5480 us/op 24.303 us/op 0.19
mainnet_e58758 - phase0 afterProcessEpoch 163.38 ms/op 162.69 ms/op 1.00
phase0 processEffectiveBalanceUpdates - 250000 normalcase 1.9903 ms/op 2.2726 ms/op 0.88
phase0 processEffectiveBalanceUpdates - 250000 worstcase 0.5 2.2381 ms/op 2.4939 ms/op 0.90
altair processInactivityUpdates - 250000 normalcase 50.336 ms/op 49.815 ms/op 1.01
altair processInactivityUpdates - 250000 worstcase 49.603 ms/op 61.738 ms/op 0.80
phase0 processRegistryUpdates - 250000 normalcase 15.822 us/op 26.639 us/op 0.59
phase0 processRegistryUpdates - 250000 badcase_full_deposits 627.90 us/op 501.43 us/op 1.25
phase0 processRegistryUpdates - 250000 worstcase 0.5 222.76 ms/op 250.56 ms/op 0.89
altair processRewardsAndPenalties - 250000 normalcase 139.31 ms/op 131.30 ms/op 1.06
altair processRewardsAndPenalties - 250000 worstcase 138.39 ms/op 94.644 ms/op 1.46
phase0 getAttestationDeltas - 250000 normalcase 11.520 ms/op 14.054 ms/op 0.82
phase0 getAttestationDeltas - 250000 worstcase 11.702 ms/op 14.453 ms/op 0.81
phase0 processSlashings - 250000 worstcase 5.2230 ms/op 6.2150 ms/op 0.84
altair processSyncCommitteeUpdates - 250000 285.85 ms/op 325.45 ms/op 0.88
BeaconState.hashTreeRoot - No change 518.00 ns/op 620.00 ns/op 0.84
BeaconState.hashTreeRoot - 1 full validator 70.455 us/op 74.083 us/op 0.95
BeaconState.hashTreeRoot - 32 full validator 710.78 us/op 637.72 us/op 1.11
BeaconState.hashTreeRoot - 512 full validator 8.5612 ms/op 7.7035 ms/op 1.11
BeaconState.hashTreeRoot - 1 validator.effectiveBalance 87.404 us/op 101.86 us/op 0.86
BeaconState.hashTreeRoot - 32 validator.effectiveBalance 1.4062 ms/op 1.6778 ms/op 0.84
BeaconState.hashTreeRoot - 512 validator.effectiveBalance 16.163 ms/op 19.005 ms/op 0.85
BeaconState.hashTreeRoot - 1 balances 77.619 us/op 69.878 us/op 1.11
BeaconState.hashTreeRoot - 32 balances 638.54 us/op 749.93 us/op 0.85
BeaconState.hashTreeRoot - 512 balances 6.8454 ms/op 6.9126 ms/op 0.99
BeaconState.hashTreeRoot - 250000 balances 112.24 ms/op 101.51 ms/op 1.11
aggregationBits - 2048 els - zipIndexesInBitList 24.021 us/op 42.430 us/op 0.57
regular array get 100000 times 62.484 us/op 51.524 us/op 1.21
wrappedArray get 100000 times 61.058 us/op 52.621 us/op 1.16
arrayWithProxy get 100000 times 27.065 ms/op 32.295 ms/op 0.84
ssz.Root.equals 444.00 ns/op 598.00 ns/op 0.74
byteArrayEquals 445.00 ns/op 583.00 ns/op 0.76
shuffle list - 16384 els 11.314 ms/op 11.105 ms/op 1.02
shuffle list - 250000 els 167.41 ms/op 157.01 ms/op 1.07
processSlot - 1 slots 14.321 us/op 16.067 us/op 0.89
processSlot - 32 slots 1.9112 ms/op 2.0942 ms/op 0.91
getEffectiveBalanceIncrementsZeroInactive - 250000 vs - 7PWei 373.52 us/op 437.79 us/op 0.85
getCommitteeAssignments - req 1 vs - 250000 vc 5.4071 ms/op 6.1717 ms/op 0.88
getCommitteeAssignments - req 100 vs - 250000 vc 7.8433 ms/op 8.5309 ms/op 0.92
getCommitteeAssignments - req 1000 vs - 250000 vc 8.4175 ms/op 9.0009 ms/op 0.94
RootCache.getBlockRootAtSlot - 250000 vs - 7PWei 8.6400 ns/op 11.560 ns/op 0.75
state getBlockRootAtSlot - 250000 vs - 7PWei 1.0445 us/op 1.5781 us/op 0.66
computeProposers - vc 250000 17.204 ms/op 22.499 ms/op 0.76
computeEpochShuffling - vc 250000 171.16 ms/op 190.67 ms/op 0.90
getNextSyncCommittee - vc 250000 289.41 ms/op 388.35 ms/op 0.75

by benchmarkbot/action

Copy link
Contributor

@twoeths twoeths left a comment

Choose a reason for hiding this comment

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

lgtm, do we need to also change @multiformats/multiaddr to 11.0.6 in package.json @wemeetagain ?

@wemeetagain wemeetagain merged commit 14fe299 into unstable Oct 30, 2022
@wemeetagain wemeetagain deleted the cayman/update-multiaddr branch October 30, 2022 18:01
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.

2 participants