Skip to content

Commit

Permalink
feat: track leaked libp2p connections (#6656)
Browse files Browse the repository at this point in the history
* feat: track leaked libp2p connections

* update var name

---------

Co-authored-by: Nico Flaig <nflaig@protonmail.com>
  • Loading branch information
twoeths and nflaig authored Apr 11, 2024
1 parent e029851 commit f21660e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 4 additions & 0 deletions packages/beacon-node/src/network/core/metrics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,10 @@ export function createNetworkCoreMetrics(register: RegistryMetricCreator) {
buckets: [0.001, 0.01, 0.1, 1],
}),
},
leakedConnectionsCount: register.gauge({
name: "lodestar_peer_manager_leaked_connections_count",
help: "Total libp2p leaked connections detected by lodestar",
}),

discovery: {
peersToConnect: register.gauge({
Expand Down
3 changes: 2 additions & 1 deletion packages/beacon-node/src/network/peers/peerManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -504,11 +504,12 @@ export class PeerManager {

// Prune connectedPeers map in case it leaks. It has happen in previous nodes,
// disconnect is not always called for all peers
if (this.connectedPeers.size > connectedPeers.length * 2) {
if (this.connectedPeers.size > connectedPeers.length * 1.1) {
const actualConnectedPeerIds = new Set(connectedPeers.map((peerId) => peerId.toString()));
for (const peerIdStr of this.connectedPeers.keys()) {
if (!actualConnectedPeerIds.has(peerIdStr)) {
this.connectedPeers.delete(peerIdStr);
this.metrics?.leakedConnectionsCount.inc();
}
}
}
Expand Down

1 comment on commit f21660e

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Performance Alert ⚠️

Possible performance regression was detected for some benchmarks.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold.

Benchmark suite Current: f21660e Previous: e029851 Ratio
getExpectedWithdrawals 250000 eb:0.95,eth1:0.3,we:0.05,wn:0,smpl:42 26.873 us/op 8.2670 us/op 3.25
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,smpl:16384 2.8746 ms/op 798.40 us/op 3.60
Full benchmark results
Benchmark suite Current: f21660e Previous: e029851 Ratio
getPubkeys - index2pubkey - req 1000 vs - 250000 vc 687.18 us/op 544.80 us/op 1.26
getPubkeys - validatorsArr - req 1000 vs - 250000 vc 85.209 us/op 50.916 us/op 1.67
BLS verify - blst-native 1.3070 ms/op 1.1256 ms/op 1.16
BLS verifyMultipleSignatures 3 - blst-native 2.7349 ms/op 2.4088 ms/op 1.14
BLS verifyMultipleSignatures 8 - blst-native 6.0181 ms/op 5.2962 ms/op 1.14
BLS verifyMultipleSignatures 32 - blst-native 21.805 ms/op 19.454 ms/op 1.12
BLS verifyMultipleSignatures 64 - blst-native 43.107 ms/op 38.288 ms/op 1.13
BLS verifyMultipleSignatures 128 - blst-native 87.668 ms/op 75.992 ms/op 1.15
BLS deserializing 10000 signatures 893.41 ms/op 781.29 ms/op 1.14
BLS deserializing 100000 signatures 9.4154 s/op 8.1682 s/op 1.15
BLS verifyMultipleSignatures - same message - 3 - blst-native 1.3343 ms/op 1.1158 ms/op 1.20
BLS verifyMultipleSignatures - same message - 8 - blst-native 1.5130 ms/op 1.2661 ms/op 1.19
BLS verifyMultipleSignatures - same message - 32 - blst-native 2.9534 ms/op 1.9958 ms/op 1.48
BLS verifyMultipleSignatures - same message - 64 - blst-native 4.2413 ms/op 3.8102 ms/op 1.11
BLS verifyMultipleSignatures - same message - 128 - blst-native 7.4444 ms/op 4.9924 ms/op 1.49
BLS aggregatePubkeys 32 - blst-native 27.940 us/op 22.512 us/op 1.24
BLS aggregatePubkeys 128 - blst-native 104.02 us/op 88.546 us/op 1.17
notSeenSlots=1 numMissedVotes=1 numBadVotes=10 70.834 ms/op 41.242 ms/op 1.72
notSeenSlots=1 numMissedVotes=0 numBadVotes=4 70.547 ms/op 50.977 ms/op 1.38
notSeenSlots=2 numMissedVotes=1 numBadVotes=10 39.994 ms/op 26.312 ms/op 1.52
getSlashingsAndExits - default max 177.92 us/op 108.50 us/op 1.64
getSlashingsAndExits - 2k 590.89 us/op 328.33 us/op 1.80
proposeBlockBody type=full, size=empty 6.3823 ms/op 4.2550 ms/op 1.50
isKnown best case - 1 super set check 517.00 ns/op 308.00 ns/op 1.68
isKnown normal case - 2 super set checks 531.00 ns/op 318.00 ns/op 1.67
isKnown worse case - 16 super set checks 644.00 ns/op 316.00 ns/op 2.04
InMemoryCheckpointStateCache - add get delete 7.9090 us/op 4.0220 us/op 1.97
validate api signedAggregateAndProof - struct 2.9151 ms/op 2.3888 ms/op 1.22
validate gossip signedAggregateAndProof - struct 2.8991 ms/op 2.3931 ms/op 1.21
validate gossip attestation - vc 640000 1.4239 ms/op 1.1278 ms/op 1.26
batch validate gossip attestation - vc 640000 - chunk 32 171.45 us/op 135.62 us/op 1.26
batch validate gossip attestation - vc 640000 - chunk 64 153.76 us/op 119.06 us/op 1.29
batch validate gossip attestation - vc 640000 - chunk 128 147.34 us/op 110.63 us/op 1.33
batch validate gossip attestation - vc 640000 - chunk 256 128.89 us/op 104.91 us/op 1.23
pickEth1Vote - no votes 1.1512 ms/op 909.20 us/op 1.27
pickEth1Vote - max votes 11.449 ms/op 5.2678 ms/op 2.17
pickEth1Vote - Eth1Data hashTreeRoot value x2048 17.806 ms/op 11.515 ms/op 1.55
pickEth1Vote - Eth1Data hashTreeRoot tree x2048 30.522 ms/op 16.213 ms/op 1.88
pickEth1Vote - Eth1Data fastSerialize value x2048 606.91 us/op 426.09 us/op 1.42
pickEth1Vote - Eth1Data fastSerialize tree x2048 5.3079 ms/op 7.5547 ms/op 0.70
bytes32 toHexString 504.00 ns/op 428.00 ns/op 1.18
bytes32 Buffer.toString(hex) 290.00 ns/op 297.00 ns/op 0.98
bytes32 Buffer.toString(hex) from Uint8Array 440.00 ns/op 396.00 ns/op 1.11
bytes32 Buffer.toString(hex) + 0x 303.00 ns/op 299.00 ns/op 1.01
Object access 1 prop 0.16400 ns/op 0.19400 ns/op 0.85
Map access 1 prop 0.15200 ns/op 0.19000 ns/op 0.80
Object get x1000 7.6150 ns/op 4.6800 ns/op 1.63
Map get x1000 0.76600 ns/op 0.68300 ns/op 1.12
Object set x1000 51.396 ns/op 25.220 ns/op 2.04
Map set x1000 41.135 ns/op 17.222 ns/op 2.39
Return object 10000 times 0.24000 ns/op 0.21070 ns/op 1.14
Throw Error 10000 times 3.8231 us/op 2.5503 us/op 1.50
fastMsgIdFn sha256 / 200 bytes 3.2860 us/op 1.8660 us/op 1.76
fastMsgIdFn h32 xxhash / 200 bytes 303.00 ns/op 286.00 ns/op 1.06
fastMsgIdFn h64 xxhash / 200 bytes 353.00 ns/op 340.00 ns/op 1.04
fastMsgIdFn sha256 / 1000 bytes 11.194 us/op 5.8580 us/op 1.91
fastMsgIdFn h32 xxhash / 1000 bytes 403.00 ns/op 394.00 ns/op 1.02
fastMsgIdFn h64 xxhash / 1000 bytes 413.00 ns/op 395.00 ns/op 1.05
fastMsgIdFn sha256 / 10000 bytes 102.07 us/op 48.794 us/op 2.09
fastMsgIdFn h32 xxhash / 10000 bytes 2.2240 us/op 1.6990 us/op 1.31
fastMsgIdFn h64 xxhash / 10000 bytes 1.6230 us/op 1.2360 us/op 1.31
send data - 1000 256B messages 20.574 ms/op 14.186 ms/op 1.45
send data - 1000 512B messages 26.357 ms/op 14.968 ms/op 1.76
send data - 1000 1024B messages 38.282 ms/op 22.787 ms/op 1.68
send data - 1000 1200B messages 36.455 ms/op 27.491 ms/op 1.33
send data - 1000 2048B messages 50.289 ms/op 35.659 ms/op 1.41
send data - 1000 4096B messages 45.051 ms/op 32.114 ms/op 1.40
send data - 1000 16384B messages 128.72 ms/op 88.463 ms/op 1.46
send data - 1000 65536B messages 500.85 ms/op 405.01 ms/op 1.24
enrSubnets - fastDeserialize 64 bits 1.3210 us/op 1.0500 us/op 1.26
enrSubnets - ssz BitVector 64 bits 412.00 ns/op 418.00 ns/op 0.99
enrSubnets - fastDeserialize 4 bits 168.00 ns/op 194.00 ns/op 0.87
enrSubnets - ssz BitVector 4 bits 414.00 ns/op 405.00 ns/op 1.02
prioritizePeers score -10:0 att 32-0.1 sync 2-0 104.82 us/op 65.785 us/op 1.59
prioritizePeers score 0:0 att 32-0.25 sync 2-0.25 124.94 us/op 80.698 us/op 1.55
prioritizePeers score 0:0 att 32-0.5 sync 2-0.5 161.51 us/op 104.39 us/op 1.55
prioritizePeers score 0:0 att 64-0.75 sync 4-0.75 304.74 us/op 178.11 us/op 1.71
prioritizePeers score 0:0 att 64-1 sync 4-1 355.95 us/op 201.96 us/op 1.76
array of 16000 items push then shift 1.6941 us/op 1.2710 us/op 1.33
LinkedList of 16000 items push then shift 8.8110 ns/op 5.8710 ns/op 1.50
array of 16000 items push then pop 89.800 ns/op 49.448 ns/op 1.82
LinkedList of 16000 items push then pop 8.6660 ns/op 5.6520 ns/op 1.53
array of 24000 items push then shift 2.4829 us/op 1.8596 us/op 1.34
LinkedList of 24000 items push then shift 8.8460 ns/op 5.7860 ns/op 1.53
array of 24000 items push then pop 130.87 ns/op 77.905 ns/op 1.68
LinkedList of 24000 items push then pop 8.6570 ns/op 5.8780 ns/op 1.47
intersect bitArray bitLen 8 6.1490 ns/op 4.7270 ns/op 1.30
intersect array and set length 8 64.388 ns/op 48.419 ns/op 1.33
intersect bitArray bitLen 128 35.394 ns/op 29.384 ns/op 1.20
intersect array and set length 128 863.42 ns/op 681.22 ns/op 1.27
bitArray.getTrueBitIndexes() bitLen 128 1.6210 us/op 1.2650 us/op 1.28
bitArray.getTrueBitIndexes() bitLen 248 2.6250 us/op 1.9270 us/op 1.36
bitArray.getTrueBitIndexes() bitLen 512 4.8190 us/op 3.5120 us/op 1.37
Buffer.concat 32 items 1.0020 us/op 900.00 ns/op 1.11
Uint8Array.set 32 items 1.6270 us/op 2.0890 us/op 0.78
Set add up to 64 items then delete first 4.3755 us/op 1.7387 us/op 2.52
OrderedSet add up to 64 items then delete first 5.6969 us/op 2.6711 us/op 2.13
Set add up to 64 items then delete last 4.9525 us/op 1.9715 us/op 2.51
OrderedSet add up to 64 items then delete last 6.1060 us/op 2.9483 us/op 2.07
Set add up to 64 items then delete middle 4.9789 us/op 1.9826 us/op 2.51
OrderedSet add up to 64 items then delete middle 7.7407 us/op 4.2460 us/op 1.82
Set add up to 128 items then delete first 10.146 us/op 3.9214 us/op 2.59
OrderedSet add up to 128 items then delete first 13.466 us/op 6.1587 us/op 2.19
Set add up to 128 items then delete last 10.019 us/op 3.7970 us/op 2.64
OrderedSet add up to 128 items then delete last 12.629 us/op 5.7032 us/op 2.21
Set add up to 128 items then delete middle 10.171 us/op 3.8007 us/op 2.68
OrderedSet add up to 128 items then delete middle 18.743 us/op 10.598 us/op 1.77
Set add up to 256 items then delete first 20.566 us/op 7.7826 us/op 2.64
OrderedSet add up to 256 items then delete first 27.132 us/op 12.226 us/op 2.22
Set add up to 256 items then delete last 20.352 us/op 7.5374 us/op 2.70
OrderedSet add up to 256 items then delete last 25.967 us/op 11.340 us/op 2.29
Set add up to 256 items then delete middle 19.859 us/op 7.5320 us/op 2.64
OrderedSet add up to 256 items then delete middle 49.729 us/op 30.743 us/op 1.62
transfer serialized Status (84 B) 2.0470 us/op 1.3640 us/op 1.50
copy serialized Status (84 B) 1.5290 us/op 1.1700 us/op 1.31
transfer serialized SignedVoluntaryExit (112 B) 2.2440 us/op 1.5570 us/op 1.44
copy serialized SignedVoluntaryExit (112 B) 1.6570 us/op 1.2600 us/op 1.32
transfer serialized ProposerSlashing (416 B) 3.3040 us/op 2.2430 us/op 1.47
copy serialized ProposerSlashing (416 B) 3.1110 us/op 2.3270 us/op 1.34
transfer serialized Attestation (485 B) 3.3500 us/op 2.3330 us/op 1.44
copy serialized Attestation (485 B) 3.1570 us/op 2.3270 us/op 1.36
transfer serialized AttesterSlashing (33232 B) 3.2390 us/op 2.1500 us/op 1.51
copy serialized AttesterSlashing (33232 B) 8.0940 us/op 4.2390 us/op 1.91
transfer serialized Small SignedBeaconBlock (128000 B) 3.7540 us/op 2.3550 us/op 1.59
copy serialized Small SignedBeaconBlock (128000 B) 18.378 us/op 8.6990 us/op 2.11
transfer serialized Avg SignedBeaconBlock (200000 B) 4.1170 us/op 2.5180 us/op 1.64
copy serialized Avg SignedBeaconBlock (200000 B) 26.441 us/op 13.041 us/op 2.03
transfer serialized BlobsSidecar (524380 B) 4.1600 us/op 2.4290 us/op 1.71
copy serialized BlobsSidecar (524380 B) 93.608 us/op 79.067 us/op 1.18
transfer serialized Big SignedBeaconBlock (1000000 B) 4.4360 us/op 3.0370 us/op 1.46
copy serialized Big SignedBeaconBlock (1000000 B) 161.16 us/op 139.69 us/op 1.15
pass gossip attestations to forkchoice per slot 4.1034 ms/op 2.6115 ms/op 1.57
forkChoice updateHead vc 100000 bc 64 eq 0 677.67 us/op 451.39 us/op 1.50
forkChoice updateHead vc 600000 bc 64 eq 0 4.1988 ms/op 2.7572 ms/op 1.52
forkChoice updateHead vc 1000000 bc 64 eq 0 7.0544 ms/op 4.3884 ms/op 1.61
forkChoice updateHead vc 600000 bc 320 eq 0 4.1871 ms/op 2.5956 ms/op 1.61
forkChoice updateHead vc 600000 bc 1200 eq 0 4.3639 ms/op 2.5893 ms/op 1.69
forkChoice updateHead vc 600000 bc 7200 eq 0 5.3539 ms/op 3.5704 ms/op 1.50
forkChoice updateHead vc 600000 bc 64 eq 1000 11.117 ms/op 9.7675 ms/op 1.14
forkChoice updateHead vc 600000 bc 64 eq 10000 11.771 ms/op 9.1812 ms/op 1.28
forkChoice updateHead vc 600000 bc 64 eq 300000 16.745 ms/op 11.064 ms/op 1.51
computeDeltas 500000 validators 300 proto nodes 6.5190 ms/op 3.0094 ms/op 2.17
computeDeltas 500000 validators 1200 proto nodes 6.5132 ms/op 2.7799 ms/op 2.34
computeDeltas 500000 validators 7200 proto nodes 6.3596 ms/op 2.8522 ms/op 2.23
computeDeltas 750000 validators 300 proto nodes 10.026 ms/op 4.5301 ms/op 2.21
computeDeltas 750000 validators 1200 proto nodes 9.8404 ms/op 4.5314 ms/op 2.17
computeDeltas 750000 validators 7200 proto nodes 9.8305 ms/op 4.4805 ms/op 2.19
computeDeltas 1400000 validators 300 proto nodes 18.941 ms/op 8.6265 ms/op 2.20
computeDeltas 1400000 validators 1200 proto nodes 18.141 ms/op 8.7363 ms/op 2.08
computeDeltas 1400000 validators 7200 proto nodes 18.405 ms/op 8.6891 ms/op 2.12
computeDeltas 2100000 validators 300 proto nodes 27.101 ms/op 12.701 ms/op 2.13
computeDeltas 2100000 validators 1200 proto nodes 27.432 ms/op 12.632 ms/op 2.17
computeDeltas 2100000 validators 7200 proto nodes 27.088 ms/op 12.432 ms/op 2.18
altair processAttestation - 250000 vs - 7PWei normalcase 2.2272 ms/op 1.5503 ms/op 1.44
altair processAttestation - 250000 vs - 7PWei worstcase 3.3143 ms/op 2.3705 ms/op 1.40
altair processAttestation - setStatus - 1/6 committees join 187.64 us/op 71.716 us/op 2.62
altair processAttestation - setStatus - 1/3 committees join 351.17 us/op 142.30 us/op 2.47
altair processAttestation - setStatus - 1/2 committees join 487.96 us/op 203.23 us/op 2.40
altair processAttestation - setStatus - 2/3 committees join 603.57 us/op 261.11 us/op 2.31
altair processAttestation - setStatus - 4/5 committees join 808.14 us/op 369.22 us/op 2.19
altair processAttestation - setStatus - 100% committees join 962.47 us/op 451.79 us/op 2.13
altair processBlock - 250000 vs - 7PWei normalcase 9.3932 ms/op 6.8568 ms/op 1.37
altair processBlock - 250000 vs - 7PWei normalcase hashState 37.969 ms/op 28.719 ms/op 1.32
altair processBlock - 250000 vs - 7PWei worstcase 39.915 ms/op 31.301 ms/op 1.28
altair processBlock - 250000 vs - 7PWei worstcase hashState 96.684 ms/op 83.334 ms/op 1.16
phase0 processBlock - 250000 vs - 7PWei normalcase 3.0668 ms/op 2.0723 ms/op 1.48
phase0 processBlock - 250000 vs - 7PWei worstcase 31.643 ms/op 23.823 ms/op 1.33
altair processEth1Data - 250000 vs - 7PWei normalcase 480.66 us/op 286.16 us/op 1.68
getExpectedWithdrawals 250000 eb:1,eth1:1,we:0,wn:0,smpl:15 17.313 us/op 11.870 us/op 1.46
getExpectedWithdrawals 250000 eb:0.95,eth1:0.1,we:0.05,wn:0,smpl:219 87.291 us/op 58.201 us/op 1.50
getExpectedWithdrawals 250000 eb:0.95,eth1:0.3,we:0.05,wn:0,smpl:42 26.873 us/op 8.2670 us/op 3.25
getExpectedWithdrawals 250000 eb:0.95,eth1:0.7,we:0.05,wn:0,smpl:18 11.099 us/op 11.175 us/op 0.99
getExpectedWithdrawals 250000 eb:0.1,eth1:0.1,we:0,wn:0,smpl:1020 292.79 us/op 134.30 us/op 2.18
getExpectedWithdrawals 250000 eb:0.03,eth1:0.03,we:0,wn:0,smpl:11777 2.2161 ms/op 991.63 us/op 2.23
getExpectedWithdrawals 250000 eb:0.01,eth1:0.01,we:0,wn:0,smpl:16384 1.5067 ms/op 1.1660 ms/op 1.29
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,smpl:16384 2.8746 ms/op 798.40 us/op 3.60
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,nocache,smpl:16384 3.5118 ms/op 1.9027 ms/op 1.85
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,smpl:16384 2.3667 ms/op 1.7245 ms/op 1.37
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,nocache,smpl:16384 4.9711 ms/op 3.3862 ms/op 1.47
Tree 40 250000 create 389.62 ms/op 230.25 ms/op 1.69
Tree 40 250000 get(125000) 200.03 ns/op 113.39 ns/op 1.76
Tree 40 250000 set(125000) 1.0042 us/op 714.72 ns/op 1.41
Tree 40 250000 toArray() 20.652 ms/op 9.3646 ms/op 2.21
Tree 40 250000 iterate all - toArray() + loop 20.359 ms/op 9.6999 ms/op 2.10
Tree 40 250000 iterate all - get(i) 65.279 ms/op 42.724 ms/op 1.53
MutableVector 250000 create 20.928 ms/op 10.364 ms/op 2.02
MutableVector 250000 get(125000) 6.6100 ns/op 5.4750 ns/op 1.21
MutableVector 250000 set(125000) 259.49 ns/op 207.41 ns/op 1.25
MutableVector 250000 toArray() 3.9069 ms/op 2.7465 ms/op 1.42
MutableVector 250000 iterate all - toArray() + loop 3.8066 ms/op 2.4122 ms/op 1.58
MutableVector 250000 iterate all - get(i) 1.5276 ms/op 1.3107 ms/op 1.17
Array 250000 create 3.3816 ms/op 2.0193 ms/op 1.67
Array 250000 clone - spread 1.3092 ms/op 1.1850 ms/op 1.10
Array 250000 get(125000) 1.0400 ns/op 1.0770 ns/op 0.97
Array 250000 set(125000) 4.1560 ns/op 1.2850 ns/op 3.23
Array 250000 iterate all - loop 163.90 us/op 156.61 us/op 1.05
effectiveBalanceIncrements clone Uint8Array 300000 30.181 us/op 15.180 us/op 1.99
effectiveBalanceIncrements clone MutableVector 300000 375.00 ns/op 447.00 ns/op 0.84
effectiveBalanceIncrements rw all Uint8Array 300000 198.71 us/op 184.20 us/op 1.08
effectiveBalanceIncrements rw all MutableVector 300000 86.818 ms/op 65.916 ms/op 1.32
phase0 afterProcessEpoch - 250000 vs - 7PWei 114.33 ms/op 81.683 ms/op 1.40
phase0 beforeProcessEpoch - 250000 vs - 7PWei 56.603 ms/op 27.815 ms/op 2.03
altair processEpoch - mainnet_e81889 563.88 ms/op 426.38 ms/op 1.32
mainnet_e81889 - altair beforeProcessEpoch 85.070 ms/op 67.385 ms/op 1.26
mainnet_e81889 - altair processJustificationAndFinalization 22.959 us/op 5.6940 us/op 4.03
mainnet_e81889 - altair processInactivityUpdates 6.5830 ms/op 4.5054 ms/op 1.46
mainnet_e81889 - altair processRewardsAndPenalties 84.786 ms/op 57.361 ms/op 1.48
mainnet_e81889 - altair processRegistryUpdates 2.7090 us/op 1.9350 us/op 1.40
mainnet_e81889 - altair processSlashings 693.00 ns/op 632.00 ns/op 1.10
mainnet_e81889 - altair processEth1DataReset 925.00 ns/op 564.00 ns/op 1.64
mainnet_e81889 - altair processEffectiveBalanceUpdates 2.6645 ms/op 1.7229 ms/op 1.55
mainnet_e81889 - altair processSlashingsReset 5.3000 us/op 3.6550 us/op 1.45
mainnet_e81889 - altair processRandaoMixesReset 6.4480 us/op 4.2880 us/op 1.50
mainnet_e81889 - altair processHistoricalRootsUpdate 832.00 ns/op 1.1240 us/op 0.74
mainnet_e81889 - altair processParticipationFlagUpdates 3.5820 us/op 1.6500 us/op 2.17
mainnet_e81889 - altair processSyncCommitteeUpdates 662.00 ns/op 618.00 ns/op 1.07
mainnet_e81889 - altair afterProcessEpoch 120.07 ms/op 81.017 ms/op 1.48
capella processEpoch - mainnet_e217614 2.0559 s/op 1.6493 s/op 1.25
mainnet_e217614 - capella beforeProcessEpoch 496.62 ms/op 401.47 ms/op 1.24
mainnet_e217614 - capella processJustificationAndFinalization 20.279 us/op 8.5210 us/op 2.38
mainnet_e217614 - capella processInactivityUpdates 17.345 ms/op 15.266 ms/op 1.14
mainnet_e217614 - capella processRewardsAndPenalties 594.27 ms/op 462.64 ms/op 1.28
mainnet_e217614 - capella processRegistryUpdates 30.809 us/op 16.570 us/op 1.86
mainnet_e217614 - capella processSlashings 641.00 ns/op 671.00 ns/op 0.96
mainnet_e217614 - capella processEth1DataReset 706.00 ns/op 598.00 ns/op 1.18
mainnet_e217614 - capella processEffectiveBalanceUpdates 13.789 ms/op 4.3089 ms/op 3.20
mainnet_e217614 - capella processSlashingsReset 3.7670 us/op 1.6880 us/op 2.23
mainnet_e217614 - capella processRandaoMixesReset 7.2410 us/op 2.9070 us/op 2.49
mainnet_e217614 - capella processHistoricalRootsUpdate 876.00 ns/op 595.00 ns/op 1.47
mainnet_e217614 - capella processParticipationFlagUpdates 3.0830 us/op 1.1680 us/op 2.64
mainnet_e217614 - capella afterProcessEpoch 373.04 ms/op 245.36 ms/op 1.52
phase0 processEpoch - mainnet_e58758 477.54 ms/op 406.36 ms/op 1.18
mainnet_e58758 - phase0 beforeProcessEpoch 145.81 ms/op 113.94 ms/op 1.28
mainnet_e58758 - phase0 processJustificationAndFinalization 17.912 us/op 12.221 us/op 1.47
mainnet_e58758 - phase0 processRewardsAndPenalties 69.016 ms/op 60.058 ms/op 1.15
mainnet_e58758 - phase0 processRegistryUpdates 11.230 us/op 7.6500 us/op 1.47
mainnet_e58758 - phase0 processSlashings 610.00 ns/op 601.00 ns/op 1.01
mainnet_e58758 - phase0 processEth1DataReset 478.00 ns/op 501.00 ns/op 0.95
mainnet_e58758 - phase0 processEffectiveBalanceUpdates 1.3381 ms/op 1.3542 ms/op 0.99
mainnet_e58758 - phase0 processSlashingsReset 3.6230 us/op 2.3530 us/op 1.54
mainnet_e58758 - phase0 processRandaoMixesReset 5.9260 us/op 2.5540 us/op 2.32
mainnet_e58758 - phase0 processHistoricalRootsUpdate 566.00 ns/op 493.00 ns/op 1.15
mainnet_e58758 - phase0 processParticipationRecordUpdates 4.6730 us/op 2.6500 us/op 1.76
mainnet_e58758 - phase0 afterProcessEpoch 102.12 ms/op 66.355 ms/op 1.54
phase0 processEffectiveBalanceUpdates - 250000 normalcase 1.6138 ms/op 1.8329 ms/op 0.88
phase0 processEffectiveBalanceUpdates - 250000 worstcase 0.5 1.5870 ms/op 1.0425 ms/op 1.52
altair processInactivityUpdates - 250000 normalcase 33.706 ms/op 22.390 ms/op 1.51
altair processInactivityUpdates - 250000 worstcase 38.103 ms/op 25.594 ms/op 1.49
phase0 processRegistryUpdates - 250000 normalcase 12.214 us/op 7.8510 us/op 1.56
phase0 processRegistryUpdates - 250000 badcase_full_deposits 453.41 us/op 430.59 us/op 1.05
phase0 processRegistryUpdates - 250000 worstcase 0.5 147.16 ms/op 120.47 ms/op 1.22
altair processRewardsAndPenalties - 250000 normalcase 66.083 ms/op 70.663 ms/op 0.94
altair processRewardsAndPenalties - 250000 worstcase 69.387 ms/op 68.346 ms/op 1.02
phase0 getAttestationDeltas - 250000 normalcase 12.451 ms/op 5.5631 ms/op 2.24
phase0 getAttestationDeltas - 250000 worstcase 11.095 ms/op 5.6359 ms/op 1.97
phase0 processSlashings - 250000 worstcase 129.28 us/op 83.557 us/op 1.55
altair processSyncCommitteeUpdates - 250000 167.96 ms/op 98.269 ms/op 1.71
BeaconState.hashTreeRoot - No change 540.00 ns/op 319.00 ns/op 1.69
BeaconState.hashTreeRoot - 1 full validator 169.67 us/op 83.773 us/op 2.03
BeaconState.hashTreeRoot - 32 full validator 1.7241 ms/op 860.82 us/op 2.00
BeaconState.hashTreeRoot - 512 full validator 17.038 ms/op 9.2736 ms/op 1.84
BeaconState.hashTreeRoot - 1 validator.effectiveBalance 161.81 us/op 101.77 us/op 1.59
BeaconState.hashTreeRoot - 32 validator.effectiveBalance 2.0756 ms/op 1.3847 ms/op 1.50
BeaconState.hashTreeRoot - 512 validator.effectiveBalance 28.275 ms/op 17.555 ms/op 1.61
BeaconState.hashTreeRoot - 1 balances 154.23 us/op 81.205 us/op 1.90
BeaconState.hashTreeRoot - 32 balances 1.3430 ms/op 729.96 us/op 1.84
BeaconState.hashTreeRoot - 512 balances 11.398 ms/op 7.3467 ms/op 1.55
BeaconState.hashTreeRoot - 250000 balances 219.87 ms/op 141.96 ms/op 1.55
aggregationBits - 2048 els - zipIndexesInBitList 30.198 us/op 19.407 us/op 1.56
byteArrayEquals 32 74.941 ns/op 64.480 ns/op 1.16
Buffer.compare 32 56.131 ns/op 39.405 ns/op 1.42
byteArrayEquals 1024 2.0400 us/op 1.7495 us/op 1.17
Buffer.compare 1024 72.607 ns/op 44.426 ns/op 1.63
byteArrayEquals 16384 32.495 us/op 27.924 us/op 1.16
Buffer.compare 16384 271.70 ns/op 206.35 ns/op 1.32
byteArrayEquals 123687377 245.44 ms/op 209.71 ms/op 1.17
Buffer.compare 123687377 7.6854 ms/op 4.4011 ms/op 1.75
byteArrayEquals 32 - diff last byte 76.960 ns/op 61.590 ns/op 1.25
Buffer.compare 32 - diff last byte 58.894 ns/op 40.340 ns/op 1.46
byteArrayEquals 1024 - diff last byte 2.0781 us/op 1.7565 us/op 1.18
Buffer.compare 1024 - diff last byte 74.450 ns/op 48.720 ns/op 1.53
byteArrayEquals 16384 - diff last byte 33.053 us/op 27.539 us/op 1.20
Buffer.compare 16384 - diff last byte 282.86 ns/op 215.37 ns/op 1.31
byteArrayEquals 123687377 - diff last byte 245.96 ms/op 209.63 ms/op 1.17
Buffer.compare 123687377 - diff last byte 6.2823 ms/op 4.3565 ms/op 1.44
byteArrayEquals 32 - random bytes 5.2950 ns/op 4.6400 ns/op 1.14
Buffer.compare 32 - random bytes 62.350 ns/op 41.489 ns/op 1.50
byteArrayEquals 1024 - random bytes 5.1760 ns/op 4.5260 ns/op 1.14
Buffer.compare 1024 - random bytes 60.999 ns/op 40.331 ns/op 1.51
byteArrayEquals 16384 - random bytes 5.1770 ns/op 4.5570 ns/op 1.14
Buffer.compare 16384 - random bytes 60.696 ns/op 40.025 ns/op 1.52
byteArrayEquals 123687377 - random bytes 8.4500 ns/op 8.1100 ns/op 1.04
Buffer.compare 123687377 - random bytes 63.770 ns/op 42.540 ns/op 1.50
regular array get 100000 times 44.202 us/op 40.839 us/op 1.08
wrappedArray get 100000 times 44.317 us/op 41.754 us/op 1.06
arrayWithProxy get 100000 times 14.497 ms/op 10.208 ms/op 1.42
ssz.Root.equals 54.161 ns/op 55.143 ns/op 0.98
byteArrayEquals 52.853 ns/op 53.302 ns/op 0.99
Buffer.compare 14.696 ns/op 9.4480 ns/op 1.56
shuffle list - 16384 els 8.5256 ms/op 5.6776 ms/op 1.50
shuffle list - 250000 els 125.01 ms/op 84.230 ms/op 1.48
processSlot - 1 slots 15.898 us/op 13.357 us/op 1.19
processSlot - 32 slots 4.1191 ms/op 2.6719 ms/op 1.54
getEffectiveBalanceIncrementsZeroInactive - 250000 vs - 7PWei 66.512 ms/op 49.211 ms/op 1.35
getCommitteeAssignments - req 1 vs - 250000 vc 2.6210 ms/op 2.2661 ms/op 1.16
getCommitteeAssignments - req 100 vs - 250000 vc 3.7943 ms/op 3.3153 ms/op 1.14
getCommitteeAssignments - req 1000 vs - 250000 vc 4.1193 ms/op 3.6297 ms/op 1.13
findModifiedValidators - 10000 modified validators 341.42 ms/op 288.20 ms/op 1.18
findModifiedValidators - 1000 modified validators 190.01 ms/op 160.05 ms/op 1.19
findModifiedValidators - 100 modified validators 178.05 ms/op 144.45 ms/op 1.23
findModifiedValidators - 10 modified validators 191.05 ms/op 146.16 ms/op 1.31
findModifiedValidators - 1 modified validators 188.16 ms/op 141.80 ms/op 1.33
findModifiedValidators - no difference 197.95 ms/op 160.49 ms/op 1.23
compare ViewDUs 5.0491 s/op 4.0264 s/op 1.25
compare each validator Uint8Array 1.8164 s/op 1.3482 s/op 1.35
compare ViewDU to Uint8Array 1.1155 s/op 907.96 ms/op 1.23
migrate state 1000000 validators, 24 modified, 0 new 782.16 ms/op 691.76 ms/op 1.13
migrate state 1000000 validators, 1700 modified, 1000 new 1.1283 s/op 929.62 ms/op 1.21
migrate state 1000000 validators, 3400 modified, 2000 new 1.4427 s/op 1.2275 s/op 1.18
migrate state 1500000 validators, 24 modified, 0 new 880.97 ms/op 645.28 ms/op 1.37
migrate state 1500000 validators, 1700 modified, 1000 new 1.2919 s/op 861.33 ms/op 1.50
migrate state 1500000 validators, 3400 modified, 2000 new 1.4856 s/op 1.1136 s/op 1.33
RootCache.getBlockRootAtSlot - 250000 vs - 7PWei 5.2600 ns/op 4.1200 ns/op 1.28
state getBlockRootAtSlot - 250000 vs - 7PWei 720.23 ns/op 854.21 ns/op 0.84
computeProposers - vc 250000 10.233 ms/op 6.3829 ms/op 1.60
computeEpochShuffling - vc 250000 129.49 ms/op 78.380 ms/op 1.65
getNextSyncCommittee - vc 250000 172.76 ms/op 103.42 ms/op 1.67
computeSigningRoot for AttestationData 29.919 us/op 24.425 us/op 1.22
hash AttestationData serialized data then Buffer.toString(base64) 2.4612 us/op 1.2351 us/op 1.99
toHexString serialized data 1.6504 us/op 738.52 ns/op 2.23
Buffer.toString(base64) 280.12 ns/op 138.34 ns/op 2.02

Please sign in to comment.