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

Update gossipsub / libp2p #5029

Merged
merged 5 commits into from
Jan 21, 2023
Merged

Update gossipsub / libp2p #5029

merged 5 commits into from
Jan 21, 2023

Conversation

wemeetagain
Copy link
Member

@wemeetagain wemeetagain commented Jan 20, 2023

Update of gossipsub (for ChainSafe/js-libp2p-gossipsub#399) requires updating libp2p (and friends) due to breaking change in peer-id interface.
Also new Libp2p type doesn't include connectionManager and registrar (see libp2p/js-libp2p-interfaces#338)

This is a minimal change to fix above issues

@wemeetagain wemeetagain requested a review from a team as a code owner January 20, 2023 23:15
@wemeetagain wemeetagain changed the title Cayman/update gossipsub Update gossipsub / libp2p Jan 20, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Jan 20, 2023

Performance Report

✔️ no performance regression detected

Full benchmark results
Benchmark suite Current: 64bdd74 Previous: c49ee3c Ratio
getPubkeys - index2pubkey - req 1000 vs - 250000 vc 1.5357 ms/op 1.0780 ms/op 1.42
getPubkeys - validatorsArr - req 1000 vs - 250000 vc 92.197 us/op 64.170 us/op 1.44
BLS verify - blst-native 2.3943 ms/op 2.1754 ms/op 1.10
BLS verifyMultipleSignatures 3 - blst-native 4.8403 ms/op 4.4893 ms/op 1.08
BLS verifyMultipleSignatures 8 - blst-native 10.484 ms/op 9.7019 ms/op 1.08
BLS verifyMultipleSignatures 32 - blst-native 38.704 ms/op 35.305 ms/op 1.10
BLS aggregatePubkeys 32 - blst-native 49.287 us/op 46.975 us/op 1.05
BLS aggregatePubkeys 128 - blst-native 194.88 us/op 182.49 us/op 1.07
getAttestationsForBlock 112.44 ms/op 78.837 ms/op 1.43
isKnown best case - 1 super set check 615.00 ns/op 491.00 ns/op 1.25
isKnown normal case - 2 super set checks 576.00 ns/op 478.00 ns/op 1.21
isKnown worse case - 16 super set checks 594.00 ns/op 477.00 ns/op 1.25
CheckpointStateCache - add get delete 10.508 us/op 8.4250 us/op 1.25
validate gossip signedAggregateAndProof - struct 5.2530 ms/op 5.0144 ms/op 1.05
validate gossip attestation - struct 2.5107 ms/op 2.3565 ms/op 1.07
pickEth1Vote - no votes 2.7756 ms/op 2.4257 ms/op 1.14
pickEth1Vote - max votes 22.544 ms/op 16.456 ms/op 1.37
pickEth1Vote - Eth1Data hashTreeRoot value x2048 15.329 ms/op 13.364 ms/op 1.15
pickEth1Vote - Eth1Data hashTreeRoot tree x2048 25.859 ms/op 20.763 ms/op 1.25
pickEth1Vote - Eth1Data fastSerialize value x2048 1.5429 ms/op 1.1056 ms/op 1.40
pickEth1Vote - Eth1Data fastSerialize tree x2048 12.744 ms/op 9.9021 ms/op 1.29
bytes32 toHexString 1.3370 us/op 890.00 ns/op 1.50
bytes32 Buffer.toString(hex) 735.00 ns/op 671.00 ns/op 1.10
bytes32 Buffer.toString(hex) from Uint8Array 1.1550 us/op 1.0340 us/op 1.12
bytes32 Buffer.toString(hex) + 0x 750.00 ns/op 689.00 ns/op 1.09
Object access 1 prop 0.34400 ns/op 0.32700 ns/op 1.05
Map access 1 prop 0.31700 ns/op 0.30700 ns/op 1.03
Object get x1000 19.803 ns/op 10.917 ns/op 1.81
Map get x1000 1.2470 ns/op 0.92600 ns/op 1.35
Object set x1000 129.60 ns/op 71.775 ns/op 1.81
Map set x1000 84.836 ns/op 44.578 ns/op 1.90
Return object 10000 times 0.44920 ns/op 0.43040 ns/op 1.04
Throw Error 10000 times 8.3071 us/op 6.6752 us/op 1.24
fastMsgIdFn sha256 / 200 bytes 5.2410 us/op 4.9810 us/op 1.05
fastMsgIdFn h32 xxhash / 200 bytes 585.00 ns/op 539.00 ns/op 1.09
fastMsgIdFn h64 xxhash / 200 bytes 804.00 ns/op 719.00 ns/op 1.12
fastMsgIdFn sha256 / 1000 bytes 16.273 us/op 15.769 us/op 1.03
fastMsgIdFn h32 xxhash / 1000 bytes 764.00 ns/op 716.00 ns/op 1.07
fastMsgIdFn h64 xxhash / 1000 bytes 931.00 ns/op 825.00 ns/op 1.13
fastMsgIdFn sha256 / 10000 bytes 140.92 us/op 137.67 us/op 1.02
fastMsgIdFn h32 xxhash / 10000 bytes 2.7990 us/op 2.6130 us/op 1.07
fastMsgIdFn h64 xxhash / 10000 bytes 2.0300 us/op 1.7930 us/op 1.13
enrSubnets - fastDeserialize 64 bits 2.9950 us/op 2.5720 us/op 1.16
enrSubnets - ssz BitVector 64 bits 1.0370 us/op 964.00 ns/op 1.08
enrSubnets - fastDeserialize 4 bits 357.00 ns/op 378.00 ns/op 0.94
enrSubnets - ssz BitVector 4 bits 1.0400 us/op 956.00 ns/op 1.09
prioritizePeers score -10:0 att 32-0.1 sync 2-0 205.99 us/op 151.30 us/op 1.36
prioritizePeers score 0:0 att 32-0.25 sync 2-0.25 254.74 us/op 171.65 us/op 1.48
prioritizePeers score 0:0 att 32-0.5 sync 2-0.5 414.68 us/op 253.19 us/op 1.64
prioritizePeers score 0:0 att 64-0.75 sync 4-0.75 686.23 us/op 443.57 us/op 1.55
prioritizePeers score 0:0 att 64-1 sync 4-1 772.90 us/op 503.68 us/op 1.53
array of 16000 items push then shift 3.3677 us/op 51.634 us/op 0.07
LinkedList of 16000 items push then shift 20.429 ns/op 12.592 ns/op 1.62
array of 16000 items push then pop 245.35 ns/op 195.40 ns/op 1.26
LinkedList of 16000 items push then pop 19.637 ns/op 12.211 ns/op 1.61
array of 24000 items push then shift 5.0633 us/op 77.404 us/op 0.07
LinkedList of 24000 items push then shift 24.731 ns/op 12.659 ns/op 1.95
array of 24000 items push then pop 246.90 ns/op 193.28 ns/op 1.28
LinkedList of 24000 items push then pop 20.741 ns/op 12.203 ns/op 1.70
intersect bitArray bitLen 8 35.915 ns/op 21.753 ns/op 1.65
intersect array and set length 8 200.44 ns/op 126.62 ns/op 1.58
intersect bitArray bitLen 128 129.93 ns/op 70.658 ns/op 1.84
intersect array and set length 128 2.7510 us/op 1.7172 us/op 1.60
Buffer.concat 32 items 7.2360 us/op 4.5570 us/op 1.59
Uint8Array.set 32 items 4.8220 us/op 3.6150 us/op 1.33
pass gossip attestations to forkchoice per slot 5.0770 ms/op 3.6770 ms/op 1.38
computeDeltas 6.9627 ms/op 4.1719 ms/op 1.67
computeProposerBoostScoreFromBalances 3.1238 ms/op 2.5284 ms/op 1.24
altair processAttestation - 250000 vs - 7PWei normalcase 4.9068 ms/op 3.4477 ms/op 1.42
altair processAttestation - 250000 vs - 7PWei worstcase 8.0776 ms/op 5.3492 ms/op 1.51
altair processAttestation - setStatus - 1/6 committees join 245.23 us/op 182.74 us/op 1.34
altair processAttestation - setStatus - 1/3 committees join 471.01 us/op 361.36 us/op 1.30
altair processAttestation - setStatus - 1/2 committees join 659.46 us/op 533.38 us/op 1.24
altair processAttestation - setStatus - 2/3 committees join 847.06 us/op 699.36 us/op 1.21
altair processAttestation - setStatus - 4/5 committees join 1.1790 ms/op 966.51 us/op 1.22
altair processAttestation - setStatus - 100% committees join 1.4262 ms/op 1.1671 ms/op 1.22
altair processBlock - 250000 vs - 7PWei normalcase 29.357 ms/op 23.878 ms/op 1.23
altair processBlock - 250000 vs - 7PWei normalcase hashState 42.456 ms/op 37.057 ms/op 1.15
altair processBlock - 250000 vs - 7PWei worstcase 105.27 ms/op 74.299 ms/op 1.42
altair processBlock - 250000 vs - 7PWei worstcase hashState 113.71 ms/op 101.14 ms/op 1.12
phase0 processBlock - 250000 vs - 7PWei normalcase 4.3555 ms/op 3.4909 ms/op 1.25
phase0 processBlock - 250000 vs - 7PWei worstcase 58.068 ms/op 51.797 ms/op 1.12
altair processEth1Data - 250000 vs - 7PWei normalcase 952.22 us/op 737.62 us/op 1.29
vc - 250000 eb 1 eth1 1 we 0 wn 0 - smpl 15 14.069 us/op 8.4060 us/op 1.67
vc - 250000 eb 0.95 eth1 0.1 we 0.05 wn 0 - smpl 219 35.824 us/op 23.028 us/op 1.56
vc - 250000 eb 0.95 eth1 0.3 we 0.05 wn 0 - smpl 42 18.452 us/op 10.290 us/op 1.79
vc - 250000 eb 0.95 eth1 0.7 we 0.05 wn 0 - smpl 18 14.839 us/op 7.8110 us/op 1.90
vc - 250000 eb 0.1 eth1 0.1 we 0 wn 0 - smpl 1020 139.03 us/op 88.702 us/op 1.57
vc - 250000 eb 0.03 eth1 0.03 we 0 wn 0 - smpl 11777 1.2769 ms/op 844.71 us/op 1.51
vc - 250000 eb 0.01 eth1 0.01 we 0 wn 0 - smpl 16384 1.6907 ms/op 1.1255 ms/op 1.50
vc - 250000 eb 0 eth1 0 we 0 wn 0 - smpl 16384 1.6203 ms/op 1.1044 ms/op 1.47
vc - 250000 eb 0 eth1 0 we 0 wn 0 nocache - smpl 16384 5.4918 ms/op 4.0219 ms/op 1.37
vc - 250000 eb 0 eth1 1 we 0 wn 0 - smpl 16384 3.5182 ms/op 2.2895 ms/op 1.54
vc - 250000 eb 0 eth1 1 we 0 wn 0 nocache - smpl 16384 9.1195 ms/op 6.9289 ms/op 1.32
Tree 40 250000 create 909.94 ms/op 595.90 ms/op 1.53
Tree 40 250000 get(125000) 341.48 ns/op 269.55 ns/op 1.27
Tree 40 250000 set(125000) 2.3880 us/op 2.0214 us/op 1.18
Tree 40 250000 toArray() 36.154 ms/op 26.904 ms/op 1.34
Tree 40 250000 iterate all - toArray() + loop 36.423 ms/op 26.886 ms/op 1.35
Tree 40 250000 iterate all - get(i) 124.03 ms/op 103.48 ms/op 1.20
MutableVector 250000 create 17.394 ms/op 12.937 ms/op 1.34
MutableVector 250000 get(125000) 16.125 ns/op 10.807 ns/op 1.49
MutableVector 250000 set(125000) 705.16 ns/op 531.92 ns/op 1.33
MutableVector 250000 toArray() 7.3806 ms/op 5.7455 ms/op 1.28
MutableVector 250000 iterate all - toArray() + loop 7.8851 ms/op 5.9472 ms/op 1.33
MutableVector 250000 iterate all - get(i) 4.4115 ms/op 3.1368 ms/op 1.41
Array 250000 create 7.2185 ms/op 5.6917 ms/op 1.27
Array 250000 clone - spread 2.8984 ms/op 2.6003 ms/op 1.11
Array 250000 get(125000) 1.3370 ns/op 1.2120 ns/op 1.10
Array 250000 set(125000) 1.3100 ns/op 1.2110 ns/op 1.08
Array 250000 iterate all - loop 208.36 us/op 150.90 us/op 1.38
effectiveBalanceIncrements clone Uint8Array 300000 97.109 us/op 47.810 us/op 2.03
effectiveBalanceIncrements clone MutableVector 300000 878.00 ns/op 806.00 ns/op 1.09
effectiveBalanceIncrements rw all Uint8Array 300000 309.96 us/op 243.91 us/op 1.27
effectiveBalanceIncrements rw all MutableVector 300000 226.36 ms/op 164.27 ms/op 1.38
phase0 afterProcessEpoch - 250000 vs - 7PWei 227.58 ms/op 186.96 ms/op 1.22
phase0 beforeProcessEpoch - 250000 vs - 7PWei 113.93 ms/op 57.024 ms/op 2.00
altair processEpoch - mainnet_e81889 682.96 ms/op 535.52 ms/op 1.28
mainnet_e81889 - altair beforeProcessEpoch 165.23 ms/op 112.34 ms/op 1.47
mainnet_e81889 - altair processJustificationAndFinalization 35.708 us/op 18.178 us/op 1.96
mainnet_e81889 - altair processInactivityUpdates 12.977 ms/op 8.9914 ms/op 1.44
mainnet_e81889 - altair processRewardsAndPenalties 110.92 ms/op 75.941 ms/op 1.46
mainnet_e81889 - altair processRegistryUpdates 7.0410 us/op 2.7080 us/op 2.60
mainnet_e81889 - altair processSlashings 1.5670 us/op 550.00 ns/op 2.85
mainnet_e81889 - altair processEth1DataReset 1.5260 us/op 521.00 ns/op 2.93
mainnet_e81889 - altair processEffectiveBalanceUpdates 2.9549 ms/op 1.9170 ms/op 1.54
mainnet_e81889 - altair processSlashingsReset 13.286 us/op 4.7080 us/op 2.82
mainnet_e81889 - altair processRandaoMixesReset 11.859 us/op 4.1460 us/op 2.86
mainnet_e81889 - altair processHistoricalRootsUpdate 1.8220 us/op 637.00 ns/op 2.86
mainnet_e81889 - altair processParticipationFlagUpdates 7.7240 us/op 2.1070 us/op 3.67
mainnet_e81889 - altair processSyncCommitteeUpdates 1.7040 us/op 630.00 ns/op 2.70
mainnet_e81889 - altair afterProcessEpoch 237.46 ms/op 196.67 ms/op 1.21
phase0 processEpoch - mainnet_e58758 623.68 ms/op 485.36 ms/op 1.28
mainnet_e58758 - phase0 beforeProcessEpoch 267.38 ms/op 192.84 ms/op 1.39
mainnet_e58758 - phase0 processJustificationAndFinalization 36.690 us/op 16.736 us/op 2.19
mainnet_e58758 - phase0 processRewardsAndPenalties 157.68 ms/op 67.210 ms/op 2.35
mainnet_e58758 - phase0 processRegistryUpdates 18.235 us/op 7.6710 us/op 2.38
mainnet_e58758 - phase0 processSlashings 1.5440 us/op 568.00 ns/op 2.72
mainnet_e58758 - phase0 processEth1DataReset 1.6260 us/op 599.00 ns/op 2.71
mainnet_e58758 - phase0 processEffectiveBalanceUpdates 2.2710 ms/op 1.8224 ms/op 1.25
mainnet_e58758 - phase0 processSlashingsReset 8.0440 us/op 3.4370 us/op 2.34
mainnet_e58758 - phase0 processRandaoMixesReset 13.197 us/op 4.2390 us/op 3.11
mainnet_e58758 - phase0 processHistoricalRootsUpdate 1.9520 us/op 548.00 ns/op 3.56
mainnet_e58758 - phase0 processParticipationRecordUpdates 12.359 us/op 3.9830 us/op 3.10
mainnet_e58758 - phase0 afterProcessEpoch 194.41 ms/op 163.09 ms/op 1.19
phase0 processEffectiveBalanceUpdates - 250000 normalcase 3.4427 ms/op 1.9339 ms/op 1.78
phase0 processEffectiveBalanceUpdates - 250000 worstcase 0.5 3.9030 ms/op 2.3735 ms/op 1.64
altair processInactivityUpdates - 250000 normalcase 43.845 ms/op 31.902 ms/op 1.37
altair processInactivityUpdates - 250000 worstcase 53.473 ms/op 39.253 ms/op 1.36
phase0 processRegistryUpdates - 250000 normalcase 14.981 us/op 6.7820 us/op 2.21
phase0 processRegistryUpdates - 250000 badcase_full_deposits 525.00 us/op 373.12 us/op 1.41
phase0 processRegistryUpdates - 250000 worstcase 0.5 261.05 ms/op 176.58 ms/op 1.48
altair processRewardsAndPenalties - 250000 normalcase 142.08 ms/op 102.31 ms/op 1.39
altair processRewardsAndPenalties - 250000 worstcase 97.641 ms/op 96.870 ms/op 1.01
phase0 getAttestationDeltas - 250000 normalcase 16.538 ms/op 12.060 ms/op 1.37
phase0 getAttestationDeltas - 250000 worstcase 15.751 ms/op 12.082 ms/op 1.30
phase0 processSlashings - 250000 worstcase 7.0238 ms/op 5.1646 ms/op 1.36
altair processSyncCommitteeUpdates - 250000 332.04 ms/op 288.58 ms/op 1.15
BeaconState.hashTreeRoot - No change 604.00 ns/op 474.00 ns/op 1.27
BeaconState.hashTreeRoot - 1 full validator 78.669 us/op 71.537 us/op 1.10
BeaconState.hashTreeRoot - 32 full validator 971.40 us/op 652.61 us/op 1.49
BeaconState.hashTreeRoot - 512 full validator 7.4123 ms/op 7.4704 ms/op 0.99
BeaconState.hashTreeRoot - 1 validator.effectiveBalance 95.362 us/op 87.751 us/op 1.09
BeaconState.hashTreeRoot - 32 validator.effectiveBalance 1.3931 ms/op 1.2624 ms/op 1.10
BeaconState.hashTreeRoot - 512 validator.effectiveBalance 19.404 ms/op 17.233 ms/op 1.13
BeaconState.hashTreeRoot - 1 balances 72.669 us/op 63.424 us/op 1.15
BeaconState.hashTreeRoot - 32 balances 722.38 us/op 623.60 us/op 1.16
BeaconState.hashTreeRoot - 512 balances 6.8682 ms/op 6.3152 ms/op 1.09
BeaconState.hashTreeRoot - 250000 balances 113.10 ms/op 104.72 ms/op 1.08
aggregationBits - 2048 els - zipIndexesInBitList 37.300 us/op 23.781 us/op 1.57
regular array get 100000 times 80.713 us/op 60.547 us/op 1.33
wrappedArray get 100000 times 79.803 us/op 60.510 us/op 1.32
arrayWithProxy get 100000 times 39.391 ms/op 27.084 ms/op 1.45
ssz.Root.equals 1.3020 us/op 974.00 ns/op 1.34
byteArrayEquals 1.3030 us/op 938.00 ns/op 1.39
shuffle list - 16384 els 13.402 ms/op 11.479 ms/op 1.17
shuffle list - 250000 els 196.97 ms/op 167.85 ms/op 1.17
processSlot - 1 slots 14.811 us/op 12.990 us/op 1.14
processSlot - 32 slots 2.0071 ms/op 1.9701 ms/op 1.02
getEffectiveBalanceIncrementsZeroInactive - 250000 vs - 7PWei 403.52 us/op 325.19 us/op 1.24
getCommitteeAssignments - req 1 vs - 250000 vc 6.7823 ms/op 5.4545 ms/op 1.24
getCommitteeAssignments - req 100 vs - 250000 vc 8.9008 ms/op 7.9321 ms/op 1.12
getCommitteeAssignments - req 1000 vs - 250000 vc 9.6212 ms/op 8.5133 ms/op 1.13
RootCache.getBlockRootAtSlot - 250000 vs - 7PWei 11.540 ns/op 7.7700 ns/op 1.49
state getBlockRootAtSlot - 250000 vs - 7PWei 1.4195 us/op 1.3485 us/op 1.05
computeProposers - vc 250000 18.620 ms/op 17.418 ms/op 1.07
computeEpochShuffling - vc 250000 200.33 ms/op 173.06 ms/op 1.16
getNextSyncCommittee - vc 250000 311.51 ms/op 287.20 ms/op 1.08

by benchmarkbot/action

dapplion
dapplion previously approved these changes Jan 21, 2023
twoeths
twoeths previously approved these changes Jan 21, 2023
@twoeths twoeths merged commit c7cf766 into unstable Jan 21, 2023
@twoeths twoeths deleted the cayman/update-gossipsub branch January 21, 2023 08:10
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