Skip to content

Commit

Permalink
fix: update @libp2p/tcp (#6676)
Browse files Browse the repository at this point in the history
* fix: update @libp2p/tcp

* chore: fix linter error
  • Loading branch information
wemeetagain authored Apr 17, 2024
1 parent eb84b49 commit f5148b2
Show file tree
Hide file tree
Showing 4 changed files with 112 additions and 127 deletions.
4 changes: 2 additions & 2 deletions packages/beacon-node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -113,13 +113,13 @@
"@fastify/swagger-ui": "^1.9.3",
"@libp2p/bootstrap": "^10.0.10",
"@libp2p/identify": "^1.0.9",
"@libp2p/interface": "^1.1.1",
"@libp2p/interface": "^1.2.0",
"@libp2p/mdns": "^10.0.10",
"@libp2p/mplex": "^10.0.10",
"@libp2p/peer-id": "^4.0.4",
"@libp2p/peer-id-factory": "^4.0.3",
"@libp2p/prometheus-metrics": "^3.0.10",
"@libp2p/tcp": "9.0.10",
"@libp2p/tcp": "9.0.22",
"@lodestar/api": "^1.17.0",
"@lodestar/config": "^1.17.0",
"@lodestar/db": "^1.17.0",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {concat} from "uint8arrays";
import {concat} from "uint8arrays/concat";
import {digest} from "@chainsafe/as-sha256";
import {createProof, Proof, ProofType} from "@chainsafe/persistent-merkle-tree";
import {routes, ServerApi} from "@lodestar/api";
Expand Down
2 changes: 1 addition & 1 deletion packages/reqresp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
},
"dependencies": {
"@chainsafe/fast-crc32c": "^4.1.1",
"@libp2p/interface": "^1.1.1",
"@libp2p/interface": "^1.2.0",
"@lodestar/config": "^1.17.0",
"@lodestar/params": "^1.17.0",
"@lodestar/utils": "^1.17.0",
Expand Down
Loading

1 comment on commit f5148b2

@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: f5148b2 Previous: eb84b49 Ratio
Set add up to 64 items then delete first 5.5707 us/op 1.7816 us/op 3.13
Set add up to 128 items then delete first 12.065 us/op 3.9506 us/op 3.05
Set add up to 128 items then delete last 12.202 us/op 3.9784 us/op 3.07
Set add up to 256 items then delete first 23.504 us/op 7.8001 us/op 3.01
Set add up to 256 items then delete last 22.940 us/op 7.5118 us/op 3.05
Set add up to 256 items then delete middle 22.976 us/op 7.4354 us/op 3.09
forkChoice updateHead vc 600000 bc 64 eq 300000 54.969 ms/op 12.060 ms/op 4.56
altair processAttestation - 250000 vs - 7PWei normalcase 7.9320 ms/op 1.8188 ms/op 4.36
altair processAttestation - 250000 vs - 7PWei worstcase 10.812 ms/op 2.4310 ms/op 4.45
altair processAttestation - setStatus - 1/6 committees join 412.80 us/op 74.917 us/op 5.51
altair processAttestation - setStatus - 1/3 committees join 812.36 us/op 158.96 us/op 5.11
altair processAttestation - setStatus - 1/2 committees join 1.0978 ms/op 236.25 us/op 4.65
altair processAttestation - setStatus - 2/3 committees join 1.3693 ms/op 296.89 us/op 4.61
altair processAttestation - setStatus - 4/5 committees join 1.7185 ms/op 390.39 us/op 4.40
altair processAttestation - setStatus - 100% committees join 2.0279 ms/op 494.63 us/op 4.10
altair processBlock - 250000 vs - 7PWei normalcase 19.435 ms/op 5.2382 ms/op 3.71
altair processBlock - 250000 vs - 7PWei normalcase hashState 89.449 ms/op 27.293 ms/op 3.28
phase0 processBlock - 250000 vs - 7PWei normalcase 6.9290 ms/op 2.0512 ms/op 3.38
altair processEth1Data - 250000 vs - 7PWei normalcase 1.2087 ms/op 272.96 us/op 4.43
getExpectedWithdrawals 250000 eb:1,eth1:1,we:0,wn:0,smpl:15 35.117 us/op 11.006 us/op 3.19
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,nocache,smpl:16384 12.393 ms/op 3.7854 ms/op 3.27
phase0 beforeProcessEpoch - 250000 vs - 7PWei 134.76 ms/op 43.245 ms/op 3.12
Full benchmark results
Benchmark suite Current: f5148b2 Previous: eb84b49 Ratio
getPubkeys - index2pubkey - req 1000 vs - 250000 vc 566.38 us/op 526.59 us/op 1.08
getPubkeys - validatorsArr - req 1000 vs - 250000 vc 105.04 us/op 58.438 us/op 1.80
BLS verify - blst-native 1.3367 ms/op 1.1239 ms/op 1.19
BLS verifyMultipleSignatures 3 - blst-native 2.8140 ms/op 2.4336 ms/op 1.16
BLS verifyMultipleSignatures 8 - blst-native 6.1794 ms/op 5.3412 ms/op 1.16
BLS verifyMultipleSignatures 32 - blst-native 22.211 ms/op 19.966 ms/op 1.11
BLS verifyMultipleSignatures 64 - blst-native 44.382 ms/op 38.784 ms/op 1.14
BLS verifyMultipleSignatures 128 - blst-native 86.316 ms/op 81.528 ms/op 1.06
BLS deserializing 10000 signatures 906.25 ms/op 860.10 ms/op 1.05
BLS deserializing 100000 signatures 9.2687 s/op 9.0289 s/op 1.03
BLS verifyMultipleSignatures - same message - 3 - blst-native 1.3740 ms/op 1.2455 ms/op 1.10
BLS verifyMultipleSignatures - same message - 8 - blst-native 1.5319 ms/op 1.3260 ms/op 1.16
BLS verifyMultipleSignatures - same message - 32 - blst-native 2.4246 ms/op 2.6801 ms/op 0.90
BLS verifyMultipleSignatures - same message - 64 - blst-native 3.5064 ms/op 4.3910 ms/op 0.80
BLS verifyMultipleSignatures - same message - 128 - blst-native 5.8519 ms/op 9.4573 ms/op 0.62
BLS aggregatePubkeys 32 - blst-native 25.941 us/op 26.735 us/op 0.97
BLS aggregatePubkeys 128 - blst-native 101.38 us/op 103.17 us/op 0.98
notSeenSlots=1 numMissedVotes=1 numBadVotes=10 63.597 ms/op 59.448 ms/op 1.07
notSeenSlots=1 numMissedVotes=0 numBadVotes=4 80.511 ms/op 75.262 ms/op 1.07
notSeenSlots=2 numMissedVotes=1 numBadVotes=10 49.355 ms/op 30.806 ms/op 1.60
getSlashingsAndExits - default max 221.03 us/op 339.17 us/op 0.65
getSlashingsAndExits - 2k 472.31 us/op 557.48 us/op 0.85
proposeBlockBody type=full, size=empty 6.8600 ms/op 4.6515 ms/op 1.47
isKnown best case - 1 super set check 466.00 ns/op 805.00 ns/op 0.58
isKnown normal case - 2 super set checks 524.00 ns/op 1.1070 us/op 0.47
isKnown worse case - 16 super set checks 439.00 ns/op 1.0520 us/op 0.42
InMemoryCheckpointStateCache - add get delete 7.0400 us/op 11.830 us/op 0.60
validate api signedAggregateAndProof - struct 2.9167 ms/op 2.4987 ms/op 1.17
validate gossip signedAggregateAndProof - struct 2.8513 ms/op 2.5550 ms/op 1.12
validate gossip attestation - vc 640000 1.4036 ms/op 1.2874 ms/op 1.09
batch validate gossip attestation - vc 640000 - chunk 32 176.99 us/op 203.63 us/op 0.87
batch validate gossip attestation - vc 640000 - chunk 64 159.14 us/op 181.02 us/op 0.88
batch validate gossip attestation - vc 640000 - chunk 128 154.55 us/op 196.55 us/op 0.79
batch validate gossip attestation - vc 640000 - chunk 256 150.83 us/op 160.13 us/op 0.94
pickEth1Vote - no votes 1.5095 ms/op 1.1401 ms/op 1.32
pickEth1Vote - max votes 11.698 ms/op 17.102 ms/op 0.68
pickEth1Vote - Eth1Data hashTreeRoot value x2048 21.620 ms/op 28.001 ms/op 0.77
pickEth1Vote - Eth1Data hashTreeRoot tree x2048 33.432 ms/op 51.307 ms/op 0.65
pickEth1Vote - Eth1Data fastSerialize value x2048 828.77 us/op 839.25 us/op 0.99
pickEth1Vote - Eth1Data fastSerialize tree x2048 6.4259 ms/op 13.506 ms/op 0.48
bytes32 toHexString 819.00 ns/op 1.4590 us/op 0.56
bytes32 Buffer.toString(hex) 315.00 ns/op 620.00 ns/op 0.51
bytes32 Buffer.toString(hex) from Uint8Array 614.00 ns/op 1.1860 us/op 0.52
bytes32 Buffer.toString(hex) + 0x 310.00 ns/op 878.00 ns/op 0.35
Object access 1 prop 0.24400 ns/op 0.49100 ns/op 0.50
Map access 1 prop 0.16400 ns/op 0.42800 ns/op 0.38
Object get x1000 8.1800 ns/op 7.5890 ns/op 1.08
Map get x1000 0.95900 ns/op 1.2630 ns/op 0.76
Object set x1000 84.287 ns/op 77.152 ns/op 1.09
Map set x1000 61.462 ns/op 33.147 ns/op 1.85
Return object 10000 times 0.28510 ns/op 0.30740 ns/op 0.93
Throw Error 10000 times 4.2165 us/op 3.2754 us/op 1.29
fastMsgIdFn sha256 / 200 bytes 3.7510 us/op 3.1570 us/op 1.19
fastMsgIdFn h32 xxhash / 200 bytes 413.00 ns/op 465.00 ns/op 0.89
fastMsgIdFn h64 xxhash / 200 bytes 435.00 ns/op 449.00 ns/op 0.97
fastMsgIdFn sha256 / 1000 bytes 12.280 us/op 8.1260 us/op 1.51
fastMsgIdFn h32 xxhash / 1000 bytes 531.00 ns/op 1.1570 us/op 0.46
fastMsgIdFn h64 xxhash / 1000 bytes 547.00 ns/op 862.00 ns/op 0.63
fastMsgIdFn sha256 / 10000 bytes 114.83 us/op 58.656 us/op 1.96
fastMsgIdFn h32 xxhash / 10000 bytes 2.1830 us/op 2.6020 us/op 0.84
fastMsgIdFn h64 xxhash / 10000 bytes 1.5450 us/op 1.6930 us/op 0.91
send data - 1000 256B messages 27.359 ms/op 20.197 ms/op 1.35
send data - 1000 512B messages 32.180 ms/op 21.823 ms/op 1.47
send data - 1000 1024B messages 48.050 ms/op 43.097 ms/op 1.11
send data - 1000 1200B messages 45.378 ms/op 52.161 ms/op 0.87
send data - 1000 2048B messages 62.919 ms/op 52.424 ms/op 1.20
send data - 1000 4096B messages 56.302 ms/op 38.751 ms/op 1.45
send data - 1000 16384B messages 150.72 ms/op 98.038 ms/op 1.54
send data - 1000 65536B messages 573.16 ms/op 401.44 ms/op 1.43
enrSubnets - fastDeserialize 64 bits 1.7930 us/op 1.5270 us/op 1.17
enrSubnets - ssz BitVector 64 bits 592.00 ns/op 636.00 ns/op 0.93
enrSubnets - fastDeserialize 4 bits 252.00 ns/op 295.00 ns/op 0.85
enrSubnets - ssz BitVector 4 bits 570.00 ns/op 640.00 ns/op 0.89
prioritizePeers score -10:0 att 32-0.1 sync 2-0 238.81 us/op 176.18 us/op 1.36
prioritizePeers score 0:0 att 32-0.25 sync 2-0.25 369.90 us/op 264.87 us/op 1.40
prioritizePeers score 0:0 att 32-0.5 sync 2-0.5 453.47 us/op 329.90 us/op 1.37
prioritizePeers score 0:0 att 64-0.75 sync 4-0.75 717.26 us/op 483.26 us/op 1.48
prioritizePeers score 0:0 att 64-1 sync 4-1 900.22 us/op 466.75 us/op 1.93
array of 16000 items push then shift 1.7660 us/op 1.3443 us/op 1.31
LinkedList of 16000 items push then shift 11.094 ns/op 6.2920 ns/op 1.76
array of 16000 items push then pop 129.29 ns/op 110.30 ns/op 1.17
LinkedList of 16000 items push then pop 9.7640 ns/op 6.0980 ns/op 1.60
array of 24000 items push then shift 2.6920 us/op 1.8943 us/op 1.42
LinkedList of 24000 items push then shift 11.155 ns/op 5.9330 ns/op 1.88
array of 24000 items push then pop 188.23 ns/op 106.19 ns/op 1.77
LinkedList of 24000 items push then pop 9.8030 ns/op 5.7300 ns/op 1.71
intersect bitArray bitLen 8 6.7700 ns/op 4.9330 ns/op 1.37
intersect array and set length 8 114.83 ns/op 49.860 ns/op 2.30
intersect bitArray bitLen 128 42.991 ns/op 29.784 ns/op 1.44
intersect array and set length 128 1.2180 us/op 734.01 ns/op 1.66
bitArray.getTrueBitIndexes() bitLen 128 2.2200 us/op 1.2530 us/op 1.77
bitArray.getTrueBitIndexes() bitLen 248 3.6100 us/op 2.0530 us/op 1.76
bitArray.getTrueBitIndexes() bitLen 512 8.3180 us/op 3.9320 us/op 2.12
Buffer.concat 32 items 1.2730 us/op 1.0480 us/op 1.21
Uint8Array.set 32 items 2.3180 us/op 1.7250 us/op 1.34
Set add up to 64 items then delete first 5.5707 us/op 1.7816 us/op 3.13
OrderedSet add up to 64 items then delete first 7.6495 us/op 2.6751 us/op 2.86
Set add up to 64 items then delete last 6.0255 us/op 2.0166 us/op 2.99
OrderedSet add up to 64 items then delete last 7.7540 us/op 2.9632 us/op 2.62
Set add up to 64 items then delete middle 5.7392 us/op 1.9812 us/op 2.90
OrderedSet add up to 64 items then delete middle 9.2501 us/op 4.2273 us/op 2.19
Set add up to 128 items then delete first 12.065 us/op 3.9506 us/op 3.05
OrderedSet add up to 128 items then delete first 16.048 us/op 6.1849 us/op 2.59
Set add up to 128 items then delete last 12.202 us/op 3.9784 us/op 3.07
OrderedSet add up to 128 items then delete last 15.219 us/op 5.8934 us/op 2.58
Set add up to 128 items then delete middle 11.376 us/op 3.7940 us/op 3.00
OrderedSet add up to 128 items then delete middle 21.905 us/op 10.908 us/op 2.01
Set add up to 256 items then delete first 23.504 us/op 7.8001 us/op 3.01
OrderedSet add up to 256 items then delete first 34.963 us/op 12.577 us/op 2.78
Set add up to 256 items then delete last 22.940 us/op 7.5118 us/op 3.05
OrderedSet add up to 256 items then delete last 30.891 us/op 11.552 us/op 2.67
Set add up to 256 items then delete middle 22.976 us/op 7.4354 us/op 3.09
OrderedSet add up to 256 items then delete middle 55.380 us/op 31.855 us/op 1.74
transfer serialized Status (84 B) 2.2720 us/op 1.5270 us/op 1.49
copy serialized Status (84 B) 1.6690 us/op 1.2210 us/op 1.37
transfer serialized SignedVoluntaryExit (112 B) 2.3460 us/op 1.5700 us/op 1.49
copy serialized SignedVoluntaryExit (112 B) 1.7720 us/op 1.2880 us/op 1.38
transfer serialized ProposerSlashing (416 B) 3.6030 us/op 2.0560 us/op 1.75
copy serialized ProposerSlashing (416 B) 3.5310 us/op 1.5130 us/op 2.33
transfer serialized Attestation (485 B) 3.7960 us/op 1.7750 us/op 2.14
copy serialized Attestation (485 B) 3.0380 us/op 1.6670 us/op 1.82
transfer serialized AttesterSlashing (33232 B) 3.7480 us/op 1.7310 us/op 2.17
copy serialized AttesterSlashing (33232 B) 20.864 us/op 3.5150 us/op 5.94
transfer serialized Small SignedBeaconBlock (128000 B) 5.1360 us/op 3.1020 us/op 1.66
copy serialized Small SignedBeaconBlock (128000 B) 36.207 us/op 24.334 us/op 1.49
transfer serialized Avg SignedBeaconBlock (200000 B) 5.1810 us/op 2.6090 us/op 1.99
copy serialized Avg SignedBeaconBlock (200000 B) 60.548 us/op 14.012 us/op 4.32
transfer serialized BlobsSidecar (524380 B) 6.0200 us/op 2.6720 us/op 2.25
copy serialized BlobsSidecar (524380 B) 159.42 us/op 80.887 us/op 1.97
transfer serialized Big SignedBeaconBlock (1000000 B) 5.8760 us/op 2.9560 us/op 1.99
copy serialized Big SignedBeaconBlock (1000000 B) 307.28 us/op 243.46 us/op 1.26
pass gossip attestations to forkchoice per slot 5.0232 ms/op 2.8839 ms/op 1.74
forkChoice updateHead vc 100000 bc 64 eq 0 714.60 us/op 493.82 us/op 1.45
forkChoice updateHead vc 600000 bc 64 eq 0 6.8959 ms/op 3.5666 ms/op 1.93
forkChoice updateHead vc 1000000 bc 64 eq 0 7.9774 ms/op 4.7932 ms/op 1.66
forkChoice updateHead vc 600000 bc 320 eq 0 4.6475 ms/op 2.7556 ms/op 1.69
forkChoice updateHead vc 600000 bc 1200 eq 0 4.9942 ms/op 2.9753 ms/op 1.68
forkChoice updateHead vc 600000 bc 7200 eq 0 6.6299 ms/op 3.8512 ms/op 1.72
forkChoice updateHead vc 600000 bc 64 eq 1000 12.220 ms/op 10.200 ms/op 1.20
forkChoice updateHead vc 600000 bc 64 eq 10000 14.463 ms/op 10.022 ms/op 1.44
forkChoice updateHead vc 600000 bc 64 eq 300000 54.969 ms/op 12.060 ms/op 4.56
computeDeltas 500000 validators 300 proto nodes 7.6026 ms/op 3.2966 ms/op 2.31
computeDeltas 500000 validators 1200 proto nodes 7.3888 ms/op 3.1637 ms/op 2.34
computeDeltas 500000 validators 7200 proto nodes 6.9354 ms/op 3.2527 ms/op 2.13
computeDeltas 750000 validators 300 proto nodes 10.657 ms/op 4.9853 ms/op 2.14
computeDeltas 750000 validators 1200 proto nodes 10.698 ms/op 5.2160 ms/op 2.05
computeDeltas 750000 validators 7200 proto nodes 10.418 ms/op 4.9300 ms/op 2.11
computeDeltas 1400000 validators 300 proto nodes 21.535 ms/op 8.7427 ms/op 2.46
computeDeltas 1400000 validators 1200 proto nodes 20.608 ms/op 8.8999 ms/op 2.32
computeDeltas 1400000 validators 7200 proto nodes 20.142 ms/op 9.0048 ms/op 2.24
computeDeltas 2100000 validators 300 proto nodes 30.415 ms/op 13.936 ms/op 2.18
computeDeltas 2100000 validators 1200 proto nodes 31.930 ms/op 13.009 ms/op 2.45
computeDeltas 2100000 validators 7200 proto nodes 33.406 ms/op 12.641 ms/op 2.64
altair processAttestation - 250000 vs - 7PWei normalcase 7.9320 ms/op 1.8188 ms/op 4.36
altair processAttestation - 250000 vs - 7PWei worstcase 10.812 ms/op 2.4310 ms/op 4.45
altair processAttestation - setStatus - 1/6 committees join 412.80 us/op 74.917 us/op 5.51
altair processAttestation - setStatus - 1/3 committees join 812.36 us/op 158.96 us/op 5.11
altair processAttestation - setStatus - 1/2 committees join 1.0978 ms/op 236.25 us/op 4.65
altair processAttestation - setStatus - 2/3 committees join 1.3693 ms/op 296.89 us/op 4.61
altair processAttestation - setStatus - 4/5 committees join 1.7185 ms/op 390.39 us/op 4.40
altair processAttestation - setStatus - 100% committees join 2.0279 ms/op 494.63 us/op 4.10
altair processBlock - 250000 vs - 7PWei normalcase 19.435 ms/op 5.2382 ms/op 3.71
altair processBlock - 250000 vs - 7PWei normalcase hashState 89.449 ms/op 27.293 ms/op 3.28
altair processBlock - 250000 vs - 7PWei worstcase 77.257 ms/op 32.102 ms/op 2.41
altair processBlock - 250000 vs - 7PWei worstcase hashState 196.50 ms/op 88.876 ms/op 2.21
phase0 processBlock - 250000 vs - 7PWei normalcase 6.9290 ms/op 2.0512 ms/op 3.38
phase0 processBlock - 250000 vs - 7PWei worstcase 58.098 ms/op 24.628 ms/op 2.36
altair processEth1Data - 250000 vs - 7PWei normalcase 1.2087 ms/op 272.96 us/op 4.43
getExpectedWithdrawals 250000 eb:1,eth1:1,we:0,wn:0,smpl:15 35.117 us/op 11.006 us/op 3.19
getExpectedWithdrawals 250000 eb:0.95,eth1:0.1,we:0.05,wn:0,smpl:219 148.47 us/op 59.277 us/op 2.50
getExpectedWithdrawals 250000 eb:0.95,eth1:0.3,we:0.05,wn:0,smpl:42 59.735 us/op 30.542 us/op 1.96
getExpectedWithdrawals 250000 eb:0.95,eth1:0.7,we:0.05,wn:0,smpl:18 40.492 us/op 23.514 us/op 1.72
getExpectedWithdrawals 250000 eb:0.1,eth1:0.1,we:0,wn:0,smpl:1020 321.66 us/op 194.24 us/op 1.66
getExpectedWithdrawals 250000 eb:0.03,eth1:0.03,we:0,wn:0,smpl:11777 2.7972 ms/op 1.2550 ms/op 2.23
getExpectedWithdrawals 250000 eb:0.01,eth1:0.01,we:0,wn:0,smpl:16384 3.9335 ms/op 1.8883 ms/op 2.08
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,smpl:16384 3.3347 ms/op 1.7141 ms/op 1.95
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,nocache,smpl:16384 12.393 ms/op 3.7854 ms/op 3.27
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,smpl:16384 6.0161 ms/op 2.3147 ms/op 2.60
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,nocache,smpl:16384 19.883 ms/op 6.7619 ms/op 2.94
Tree 40 250000 create 1.6332 s/op 311.21 ms/op 5.25
Tree 40 250000 get(125000) 387.26 ns/op 132.96 ns/op 2.91
Tree 40 250000 set(125000) 5.8199 us/op 760.34 ns/op 7.65
Tree 40 250000 toArray() 59.792 ms/op 13.670 ms/op 4.37
Tree 40 250000 iterate all - toArray() + loop 65.092 ms/op 19.181 ms/op 3.39
Tree 40 250000 iterate all - get(i) 163.02 ms/op 47.915 ms/op 3.40
MutableVector 250000 create 27.365 ms/op 10.840 ms/op 2.52
MutableVector 250000 get(125000) 11.670 ns/op 5.6240 ns/op 2.08
MutableVector 250000 set(125000) 1.0745 us/op 219.53 ns/op 4.89
MutableVector 250000 toArray() 7.7227 ms/op 2.9348 ms/op 2.63
MutableVector 250000 iterate all - toArray() + loop 8.2208 ms/op 3.0532 ms/op 2.69
MutableVector 250000 iterate all - get(i) 3.0926 ms/op 1.3474 ms/op 2.30
Array 250000 create 6.8597 ms/op 3.3935 ms/op 2.02
Array 250000 clone - spread 7.3420 ms/op 1.2706 ms/op 5.78
Array 250000 get(125000) 4.0960 ns/op 1.1280 ns/op 3.63
Array 250000 set(125000) 7.0830 ns/op 1.3100 ns/op 5.41
Array 250000 iterate all - loop 218.46 us/op 154.71 us/op 1.41
effectiveBalanceIncrements clone Uint8Array 300000 121.64 us/op 14.804 us/op 8.22
effectiveBalanceIncrements clone MutableVector 300000 2.6890 us/op 462.00 ns/op 5.82
effectiveBalanceIncrements rw all Uint8Array 300000 310.20 us/op 190.05 us/op 1.63
effectiveBalanceIncrements rw all MutableVector 300000 323.01 ms/op 67.930 ms/op 4.76
phase0 afterProcessEpoch - 250000 vs - 7PWei 176.60 ms/op 77.383 ms/op 2.28
phase0 beforeProcessEpoch - 250000 vs - 7PWei 134.76 ms/op 43.245 ms/op 3.12
altair processEpoch - mainnet_e81889 1.1120 s/op 436.09 ms/op 2.55
mainnet_e81889 - altair beforeProcessEpoch 227.70 ms/op 65.581 ms/op 3.47
mainnet_e81889 - altair processJustificationAndFinalization 45.629 us/op 16.083 us/op 2.84
mainnet_e81889 - altair processInactivityUpdates 19.414 ms/op 4.2293 ms/op 4.59
mainnet_e81889 - altair processRewardsAndPenalties 96.297 ms/op 58.901 ms/op 1.63
mainnet_e81889 - altair processRegistryUpdates 10.440 us/op 1.9520 us/op 5.35
mainnet_e81889 - altair processSlashings 1.8030 us/op 547.00 ns/op 3.30
mainnet_e81889 - altair processEth1DataReset 2.2380 us/op 1.2240 us/op 1.83
mainnet_e81889 - altair processEffectiveBalanceUpdates 2.7041 ms/op 973.27 us/op 2.78
mainnet_e81889 - altair processSlashingsReset 11.812 us/op 3.8720 us/op 3.05
mainnet_e81889 - altair processRandaoMixesReset 15.698 us/op 3.8050 us/op 4.13
mainnet_e81889 - altair processHistoricalRootsUpdate 3.1170 us/op 689.00 ns/op 4.52
mainnet_e81889 - altair processParticipationFlagUpdates 7.2460 us/op 1.6600 us/op 4.37
mainnet_e81889 - altair processSyncCommitteeUpdates 2.7940 us/op 471.00 ns/op 5.93
mainnet_e81889 - altair afterProcessEpoch 183.83 ms/op 78.880 ms/op 2.33
capella processEpoch - mainnet_e217614 4.8386 s/op 1.7709 s/op 2.73
mainnet_e217614 - capella beforeProcessEpoch 1.0608 s/op 398.49 ms/op 2.66
mainnet_e217614 - capella processJustificationAndFinalization 45.954 us/op 19.323 us/op 2.38
mainnet_e217614 - capella processInactivityUpdates 37.480 ms/op 23.044 ms/op 1.63
mainnet_e217614 - capella processRewardsAndPenalties 984.94 ms/op 512.76 ms/op 1.92
mainnet_e217614 - capella processRegistryUpdates 50.644 us/op 19.324 us/op 2.62
mainnet_e217614 - capella processSlashings 1.7950 us/op 817.00 ns/op 2.20
mainnet_e217614 - capella processEth1DataReset 2.1750 us/op 644.00 ns/op 3.38
mainnet_e217614 - capella processEffectiveBalanceUpdates 22.927 ms/op 3.5541 ms/op 6.45
mainnet_e217614 - capella processSlashingsReset 10.773 us/op 4.2500 us/op 2.53
mainnet_e217614 - capella processRandaoMixesReset 13.542 us/op 6.3330 us/op 2.14
mainnet_e217614 - capella processHistoricalRootsUpdate 2.9160 us/op 869.00 ns/op 3.36
mainnet_e217614 - capella processParticipationFlagUpdates 5.2580 us/op 2.6160 us/op 2.01
mainnet_e217614 - capella afterProcessEpoch 411.99 ms/op 222.60 ms/op 1.85
phase0 processEpoch - mainnet_e58758 681.65 ms/op 438.21 ms/op 1.56
mainnet_e58758 - phase0 beforeProcessEpoch 194.96 ms/op 133.78 ms/op 1.46
mainnet_e58758 - phase0 processJustificationAndFinalization 29.893 us/op 19.703 us/op 1.52
mainnet_e58758 - phase0 processRewardsAndPenalties 72.289 ms/op 57.260 ms/op 1.26
mainnet_e58758 - phase0 processRegistryUpdates 16.124 us/op 13.133 us/op 1.23
mainnet_e58758 - phase0 processSlashings 1.0100 us/op 880.00 ns/op 1.15
mainnet_e58758 - phase0 processEth1DataReset 622.00 ns/op 651.00 ns/op 0.96
mainnet_e58758 - phase0 processEffectiveBalanceUpdates 1.2906 ms/op 945.13 us/op 1.37
mainnet_e58758 - phase0 processSlashingsReset 3.7600 us/op 4.5120 us/op 0.83
mainnet_e58758 - phase0 processRandaoMixesReset 6.3060 us/op 6.1420 us/op 1.03
mainnet_e58758 - phase0 processHistoricalRootsUpdate 588.00 ns/op 717.00 ns/op 0.82
mainnet_e58758 - phase0 processParticipationRecordUpdates 4.6940 us/op 3.9060 us/op 1.20
mainnet_e58758 - phase0 afterProcessEpoch 106.40 ms/op 66.245 ms/op 1.61
phase0 processEffectiveBalanceUpdates - 250000 normalcase 1.4257 ms/op 966.53 us/op 1.48
phase0 processEffectiveBalanceUpdates - 250000 worstcase 0.5 2.1938 ms/op 1.6085 ms/op 1.36
altair processInactivityUpdates - 250000 normalcase 38.465 ms/op 23.198 ms/op 1.66
altair processInactivityUpdates - 250000 worstcase 31.807 ms/op 25.507 ms/op 1.25
phase0 processRegistryUpdates - 250000 normalcase 20.381 us/op 12.193 us/op 1.67
phase0 processRegistryUpdates - 250000 badcase_full_deposits 574.55 us/op 435.06 us/op 1.32
phase0 processRegistryUpdates - 250000 worstcase 0.5 234.79 ms/op 116.42 ms/op 2.02
altair processRewardsAndPenalties - 250000 normalcase 65.764 ms/op 60.663 ms/op 1.08
altair processRewardsAndPenalties - 250000 worstcase 103.72 ms/op 56.741 ms/op 1.83
phase0 getAttestationDeltas - 250000 normalcase 12.271 ms/op 6.0461 ms/op 2.03
phase0 getAttestationDeltas - 250000 worstcase 13.195 ms/op 6.1778 ms/op 2.14
phase0 processSlashings - 250000 worstcase 134.19 us/op 87.643 us/op 1.53
altair processSyncCommitteeUpdates - 250000 189.30 ms/op 130.37 ms/op 1.45
BeaconState.hashTreeRoot - No change 761.00 ns/op 750.00 ns/op 1.01
BeaconState.hashTreeRoot - 1 full validator 184.91 us/op 121.76 us/op 1.52
BeaconState.hashTreeRoot - 32 full validator 1.7553 ms/op 1.2492 ms/op 1.41
BeaconState.hashTreeRoot - 512 full validator 19.088 ms/op 19.934 ms/op 0.96
BeaconState.hashTreeRoot - 1 validator.effectiveBalance 188.49 us/op 114.85 us/op 1.64
BeaconState.hashTreeRoot - 32 validator.effectiveBalance 2.4198 ms/op 1.4725 ms/op 1.64
BeaconState.hashTreeRoot - 512 validator.effectiveBalance 32.610 ms/op 23.715 ms/op 1.38
BeaconState.hashTreeRoot - 1 balances 150.81 us/op 93.666 us/op 1.61
BeaconState.hashTreeRoot - 32 balances 1.3751 ms/op 852.53 us/op 1.61
BeaconState.hashTreeRoot - 512 balances 13.476 ms/op 8.8593 ms/op 1.52
BeaconState.hashTreeRoot - 250000 balances 240.96 ms/op 189.92 ms/op 1.27
aggregationBits - 2048 els - zipIndexesInBitList 45.848 us/op 20.411 us/op 2.25
byteArrayEquals 32 84.308 ns/op 65.428 ns/op 1.29
Buffer.compare 32 59.218 ns/op 38.753 ns/op 1.53
byteArrayEquals 1024 2.4922 us/op 1.7866 us/op 1.39
Buffer.compare 1024 80.018 ns/op 46.199 ns/op 1.73
byteArrayEquals 16384 34.557 us/op 29.005 us/op 1.19
Buffer.compare 16384 287.23 ns/op 225.99 ns/op 1.27
byteArrayEquals 123687377 303.31 ms/op 224.98 ms/op 1.35
Buffer.compare 123687377 12.570 ms/op 6.8724 ms/op 1.83
byteArrayEquals 32 - diff last byte 98.967 ns/op 71.135 ns/op 1.39
Buffer.compare 32 - diff last byte 75.029 ns/op 42.580 ns/op 1.76
byteArrayEquals 1024 - diff last byte 2.5268 us/op 1.8151 us/op 1.39
Buffer.compare 1024 - diff last byte 84.220 ns/op 46.165 ns/op 1.82
byteArrayEquals 16384 - diff last byte 40.096 us/op 28.847 us/op 1.39
Buffer.compare 16384 - diff last byte 294.85 ns/op 241.19 ns/op 1.22
byteArrayEquals 123687377 - diff last byte 296.95 ms/op 214.92 ms/op 1.38
Buffer.compare 123687377 - diff last byte 12.590 ms/op 6.3656 ms/op 1.98
byteArrayEquals 32 - random bytes 7.6330 ns/op 5.6360 ns/op 1.35
Buffer.compare 32 - random bytes 67.310 ns/op 41.550 ns/op 1.62
byteArrayEquals 1024 - random bytes 7.0850 ns/op 4.7960 ns/op 1.48
Buffer.compare 1024 - random bytes 71.807 ns/op 36.590 ns/op 1.96
byteArrayEquals 16384 - random bytes 7.7170 ns/op 5.3230 ns/op 1.45
Buffer.compare 16384 - random bytes 78.324 ns/op 40.901 ns/op 1.91
byteArrayEquals 123687377 - random bytes 17.140 ns/op 9.0600 ns/op 1.89
Buffer.compare 123687377 - random bytes 96.990 ns/op 43.150 ns/op 2.25
regular array get 100000 times 56.159 us/op 41.953 us/op 1.34
wrappedArray get 100000 times 58.899 us/op 42.271 us/op 1.39
arrayWithProxy get 100000 times 18.004 ms/op 10.370 ms/op 1.74
ssz.Root.equals 62.096 ns/op 55.816 ns/op 1.11
byteArrayEquals 59.580 ns/op 54.959 ns/op 1.08
Buffer.compare 13.009 ns/op 9.4770 ns/op 1.37
shuffle list - 16384 els 9.5796 ms/op 6.1049 ms/op 1.57
shuffle list - 250000 els 148.97 ms/op 92.557 ms/op 1.61
processSlot - 1 slots 24.986 us/op 13.354 us/op 1.87
processSlot - 32 slots 4.8993 ms/op 3.6080 ms/op 1.36
getEffectiveBalanceIncrementsZeroInactive - 250000 vs - 7PWei 75.280 ms/op 51.880 ms/op 1.45
getCommitteeAssignments - req 1 vs - 250000 vc 3.0088 ms/op 2.5915 ms/op 1.16
getCommitteeAssignments - req 100 vs - 250000 vc 4.2934 ms/op 3.7604 ms/op 1.14
getCommitteeAssignments - req 1000 vs - 250000 vc 4.7927 ms/op 4.0552 ms/op 1.18
findModifiedValidators - 10000 modified validators 431.38 ms/op 361.92 ms/op 1.19
findModifiedValidators - 1000 modified validators 259.87 ms/op 227.17 ms/op 1.14
findModifiedValidators - 100 modified validators 210.14 ms/op 184.62 ms/op 1.14
findModifiedValidators - 10 modified validators 214.07 ms/op 188.83 ms/op 1.13
findModifiedValidators - 1 modified validators 224.56 ms/op 179.47 ms/op 1.25
findModifiedValidators - no difference 230.81 ms/op 214.93 ms/op 1.07
compare ViewDUs 7.4018 s/op 4.6353 s/op 1.60
compare each validator Uint8Array 2.7749 s/op 1.8447 s/op 1.50
compare ViewDU to Uint8Array 1.7809 s/op 1.2171 s/op 1.46
migrate state 1000000 validators, 24 modified, 0 new 1.2691 s/op 695.38 ms/op 1.82
migrate state 1000000 validators, 1700 modified, 1000 new 1.7469 s/op 1.0785 s/op 1.62
migrate state 1000000 validators, 3400 modified, 2000 new 1.4233 s/op 1.3480 s/op 1.06
migrate state 1500000 validators, 24 modified, 0 new 1.0225 s/op 819.94 ms/op 1.25
migrate state 1500000 validators, 1700 modified, 1000 new 1.3702 s/op 1.2008 s/op 1.14
migrate state 1500000 validators, 3400 modified, 2000 new 1.4702 s/op 1.2445 s/op 1.18
RootCache.getBlockRootAtSlot - 250000 vs - 7PWei 4.5000 ns/op 4.9300 ns/op 0.91
state getBlockRootAtSlot - 250000 vs - 7PWei 527.42 ns/op 712.25 ns/op 0.74
computeProposers - vc 250000 9.5596 ms/op 6.8794 ms/op 1.39
computeEpochShuffling - vc 250000 127.28 ms/op 95.068 ms/op 1.34
getNextSyncCommittee - vc 250000 167.16 ms/op 125.37 ms/op 1.33
computeSigningRoot for AttestationData 25.338 us/op 33.326 us/op 0.76
hash AttestationData serialized data then Buffer.toString(base64) 2.4253 us/op 1.3167 us/op 1.84
toHexString serialized data 1.2787 us/op 999.70 ns/op 1.28
Buffer.toString(base64) 250.39 ns/op 210.56 ns/op 1.19

Please sign in to comment.