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: upgrade to js-libp2p 2.0 #7077

Merged
merged 12 commits into from
Oct 11, 2024
Merged

chore: upgrade to js-libp2p 2.0 #7077

merged 12 commits into from
Oct 11, 2024

Conversation

wemeetagain
Copy link
Member

Description

  • bump libp2p and related deps to latest version
  • PeerId no longer contains a private key, anything that needs a private key must pass a PrivateKey instead

@wemeetagain wemeetagain requested a review from a team as a code owner September 11, 2024 21:02
Copy link
Contributor

github-actions bot commented Sep 11, 2024

Performance Report

✔️ no performance regression detected

Full benchmark results
Benchmark suite Current: 80f5e67 Previous: cbc7c90 Ratio
getPubkeys - index2pubkey - req 1000 vs - 250000 vc 1.8312 ms/op 1.9196 ms/op 0.95
getPubkeys - validatorsArr - req 1000 vs - 250000 vc 49.659 us/op 53.423 us/op 0.93
BLS verify - blst 891.93 us/op 782.84 us/op 1.14
BLS verifyMultipleSignatures 3 - blst 1.2973 ms/op 1.2893 ms/op 1.01
BLS verifyMultipleSignatures 8 - blst 1.9498 ms/op 1.6301 ms/op 1.20
BLS verifyMultipleSignatures 32 - blst 4.4748 ms/op 4.8039 ms/op 0.93
BLS verifyMultipleSignatures 64 - blst 8.2867 ms/op 8.9097 ms/op 0.93
BLS verifyMultipleSignatures 128 - blst 15.998 ms/op 17.043 ms/op 0.94
BLS deserializing 10000 signatures 605.45 ms/op 677.81 ms/op 0.89
BLS deserializing 100000 signatures 6.0292 s/op 6.7963 s/op 0.89
BLS verifyMultipleSignatures - same message - 3 - blst 932.63 us/op 941.42 us/op 0.99
BLS verifyMultipleSignatures - same message - 8 - blst 1.0978 ms/op 1.0756 ms/op 1.02
BLS verifyMultipleSignatures - same message - 32 - blst 1.6505 ms/op 1.7309 ms/op 0.95
BLS verifyMultipleSignatures - same message - 64 - blst 2.5493 ms/op 2.6290 ms/op 0.97
BLS verifyMultipleSignatures - same message - 128 - blst 4.2243 ms/op 4.3364 ms/op 0.97
BLS aggregatePubkeys 32 - blst 17.894 us/op 20.804 us/op 0.86
BLS aggregatePubkeys 128 - blst 62.872 us/op 70.539 us/op 0.89
notSeenSlots=1 numMissedVotes=1 numBadVotes=10 50.190 ms/op 55.478 ms/op 0.90
notSeenSlots=1 numMissedVotes=0 numBadVotes=4 47.300 ms/op 48.264 ms/op 0.98
notSeenSlots=2 numMissedVotes=1 numBadVotes=10 34.981 ms/op 32.681 ms/op 1.07
getSlashingsAndExits - default max 72.139 us/op 87.662 us/op 0.82
getSlashingsAndExits - 2k 254.12 us/op 256.79 us/op 0.99
proposeBlockBody type=full, size=empty 5.0393 ms/op 5.7615 ms/op 0.87
isKnown best case - 1 super set check 516.00 ns/op 303.00 ns/op 1.70
isKnown normal case - 2 super set checks 572.00 ns/op 290.00 ns/op 1.97
isKnown worse case - 16 super set checks 481.00 ns/op 273.00 ns/op 1.76
InMemoryCheckpointStateCache - add get delete 2.7210 us/op 2.6500 us/op 1.03
updateUnfinalizedPubkeys - updating 10 pubkeys 763.78 us/op 926.13 us/op 0.82
updateUnfinalizedPubkeys - updating 100 pubkeys 3.0041 ms/op 3.2444 ms/op 0.93
updateUnfinalizedPubkeys - updating 1000 pubkeys 40.632 ms/op 50.572 ms/op 0.80
validate api signedAggregateAndProof - struct 1.5146 ms/op 1.4616 ms/op 1.04
validate gossip signedAggregateAndProof - struct 1.4613 ms/op 1.3665 ms/op 1.07
batch validate gossip attestation - vc 640000 - chunk 32 124.27 us/op 122.98 us/op 1.01
batch validate gossip attestation - vc 640000 - chunk 64 104.37 us/op 107.41 us/op 0.97
batch validate gossip attestation - vc 640000 - chunk 128 98.360 us/op 102.74 us/op 0.96
batch validate gossip attestation - vc 640000 - chunk 256 104.66 us/op 97.142 us/op 1.08
pickEth1Vote - no votes 933.97 us/op 1.0171 ms/op 0.92
pickEth1Vote - max votes 6.3548 ms/op 5.8011 ms/op 1.10
pickEth1Vote - Eth1Data hashTreeRoot value x2048 11.699 ms/op 12.506 ms/op 0.94
pickEth1Vote - Eth1Data hashTreeRoot tree x2048 20.595 ms/op 16.663 ms/op 1.24
pickEth1Vote - Eth1Data fastSerialize value x2048 383.90 us/op 509.70 us/op 0.75
pickEth1Vote - Eth1Data fastSerialize tree x2048 4.1222 ms/op 2.3078 ms/op 1.79
bytes32 toHexString 766.00 ns/op 421.00 ns/op 1.82
bytes32 Buffer.toString(hex) 473.00 ns/op 247.00 ns/op 1.91
bytes32 Buffer.toString(hex) from Uint8Array 663.00 ns/op 380.00 ns/op 1.74
bytes32 Buffer.toString(hex) + 0x 478.00 ns/op 243.00 ns/op 1.97
Object access 1 prop 0.37200 ns/op 0.13900 ns/op 2.68
Map access 1 prop 0.32400 ns/op 0.12900 ns/op 2.51
Object get x1000 4.9600 ns/op 5.8940 ns/op 0.84
Map get x1000 5.7350 ns/op 6.1840 ns/op 0.93
Object set x1000 28.294 ns/op 32.544 ns/op 0.87
Map set x1000 20.235 ns/op 21.759 ns/op 0.93
Return object 10000 times 0.30660 ns/op 0.28600 ns/op 1.07
Throw Error 10000 times 2.6852 us/op 3.2777 us/op 0.82
toHex 124.61 ns/op 149.22 ns/op 0.84
Buffer.from 109.57 ns/op 129.03 ns/op 0.85
shared Buffer 71.477 ns/op 88.847 ns/op 0.80
fastMsgIdFn sha256 / 200 bytes 2.1150 us/op 2.2560 us/op 0.94
fastMsgIdFn h32 xxhash / 200 bytes 479.00 ns/op 232.00 ns/op 2.06
fastMsgIdFn h64 xxhash / 200 bytes 471.00 ns/op 264.00 ns/op 1.78
fastMsgIdFn sha256 / 1000 bytes 6.0610 us/op 7.3370 us/op 0.83
fastMsgIdFn h32 xxhash / 1000 bytes 609.00 ns/op 362.00 ns/op 1.68
fastMsgIdFn h64 xxhash / 1000 bytes 541.00 ns/op 339.00 ns/op 1.60
fastMsgIdFn sha256 / 10000 bytes 48.117 us/op 63.874 us/op 0.75
fastMsgIdFn h32 xxhash / 10000 bytes 1.9100 us/op 1.8220 us/op 1.05
fastMsgIdFn h64 xxhash / 10000 bytes 1.3010 us/op 1.1900 us/op 1.09
send data - 1000 256B messages 10.076 ms/op 11.329 ms/op 0.89
send data - 1000 512B messages 14.096 ms/op 16.650 ms/op 0.85
send data - 1000 1024B messages 24.945 ms/op 26.764 ms/op 0.93
send data - 1000 1200B messages 24.091 ms/op 24.377 ms/op 0.99
send data - 1000 2048B messages 28.330 ms/op 30.773 ms/op 0.92
send data - 1000 4096B messages 26.226 ms/op 30.082 ms/op 0.87
send data - 1000 16384B messages 60.444 ms/op 68.547 ms/op 0.88
send data - 1000 65536B messages 234.03 ms/op 196.52 ms/op 1.19
enrSubnets - fastDeserialize 64 bits 1.0700 us/op 1.0740 us/op 1.00
enrSubnets - ssz BitVector 64 bits 512.00 ns/op 334.00 ns/op 1.53
enrSubnets - fastDeserialize 4 bits 330.00 ns/op 141.00 ns/op 2.34
enrSubnets - ssz BitVector 4 bits 513.00 ns/op 338.00 ns/op 1.52
prioritizePeers score -10:0 att 32-0.1 sync 2-0 113.94 us/op 140.69 us/op 0.81
prioritizePeers score 0:0 att 32-0.25 sync 2-0.25 131.61 us/op 150.83 us/op 0.87
prioritizePeers score 0:0 att 32-0.5 sync 2-0.5 213.64 us/op 260.10 us/op 0.82
prioritizePeers score 0:0 att 64-0.75 sync 4-0.75 392.00 us/op 388.24 us/op 1.01
prioritizePeers score 0:0 att 64-1 sync 4-1 550.66 us/op 632.07 us/op 0.87
array of 16000 items push then shift 1.3744 us/op 1.6571 us/op 0.83
LinkedList of 16000 items push then shift 6.5160 ns/op 7.1670 ns/op 0.91
array of 16000 items push then pop 122.83 ns/op 125.29 ns/op 0.98
LinkedList of 16000 items push then pop 6.7040 ns/op 6.9190 ns/op 0.97
array of 24000 items push then shift 1.9208 us/op 2.4024 us/op 0.80
LinkedList of 24000 items push then shift 6.7230 ns/op 7.0320 ns/op 0.96
array of 24000 items push then pop 116.99 ns/op 134.06 ns/op 0.87
LinkedList of 24000 items push then pop 6.5870 ns/op 6.7200 ns/op 0.98
intersect bitArray bitLen 8 5.2350 ns/op 6.2360 ns/op 0.84
intersect array and set length 8 42.426 ns/op 44.684 ns/op 0.95
intersect bitArray bitLen 128 25.184 ns/op 28.944 ns/op 0.87
intersect array and set length 128 586.50 ns/op 652.78 ns/op 0.90
bitArray.getTrueBitIndexes() bitLen 128 1.9320 us/op 1.7700 us/op 1.09
bitArray.getTrueBitIndexes() bitLen 248 2.6190 us/op 3.1710 us/op 0.83
bitArray.getTrueBitIndexes() bitLen 512 6.2810 us/op 5.7950 us/op 1.08
Buffer.concat 32 items 981.00 ns/op 868.00 ns/op 1.13
Uint8Array.set 32 items 1.1900 us/op 1.3670 us/op 0.87
Buffer.copy 1.3400 us/op 1.5290 us/op 0.88
Uint8Array.set - with subarray 1.7880 us/op 2.4100 us/op 0.74
Uint8Array.set - without subarray 1.1740 us/op 1.2970 us/op 0.91
getUint32 - dataview 388.00 ns/op 242.00 ns/op 1.60
getUint32 - manual 322.00 ns/op 181.00 ns/op 1.78
Set add up to 64 items then delete first 1.7900 us/op 2.2871 us/op 0.78
OrderedSet add up to 64 items then delete first 2.7217 us/op 3.3554 us/op 0.81
Set add up to 64 items then delete last 2.0149 us/op 2.5564 us/op 0.79
OrderedSet add up to 64 items then delete last 2.9990 us/op 3.8041 us/op 0.79
Set add up to 64 items then delete middle 2.0111 us/op 2.5514 us/op 0.79
OrderedSet add up to 64 items then delete middle 4.3991 us/op 5.2024 us/op 0.85
Set add up to 128 items then delete first 3.9692 us/op 5.1903 us/op 0.76
OrderedSet add up to 128 items then delete first 6.1654 us/op 8.3658 us/op 0.74
Set add up to 128 items then delete last 3.8460 us/op 5.3707 us/op 0.72
OrderedSet add up to 128 items then delete last 5.8029 us/op 7.6545 us/op 0.76
Set add up to 128 items then delete middle 3.8385 us/op 4.9593 us/op 0.77
OrderedSet add up to 128 items then delete middle 11.332 us/op 13.847 us/op 0.82
Set add up to 256 items then delete first 7.8786 us/op 10.518 us/op 0.75
OrderedSet add up to 256 items then delete first 12.203 us/op 16.470 us/op 0.74
Set add up to 256 items then delete last 7.6255 us/op 10.069 us/op 0.76
OrderedSet add up to 256 items then delete last 11.557 us/op 14.473 us/op 0.80
Set add up to 256 items then delete middle 7.5826 us/op 9.7076 us/op 0.78
OrderedSet add up to 256 items then delete middle 33.869 us/op 43.626 us/op 0.78
transfer serialized Status (84 B) 1.4070 us/op 1.3300 us/op 1.06
copy serialized Status (84 B) 1.2130 us/op 1.3510 us/op 0.90
transfer serialized SignedVoluntaryExit (112 B) 1.5520 us/op 1.5270 us/op 1.02
copy serialized SignedVoluntaryExit (112 B) 1.3180 us/op 1.3630 us/op 0.97
transfer serialized ProposerSlashing (416 B) 1.8540 us/op 2.1120 us/op 0.88
copy serialized ProposerSlashing (416 B) 1.6540 us/op 1.8210 us/op 0.91
transfer serialized Attestation (485 B) 1.6750 us/op 1.6880 us/op 0.99
copy serialized Attestation (485 B) 1.7160 us/op 1.7330 us/op 0.99
transfer serialized AttesterSlashing (33232 B) 2.2800 us/op 1.7930 us/op 1.27
copy serialized AttesterSlashing (33232 B) 4.1910 us/op 6.3910 us/op 0.66
transfer serialized Small SignedBeaconBlock (128000 B) 2.3360 us/op 2.7040 us/op 0.86
copy serialized Small SignedBeaconBlock (128000 B) 10.952 us/op 23.436 us/op 0.47
transfer serialized Avg SignedBeaconBlock (200000 B) 2.4040 us/op 3.7300 us/op 0.64
copy serialized Avg SignedBeaconBlock (200000 B) 11.784 us/op 36.103 us/op 0.33
transfer serialized BlobsSidecar (524380 B) 2.3010 us/op 4.3200 us/op 0.53
copy serialized BlobsSidecar (524380 B) 70.937 us/op 252.79 us/op 0.28
transfer serialized Big SignedBeaconBlock (1000000 B) 2.8350 us/op 3.6290 us/op 0.78
copy serialized Big SignedBeaconBlock (1000000 B) 123.13 us/op 178.22 us/op 0.69
pass gossip attestations to forkchoice per slot 2.4016 ms/op 2.7267 ms/op 0.88
forkChoice updateHead vc 100000 bc 64 eq 0 342.28 us/op 463.25 us/op 0.74
forkChoice updateHead vc 600000 bc 64 eq 0 2.2690 ms/op 3.4649 ms/op 0.65
forkChoice updateHead vc 1000000 bc 64 eq 0 3.6755 ms/op 5.7369 ms/op 0.64
forkChoice updateHead vc 600000 bc 320 eq 0 2.1897 ms/op 3.0298 ms/op 0.72
forkChoice updateHead vc 600000 bc 1200 eq 0 2.2446 ms/op 2.9437 ms/op 0.76
forkChoice updateHead vc 600000 bc 7200 eq 0 2.5802 ms/op 4.4168 ms/op 0.58
forkChoice updateHead vc 600000 bc 64 eq 1000 8.9339 ms/op 10.494 ms/op 0.85
forkChoice updateHead vc 600000 bc 64 eq 10000 8.9256 ms/op 10.537 ms/op 0.85
forkChoice updateHead vc 600000 bc 64 eq 300000 11.560 ms/op 14.811 ms/op 0.78
computeDeltas 500000 validators 300 proto nodes 3.3007 ms/op 4.4672 ms/op 0.74
computeDeltas 500000 validators 1200 proto nodes 3.2044 ms/op 4.4726 ms/op 0.72
computeDeltas 500000 validators 7200 proto nodes 3.2190 ms/op 4.9467 ms/op 0.65
computeDeltas 750000 validators 300 proto nodes 4.8782 ms/op 7.6595 ms/op 0.64
computeDeltas 750000 validators 1200 proto nodes 4.8117 ms/op 7.1082 ms/op 0.68
computeDeltas 750000 validators 7200 proto nodes 4.7148 ms/op 7.1251 ms/op 0.66
computeDeltas 1400000 validators 300 proto nodes 8.7587 ms/op 11.928 ms/op 0.73
computeDeltas 1400000 validators 1200 proto nodes 9.1242 ms/op 11.195 ms/op 0.82
computeDeltas 1400000 validators 7200 proto nodes 8.8826 ms/op 11.332 ms/op 0.78
computeDeltas 2100000 validators 300 proto nodes 13.867 ms/op 16.863 ms/op 0.82
computeDeltas 2100000 validators 1200 proto nodes 13.552 ms/op 17.001 ms/op 0.80
computeDeltas 2100000 validators 7200 proto nodes 14.083 ms/op 17.278 ms/op 0.82
altair processAttestation - 250000 vs - 7PWei normalcase 1.3561 ms/op 2.0578 ms/op 0.66
altair processAttestation - 250000 vs - 7PWei worstcase 2.0225 ms/op 3.2805 ms/op 0.62
altair processAttestation - setStatus - 1/6 committees join 89.628 us/op 131.81 us/op 0.68
altair processAttestation - setStatus - 1/3 committees join 183.32 us/op 248.34 us/op 0.74
altair processAttestation - setStatus - 1/2 committees join 271.49 us/op 329.41 us/op 0.82
altair processAttestation - setStatus - 2/3 committees join 354.68 us/op 442.62 us/op 0.80
altair processAttestation - setStatus - 4/5 committees join 494.72 us/op 619.97 us/op 0.80
altair processAttestation - setStatus - 100% committees join 594.97 us/op 732.21 us/op 0.81
altair processBlock - 250000 vs - 7PWei normalcase 2.9264 ms/op 5.3465 ms/op 0.55
altair processBlock - 250000 vs - 7PWei normalcase hashState 18.846 ms/op 29.541 ms/op 0.64
altair processBlock - 250000 vs - 7PWei worstcase 31.543 ms/op 36.346 ms/op 0.87
altair processBlock - 250000 vs - 7PWei worstcase hashState 52.590 ms/op 85.612 ms/op 0.61
phase0 processBlock - 250000 vs - 7PWei normalcase 1.7224 ms/op 2.2173 ms/op 0.78
phase0 processBlock - 250000 vs - 7PWei worstcase 22.967 ms/op 24.162 ms/op 0.95
altair processEth1Data - 250000 vs - 7PWei normalcase 237.08 us/op 382.65 us/op 0.62
getExpectedWithdrawals 250000 eb:1,eth1:1,we:0,wn:0,smpl:15 4.6580 us/op 9.0950 us/op 0.51
getExpectedWithdrawals 250000 eb:0.95,eth1:0.1,we:0.05,wn:0,smpl:219 28.570 us/op 52.489 us/op 0.54
getExpectedWithdrawals 250000 eb:0.95,eth1:0.3,we:0.05,wn:0,smpl:42 8.6300 us/op 14.103 us/op 0.61
getExpectedWithdrawals 250000 eb:0.95,eth1:0.7,we:0.05,wn:0,smpl:18 5.2170 us/op 9.9740 us/op 0.52
getExpectedWithdrawals 250000 eb:0.1,eth1:0.1,we:0,wn:0,smpl:1020 122.91 us/op 192.25 us/op 0.64
getExpectedWithdrawals 250000 eb:0.03,eth1:0.03,we:0,wn:0,smpl:11777 902.36 us/op 1.3063 ms/op 0.69
getExpectedWithdrawals 250000 eb:0.01,eth1:0.01,we:0,wn:0,smpl:16384 1.1713 ms/op 1.6347 ms/op 0.72
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,smpl:16384 1.3067 ms/op 1.7152 ms/op 0.76
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,nocache,smpl:16384 3.0306 ms/op 4.0225 ms/op 0.75
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,smpl:16384 1.2279 ms/op 1.6208 ms/op 0.76
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,nocache,smpl:16384 3.1079 ms/op 4.5884 ms/op 0.68
Tree 40 250000 create 185.67 ms/op 299.64 ms/op 0.62
Tree 40 250000 get(125000) 114.92 ns/op 160.06 ns/op 0.72
Tree 40 250000 set(125000) 526.39 ns/op 799.92 ns/op 0.66
Tree 40 250000 toArray() 9.5211 ms/op 23.445 ms/op 0.41
Tree 40 250000 iterate all - toArray() + loop 9.6139 ms/op 21.619 ms/op 0.44
Tree 40 250000 iterate all - get(i) 39.958 ms/op 59.368 ms/op 0.67
Array 250000 create 2.2889 ms/op 3.9083 ms/op 0.59
Array 250000 clone - spread 1.2692 ms/op 1.6058 ms/op 0.79
Array 250000 get(125000) 0.60100 ns/op 0.44100 ns/op 1.36
Array 250000 set(125000) 0.59400 ns/op 0.46200 ns/op 1.29
Array 250000 iterate all - loop 77.467 us/op 110.11 us/op 0.70
phase0 afterProcessEpoch - 250000 vs - 7PWei 43.086 ms/op 97.374 ms/op 0.44
Array.fill - length 1000000 2.5264 ms/op 4.5440 ms/op 0.56
Array push - length 1000000 14.481 ms/op 22.388 ms/op 0.65
Array.get 0.26761 ns/op 0.29143 ns/op 0.92
Uint8Array.get 0.34155 ns/op 0.46011 ns/op 0.74
phase0 beforeProcessEpoch - 250000 vs - 7PWei 12.636 ms/op 20.370 ms/op 0.62
altair processEpoch - mainnet_e81889 233.93 ms/op 310.83 ms/op 0.75
mainnet_e81889 - altair beforeProcessEpoch 16.281 ms/op 20.122 ms/op 0.81
mainnet_e81889 - altair processJustificationAndFinalization 6.4290 us/op 15.851 us/op 0.41
mainnet_e81889 - altair processInactivityUpdates 4.0553 ms/op 5.7359 ms/op 0.71
mainnet_e81889 - altair processRewardsAndPenalties 43.699 ms/op 45.207 ms/op 0.97
mainnet_e81889 - altair processRegistryUpdates 1.9290 us/op 2.0090 us/op 0.96
mainnet_e81889 - altair processSlashings 735.00 ns/op 393.00 ns/op 1.87
mainnet_e81889 - altair processEth1DataReset 656.00 ns/op 332.00 ns/op 1.98
mainnet_e81889 - altair processEffectiveBalanceUpdates 1.0600 ms/op 1.9382 ms/op 0.55
mainnet_e81889 - altair processSlashingsReset 2.2500 us/op 3.9670 us/op 0.57
mainnet_e81889 - altair processRandaoMixesReset 2.5540 us/op 5.7290 us/op 0.45
mainnet_e81889 - altair processHistoricalRootsUpdate 688.00 ns/op 997.00 ns/op 0.69
mainnet_e81889 - altair processParticipationFlagUpdates 1.6280 us/op 2.4150 us/op 0.67
mainnet_e81889 - altair processSyncCommitteeUpdates 467.00 ns/op 408.00 ns/op 1.14
mainnet_e81889 - altair afterProcessEpoch 41.806 ms/op 97.057 ms/op 0.43
capella processEpoch - mainnet_e217614 1.0102 s/op 1.1703 s/op 0.86
mainnet_e217614 - capella beforeProcessEpoch 64.321 ms/op 73.531 ms/op 0.87
mainnet_e217614 - capella processJustificationAndFinalization 12.644 us/op 19.036 us/op 0.66
mainnet_e217614 - capella processInactivityUpdates 12.204 ms/op 19.762 ms/op 0.62
mainnet_e217614 - capella processRewardsAndPenalties 249.86 ms/op 230.57 ms/op 1.08
mainnet_e217614 - capella processRegistryUpdates 11.354 us/op 14.757 us/op 0.77
mainnet_e217614 - capella processSlashings 740.00 ns/op 429.00 ns/op 1.72
mainnet_e217614 - capella processEth1DataReset 671.00 ns/op 436.00 ns/op 1.54
mainnet_e217614 - capella processEffectiveBalanceUpdates 3.8934 ms/op 16.479 ms/op 0.24
mainnet_e217614 - capella processSlashingsReset 2.6130 us/op 4.8890 us/op 0.53
mainnet_e217614 - capella processRandaoMixesReset 2.8720 us/op 5.2440 us/op 0.55
mainnet_e217614 - capella processHistoricalRootsUpdate 691.00 ns/op 693.00 ns/op 1.00
mainnet_e217614 - capella processParticipationFlagUpdates 1.3080 us/op 2.2210 us/op 0.59
mainnet_e217614 - capella afterProcessEpoch 102.12 ms/op 242.12 ms/op 0.42
phase0 processEpoch - mainnet_e58758 283.88 ms/op 419.84 ms/op 0.68
mainnet_e58758 - phase0 beforeProcessEpoch 77.476 ms/op 89.133 ms/op 0.87
mainnet_e58758 - phase0 processJustificationAndFinalization 11.191 us/op 19.770 us/op 0.57
mainnet_e58758 - phase0 processRewardsAndPenalties 24.643 ms/op 36.470 ms/op 0.68
mainnet_e58758 - phase0 processRegistryUpdates 5.8130 us/op 8.0970 us/op 0.72
mainnet_e58758 - phase0 processSlashings 696.00 ns/op 418.00 ns/op 1.67
mainnet_e58758 - phase0 processEth1DataReset 684.00 ns/op 401.00 ns/op 1.71
mainnet_e58758 - phase0 processEffectiveBalanceUpdates 1.3719 ms/op 1.6909 ms/op 0.81
mainnet_e58758 - phase0 processSlashingsReset 2.3780 us/op 5.8930 us/op 0.40
mainnet_e58758 - phase0 processRandaoMixesReset 2.8190 us/op 4.2670 us/op 0.66
mainnet_e58758 - phase0 processHistoricalRootsUpdate 681.00 ns/op 383.00 ns/op 1.78
mainnet_e58758 - phase0 processParticipationRecordUpdates 2.4240 us/op 4.1270 us/op 0.59
mainnet_e58758 - phase0 afterProcessEpoch 36.727 ms/op 82.827 ms/op 0.44
phase0 processEffectiveBalanceUpdates - 250000 normalcase 1.6117 ms/op 1.4770 ms/op 1.09
phase0 processEffectiveBalanceUpdates - 250000 worstcase 0.5 1.7880 ms/op 2.8888 ms/op 0.62
altair processInactivityUpdates - 250000 normalcase 15.549 ms/op 16.134 ms/op 0.96
altair processInactivityUpdates - 250000 worstcase 14.566 ms/op 17.215 ms/op 0.85
phase0 processRegistryUpdates - 250000 normalcase 3.0050 us/op 10.230 us/op 0.29
phase0 processRegistryUpdates - 250000 badcase_full_deposits 297.40 us/op 339.43 us/op 0.88
phase0 processRegistryUpdates - 250000 worstcase 0.5 109.92 ms/op 121.75 ms/op 0.90
altair processRewardsAndPenalties - 250000 normalcase 38.217 ms/op 41.216 ms/op 0.93
altair processRewardsAndPenalties - 250000 worstcase 47.212 ms/op 56.037 ms/op 0.84
phase0 getAttestationDeltas - 250000 normalcase 6.5706 ms/op 11.918 ms/op 0.55
phase0 getAttestationDeltas - 250000 worstcase 5.9867 ms/op 9.8149 ms/op 0.61
phase0 processSlashings - 250000 worstcase 87.760 us/op 134.85 us/op 0.65
altair processSyncCommitteeUpdates - 250000 97.469 ms/op 140.76 ms/op 0.69
BeaconState.hashTreeRoot - No change 456.00 ns/op 264.00 ns/op 1.73
BeaconState.hashTreeRoot - 1 full validator 112.03 us/op 152.12 us/op 0.74
BeaconState.hashTreeRoot - 32 full validator 1.1633 ms/op 1.4407 ms/op 0.81
BeaconState.hashTreeRoot - 512 full validator 8.9499 ms/op 14.867 ms/op 0.60
BeaconState.hashTreeRoot - 1 validator.effectiveBalance 130.05 us/op 161.04 us/op 0.81
BeaconState.hashTreeRoot - 32 validator.effectiveBalance 1.8456 ms/op 2.3363 ms/op 0.79
BeaconState.hashTreeRoot - 512 validator.effectiveBalance 21.261 ms/op 32.597 ms/op 0.65
BeaconState.hashTreeRoot - 1 balances 106.08 us/op 148.56 us/op 0.71
BeaconState.hashTreeRoot - 32 balances 982.59 us/op 1.1661 ms/op 0.84
BeaconState.hashTreeRoot - 512 balances 7.6222 ms/op 9.1769 ms/op 0.83
BeaconState.hashTreeRoot - 250000 balances 170.60 ms/op 207.60 ms/op 0.82
aggregationBits - 2048 els - zipIndexesInBitList 21.034 us/op 37.535 us/op 0.56
byteArrayEquals 32 46.527 ns/op 56.014 ns/op 0.83
Buffer.compare 32 15.418 ns/op 17.561 ns/op 0.88
byteArrayEquals 1024 1.2663 us/op 1.6824 us/op 0.75
Buffer.compare 1024 23.164 ns/op 26.255 ns/op 0.88
byteArrayEquals 16384 20.064 us/op 25.414 us/op 0.79
Buffer.compare 16384 184.76 ns/op 206.52 ns/op 0.89
byteArrayEquals 123687377 143.05 ms/op 196.60 ms/op 0.73
Buffer.compare 123687377 3.7168 ms/op 8.8403 ms/op 0.42
byteArrayEquals 32 - diff last byte 47.254 ns/op 53.505 ns/op 0.88
Buffer.compare 32 - diff last byte 16.175 ns/op 17.639 ns/op 0.92
byteArrayEquals 1024 - diff last byte 1.2601 us/op 1.6137 us/op 0.78
Buffer.compare 1024 - diff last byte 24.073 ns/op 26.926 ns/op 0.89
byteArrayEquals 16384 - diff last byte 20.062 us/op 25.772 us/op 0.78
Buffer.compare 16384 - diff last byte 203.91 ns/op 193.80 ns/op 1.05
byteArrayEquals 123687377 - diff last byte 150.82 ms/op 192.92 ms/op 0.78
Buffer.compare 123687377 - diff last byte 4.8989 ms/op 8.1562 ms/op 0.60
byteArrayEquals 32 - random bytes 6.5040 ns/op 5.2120 ns/op 1.25
Buffer.compare 32 - random bytes 16.830 ns/op 17.403 ns/op 0.97
byteArrayEquals 1024 - random bytes 4.5580 ns/op 5.2530 ns/op 0.87
Buffer.compare 1024 - random bytes 14.535 ns/op 17.475 ns/op 0.83
byteArrayEquals 16384 - random bytes 4.4960 ns/op 5.2220 ns/op 0.86
Buffer.compare 16384 - random bytes 14.131 ns/op 17.392 ns/op 0.81
byteArrayEquals 123687377 - random bytes 7.2600 ns/op 6.4800 ns/op 1.12
Buffer.compare 123687377 - random bytes 16.770 ns/op 18.370 ns/op 0.91
regular array get 100000 times 28.062 us/op 43.122 us/op 0.65
wrappedArray get 100000 times 27.999 us/op 33.294 us/op 0.84
arrayWithProxy get 100000 times 10.071 ms/op 13.336 ms/op 0.76
ssz.Root.equals 40.506 ns/op 46.420 ns/op 0.87
byteArrayEquals 39.600 ns/op 45.845 ns/op 0.86
Buffer.compare 8.4590 ns/op 10.697 ns/op 0.79
processSlot - 1 slots 12.014 us/op 14.429 us/op 0.83
processSlot - 32 slots 2.6127 ms/op 2.4778 ms/op 1.05
getEffectiveBalanceIncrementsZeroInactive - 250000 vs - 7PWei 41.761 ms/op 37.512 ms/op 1.11
getCommitteeAssignments - req 1 vs - 250000 vc 1.6971 ms/op 2.1221 ms/op 0.80
getCommitteeAssignments - req 100 vs - 250000 vc 3.3522 ms/op 4.1724 ms/op 0.80
getCommitteeAssignments - req 1000 vs - 250000 vc 3.5739 ms/op 4.4132 ms/op 0.81
findModifiedValidators - 10000 modified validators 208.09 ms/op 260.22 ms/op 0.80
findModifiedValidators - 1000 modified validators 151.63 ms/op 180.29 ms/op 0.84
findModifiedValidators - 100 modified validators 134.49 ms/op 175.56 ms/op 0.77
findModifiedValidators - 10 modified validators 145.10 ms/op 162.48 ms/op 0.89
findModifiedValidators - 1 modified validators 130.94 ms/op 177.61 ms/op 0.74
findModifiedValidators - no difference 140.01 ms/op 174.00 ms/op 0.80
compare ViewDUs 3.4257 s/op 3.2817 s/op 1.04
compare each validator Uint8Array 1.5947 s/op 1.2168 s/op 1.31
compare ViewDU to Uint8Array 687.05 ms/op 1.2111 s/op 0.57
migrate state 1000000 validators, 24 modified, 0 new 696.06 ms/op 884.89 ms/op 0.79
migrate state 1000000 validators, 1700 modified, 1000 new 947.10 ms/op 1.1999 s/op 0.79
migrate state 1000000 validators, 3400 modified, 2000 new 1.1698 s/op 1.2801 s/op 0.91
migrate state 1500000 validators, 24 modified, 0 new 721.97 ms/op 869.00 ms/op 0.83
migrate state 1500000 validators, 1700 modified, 1000 new 958.22 ms/op 1.0818 s/op 0.89
migrate state 1500000 validators, 3400 modified, 2000 new 1.1028 s/op 1.4083 s/op 0.78
RootCache.getBlockRootAtSlot - 250000 vs - 7PWei 6.0500 ns/op 4.9900 ns/op 1.21
state getBlockRootAtSlot - 250000 vs - 7PWei 1.0198 us/op 794.17 ns/op 1.28
computeProposers - vc 250000 6.7148 ms/op 8.3958 ms/op 0.80
computeEpochShuffling - vc 250000 36.377 ms/op 95.419 ms/op 0.38
getNextSyncCommittee - vc 250000 115.83 ms/op 139.47 ms/op 0.83
computeSigningRoot for AttestationData 29.234 us/op 23.399 us/op 1.25
hash AttestationData serialized data then Buffer.toString(base64) 1.0918 us/op 1.7060 us/op 0.64
toHexString serialized data 706.67 ns/op 1.1090 us/op 0.64
Buffer.toString(base64) 139.11 ns/op 211.42 ns/op 0.66
nodejs block root to RootHex using toHex 105.16 ns/op 203.73 ns/op 0.52
nodejs block root to RootHex using toRootHex 68.555 ns/op 124.07 ns/op 0.55
browser block root to RootHex using the deprecated toHexString 192.55 ns/op 363.32 ns/op 0.53
browser block root to RootHex using toHex 155.98 ns/op 251.29 ns/op 0.62
browser block root to RootHex using toRootHex 141.41 ns/op 203.40 ns/op 0.70

by benchmarkbot/action

Copy link

codecov bot commented Sep 12, 2024

Codecov Report

Attention: Patch coverage is 57.42574% with 43 lines in your changes missing coverage. Please review.

Project coverage is 49.18%. Comparing base (911a3f5) to head (e38824c).
Report is 1 commits behind head on unstable.

Additional details and impacted files
@@             Coverage Diff              @@
##           unstable    #7077      +/-   ##
============================================
- Coverage     49.19%   49.18%   -0.01%     
============================================
  Files           598      598              
  Lines         39797    39801       +4     
  Branches       2094     2087       -7     
============================================
- Hits          19577    19576       -1     
- Misses        20179    20184       +5     
  Partials         41       41              

@wemeetagain
Copy link
Member Author

just deployed to feat3
ready for review

nflaig
nflaig previously approved these changes Sep 25, 2024
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.

LGTM

@twoeths
Copy link
Contributor

twoeths commented Sep 27, 2024

there is 1 mainnet block received very late on feat3, I'm not sure if it's related to the new libp2p or not

Screenshot 2024-09-27 at 17 16 44

@twoeths
Copy link
Contributor

twoeths commented Sep 27, 2024

@wemeetagain is this IDONTWANT feature ON for this branch? ChainSafe/js-libp2p-gossipsub#498

what's the consequence of that and do we need to tweak params for them? GossipsubIdontwantMinDataSize seems low as it's around Attestation message

@wemeetagain
Copy link
Member Author

Yes IDONTWANT is now enabled by default.

what's the consequence of that and do we need to tweak params for them?

When we receive new (non-duplicate) messages greater than idontwantMinDataSize (default 512), we will immediately send an IDONTWANT to our mesh peers.

We likely want to avoid having to send "a lot" of IDONTWANTs and make sure we're just sending them for messages that are "larger". Avoid sending for attestations, ensure sending for blocks and blobs.

We can bump idontwantMinDataSize to 16829 to avoid the largest Attestations in electra.
node -e "import('@lodestar/types').then(x => console.log(x.ssz.electra.SignedAggregateAndProof.maxSize))"

@wemeetagain
Copy link
Member Author

redeployed with tweaked idontwantMinDataSize

@twoeths
Copy link
Contributor

twoeths commented Oct 1, 2024

in the last 2 days peer counts are around ~130 on the mainnet node and ~120 on the 1k node, not sure if that's an issue of new libp2p but let's see if it happens after the restart

Screenshot 2024-10-01 at 09 25 17

@philknows philknows added this to the v1.23.0 milestone Oct 1, 2024
// Only send IDONTWANT messages if the message size is larger than this
// This should be large enough to not send IDONTWANT for "small" messages
// See https://github.com/ChainSafe/lodestar/pull/7077#issuecomment-2383679472
idontwantMinDataSize: 16829,
Copy link
Member

@nflaig nflaig Oct 11, 2024

Choose a reason for hiding this comment

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

Regarding #7077 (comment), isn't the maxSize inflated because the list limits are way too high but in reality can't happen because those are just aggregates over committees while the limit is the block attestation max.

Anyhow doesn't matter much as long as this is smaller than block / blob size

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, its way higher than needed, but it should suffice for now.

@wemeetagain wemeetagain merged commit d37bdb0 into unstable Oct 11, 2024
18 of 20 checks passed
@wemeetagain wemeetagain deleted the cayman/bump-libp2p branch October 11, 2024 21:19
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.

4 participants