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

feat: increase default target peers to 100 #6556

Merged
merged 1 commit into from
Apr 11, 2024

Conversation

twoeths
Copy link
Contributor

@twoeths twoeths commented Mar 18, 2024

Motivation

  • Increase target peers to 100 like other clients
  • Has tested this option for 3 days and haven't seen it affect memory. Now this branch makes it as default option

Description

  • Also it make sense to enable gossipsub batch publish option to serialize published messages once in gossipsub

Closes #5799

Copy link
Contributor

github-actions bot commented Mar 18, 2024

Performance Report

✔️ no performance regression detected

Full benchmark results
Benchmark suite Current: 02f0c24 Previous: 6bd9af9 Ratio
getPubkeys - index2pubkey - req 1000 vs - 250000 vc 681.32 us/op 1.0549 ms/op 0.65
getPubkeys - validatorsArr - req 1000 vs - 250000 vc 81.351 us/op 132.70 us/op 0.61
BLS verify - blst-native 1.2872 ms/op 1.3869 ms/op 0.93
BLS verifyMultipleSignatures 3 - blst-native 2.6496 ms/op 2.8300 ms/op 0.94
BLS verifyMultipleSignatures 8 - blst-native 5.9204 ms/op 6.3027 ms/op 0.94
BLS verifyMultipleSignatures 32 - blst-native 21.724 ms/op 24.058 ms/op 0.90
BLS verifyMultipleSignatures 64 - blst-native 42.796 ms/op 45.044 ms/op 0.95
BLS verifyMultipleSignatures 128 - blst-native 83.316 ms/op 80.752 ms/op 1.03
BLS deserializing 10000 signatures 871.86 ms/op 899.03 ms/op 0.97
BLS deserializing 100000 signatures 9.1689 s/op 9.0007 s/op 1.02
BLS verifyMultipleSignatures - same message - 3 - blst-native 1.3128 ms/op 1.2066 ms/op 1.09
BLS verifyMultipleSignatures - same message - 8 - blst-native 1.4849 ms/op 1.5024 ms/op 0.99
BLS verifyMultipleSignatures - same message - 32 - blst-native 2.8683 ms/op 2.6658 ms/op 1.08
BLS verifyMultipleSignatures - same message - 64 - blst-native 3.9828 ms/op 3.1535 ms/op 1.26
BLS verifyMultipleSignatures - same message - 128 - blst-native 7.7897 ms/op 8.1379 ms/op 0.96
BLS aggregatePubkeys 32 - blst-native 25.081 us/op 28.426 us/op 0.88
BLS aggregatePubkeys 128 - blst-native 98.312 us/op 101.09 us/op 0.97
notSeenSlots=1 numMissedVotes=1 numBadVotes=10 61.566 ms/op 76.790 ms/op 0.80
notSeenSlots=1 numMissedVotes=0 numBadVotes=4 70.185 ms/op 74.138 ms/op 0.95
notSeenSlots=2 numMissedVotes=1 numBadVotes=10 34.777 ms/op 33.489 ms/op 1.04
getSlashingsAndExits - default max 195.01 us/op 274.81 us/op 0.71
getSlashingsAndExits - 2k 383.53 us/op 530.84 us/op 0.72
proposeBlockBody type=full, size=empty 5.7814 ms/op 4.8034 ms/op 1.20
isKnown best case - 1 super set check 311.00 ns/op 410.00 ns/op 0.76
isKnown normal case - 2 super set checks 294.00 ns/op 715.00 ns/op 0.41
isKnown worse case - 16 super set checks 295.00 ns/op 639.00 ns/op 0.46
InMemoryCheckpointStateCache - add get delete 6.1190 us/op 6.8250 us/op 0.90
validate api signedAggregateAndProof - struct 2.7045 ms/op 2.9063 ms/op 0.93
validate gossip signedAggregateAndProof - struct 2.7816 ms/op 2.7640 ms/op 1.01
validate gossip attestation - vc 640000 1.3422 ms/op 1.2890 ms/op 1.04
batch validate gossip attestation - vc 640000 - chunk 32 159.41 us/op 171.40 us/op 0.93
batch validate gossip attestation - vc 640000 - chunk 64 140.69 us/op 164.11 us/op 0.86
batch validate gossip attestation - vc 640000 - chunk 128 132.77 us/op 156.68 us/op 0.85
batch validate gossip attestation - vc 640000 - chunk 256 128.42 us/op 139.13 us/op 0.92
pickEth1Vote - no votes 1.1402 ms/op 1.0726 ms/op 1.06
pickEth1Vote - max votes 7.1739 ms/op 12.066 ms/op 0.59
pickEth1Vote - Eth1Data hashTreeRoot value x2048 17.100 ms/op 21.977 ms/op 0.78
pickEth1Vote - Eth1Data hashTreeRoot tree x2048 26.564 ms/op 40.949 ms/op 0.65
pickEth1Vote - Eth1Data fastSerialize value x2048 602.95 us/op 565.33 us/op 1.07
pickEth1Vote - Eth1Data fastSerialize tree x2048 6.0092 ms/op 8.2086 ms/op 0.73
bytes32 toHexString 496.00 ns/op 822.00 ns/op 0.60
bytes32 Buffer.toString(hex) 292.00 ns/op 417.00 ns/op 0.70
bytes32 Buffer.toString(hex) from Uint8Array 432.00 ns/op 574.00 ns/op 0.75
bytes32 Buffer.toString(hex) + 0x 295.00 ns/op 361.00 ns/op 0.82
Object access 1 prop 0.15700 ns/op 0.25500 ns/op 0.62
Map access 1 prop 0.14400 ns/op 0.28900 ns/op 0.50
Object get x1000 7.1310 ns/op 5.8490 ns/op 1.22
Map get x1000 0.73500 ns/op 0.96400 ns/op 0.76
Object set x1000 49.733 ns/op 54.102 ns/op 0.92
Map set x1000 39.491 ns/op 37.718 ns/op 1.05
Return object 10000 times 0.23550 ns/op 0.26470 ns/op 0.89
Throw Error 10000 times 3.8600 us/op 3.0208 us/op 1.28
fastMsgIdFn sha256 / 200 bytes 3.2700 us/op 2.3740 us/op 1.38
fastMsgIdFn h32 xxhash / 200 bytes 274.00 ns/op 455.00 ns/op 0.60
fastMsgIdFn h64 xxhash / 200 bytes 336.00 ns/op 536.00 ns/op 0.63
fastMsgIdFn sha256 / 1000 bytes 11.177 us/op 8.8300 us/op 1.27
fastMsgIdFn h32 xxhash / 1000 bytes 397.00 ns/op 664.00 ns/op 0.60
fastMsgIdFn h64 xxhash / 1000 bytes 406.00 ns/op 558.00 ns/op 0.73
fastMsgIdFn sha256 / 10000 bytes 102.00 us/op 59.759 us/op 1.71
fastMsgIdFn h32 xxhash / 10000 bytes 1.8980 us/op 2.1510 us/op 0.88
fastMsgIdFn h64 xxhash / 10000 bytes 1.3120 us/op 1.4520 us/op 0.90
send data - 1000 256B messages 18.665 ms/op 15.394 ms/op 1.21
send data - 1000 512B messages 24.839 ms/op 19.033 ms/op 1.31
send data - 1000 1024B messages 37.915 ms/op 31.332 ms/op 1.21
send data - 1000 1200B messages 37.723 ms/op 37.009 ms/op 1.02
send data - 1000 2048B messages 47.364 ms/op 41.809 ms/op 1.13
send data - 1000 4096B messages 41.634 ms/op 42.226 ms/op 0.99
send data - 1000 16384B messages 118.65 ms/op 106.12 ms/op 1.12
send data - 1000 65536B messages 506.99 ms/op 485.18 ms/op 1.04
enrSubnets - fastDeserialize 64 bits 1.2630 us/op 1.1500 us/op 1.10
enrSubnets - ssz BitVector 64 bits 412.00 ns/op 512.00 ns/op 0.80
enrSubnets - fastDeserialize 4 bits 165.00 ns/op 232.00 ns/op 0.71
enrSubnets - ssz BitVector 4 bits 411.00 ns/op 475.00 ns/op 0.87
prioritizePeers score -10:0 att 32-0.1 sync 2-0 211.96 us/op 82.297 us/op 2.58
prioritizePeers score 0:0 att 32-0.25 sync 2-0.25 278.86 us/op 114.62 us/op 2.43
prioritizePeers score 0:0 att 32-0.5 sync 2-0.5 339.63 us/op 205.91 us/op 1.65
prioritizePeers score 0:0 att 64-0.75 sync 4-0.75 587.79 us/op 281.23 us/op 2.09
prioritizePeers score 0:0 att 64-1 sync 4-1 700.68 us/op 265.87 us/op 2.64
array of 16000 items push then shift 1.6535 us/op 1.7570 us/op 0.94
LinkedList of 16000 items push then shift 8.8860 ns/op 7.6490 ns/op 1.16
array of 16000 items push then pop 101.26 ns/op 108.43 ns/op 0.93
LinkedList of 16000 items push then pop 8.8450 ns/op 6.9480 ns/op 1.27
array of 24000 items push then shift 2.5292 us/op 2.2630 us/op 1.12
LinkedList of 24000 items push then shift 9.0310 ns/op 7.3980 ns/op 1.22
array of 24000 items push then pop 138.25 ns/op 137.28 ns/op 1.01
LinkedList of 24000 items push then pop 8.8560 ns/op 6.8960 ns/op 1.28
intersect bitArray bitLen 8 6.2270 ns/op 5.2560 ns/op 1.18
intersect array and set length 8 64.280 ns/op 51.746 ns/op 1.24
intersect bitArray bitLen 128 36.202 ns/op 30.528 ns/op 1.19
intersect array and set length 128 914.37 ns/op 734.21 ns/op 1.25
bitArray.getTrueBitIndexes() bitLen 128 1.4900 us/op 1.6000 us/op 0.93
bitArray.getTrueBitIndexes() bitLen 248 2.7060 us/op 2.6450 us/op 1.02
bitArray.getTrueBitIndexes() bitLen 512 5.5900 us/op 4.5640 us/op 1.22
Buffer.concat 32 items 996.00 ns/op 961.00 ns/op 1.04
Uint8Array.set 32 items 1.9530 us/op 1.8930 us/op 1.03
Set add up to 64 items then delete first 4.2470 us/op 1.8562 us/op 2.29
OrderedSet add up to 64 items then delete first 5.3838 us/op 2.9512 us/op 1.82
Set add up to 64 items then delete last 4.5662 us/op 2.1247 us/op 2.15
OrderedSet add up to 64 items then delete last 5.6661 us/op 3.1888 us/op 1.78
Set add up to 64 items then delete middle 4.5199 us/op 2.1759 us/op 2.08
OrderedSet add up to 64 items then delete middle 6.8890 us/op 5.2344 us/op 1.32
Set add up to 128 items then delete first 9.2631 us/op 4.5420 us/op 2.04
OrderedSet add up to 128 items then delete first 12.168 us/op 6.7067 us/op 1.81
Set add up to 128 items then delete last 9.0444 us/op 4.2757 us/op 2.12
OrderedSet add up to 128 items then delete last 11.505 us/op 6.3364 us/op 1.82
Set add up to 128 items then delete middle 9.0884 us/op 3.9701 us/op 2.29
OrderedSet add up to 128 items then delete middle 17.109 us/op 11.259 us/op 1.52
Set add up to 256 items then delete first 18.885 us/op 8.3641 us/op 2.26
OrderedSet add up to 256 items then delete first 25.198 us/op 13.364 us/op 1.89
Set add up to 256 items then delete last 18.053 us/op 8.2394 us/op 2.19
OrderedSet add up to 256 items then delete last 22.993 us/op 12.169 us/op 1.89
Set add up to 256 items then delete middle 18.569 us/op 7.8686 us/op 2.36
OrderedSet add up to 256 items then delete middle 45.666 us/op 38.864 us/op 1.18
transfer serialized Status (84 B) 1.6910 us/op 1.5510 us/op 1.09
copy serialized Status (84 B) 1.3370 us/op 1.6540 us/op 0.81
transfer serialized SignedVoluntaryExit (112 B) 1.9110 us/op 1.9690 us/op 0.97
copy serialized SignedVoluntaryExit (112 B) 1.3910 us/op 1.4760 us/op 0.94
transfer serialized ProposerSlashing (416 B) 2.0520 us/op 2.2410 us/op 0.92
copy serialized ProposerSlashing (416 B) 1.7720 us/op 1.9430 us/op 0.91
transfer serialized Attestation (485 B) 2.1030 us/op 2.8040 us/op 0.75
copy serialized Attestation (485 B) 1.8440 us/op 3.4680 us/op 0.53
transfer serialized AttesterSlashing (33232 B) 2.1190 us/op 2.3920 us/op 0.89
copy serialized AttesterSlashing (33232 B) 6.4730 us/op 5.7650 us/op 1.12
transfer serialized Small SignedBeaconBlock (128000 B) 2.4490 us/op 2.0590 us/op 1.19
copy serialized Small SignedBeaconBlock (128000 B) 16.964 us/op 11.842 us/op 1.43
transfer serialized Avg SignedBeaconBlock (200000 B) 2.8730 us/op 1.9410 us/op 1.48
copy serialized Avg SignedBeaconBlock (200000 B) 27.038 us/op 15.259 us/op 1.77
transfer serialized BlobsSidecar (524380 B) 2.8510 us/op 2.4960 us/op 1.14
copy serialized BlobsSidecar (524380 B) 90.809 us/op 85.429 us/op 1.06
transfer serialized Big SignedBeaconBlock (1000000 B) 2.9020 us/op 3.3820 us/op 0.86
copy serialized Big SignedBeaconBlock (1000000 B) 154.28 us/op 161.90 us/op 0.95
pass gossip attestations to forkchoice per slot 4.1275 ms/op 3.3244 ms/op 1.24
forkChoice updateHead vc 100000 bc 64 eq 0 679.95 us/op 591.30 us/op 1.15
forkChoice updateHead vc 600000 bc 64 eq 0 4.2083 ms/op 2.9563 ms/op 1.42
forkChoice updateHead vc 1000000 bc 64 eq 0 7.1198 ms/op 6.4037 ms/op 1.11
forkChoice updateHead vc 600000 bc 320 eq 0 4.1399 ms/op 3.7888 ms/op 1.09
forkChoice updateHead vc 600000 bc 1200 eq 0 4.2336 ms/op 3.8169 ms/op 1.11
forkChoice updateHead vc 600000 bc 7200 eq 0 5.3386 ms/op 7.9269 ms/op 0.67
forkChoice updateHead vc 600000 bc 64 eq 1000 11.036 ms/op 11.332 ms/op 0.97
forkChoice updateHead vc 600000 bc 64 eq 10000 11.794 ms/op 10.981 ms/op 1.07
forkChoice updateHead vc 600000 bc 64 eq 300000 15.361 ms/op 12.865 ms/op 1.19
computeDeltas 500000 validators 300 proto nodes 6.4669 ms/op 4.2512 ms/op 1.52
computeDeltas 500000 validators 1200 proto nodes 6.4441 ms/op 4.3017 ms/op 1.50
computeDeltas 500000 validators 7200 proto nodes 6.2597 ms/op 3.5883 ms/op 1.74
computeDeltas 750000 validators 300 proto nodes 9.4424 ms/op 5.2221 ms/op 1.81
computeDeltas 750000 validators 1200 proto nodes 9.5341 ms/op 4.8419 ms/op 1.97
computeDeltas 750000 validators 7200 proto nodes 9.5159 ms/op 4.9691 ms/op 1.91
computeDeltas 1400000 validators 300 proto nodes 17.732 ms/op 9.8626 ms/op 1.80
computeDeltas 1400000 validators 1200 proto nodes 18.323 ms/op 9.8690 ms/op 1.86
computeDeltas 1400000 validators 7200 proto nodes 19.000 ms/op 10.403 ms/op 1.83
computeDeltas 2100000 validators 300 proto nodes 27.853 ms/op 15.185 ms/op 1.83
computeDeltas 2100000 validators 1200 proto nodes 27.844 ms/op 16.852 ms/op 1.65
computeDeltas 2100000 validators 7200 proto nodes 26.862 ms/op 18.160 ms/op 1.48
altair processAttestation - 250000 vs - 7PWei normalcase 2.1271 ms/op 3.4211 ms/op 0.62
altair processAttestation - 250000 vs - 7PWei worstcase 3.1472 ms/op 4.8520 ms/op 0.65
altair processAttestation - setStatus - 1/6 committees join 144.81 us/op 151.27 us/op 0.96
altair processAttestation - setStatus - 1/3 committees join 286.14 us/op 292.16 us/op 0.98
altair processAttestation - setStatus - 1/2 committees join 390.70 us/op 366.66 us/op 1.07
altair processAttestation - setStatus - 2/3 committees join 479.19 us/op 469.25 us/op 1.02
altair processAttestation - setStatus - 4/5 committees join 660.38 us/op 661.18 us/op 1.00
altair processAttestation - setStatus - 100% committees join 770.35 us/op 811.39 us/op 0.95
altair processBlock - 250000 vs - 7PWei normalcase 8.4847 ms/op 9.5141 ms/op 0.89
altair processBlock - 250000 vs - 7PWei normalcase hashState 35.167 ms/op 44.644 ms/op 0.79
altair processBlock - 250000 vs - 7PWei worstcase 42.893 ms/op 53.935 ms/op 0.80
altair processBlock - 250000 vs - 7PWei worstcase hashState 89.480 ms/op 103.95 ms/op 0.86
phase0 processBlock - 250000 vs - 7PWei normalcase 2.3845 ms/op 3.0272 ms/op 0.79
phase0 processBlock - 250000 vs - 7PWei worstcase 28.888 ms/op 34.017 ms/op 0.85
altair processEth1Data - 250000 vs - 7PWei normalcase 475.48 us/op 715.67 us/op 0.66
getExpectedWithdrawals 250000 eb:1,eth1:1,we:0,wn:0,smpl:15 11.493 us/op 19.436 us/op 0.59
getExpectedWithdrawals 250000 eb:0.95,eth1:0.1,we:0.05,wn:0,smpl:219 36.807 us/op 108.42 us/op 0.34
getExpectedWithdrawals 250000 eb:0.95,eth1:0.3,we:0.05,wn:0,smpl:42 10.880 us/op 30.285 us/op 0.36
getExpectedWithdrawals 250000 eb:0.95,eth1:0.7,we:0.05,wn:0,smpl:18 13.879 us/op 18.867 us/op 0.74
getExpectedWithdrawals 250000 eb:0.1,eth1:0.1,we:0,wn:0,smpl:1020 154.48 us/op 211.41 us/op 0.73
getExpectedWithdrawals 250000 eb:0.03,eth1:0.03,we:0,wn:0,smpl:11777 1.0259 ms/op 1.5912 ms/op 0.64
getExpectedWithdrawals 250000 eb:0.01,eth1:0.01,we:0,wn:0,smpl:16384 1.5199 ms/op 1.7155 ms/op 0.89
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,smpl:16384 1.4576 ms/op 1.6950 ms/op 0.86
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,nocache,smpl:16384 3.2715 ms/op 4.1290 ms/op 0.79
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,smpl:16384 2.4076 ms/op 2.9632 ms/op 0.81
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,nocache,smpl:16384 5.1070 ms/op 8.0288 ms/op 0.64
Tree 40 250000 create 342.69 ms/op 566.18 ms/op 0.61
Tree 40 250000 get(125000) 190.58 ns/op 141.44 ns/op 1.35
Tree 40 250000 set(125000) 972.67 ns/op 831.54 ns/op 1.17
Tree 40 250000 toArray() 21.381 ms/op 22.210 ms/op 0.96
Tree 40 250000 iterate all - toArray() + loop 19.915 ms/op 25.245 ms/op 0.79
Tree 40 250000 iterate all - get(i) 66.579 ms/op 55.130 ms/op 1.21
MutableVector 250000 create 14.224 ms/op 11.583 ms/op 1.23
MutableVector 250000 get(125000) 6.4070 ns/op 6.4290 ns/op 1.00
MutableVector 250000 set(125000) 277.58 ns/op 245.27 ns/op 1.13
MutableVector 250000 toArray() 3.1844 ms/op 4.1415 ms/op 0.77
MutableVector 250000 iterate all - toArray() + loop 3.4333 ms/op 4.2616 ms/op 0.81
MutableVector 250000 iterate all - get(i) 1.5145 ms/op 1.4922 ms/op 1.01
Array 250000 create 3.0314 ms/op 4.2030 ms/op 0.72
Array 250000 clone - spread 1.4221 ms/op 1.4627 ms/op 0.97
Array 250000 get(125000) 1.1120 ns/op 1.2660 ns/op 0.88
Array 250000 set(125000) 4.1520 ns/op 1.4290 ns/op 2.91
Array 250000 iterate all - loop 164.97 us/op 163.86 us/op 1.01
effectiveBalanceIncrements clone Uint8Array 300000 32.855 us/op 18.283 us/op 1.80
effectiveBalanceIncrements clone MutableVector 300000 444.00 ns/op 523.00 ns/op 0.85
effectiveBalanceIncrements rw all Uint8Array 300000 199.61 us/op 193.78 us/op 1.03
effectiveBalanceIncrements rw all MutableVector 300000 90.962 ms/op 81.356 ms/op 1.12
phase0 afterProcessEpoch - 250000 vs - 7PWei 123.67 ms/op 85.498 ms/op 1.45
phase0 beforeProcessEpoch - 250000 vs - 7PWei 37.819 ms/op 51.890 ms/op 0.73
altair processEpoch - mainnet_e81889 485.39 ms/op 544.45 ms/op 0.89
mainnet_e81889 - altair beforeProcessEpoch 80.468 ms/op 107.27 ms/op 0.75
mainnet_e81889 - altair processJustificationAndFinalization 14.582 us/op 20.420 us/op 0.71
mainnet_e81889 - altair processInactivityUpdates 5.5160 ms/op 8.2399 ms/op 0.67
mainnet_e81889 - altair processRewardsAndPenalties 79.913 ms/op 80.432 ms/op 0.99
mainnet_e81889 - altair processRegistryUpdates 2.3570 us/op 4.4960 us/op 0.52
mainnet_e81889 - altair processSlashings 386.00 ns/op 1.2390 us/op 0.31
mainnet_e81889 - altair processEth1DataReset 506.00 ns/op 1.2040 us/op 0.42
mainnet_e81889 - altair processEffectiveBalanceUpdates 1.3471 ms/op 1.5241 ms/op 0.88
mainnet_e81889 - altair processSlashingsReset 3.4130 us/op 7.3530 us/op 0.46
mainnet_e81889 - altair processRandaoMixesReset 5.0820 us/op 8.6590 us/op 0.59
mainnet_e81889 - altair processHistoricalRootsUpdate 748.00 ns/op 1.4610 us/op 0.51
mainnet_e81889 - altair processParticipationFlagUpdates 1.8960 us/op 4.9400 us/op 0.38
mainnet_e81889 - altair processSyncCommitteeUpdates 794.00 ns/op 1.6680 us/op 0.48
mainnet_e81889 - altair afterProcessEpoch 120.02 ms/op 98.806 ms/op 1.21
capella processEpoch - mainnet_e217614 1.9952 s/op 1.9276 s/op 1.04
mainnet_e217614 - capella beforeProcessEpoch 453.46 ms/op 448.92 ms/op 1.01
mainnet_e217614 - capella processJustificationAndFinalization 13.538 us/op 18.099 us/op 0.75
mainnet_e217614 - capella processInactivityUpdates 22.296 ms/op 18.988 ms/op 1.17
mainnet_e217614 - capella processRewardsAndPenalties 522.85 ms/op 529.86 ms/op 0.99
mainnet_e217614 - capella processRegistryUpdates 20.718 us/op 20.815 us/op 1.00
mainnet_e217614 - capella processSlashings 592.00 ns/op 701.00 ns/op 0.84
mainnet_e217614 - capella processEth1DataReset 471.00 ns/op 725.00 ns/op 0.65
mainnet_e217614 - capella processEffectiveBalanceUpdates 4.4220 ms/op 3.5374 ms/op 1.25
mainnet_e217614 - capella processSlashingsReset 3.4560 us/op 3.8640 us/op 0.89
mainnet_e217614 - capella processRandaoMixesReset 4.6480 us/op 4.0430 us/op 1.15
mainnet_e217614 - capella processHistoricalRootsUpdate 716.00 ns/op 1.0710 us/op 0.67
mainnet_e217614 - capella processParticipationFlagUpdates 1.4960 us/op 2.8750 us/op 0.52
mainnet_e217614 - capella afterProcessEpoch 355.91 ms/op 223.26 ms/op 1.59
phase0 processEpoch - mainnet_e58758 449.22 ms/op 462.29 ms/op 0.97
mainnet_e58758 - phase0 beforeProcessEpoch 135.78 ms/op 138.36 ms/op 0.98
mainnet_e58758 - phase0 processJustificationAndFinalization 14.967 us/op 22.276 us/op 0.67
mainnet_e58758 - phase0 processRewardsAndPenalties 60.844 ms/op 61.476 ms/op 0.99
mainnet_e58758 - phase0 processRegistryUpdates 10.036 us/op 14.957 us/op 0.67
mainnet_e58758 - phase0 processSlashings 448.00 ns/op 816.00 ns/op 0.55
mainnet_e58758 - phase0 processEth1DataReset 403.00 ns/op 814.00 ns/op 0.50
mainnet_e58758 - phase0 processEffectiveBalanceUpdates 1.1078 ms/op 1.1512 ms/op 0.96
mainnet_e58758 - phase0 processSlashingsReset 4.6680 us/op 5.7170 us/op 0.82
mainnet_e58758 - phase0 processRandaoMixesReset 5.3420 us/op 6.2970 us/op 0.85
mainnet_e58758 - phase0 processHistoricalRootsUpdate 551.00 ns/op 870.00 ns/op 0.63
mainnet_e58758 - phase0 processParticipationRecordUpdates 3.6270 us/op 5.9050 us/op 0.61
mainnet_e58758 - phase0 afterProcessEpoch 100.69 ms/op 81.030 ms/op 1.24
phase0 processEffectiveBalanceUpdates - 250000 normalcase 1.3525 ms/op 1.3153 ms/op 1.03
phase0 processEffectiveBalanceUpdates - 250000 worstcase 0.5 1.4459 ms/op 1.2186 ms/op 1.19
altair processInactivityUpdates - 250000 normalcase 22.671 ms/op 28.173 ms/op 0.80
altair processInactivityUpdates - 250000 worstcase 27.429 ms/op 29.604 ms/op 0.93
phase0 processRegistryUpdates - 250000 normalcase 11.061 us/op 10.117 us/op 1.09
phase0 processRegistryUpdates - 250000 badcase_full_deposits 415.15 us/op 436.12 us/op 0.95
phase0 processRegistryUpdates - 250000 worstcase 0.5 131.17 ms/op 188.88 ms/op 0.69
altair processRewardsAndPenalties - 250000 normalcase 65.352 ms/op 65.240 ms/op 1.00
altair processRewardsAndPenalties - 250000 worstcase 56.077 ms/op 68.354 ms/op 0.82
phase0 getAttestationDeltas - 250000 normalcase 9.1065 ms/op 10.588 ms/op 0.86
phase0 getAttestationDeltas - 250000 worstcase 10.039 ms/op 7.2292 ms/op 1.39
phase0 processSlashings - 250000 worstcase 82.341 us/op 93.257 us/op 0.88
altair processSyncCommitteeUpdates - 250000 154.13 ms/op 116.25 ms/op 1.33
BeaconState.hashTreeRoot - No change 361.00 ns/op 523.00 ns/op 0.69
BeaconState.hashTreeRoot - 1 full validator 139.57 us/op 101.78 us/op 1.37
BeaconState.hashTreeRoot - 32 full validator 1.6560 ms/op 974.29 us/op 1.70
BeaconState.hashTreeRoot - 512 full validator 16.193 ms/op 10.620 ms/op 1.52
BeaconState.hashTreeRoot - 1 validator.effectiveBalance 166.73 us/op 123.77 us/op 1.35
BeaconState.hashTreeRoot - 32 validator.effectiveBalance 1.8961 ms/op 1.7352 ms/op 1.09
BeaconState.hashTreeRoot - 512 validator.effectiveBalance 25.448 ms/op 27.772 ms/op 0.92
BeaconState.hashTreeRoot - 1 balances 108.88 us/op 143.07 us/op 0.76
BeaconState.hashTreeRoot - 32 balances 1.1208 ms/op 1.1189 ms/op 1.00
BeaconState.hashTreeRoot - 512 balances 9.5863 ms/op 8.4285 ms/op 1.14
BeaconState.hashTreeRoot - 250000 balances 188.65 ms/op 154.96 ms/op 1.22
aggregationBits - 2048 els - zipIndexesInBitList 28.399 us/op 24.389 us/op 1.16
byteArrayEquals 32 75.301 ns/op 68.112 ns/op 1.11
Buffer.compare 32 55.872 ns/op 40.736 ns/op 1.37
byteArrayEquals 1024 2.0585 us/op 1.8540 us/op 1.11
Buffer.compare 1024 72.325 ns/op 56.207 ns/op 1.29
byteArrayEquals 16384 32.691 us/op 29.207 us/op 1.12
Buffer.compare 16384 272.95 ns/op 237.64 ns/op 1.15
byteArrayEquals 123687377 248.88 ms/op 235.55 ms/op 1.06
Buffer.compare 123687377 7.5033 ms/op 5.8025 ms/op 1.29
byteArrayEquals 32 - diff last byte 75.231 ns/op 72.862 ns/op 1.03
Buffer.compare 32 - diff last byte 56.182 ns/op 42.682 ns/op 1.32
byteArrayEquals 1024 - diff last byte 2.0663 us/op 1.8564 us/op 1.11
Buffer.compare 1024 - diff last byte 71.968 ns/op 52.498 ns/op 1.37
byteArrayEquals 16384 - diff last byte 32.934 us/op 30.856 us/op 1.07
Buffer.compare 16384 - diff last byte 256.19 ns/op 248.17 ns/op 1.03
byteArrayEquals 123687377 - diff last byte 247.89 ms/op 232.39 ms/op 1.07
Buffer.compare 123687377 - diff last byte 7.5166 ms/op 6.7325 ms/op 1.12
byteArrayEquals 32 - random bytes 5.2960 ns/op 6.2250 ns/op 0.85
Buffer.compare 32 - random bytes 60.808 ns/op 46.972 ns/op 1.29
byteArrayEquals 1024 - random bytes 5.2720 ns/op 6.5850 ns/op 0.80
Buffer.compare 1024 - random bytes 60.861 ns/op 39.649 ns/op 1.53
byteArrayEquals 16384 - random bytes 5.3060 ns/op 6.1080 ns/op 0.87
Buffer.compare 16384 - random bytes 60.721 ns/op 39.978 ns/op 1.52
byteArrayEquals 123687377 - random bytes 8.7600 ns/op 12.540 ns/op 0.70
Buffer.compare 123687377 - random bytes 64.690 ns/op 54.280 ns/op 1.19
regular array get 100000 times 45.717 us/op 61.683 us/op 0.74
wrappedArray get 100000 times 45.819 us/op 51.333 us/op 0.89
arrayWithProxy get 100000 times 14.664 ms/op 12.955 ms/op 1.13
ssz.Root.equals 54.369 ns/op 60.038 ns/op 0.91
byteArrayEquals 54.054 ns/op 61.810 ns/op 0.87
Buffer.compare 11.862 ns/op 11.723 ns/op 1.01
shuffle list - 16384 els 8.7434 ms/op 6.2725 ms/op 1.39
shuffle list - 250000 els 128.33 ms/op 106.91 ms/op 1.20
processSlot - 1 slots 16.894 us/op 28.168 us/op 0.60
processSlot - 32 slots 3.8378 ms/op 5.2348 ms/op 0.73
getEffectiveBalanceIncrementsZeroInactive - 250000 vs - 7PWei 58.743 ms/op 65.346 ms/op 0.90
getCommitteeAssignments - req 1 vs - 250000 vc 2.7012 ms/op 2.5854 ms/op 1.04
getCommitteeAssignments - req 100 vs - 250000 vc 3.8667 ms/op 3.8677 ms/op 1.00
getCommitteeAssignments - req 1000 vs - 250000 vc 4.2450 ms/op 4.9078 ms/op 0.86
findModifiedValidators - 10000 modified validators 355.23 ms/op 419.31 ms/op 0.85
findModifiedValidators - 1000 modified validators 211.62 ms/op 224.46 ms/op 0.94
findModifiedValidators - 100 modified validators 188.56 ms/op 203.20 ms/op 0.93
findModifiedValidators - 10 modified validators 200.80 ms/op 183.61 ms/op 1.09
findModifiedValidators - 1 modified validators 199.64 ms/op 244.73 ms/op 0.82
findModifiedValidators - no difference 196.55 ms/op 255.23 ms/op 0.77
compare ViewDUs 4.4278 s/op 5.2584 s/op 0.84
compare each validator Uint8Array 1.5359 s/op 1.9933 s/op 0.77
compare ViewDU to Uint8Array 1.1016 s/op 1.3160 s/op 0.84
migrate state 1000000 validators, 24 modified, 0 new 751.94 ms/op 878.42 ms/op 0.86
migrate state 1000000 validators, 1700 modified, 1000 new 1.0356 s/op 1.4305 s/op 0.72
migrate state 1000000 validators, 3400 modified, 2000 new 1.2558 s/op 1.6564 s/op 0.76
migrate state 1500000 validators, 24 modified, 0 new 753.14 ms/op 1.1156 s/op 0.68
migrate state 1500000 validators, 1700 modified, 1000 new 1.0259 s/op 1.2135 s/op 0.85
migrate state 1500000 validators, 3400 modified, 2000 new 1.2729 s/op 1.3913 s/op 0.91
RootCache.getBlockRootAtSlot - 250000 vs - 7PWei 4.1400 ns/op 6.1200 ns/op 0.68
state getBlockRootAtSlot - 250000 vs - 7PWei 709.25 ns/op 570.17 ns/op 1.24
computeProposers - vc 250000 9.1336 ms/op 11.872 ms/op 0.77
computeEpochShuffling - vc 250000 125.70 ms/op 103.06 ms/op 1.22
getNextSyncCommittee - vc 250000 145.79 ms/op 136.03 ms/op 1.07
computeSigningRoot for AttestationData 25.604 us/op 31.158 us/op 0.82
hash AttestationData serialized data then Buffer.toString(base64) 2.2634 us/op 1.3514 us/op 1.67
toHexString serialized data 1.0352 us/op 1.0423 us/op 0.99
Buffer.toString(base64) 217.85 ns/op 178.94 ns/op 1.22

by benchmarkbot/action

@philknows philknows added this to the v1.18.0 milestone Mar 19, 2024
@twoeths
Copy link
Contributor Author

twoeths commented Mar 20, 2024

These metrics are captured on the test mainnet node, it's consistent to other nodes

  • I don't see the heap memory increased, this is on main thread
Screenshot 2024-03-20 at 08 36 46
  • network thread heap memory don't increase as well, but its gc time increased a bit
Screenshot 2024-03-20 at 08 40 18
  • it's interesting that having more peers help us receive block 5ms - 11ms sooner , this is consistent on all nodes
Screenshot 2024-03-20 at 08 43 12
  • mesh peers are the same to stable
Screenshot 2024-03-20 at 08 46 34
  • peer count is as expected (lg1k node)
Screenshot 2024-03-20 at 08 53 10

@twoeths twoeths marked this pull request as ready for review March 20, 2024 01:53
@twoeths twoeths requested a review from a team as a code owner March 20, 2024 01:53
@twoeths
Copy link
Contributor Author

twoeths commented Mar 22, 2024

after 4 days, I found process_heap_bytes increased on the test mainnet node

Screenshot 2024-03-22 at 10 20 55

heap allocation on network thread spiked then get back to normal (see #6106), it's stable on the mainnet thread
Screenshot 2024-03-22 at 10 22 57

@nflaig
Copy link
Member

nflaig commented Mar 25, 2024

I've been running my mainnet node on 100 peers for almost 2 weeks now, effectiveness looks pretty good so far but I am also seeing a increase in heap memory over time.

image

image

Might also be related to Deneb upgrade or a memory leak we introduced in the new release. Will collect some metrics with 50 peers now to see if it is related to increasing the peer count.

@twoeths
Copy link
Contributor Author

twoeths commented Mar 26, 2024

@nflaig thanks for the input, that looks pretty bad
seems there's a memory leak in network thread and it only happens with real mainnet node #6595
it's not likely we can increase peer count to 100 by default, need more time to figure out the memory issue first

@nflaig
Copy link
Member

nflaig commented Mar 27, 2024

Network worker heap memory increase seems unrelated to increasing the peer count, still seeing the same with 50 peers

image

Will collect some more data with 100 peers, I did not take a heap snapshot yet because I forgot to enable lodestar api namespace..

@philknows philknows modified the milestones: v1.18.0, v1.19.0 Apr 2, 2024
@philknows philknows changed the title feat: increase target peers to 100 feat: increase default target peers to 100 Apr 2, 2024
@nflaig
Copy link
Member

nflaig commented Apr 8, 2024

Was able to take a heapsnapshot from my node while the network thread memory was at almost 1 GB
image

network_thread_2024-04-08T15-34-10.340Z.tar.xz

@twoeths twoeths force-pushed the tuyen/increase_target_peers branch from ef4fdfc to 800e20e Compare April 10, 2024 01:32
Copy link

codecov bot commented Apr 10, 2024

Codecov Report

Merging #6556 (800e20e) into unstable (6bd9af9) will not change coverage.
The diff coverage is 100.00%.

Additional details and impacted files
@@            Coverage Diff            @@
##           unstable    #6556   +/-   ##
=========================================
  Coverage     61.69%   61.69%           
=========================================
  Files           556      556           
  Lines         58820    58820           
  Branches       1887     1887           
=========================================
  Hits          36287    36287           
  Misses        22492    22492           
  Partials         41       41           

@twoeths
Copy link
Contributor Author

twoeths commented Apr 10, 2024

there are a lot of users already increased the target peers to 100 and it's noted that the performance of nodes increases a lot with this so we decided to get this PR in.
The heap memory leak issue in network thread is actually not related to peer count and was tracked in #6595

@twoeths twoeths marked this pull request as ready for review April 10, 2024 02:56
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.

🎉

@nflaig nflaig modified the milestones: v1.19.0, v1.18.0 Apr 10, 2024
@twoeths twoeths merged commit 2d766ca into unstable Apr 11, 2024
20 checks passed
@twoeths twoeths deleted the tuyen/increase_target_peers branch April 11, 2024 01:27
nflaig pushed a commit that referenced this pull request Apr 11, 2024
feat: increase target peers to 100
@wemeetagain
Copy link
Member

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

Increase target peers to 100, max peers to 110
4 participants