Skip to content

Conversation

@matthewkeil
Copy link
Member

Motivation

Gnosis analysis shows that there is a lot of time spent on main thread for running aggregateWithRandomness on main thread. Now that libp2p@v2 is more stable and so are some of the other conditions that triggered our revert last time, looking to check this again to see what the metrics look like for running not on main thread.

@codecov
Copy link

codecov bot commented Apr 29, 2025

Codecov Report

Attention: Patch coverage is 90.00000% with 1 line in your changes missing coverage. Please review.

Project coverage is 56.08%. Comparing base (6dae670) to head (5cd36ad).
Report is 2 commits behind head on unstable.

Additional details and impacted files
@@            Coverage Diff            @@
##           unstable    #7761   +/-   ##
=========================================
  Coverage     56.08%   56.08%           
=========================================
  Files           823      823           
  Lines         58031    58033    +2     
  Branches       4461     4467    +6     
=========================================
+ Hits          32545    32550    +5     
+ Misses        25419    25416    -3     
  Partials         67       67           
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions
Copy link
Contributor

github-actions bot commented Apr 29, 2025

Performance Report

✔️ no performance regression detected

Full benchmark results
Benchmark suite Current: fdcf3bc Previous: 4a9c1b1 Ratio
getPubkeys - index2pubkey - req 1000 vs - 250000 vc 963.18 us/op 949.24 us/op 1.01
getPubkeys - validatorsArr - req 1000 vs - 250000 vc 34.986 us/op 34.327 us/op 1.02
BLS verify - blst 810.52 us/op 797.15 us/op 1.02
BLS verifyMultipleSignatures 3 - blst 2.5474 ms/op 1.5989 ms/op 1.59
BLS verifyMultipleSignatures 8 - blst 1.8850 ms/op 1.9701 ms/op 0.96
BLS verifyMultipleSignatures 32 - blst 5.7838 ms/op 5.5798 ms/op 1.04
BLS verifyMultipleSignatures 64 - blst 10.666 ms/op 11.257 ms/op 0.95
BLS verifyMultipleSignatures 128 - blst 17.581 ms/op 17.115 ms/op 1.03
BLS deserializing 10000 signatures 697.58 ms/op 685.31 ms/op 1.02
BLS deserializing 100000 signatures 6.8891 s/op 6.8716 s/op 1.00
BLS verifyMultipleSignatures - same message - 3 - blst 1.0429 ms/op 898.94 us/op 1.16
BLS verifyMultipleSignatures - same message - 8 - blst 1.1717 ms/op 1.1640 ms/op 1.01
BLS verifyMultipleSignatures - same message - 32 - blst 1.7339 ms/op 1.6967 ms/op 1.02
BLS verifyMultipleSignatures - same message - 64 - blst 2.6442 ms/op 2.5832 ms/op 1.02
BLS verifyMultipleSignatures - same message - 128 - blst 4.4582 ms/op 4.7176 ms/op 0.95
BLS aggregatePubkeys 32 - blst 19.879 us/op 19.120 us/op 1.04
BLS aggregatePubkeys 128 - blst 71.510 us/op 68.100 us/op 1.05
notSeenSlots=1 numMissedVotes=1 numBadVotes=10 64.583 ms/op 56.501 ms/op 1.14
notSeenSlots=1 numMissedVotes=0 numBadVotes=4 49.839 ms/op 56.374 ms/op 0.88
notSeenSlots=2 numMissedVotes=1 numBadVotes=10 42.048 ms/op 49.020 ms/op 0.86
getSlashingsAndExits - default max 72.774 us/op 70.543 us/op 1.03
getSlashingsAndExits - 2k 340.20 us/op 362.90 us/op 0.94
proposeBlockBody type=full, size=empty 6.4560 ms/op 6.2740 ms/op 1.03
isKnown best case - 1 super set check 205.00 ns/op 210.00 ns/op 0.98
isKnown normal case - 2 super set checks 203.00 ns/op 207.00 ns/op 0.98
isKnown worse case - 16 super set checks 204.00 ns/op 210.00 ns/op 0.97
InMemoryCheckpointStateCache - add get delete 2.4570 us/op 2.4330 us/op 1.01
validate api signedAggregateAndProof - struct 1.4430 ms/op 1.4293 ms/op 1.01
validate gossip signedAggregateAndProof - struct 1.5460 ms/op 1.4279 ms/op 1.08
batch validate gossip attestation - vc 640000 - chunk 32 123.31 us/op 116.35 us/op 1.06
batch validate gossip attestation - vc 640000 - chunk 64 102.08 us/op 102.14 us/op 1.00
batch validate gossip attestation - vc 640000 - chunk 128 94.643 us/op 94.915 us/op 1.00
batch validate gossip attestation - vc 640000 - chunk 256 95.682 us/op 101.85 us/op 0.94
pickEth1Vote - no votes 1.0136 ms/op 1.0172 ms/op 1.00
pickEth1Vote - max votes 5.6938 ms/op 6.1039 ms/op 0.93
pickEth1Vote - Eth1Data hashTreeRoot value x2048 10.889 ms/op 11.222 ms/op 0.97
pickEth1Vote - Eth1Data hashTreeRoot tree x2048 16.599 ms/op 18.647 ms/op 0.89
pickEth1Vote - Eth1Data fastSerialize value x2048 468.86 us/op 451.48 us/op 1.04
pickEth1Vote - Eth1Data fastSerialize tree x2048 3.8463 ms/op 2.1408 ms/op 1.80
bytes32 toHexString 364.00 ns/op 362.00 ns/op 1.01
bytes32 Buffer.toString(hex) 245.00 ns/op 379.00 ns/op 0.65
bytes32 Buffer.toString(hex) from Uint8Array 346.00 ns/op 407.00 ns/op 0.85
bytes32 Buffer.toString(hex) + 0x 265.00 ns/op 292.00 ns/op 0.91
Object access 1 prop 0.12200 ns/op 0.17800 ns/op 0.69
Map access 1 prop 0.12700 ns/op 0.13200 ns/op 0.96
Object get x1000 6.0390 ns/op 5.8770 ns/op 1.03
Map get x1000 6.7950 ns/op 6.1520 ns/op 1.10
Object set x1000 28.632 ns/op 30.369 ns/op 0.94
Map set x1000 19.953 ns/op 19.638 ns/op 1.02
Return object 10000 times 0.35750 ns/op 0.29590 ns/op 1.21
Throw Error 10000 times 4.3345 us/op 4.4044 us/op 0.98
toHex 145.01 ns/op 144.55 ns/op 1.00
Buffer.from 133.08 ns/op 133.48 ns/op 1.00
shared Buffer 97.355 ns/op 90.087 ns/op 1.08
fastMsgIdFn sha256 / 200 bytes 2.2590 us/op 2.2660 us/op 1.00
fastMsgIdFn h32 xxhash / 200 bytes 204.00 ns/op 210.00 ns/op 0.97
fastMsgIdFn h64 xxhash / 200 bytes 273.00 ns/op 274.00 ns/op 1.00
fastMsgIdFn sha256 / 1000 bytes 7.3820 us/op 7.4290 us/op 0.99
fastMsgIdFn h32 xxhash / 1000 bytes 322.00 ns/op 366.00 ns/op 0.88
fastMsgIdFn h64 xxhash / 1000 bytes 337.00 ns/op 344.00 ns/op 0.98
fastMsgIdFn sha256 / 10000 bytes 63.626 us/op 65.271 us/op 0.97
fastMsgIdFn h32 xxhash / 10000 bytes 1.8090 us/op 1.8560 us/op 0.97
fastMsgIdFn h64 xxhash / 10000 bytes 1.2120 us/op 1.2390 us/op 0.98
send data - 1000 256B messages 11.087 ms/op 12.588 ms/op 0.88
send data - 1000 512B messages 15.166 ms/op 17.362 ms/op 0.87
send data - 1000 1024B messages 24.192 ms/op 26.410 ms/op 0.92
send data - 1000 1200B messages 19.169 ms/op 20.050 ms/op 0.96
send data - 1000 2048B messages 20.097 ms/op 21.569 ms/op 0.93
send data - 1000 4096B messages 23.778 ms/op 24.934 ms/op 0.95
send data - 1000 16384B messages 72.312 ms/op 85.654 ms/op 0.84
send data - 1000 65536B messages 206.52 ms/op 250.42 ms/op 0.82
enrSubnets - fastDeserialize 64 bits 861.00 ns/op 1.7590 us/op 0.49
enrSubnets - ssz BitVector 64 bits 318.00 ns/op 335.00 ns/op 0.95
enrSubnets - fastDeserialize 4 bits 133.00 ns/op 143.00 ns/op 0.93
enrSubnets - ssz BitVector 4 bits 321.00 ns/op 337.00 ns/op 0.95
prioritizePeers score -10:0 att 32-0.1 sync 2-0 119.15 us/op 125.18 us/op 0.95
prioritizePeers score 0:0 att 32-0.25 sync 2-0.25 142.50 us/op 145.29 us/op 0.98
prioritizePeers score 0:0 att 32-0.5 sync 2-0.5 202.07 us/op 209.12 us/op 0.97
prioritizePeers score 0:0 att 64-0.75 sync 4-0.75 376.56 us/op 388.00 us/op 0.97
prioritizePeers score 0:0 att 64-1 sync 4-1 471.49 us/op 478.11 us/op 0.99
array of 16000 items push then shift 1.6227 us/op 1.6489 us/op 0.98
LinkedList of 16000 items push then shift 7.1110 ns/op 7.3530 ns/op 0.97
array of 16000 items push then pop 78.545 ns/op 80.915 ns/op 0.97
LinkedList of 16000 items push then pop 6.9800 ns/op 7.2440 ns/op 0.96
array of 24000 items push then shift 2.3990 us/op 2.4591 us/op 0.98
LinkedList of 24000 items push then shift 7.0400 ns/op 7.7600 ns/op 0.91
array of 24000 items push then pop 102.60 ns/op 119.29 ns/op 0.86
LinkedList of 24000 items push then pop 6.9820 ns/op 8.0170 ns/op 0.87
intersect bitArray bitLen 8 6.5610 ns/op 6.5510 ns/op 1.00
intersect array and set length 8 37.612 ns/op 38.754 ns/op 0.97
intersect bitArray bitLen 128 29.356 ns/op 30.644 ns/op 0.96
intersect array and set length 128 614.68 ns/op 638.57 ns/op 0.96
bitArray.getTrueBitIndexes() bitLen 128 1.2420 us/op 1.0580 us/op 1.17
bitArray.getTrueBitIndexes() bitLen 248 1.7730 us/op 1.8330 us/op 0.97
bitArray.getTrueBitIndexes() bitLen 512 3.6600 us/op 3.7310 us/op 0.98
Buffer.concat 32 items 660.00 ns/op 719.00 ns/op 0.92
Uint8Array.set 32 items 1.1110 us/op 1.2030 us/op 0.92
Buffer.copy 2.4570 us/op 2.0690 us/op 1.19
Uint8Array.set - with subarray 2.2620 us/op 1.5980 us/op 1.42
Uint8Array.set - without subarray 1.2470 us/op 1.0760 us/op 1.16
getUint32 - dataview 200.00 ns/op 204.00 ns/op 0.98
getUint32 - manual 129.00 ns/op 131.00 ns/op 0.98
Set add up to 64 items then delete first 2.1922 us/op 2.5223 us/op 0.87
OrderedSet add up to 64 items then delete first 3.2970 us/op 3.9392 us/op 0.84
Set add up to 64 items then delete last 2.5030 us/op 2.6229 us/op 0.95
OrderedSet add up to 64 items then delete last 3.5522 us/op 4.6560 us/op 0.76
Set add up to 64 items then delete middle 2.4697 us/op 2.5723 us/op 0.96
OrderedSet add up to 64 items then delete middle 5.0683 us/op 5.3455 us/op 0.95
Set add up to 128 items then delete first 5.0423 us/op 5.4635 us/op 0.92
OrderedSet add up to 128 items then delete first 7.5823 us/op 7.9414 us/op 0.95
Set add up to 128 items then delete last 4.7961 us/op 4.9069 us/op 0.98
OrderedSet add up to 128 items then delete last 7.2094 us/op 7.2933 us/op 0.99
Set add up to 128 items then delete middle 4.7880 us/op 5.6141 us/op 0.85
OrderedSet add up to 128 items then delete middle 13.920 us/op 15.111 us/op 0.92
Set add up to 256 items then delete first 10.737 us/op 11.682 us/op 0.92
OrderedSet add up to 256 items then delete first 17.235 us/op 18.601 us/op 0.93
Set add up to 256 items then delete last 10.472 us/op 12.632 us/op 0.83
OrderedSet add up to 256 items then delete last 15.603 us/op 14.785 us/op 1.06
Set add up to 256 items then delete middle 10.694 us/op 9.7628 us/op 1.10
OrderedSet add up to 256 items then delete middle 45.586 us/op 45.320 us/op 1.01
transfer serialized Status (84 B) 2.4410 us/op 2.4570 us/op 0.99
copy serialized Status (84 B) 1.3140 us/op 1.2220 us/op 1.08
transfer serialized SignedVoluntaryExit (112 B) 2.4210 us/op 2.3580 us/op 1.03
copy serialized SignedVoluntaryExit (112 B) 1.2690 us/op 1.2580 us/op 1.01
transfer serialized ProposerSlashing (416 B) 2.5300 us/op 2.4540 us/op 1.03
copy serialized ProposerSlashing (416 B) 1.8620 us/op 1.2980 us/op 1.43
transfer serialized Attestation (485 B) 2.5270 us/op 2.4890 us/op 1.02
copy serialized Attestation (485 B) 1.5660 us/op 1.5080 us/op 1.04
transfer serialized AttesterSlashing (33232 B) 3.2380 us/op 2.4930 us/op 1.30
copy serialized AttesterSlashing (33232 B) 4.6390 us/op 3.5980 us/op 1.29
transfer serialized Small SignedBeaconBlock (128000 B) 3.5580 us/op 3.0680 us/op 1.16
copy serialized Small SignedBeaconBlock (128000 B) 11.115 us/op 9.4180 us/op 1.18
transfer serialized Avg SignedBeaconBlock (200000 B) 4.0300 us/op 3.6390 us/op 1.11
copy serialized Avg SignedBeaconBlock (200000 B) 15.645 us/op 15.028 us/op 1.04
transfer serialized BlobsSidecar (524380 B) 4.1260 us/op 3.6330 us/op 1.14
copy serialized BlobsSidecar (524380 B) 84.835 us/op 97.604 us/op 0.87
transfer serialized Big SignedBeaconBlock (1000000 B) 4.4470 us/op 3.9720 us/op 1.12
copy serialized Big SignedBeaconBlock (1000000 B) 232.30 us/op 118.30 us/op 1.96
pass gossip attestations to forkchoice per slot 2.8465 ms/op 2.8174 ms/op 1.01
forkChoice updateHead vc 100000 bc 64 eq 0 462.32 us/op 462.30 us/op 1.00
forkChoice updateHead vc 600000 bc 64 eq 0 2.9195 ms/op 3.0719 ms/op 0.95
forkChoice updateHead vc 1000000 bc 64 eq 0 4.9597 ms/op 4.8551 ms/op 1.02
forkChoice updateHead vc 600000 bc 320 eq 0 2.8973 ms/op 2.8919 ms/op 1.00
forkChoice updateHead vc 600000 bc 1200 eq 0 2.9403 ms/op 2.9269 ms/op 1.00
forkChoice updateHead vc 600000 bc 7200 eq 0 4.0055 ms/op 3.2413 ms/op 1.24
forkChoice updateHead vc 600000 bc 64 eq 1000 10.651 ms/op 10.862 ms/op 0.98
forkChoice updateHead vc 600000 bc 64 eq 10000 10.705 ms/op 10.724 ms/op 1.00
forkChoice updateHead vc 600000 bc 64 eq 300000 13.865 ms/op 30.703 ms/op 0.45
computeDeltas 500000 validators 300 proto nodes 4.2128 ms/op 4.0024 ms/op 1.05
computeDeltas 500000 validators 1200 proto nodes 4.2154 ms/op 4.0487 ms/op 1.04
computeDeltas 500000 validators 7200 proto nodes 4.7763 ms/op 4.1403 ms/op 1.15
computeDeltas 750000 validators 300 proto nodes 6.6958 ms/op 5.9334 ms/op 1.13
computeDeltas 750000 validators 1200 proto nodes 6.7655 ms/op 5.9402 ms/op 1.14
computeDeltas 750000 validators 7200 proto nodes 6.6245 ms/op 5.9111 ms/op 1.12
computeDeltas 1400000 validators 300 proto nodes 11.242 ms/op 11.044 ms/op 1.02
computeDeltas 1400000 validators 1200 proto nodes 10.984 ms/op 11.129 ms/op 0.99
computeDeltas 1400000 validators 7200 proto nodes 11.117 ms/op 11.103 ms/op 1.00
computeDeltas 2100000 validators 300 proto nodes 17.730 ms/op 16.709 ms/op 1.06
computeDeltas 2100000 validators 1200 proto nodes 21.164 ms/op 16.892 ms/op 1.25
computeDeltas 2100000 validators 7200 proto nodes 16.278 ms/op 16.719 ms/op 0.97
altair processAttestation - 250000 vs - 7PWei normalcase 2.0182 ms/op 2.2210 ms/op 0.91
altair processAttestation - 250000 vs - 7PWei worstcase 2.9317 ms/op 4.0769 ms/op 0.72
altair processAttestation - setStatus - 1/6 committees join 123.30 us/op 123.09 us/op 1.00
altair processAttestation - setStatus - 1/3 committees join 235.65 us/op 249.23 us/op 0.95
altair processAttestation - setStatus - 1/2 committees join 335.94 us/op 359.62 us/op 0.93
altair processAttestation - setStatus - 2/3 committees join 438.06 us/op 452.58 us/op 0.97
altair processAttestation - setStatus - 4/5 committees join 584.43 us/op 699.21 us/op 0.84
altair processAttestation - setStatus - 100% committees join 694.75 us/op 747.15 us/op 0.93
altair processBlock - 250000 vs - 7PWei normalcase 4.5917 ms/op 5.4972 ms/op 0.84
altair processBlock - 250000 vs - 7PWei normalcase hashState 33.831 ms/op 34.441 ms/op 0.98
altair processBlock - 250000 vs - 7PWei worstcase 34.919 ms/op 41.172 ms/op 0.85
altair processBlock - 250000 vs - 7PWei worstcase hashState 79.261 ms/op 85.935 ms/op 0.92
phase0 processBlock - 250000 vs - 7PWei normalcase 2.3096 ms/op 2.1114 ms/op 1.09
phase0 processBlock - 250000 vs - 7PWei worstcase 30.716 ms/op 26.902 ms/op 1.14
altair processEth1Data - 250000 vs - 7PWei normalcase 342.27 us/op 365.33 us/op 0.94
getExpectedWithdrawals 250000 eb:1,eth1:1,we:0,wn:0,smpl:15 5.3700 us/op 6.2700 us/op 0.86
getExpectedWithdrawals 250000 eb:0.95,eth1:0.1,we:0.05,wn:0,smpl:219 38.136 us/op 46.774 us/op 0.82
getExpectedWithdrawals 250000 eb:0.95,eth1:0.3,we:0.05,wn:0,smpl:42 9.2550 us/op 10.497 us/op 0.88
getExpectedWithdrawals 250000 eb:0.95,eth1:0.7,we:0.05,wn:0,smpl:18 5.8390 us/op 6.7270 us/op 0.87
getExpectedWithdrawals 250000 eb:0.1,eth1:0.1,we:0,wn:0,smpl:1020 238.05 us/op 256.65 us/op 0.93
getExpectedWithdrawals 250000 eb:0.03,eth1:0.03,we:0,wn:0,smpl:11777 1.7951 ms/op 2.6394 ms/op 0.68
getExpectedWithdrawals 250000 eb:0.01,eth1:0.01,we:0,wn:0,smpl:16384 2.2658 ms/op 2.4366 ms/op 0.93
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,smpl:16384 2.2647 ms/op 2.4512 ms/op 0.92
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,nocache,smpl:16384 4.3976 ms/op 4.9979 ms/op 0.88
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,smpl:16384 2.3077 ms/op 2.8814 ms/op 0.80
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,nocache,smpl:16384 4.4722 ms/op 6.0259 ms/op 0.74
Tree 40 250000 create 420.42 ms/op 443.94 ms/op 0.95
Tree 40 250000 get(125000) 149.77 ns/op 139.21 ns/op 1.08
Tree 40 250000 set(125000) 1.4671 us/op 1.5378 us/op 0.95
Tree 40 250000 toArray() 16.152 ms/op 20.328 ms/op 0.79
Tree 40 250000 iterate all - toArray() + loop 15.135 ms/op 21.471 ms/op 0.70
Tree 40 250000 iterate all - get(i) 49.922 ms/op 55.956 ms/op 0.89
Array 250000 create 2.4023 ms/op 2.6175 ms/op 0.92
Array 250000 clone - spread 800.51 us/op 1.3830 ms/op 0.58
Array 250000 get(125000) 0.39800 ns/op 0.41300 ns/op 0.96
Array 250000 set(125000) 0.41800 ns/op 0.43700 ns/op 0.96
Array 250000 iterate all - loop 81.534 us/op 103.62 us/op 0.79
phase0 afterProcessEpoch - 250000 vs - 7PWei 41.980 ms/op 43.088 ms/op 0.97
Array.fill - length 1000000 3.8031 ms/op 3.5963 ms/op 1.06
Array push - length 1000000 12.291 ms/op 15.872 ms/op 0.77
Array.get 0.27161 ns/op 0.27727 ns/op 0.98
Uint8Array.get 0.43568 ns/op 0.44420 ns/op 0.98
phase0 beforeProcessEpoch - 250000 vs - 7PWei 15.919 ms/op 16.905 ms/op 0.94
altair processEpoch - mainnet_e81889 260.14 ms/op 293.33 ms/op 0.89
mainnet_e81889 - altair beforeProcessEpoch 16.645 ms/op 18.196 ms/op 0.91
mainnet_e81889 - altair processJustificationAndFinalization 5.8580 us/op 5.3900 us/op 1.09
mainnet_e81889 - altair processInactivityUpdates 4.1093 ms/op 5.8297 ms/op 0.70
mainnet_e81889 - altair processRewardsAndPenalties 36.258 ms/op 40.144 ms/op 0.90
mainnet_e81889 - altair processRegistryUpdates 735.00 ns/op 768.00 ns/op 0.96
mainnet_e81889 - altair processSlashings 194.00 ns/op 189.00 ns/op 1.03
mainnet_e81889 - altair processEth1DataReset 175.00 ns/op 198.00 ns/op 0.88
mainnet_e81889 - altair processEffectiveBalanceUpdates 1.2260 ms/op 1.2557 ms/op 0.98
mainnet_e81889 - altair processSlashingsReset 928.00 ns/op 1.0700 us/op 0.87
mainnet_e81889 - altair processRandaoMixesReset 1.1570 us/op 1.2450 us/op 0.93
mainnet_e81889 - altair processHistoricalRootsUpdate 196.00 ns/op 190.00 ns/op 1.03
mainnet_e81889 - altair processParticipationFlagUpdates 515.00 ns/op 524.00 ns/op 0.98
mainnet_e81889 - altair processSyncCommitteeUpdates 143.00 ns/op 144.00 ns/op 0.99
mainnet_e81889 - altair afterProcessEpoch 44.450 ms/op 44.451 ms/op 1.00
capella processEpoch - mainnet_e217614 931.01 ms/op 959.88 ms/op 0.97
mainnet_e217614 - capella beforeProcessEpoch 67.031 ms/op 64.810 ms/op 1.03
mainnet_e217614 - capella processJustificationAndFinalization 5.2530 us/op 5.6390 us/op 0.93
mainnet_e217614 - capella processInactivityUpdates 14.055 ms/op 15.811 ms/op 0.89
mainnet_e217614 - capella processRewardsAndPenalties 203.15 ms/op 197.79 ms/op 1.03
mainnet_e217614 - capella processRegistryUpdates 8.0460 us/op 6.9210 us/op 1.16
mainnet_e217614 - capella processSlashings 197.00 ns/op 185.00 ns/op 1.06
mainnet_e217614 - capella processEth1DataReset 194.00 ns/op 174.00 ns/op 1.11
mainnet_e217614 - capella processEffectiveBalanceUpdates 10.325 ms/op 4.0577 ms/op 2.54
mainnet_e217614 - capella processSlashingsReset 966.00 ns/op 1.0520 us/op 0.92
mainnet_e217614 - capella processRandaoMixesReset 1.3460 us/op 1.2590 us/op 1.07
mainnet_e217614 - capella processHistoricalRootsUpdate 192.00 ns/op 198.00 ns/op 0.97
mainnet_e217614 - capella processParticipationFlagUpdates 520.00 ns/op 520.00 ns/op 1.00
mainnet_e217614 - capella afterProcessEpoch 115.51 ms/op 122.26 ms/op 0.94
phase0 processEpoch - mainnet_e58758 284.24 ms/op 313.45 ms/op 0.91
mainnet_e58758 - phase0 beforeProcessEpoch 74.623 ms/op 72.666 ms/op 1.03
mainnet_e58758 - phase0 processJustificationAndFinalization 6.3860 us/op 6.1540 us/op 1.04
mainnet_e58758 - phase0 processRewardsAndPenalties 35.583 ms/op 40.212 ms/op 0.88
mainnet_e58758 - phase0 processRegistryUpdates 3.0310 us/op 3.0600 us/op 0.99
mainnet_e58758 - phase0 processSlashings 182.00 ns/op 190.00 ns/op 0.96
mainnet_e58758 - phase0 processEth1DataReset 181.00 ns/op 175.00 ns/op 1.03
mainnet_e58758 - phase0 processEffectiveBalanceUpdates 1.1619 ms/op 1.1582 ms/op 1.00
mainnet_e58758 - phase0 processSlashingsReset 943.00 ns/op 960.00 ns/op 0.98
mainnet_e58758 - phase0 processRandaoMixesReset 1.6350 us/op 1.3820 us/op 1.18
mainnet_e58758 - phase0 processHistoricalRootsUpdate 268.00 ns/op 198.00 ns/op 1.35
mainnet_e58758 - phase0 processParticipationRecordUpdates 881.00 ns/op 883.00 ns/op 1.00
mainnet_e58758 - phase0 afterProcessEpoch 35.597 ms/op 35.855 ms/op 0.99
phase0 processEffectiveBalanceUpdates - 250000 normalcase 1.3307 ms/op 1.1998 ms/op 1.11
phase0 processEffectiveBalanceUpdates - 250000 worstcase 0.5 1.9179 ms/op 1.7433 ms/op 1.10
altair processInactivityUpdates - 250000 normalcase 21.138 ms/op 22.004 ms/op 0.96
altair processInactivityUpdates - 250000 worstcase 21.088 ms/op 22.831 ms/op 0.92
phase0 processRegistryUpdates - 250000 normalcase 5.9330 us/op 6.5810 us/op 0.90
phase0 processRegistryUpdates - 250000 badcase_full_deposits 338.04 us/op 422.44 us/op 0.80
phase0 processRegistryUpdates - 250000 worstcase 0.5 113.49 ms/op 120.67 ms/op 0.94
altair processRewardsAndPenalties - 250000 normalcase 32.275 ms/op 25.501 ms/op 1.27
altair processRewardsAndPenalties - 250000 worstcase 26.762 ms/op 31.278 ms/op 0.86
phase0 getAttestationDeltas - 250000 normalcase 6.9961 ms/op 5.8198 ms/op 1.20
phase0 getAttestationDeltas - 250000 worstcase 6.5625 ms/op 5.8352 ms/op 1.12
phase0 processSlashings - 250000 worstcase 122.90 us/op 98.242 us/op 1.25
altair processSyncCommitteeUpdates - 250000 10.934 ms/op 10.861 ms/op 1.01
BeaconState.hashTreeRoot - No change 202.00 ns/op 219.00 ns/op 0.92
BeaconState.hashTreeRoot - 1 full validator 90.716 us/op 83.710 us/op 1.08
BeaconState.hashTreeRoot - 32 full validator 1.0901 ms/op 1.3948 ms/op 0.78
BeaconState.hashTreeRoot - 512 full validator 10.606 ms/op 10.964 ms/op 0.97
BeaconState.hashTreeRoot - 1 validator.effectiveBalance 114.69 us/op 144.57 us/op 0.79
BeaconState.hashTreeRoot - 32 validator.effectiveBalance 1.5807 ms/op 1.8363 ms/op 0.86
BeaconState.hashTreeRoot - 512 validator.effectiveBalance 18.279 ms/op 24.825 ms/op 0.74
BeaconState.hashTreeRoot - 1 balances 87.021 us/op 85.047 us/op 1.02
BeaconState.hashTreeRoot - 32 balances 663.21 us/op 1.0038 ms/op 0.66
BeaconState.hashTreeRoot - 512 balances 6.8486 ms/op 8.0901 ms/op 0.85
BeaconState.hashTreeRoot - 250000 balances 142.05 ms/op 197.43 ms/op 0.72
aggregationBits - 2048 els - zipIndexesInBitList 21.131 us/op 20.500 us/op 1.03
byteArrayEquals 32 53.291 ns/op 52.534 ns/op 1.01
Buffer.compare 32 17.043 ns/op 16.754 ns/op 1.02
byteArrayEquals 1024 1.5770 us/op 1.5599 us/op 1.01
Buffer.compare 1024 25.422 ns/op 24.966 ns/op 1.02
byteArrayEquals 16384 25.059 us/op 24.841 us/op 1.01
Buffer.compare 16384 199.36 ns/op 200.20 ns/op 1.00
byteArrayEquals 123687377 189.68 ms/op 189.85 ms/op 1.00
Buffer.compare 123687377 6.0474 ms/op 6.2682 ms/op 0.96
byteArrayEquals 32 - diff last byte 51.953 ns/op 52.586 ns/op 0.99
Buffer.compare 32 - diff last byte 17.039 ns/op 17.159 ns/op 0.99
byteArrayEquals 1024 - diff last byte 1.5736 us/op 1.5832 us/op 0.99
Buffer.compare 1024 - diff last byte 24.979 ns/op 26.080 ns/op 0.96
byteArrayEquals 16384 - diff last byte 25.071 us/op 25.208 us/op 0.99
Buffer.compare 16384 - diff last byte 194.12 ns/op 202.53 ns/op 0.96
byteArrayEquals 123687377 - diff last byte 189.72 ms/op 190.66 ms/op 1.00
Buffer.compare 123687377 - diff last byte 6.1421 ms/op 6.5903 ms/op 0.93
byteArrayEquals 32 - random bytes 5.0850 ns/op 5.2140 ns/op 0.98
Buffer.compare 32 - random bytes 17.098 ns/op 17.551 ns/op 0.97
byteArrayEquals 1024 - random bytes 5.0970 ns/op 5.2790 ns/op 0.97
Buffer.compare 1024 - random bytes 17.061 ns/op 17.560 ns/op 0.97
byteArrayEquals 16384 - random bytes 5.1690 ns/op 5.2580 ns/op 0.98
Buffer.compare 16384 - random bytes 17.356 ns/op 17.437 ns/op 1.00
byteArrayEquals 123687377 - random bytes 7.0900 ns/op 7.0300 ns/op 1.01
Buffer.compare 123687377 - random bytes 18.320 ns/op 18.720 ns/op 0.98
regular array get 100000 times 32.941 us/op 44.827 us/op 0.73
wrappedArray get 100000 times 32.770 us/op 33.722 us/op 0.97
arrayWithProxy get 100000 times 11.921 ms/op 14.269 ms/op 0.84
ssz.Root.equals 45.844 ns/op 46.262 ns/op 0.99
byteArrayEquals 44.754 ns/op 45.282 ns/op 0.99
Buffer.compare 10.321 ns/op 10.424 ns/op 0.99
processSlot - 1 slots 9.9810 us/op 12.564 us/op 0.79
processSlot - 32 slots 2.3590 ms/op 2.5985 ms/op 0.91
getEffectiveBalanceIncrementsZeroInactive - 250000 vs - 7PWei 2.8400 ms/op 2.9213 ms/op 0.97
getCommitteeAssignments - req 1 vs - 250000 vc 2.1097 ms/op 2.1009 ms/op 1.00
getCommitteeAssignments - req 100 vs - 250000 vc 4.0884 ms/op 4.1456 ms/op 0.99
getCommitteeAssignments - req 1000 vs - 250000 vc 4.3507 ms/op 4.3816 ms/op 0.99
findModifiedValidators - 10000 modified validators 697.26 ms/op 752.67 ms/op 0.93
findModifiedValidators - 1000 modified validators 615.36 ms/op 742.25 ms/op 0.83
findModifiedValidators - 100 modified validators 271.53 ms/op 173.05 ms/op 1.57
findModifiedValidators - 10 modified validators 194.04 ms/op 147.25 ms/op 1.32
findModifiedValidators - 1 modified validators 132.67 ms/op 146.25 ms/op 0.91
findModifiedValidators - no difference 144.53 ms/op 147.79 ms/op 0.98
compare ViewDUs 6.0111 s/op 6.2287 s/op 0.97
compare each validator Uint8Array 1.8229 s/op 1.5091 s/op 1.21
compare ViewDU to Uint8Array 1.0646 s/op 1.0819 s/op 0.98
migrate state 1000000 validators, 24 modified, 0 new 735.32 ms/op 878.69 ms/op 0.84
migrate state 1000000 validators, 1700 modified, 1000 new 1.0890 s/op 1.2256 s/op 0.89
migrate state 1000000 validators, 3400 modified, 2000 new 1.2797 s/op 1.3417 s/op 0.95
migrate state 1500000 validators, 24 modified, 0 new 861.81 ms/op 843.29 ms/op 1.02
migrate state 1500000 validators, 1700 modified, 1000 new 1.0908 s/op 1.1883 s/op 0.92
migrate state 1500000 validators, 3400 modified, 2000 new 1.2138 s/op 1.3224 s/op 0.92
RootCache.getBlockRootAtSlot - 250000 vs - 7PWei 4.1500 ns/op 4.8700 ns/op 0.85
state getBlockRootAtSlot - 250000 vs - 7PWei 403.45 ns/op 488.71 ns/op 0.83
naive computeProposerIndex 100000 validators 51.148 ms/op 51.349 ms/op 1.00
computeProposerIndex 100000 validators 1.5243 ms/op 1.5286 ms/op 1.00
naiveGetNextSyncCommitteeIndices 1000 validators 8.3568 s/op 7.4463 s/op 1.12
getNextSyncCommitteeIndices 1000 validators 130.60 ms/op 111.07 ms/op 1.18
naiveGetNextSyncCommitteeIndices 10000 validators 9.1404 s/op 7.6698 s/op 1.19
getNextSyncCommitteeIndices 10000 validators 125.66 ms/op 111.02 ms/op 1.13
naiveGetNextSyncCommitteeIndices 100000 validators 8.5161 s/op 7.7347 s/op 1.10
getNextSyncCommitteeIndices 100000 validators 143.15 ms/op 113.61 ms/op 1.26
naive computeShuffledIndex 100000 validators 30.845 s/op 25.681 s/op 1.20
cached computeShuffledIndex 100000 validators 591.37 ms/op 581.22 ms/op 1.02
naive computeShuffledIndex 2000000 validators 598.81 s/op 473.00 s/op 1.27
cached computeShuffledIndex 2000000 validators 40.840 s/op 29.999 s/op 1.36
computeProposers - vc 250000 611.68 us/op 610.10 us/op 1.00
computeEpochShuffling - vc 250000 44.436 ms/op 41.346 ms/op 1.07
getNextSyncCommittee - vc 250000 11.062 ms/op 10.230 ms/op 1.08
computeSigningRoot for AttestationData 22.046 us/op 19.515 us/op 1.13
hash AttestationData serialized data then Buffer.toString(base64) 1.6463 us/op 1.6397 us/op 1.00
toHexString serialized data 1.2540 us/op 1.1097 us/op 1.13
Buffer.toString(base64) 170.27 ns/op 175.44 ns/op 0.97
nodejs block root to RootHex using toHex 155.87 ns/op 150.36 ns/op 1.04
nodejs block root to RootHex using toRootHex 104.80 ns/op 98.728 ns/op 1.06
browser block root to RootHex using the deprecated toHexString 227.70 ns/op 211.85 ns/op 1.07
browser block root to RootHex using toHex 180.62 ns/op 172.96 ns/op 1.04
browser block root to RootHex using toRootHex 165.63 ns/op 161.73 ns/op 1.02

by benchmarkbot/action

@eth2353
Copy link
Contributor

eth2353 commented Apr 29, 2025

Hey Matthew and Lodestar team, thanks for giving this another try so quickly.

I noticed a big change in event loop lag after upgrading our Gnosis Chain nodes from Lodestar 1.27.0-rc.0 (which included this change) to 1.29.0 (which didn't anymore):

image

Even in 1.27.0-rc.0, event loop lag was kind of high but 1.29 made it worse, leading to very erratic API response times.

I am now running this branch on one of our Gnosis nodes and so far it is looking very good.

On the main thread, event loop lag is much better than on 1.29.0:

image

In terms of the issues seen in #7218 . Event loop lag is worse on the network thread than on 1.29.0:

image

GC on the network thread is only slightly worse than on 1.29.0:

image

And peers are looking just fine on this node:

image

I'll keep an eye on this over the coming days but those API response times are much more stable now:
image

@twoeths
Copy link
Contributor

twoeths commented Apr 30, 2025

need to make sure metrics on network thread is not as worse as monitored here
hope lip2p2 2.0 resolves it

@nflaig
Copy link
Member

nflaig commented Apr 30, 2025

shared some metrics on discord

@twoeths
Copy link
Contributor

twoeths commented May 7, 2025

the bad peer count metrics I have last time does not happen, it just look like #7359 (comment)

I do see this PR improved the main thread a lot that caused performance issue on network thread, I track the issue in #7801

so looks good to me overal, that's something for us to improve in the future

twoeths
twoeths previously approved these changes May 7, 2025
@nflaig nflaig marked this pull request as ready for review May 8, 2025 10:20
@nflaig nflaig requested a review from a team as a code owner May 8, 2025 10:20
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

@nflaig nflaig added this to the v1.30.0 milestone May 8, 2025
Copy link
Member

@wemeetagain wemeetagain left a comment

Choose a reason for hiding this comment

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

metrics look good on this, excited to finally get it back

@wemeetagain wemeetagain merged commit 9c538e3 into unstable May 8, 2025
20 checks passed
@wemeetagain wemeetagain deleted the mkeil/aggregate-with-randomness-async-again branch May 8, 2025 17:08
nflaig added a commit that referenced this pull request May 8, 2025
@wemeetagain
Copy link
Member

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

6 participants