这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@nflaig
Copy link
Member

@nflaig nflaig commented Sep 8, 2025

Bring #8335 to unstable

**Motivation**

- misuse `dbRead*` vs `dbWrite*` which leads to incorrect metric

**Description**

- this PR should ideally be with `unstable` target branch, however
leaving here so that we can investigate #8334 easier
- we will merge this to unstable later anyway


part of #8334

Co-authored-by: Tuyen Nguyen <twoeths@users.noreply.github.com>
@nflaig nflaig requested a review from a team as a code owner September 8, 2025 15:53
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Summary of Changes

Hello @nflaig, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request addresses an issue where database read operations were being incorrectly reported as write operations in the LevelDB metrics. The change ensures that the metrics accurately reflect read requests and the number of items read, improving the reliability of monitoring for database interactions.

Highlights

  • Metric Correction: Corrected LevelDB metrics to accurately reflect read operations instead of write operations for db.iterator, db.keys, and db.values .all() calls.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in issue comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request addresses a bug in LevelDB metrics by correcting the counters used for read operations. The changes in packages/db/src/controller/level.ts ensure that methods for reading data from the database, such as keys, values, and entries (both batch and streaming versions), now correctly increment dbReadReq and dbReadItems instead of the write-related metrics. The fix is accurate and well-targeted, and the code quality is good. I have no further recommendations.

@nflaig nflaig changed the title fix: correct leveldb metrics (#8335) fix: correct leveldb metrics Sep 8, 2025
@codecov
Copy link

codecov bot commented Sep 8, 2025

Codecov Report

❌ Patch coverage is 0% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 54.07%. Comparing base (8a8da6a) to head (87dbd9b).
⚠️ Report is 1 commits behind head on unstable.

Additional details and impacted files
@@            Coverage Diff            @@
##           unstable    #8355   +/-   ##
=========================================
  Coverage     54.07%   54.07%           
=========================================
  Files           849      849           
  Lines         64126    64126           
  Branches       4852     4853    +1     
=========================================
+ Hits          34674    34677    +3     
+ Misses        29375    29372    -3     
  Partials         77       77           
🚀 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 Sep 8, 2025

Performance Report

✔️ no performance regression detected

Full benchmark results
Benchmark suite Current: dd0783d Previous: 8a8da6a Ratio
getPubkeys - index2pubkey - req 1000 vs - 250000 vc 1.1319 ms/op 1.0079 ms/op 1.12
getPubkeys - validatorsArr - req 1000 vs - 250000 vc 38.371 us/op 38.327 us/op 1.00
BLS verify - blst 887.27 us/op 896.63 us/op 0.99
BLS verifyMultipleSignatures 3 - blst 1.2942 ms/op 1.6620 ms/op 0.78
BLS verifyMultipleSignatures 8 - blst 2.5698 ms/op 2.0479 ms/op 1.25
BLS verifyMultipleSignatures 32 - blst 5.0789 ms/op 5.7911 ms/op 0.88
BLS verifyMultipleSignatures 64 - blst 10.808 ms/op 10.790 ms/op 1.00
BLS verifyMultipleSignatures 128 - blst 20.558 ms/op 17.594 ms/op 1.17
BLS deserializing 10000 signatures 773.76 ms/op 719.20 ms/op 1.08
BLS deserializing 100000 signatures 7.7759 s/op 7.2521 s/op 1.07
BLS verifyMultipleSignatures - same message - 3 - blst 1.2195 ms/op 1.0902 ms/op 1.12
BLS verifyMultipleSignatures - same message - 8 - blst 1.3561 ms/op 1.2165 ms/op 1.11
BLS verifyMultipleSignatures - same message - 32 - blst 2.0727 ms/op 1.8597 ms/op 1.11
BLS verifyMultipleSignatures - same message - 64 - blst 3.2476 ms/op 2.7405 ms/op 1.19
BLS verifyMultipleSignatures - same message - 128 - blst 5.1629 ms/op 4.6509 ms/op 1.11
BLS aggregatePubkeys 32 - blst 21.034 us/op 20.650 us/op 1.02
BLS aggregatePubkeys 128 - blst 74.874 us/op 76.397 us/op 0.98
notSeenSlots=1 numMissedVotes=1 numBadVotes=10 89.155 ms/op 61.207 ms/op 1.46
notSeenSlots=1 numMissedVotes=0 numBadVotes=4 70.975 ms/op 54.790 ms/op 1.30
notSeenSlots=2 numMissedVotes=1 numBadVotes=10 59.525 ms/op 44.619 ms/op 1.33
getSlashingsAndExits - default max 161.22 us/op 81.204 us/op 1.99
getSlashingsAndExits - 2k 503.20 us/op 372.50 us/op 1.35
proposeBlockBody type=full, size=empty 9.0470 ms/op 6.4367 ms/op 1.41
isKnown best case - 1 super set check 252.00 ns/op 212.00 ns/op 1.19
isKnown normal case - 2 super set checks 291.00 ns/op 210.00 ns/op 1.39
isKnown worse case - 16 super set checks 339.00 ns/op 212.00 ns/op 1.60
InMemoryCheckpointStateCache - add get delete 4.4340 us/op 2.6590 us/op 1.67
validate api signedAggregateAndProof - struct 1.9498 ms/op 1.4561 ms/op 1.34
validate gossip signedAggregateAndProof - struct 1.9440 ms/op 1.5727 ms/op 1.24
batch validate gossip attestation - vc 640000 - chunk 32 156.46 us/op 119.90 us/op 1.30
batch validate gossip attestation - vc 640000 - chunk 64 131.29 us/op 105.43 us/op 1.25
batch validate gossip attestation - vc 640000 - chunk 128 116.77 us/op 95.282 us/op 1.23
batch validate gossip attestation - vc 640000 - chunk 256 111.14 us/op 95.039 us/op 1.17
pickEth1Vote - no votes 1.0641 ms/op 951.25 us/op 1.12
pickEth1Vote - max votes 9.2454 ms/op 5.0880 ms/op 1.82
pickEth1Vote - Eth1Data hashTreeRoot value x2048 15.073 ms/op 10.534 ms/op 1.43
pickEth1Vote - Eth1Data hashTreeRoot tree x2048 21.456 ms/op 23.568 ms/op 0.91
pickEth1Vote - Eth1Data fastSerialize value x2048 497.22 us/op 444.24 us/op 1.12
pickEth1Vote - Eth1Data fastSerialize tree x2048 3.3599 ms/op 2.1603 ms/op 1.56
bytes32 toHexString 392.00 ns/op 371.00 ns/op 1.06
bytes32 Buffer.toString(hex) 311.00 ns/op 251.00 ns/op 1.24
bytes32 Buffer.toString(hex) from Uint8Array 340.00 ns/op 341.00 ns/op 1.00
bytes32 Buffer.toString(hex) + 0x 260.00 ns/op 252.00 ns/op 1.03
Object access 1 prop 0.14000 ns/op 0.11600 ns/op 1.21
Map access 1 prop 0.23900 ns/op 0.13900 ns/op 1.72
Object get x1000 6.3870 ns/op 6.0750 ns/op 1.05
Map get x1000 10.278 ns/op 6.2500 ns/op 1.64
Object set x1000 33.114 ns/op 28.742 ns/op 1.15
Map set x1000 21.989 ns/op 19.299 ns/op 1.14
Return object 10000 times 0.30930 ns/op 0.28810 ns/op 1.07
Throw Error 10000 times 4.7237 us/op 4.3830 us/op 1.08
toHex 178.43 ns/op 130.50 ns/op 1.37
Buffer.from 133.08 ns/op 126.95 ns/op 1.05
shared Buffer 90.571 ns/op 80.083 ns/op 1.13
fastMsgIdFn sha256 / 200 bytes 2.2390 us/op 2.1890 us/op 1.02
fastMsgIdFn h32 xxhash / 200 bytes 214.00 ns/op 311.00 ns/op 0.69
fastMsgIdFn h64 xxhash / 200 bytes 351.00 ns/op 272.00 ns/op 1.29
fastMsgIdFn sha256 / 1000 bytes 9.2190 us/op 7.9580 us/op 1.16
fastMsgIdFn h32 xxhash / 1000 bytes 462.00 ns/op 356.00 ns/op 1.30
fastMsgIdFn h64 xxhash / 1000 bytes 351.00 ns/op 338.00 ns/op 1.04
fastMsgIdFn sha256 / 10000 bytes 66.775 us/op 63.738 us/op 1.05
fastMsgIdFn h32 xxhash / 10000 bytes 1.9190 us/op 1.8350 us/op 1.05
fastMsgIdFn h64 xxhash / 10000 bytes 1.2780 us/op 1.2370 us/op 1.03
send data - 1000 256B messages 27.112 ms/op 16.494 ms/op 1.64
send data - 1000 512B messages 27.469 ms/op 19.756 ms/op 1.39
send data - 1000 1024B messages 35.726 ms/op 26.795 ms/op 1.33
send data - 1000 1200B messages 32.906 ms/op 23.945 ms/op 1.37
send data - 1000 2048B messages 29.844 ms/op 24.602 ms/op 1.21
send data - 1000 4096B messages 33.944 ms/op 26.737 ms/op 1.27
send data - 1000 16384B messages 58.050 ms/op 44.554 ms/op 1.30
send data - 1000 65536B messages 146.32 ms/op 115.79 ms/op 1.26
enrSubnets - fastDeserialize 64 bits 1.0170 us/op 887.00 ns/op 1.15
enrSubnets - ssz BitVector 64 bits 336.00 ns/op 324.00 ns/op 1.04
enrSubnets - fastDeserialize 4 bits 141.00 ns/op 127.00 ns/op 1.11
enrSubnets - ssz BitVector 4 bits 344.00 ns/op 333.00 ns/op 1.03
prioritizePeers score -10:0 att 32-0.1 sync 2-0 287.59 us/op 222.32 us/op 1.29
prioritizePeers score 0:0 att 32-0.25 sync 2-0.25 374.83 us/op 263.84 us/op 1.42
prioritizePeers score 0:0 att 32-0.5 sync 2-0.5 436.17 us/op 380.45 us/op 1.15
prioritizePeers score 0:0 att 64-0.75 sync 4-0.75 804.00 us/op 710.72 us/op 1.13
prioritizePeers score 0:0 att 64-1 sync 4-1 949.16 us/op 855.47 us/op 1.11
array of 16000 items push then shift 1.7770 us/op 1.6475 us/op 1.08
LinkedList of 16000 items push then shift 8.5060 ns/op 7.0110 ns/op 1.21
array of 16000 items push then pop 87.867 ns/op 77.012 ns/op 1.14
LinkedList of 16000 items push then pop 10.362 ns/op 6.9090 ns/op 1.50
array of 24000 items push then shift 2.9526 us/op 2.3565 us/op 1.25
LinkedList of 24000 items push then shift 10.453 ns/op 7.4210 ns/op 1.41
array of 24000 items push then pop 134.88 ns/op 103.55 ns/op 1.30
LinkedList of 24000 items push then pop 8.7670 ns/op 7.0210 ns/op 1.25
intersect bitArray bitLen 8 7.0140 ns/op 6.3410 ns/op 1.11
intersect array and set length 8 43.612 ns/op 37.594 ns/op 1.16
intersect bitArray bitLen 128 33.963 ns/op 29.511 ns/op 1.15
intersect array and set length 128 704.44 ns/op 618.68 ns/op 1.14
bitArray.getTrueBitIndexes() bitLen 128 1.5190 us/op 1.1010 us/op 1.38
bitArray.getTrueBitIndexes() bitLen 248 2.3060 us/op 1.8520 us/op 1.25
bitArray.getTrueBitIndexes() bitLen 512 4.9720 us/op 3.7180 us/op 1.34
Buffer.concat 32 items 817.00 ns/op 708.00 ns/op 1.15
Uint8Array.set 32 items 1.7420 us/op 1.7180 us/op 1.01
Buffer.copy 3.4830 us/op 2.1230 us/op 1.64
Uint8Array.set - with subarray 3.1530 us/op 1.7090 us/op 1.84
Uint8Array.set - without subarray 1.9760 us/op 1.0650 us/op 1.86
getUint32 - dataview 303.00 ns/op 195.00 ns/op 1.55
getUint32 - manual 219.00 ns/op 116.00 ns/op 1.89
Set add up to 64 items then delete first 3.6740 us/op 2.2023 us/op 1.67
OrderedSet add up to 64 items then delete first 4.8576 us/op 3.4696 us/op 1.40
Set add up to 64 items then delete last 3.6440 us/op 2.6826 us/op 1.36
OrderedSet add up to 64 items then delete last 5.7464 us/op 3.7203 us/op 1.54
Set add up to 64 items then delete middle 3.0071 us/op 2.5897 us/op 1.16
OrderedSet add up to 64 items then delete middle 7.1023 us/op 5.5785 us/op 1.27
Set add up to 128 items then delete first 6.5507 us/op 5.2301 us/op 1.25
OrderedSet add up to 128 items then delete first 10.938 us/op 8.1110 us/op 1.35
Set add up to 128 items then delete last 6.3766 us/op 5.2091 us/op 1.22
OrderedSet add up to 128 items then delete last 10.381 us/op 7.3393 us/op 1.41
Set add up to 128 items then delete middle 6.5688 us/op 5.0031 us/op 1.31
OrderedSet add up to 128 items then delete middle 17.444 us/op 15.078 us/op 1.16
Set add up to 256 items then delete first 14.302 us/op 10.224 us/op 1.40
OrderedSet add up to 256 items then delete first 23.417 us/op 16.012 us/op 1.46
Set add up to 256 items then delete last 12.727 us/op 9.2458 us/op 1.38
OrderedSet add up to 256 items then delete last 19.464 us/op 14.573 us/op 1.34
Set add up to 256 items then delete middle 12.864 us/op 9.7706 us/op 1.32
OrderedSet add up to 256 items then delete middle 48.612 us/op 41.932 us/op 1.16
transfer serialized Status (84 B) 3.4790 us/op 2.1870 us/op 1.59
copy serialized Status (84 B) 1.4690 us/op 1.1850 us/op 1.24
transfer serialized SignedVoluntaryExit (112 B) 2.7350 us/op 2.2730 us/op 1.20
copy serialized SignedVoluntaryExit (112 B) 1.5690 us/op 1.1700 us/op 1.34
transfer serialized ProposerSlashing (416 B) 2.5290 us/op 2.3220 us/op 1.09
copy serialized ProposerSlashing (416 B) 2.0530 us/op 1.2940 us/op 1.59
transfer serialized Attestation (485 B) 2.4850 us/op 2.3390 us/op 1.06
copy serialized Attestation (485 B) 2.0190 us/op 1.2580 us/op 1.60
transfer serialized AttesterSlashing (33232 B) 4.0200 us/op 3.1430 us/op 1.28
copy serialized AttesterSlashing (33232 B) 5.8950 us/op 3.8430 us/op 1.53
transfer serialized Small SignedBeaconBlock (128000 B) 3.9040 us/op 3.3850 us/op 1.15
copy serialized Small SignedBeaconBlock (128000 B) 15.579 us/op 9.5880 us/op 1.62
transfer serialized Avg SignedBeaconBlock (200000 B) 4.3870 us/op 3.7650 us/op 1.17
copy serialized Avg SignedBeaconBlock (200000 B) 21.131 us/op 13.068 us/op 1.62
transfer serialized BlobsSidecar (524380 B) 4.8630 us/op 3.5980 us/op 1.35
copy serialized BlobsSidecar (524380 B) 79.759 us/op 61.557 us/op 1.30
transfer serialized Big SignedBeaconBlock (1000000 B) 5.1520 us/op 3.5310 us/op 1.46
copy serialized Big SignedBeaconBlock (1000000 B) 135.58 us/op 115.78 us/op 1.17
pass gossip attestations to forkchoice per slot 3.1918 ms/op 2.9080 ms/op 1.10
forkChoice updateHead vc 100000 bc 64 eq 0 471.58 us/op 459.60 us/op 1.03
forkChoice updateHead vc 600000 bc 64 eq 0 4.2714 ms/op 2.8735 ms/op 1.49
forkChoice updateHead vc 1000000 bc 64 eq 0 6.3267 ms/op 4.9316 ms/op 1.28
forkChoice updateHead vc 600000 bc 320 eq 0 3.4177 ms/op 2.8784 ms/op 1.19
forkChoice updateHead vc 600000 bc 1200 eq 0 3.3403 ms/op 2.9618 ms/op 1.13
forkChoice updateHead vc 600000 bc 7200 eq 0 3.9651 ms/op 3.2473 ms/op 1.22
forkChoice updateHead vc 600000 bc 64 eq 1000 11.401 ms/op 10.929 ms/op 1.04
forkChoice updateHead vc 600000 bc 64 eq 10000 11.199 ms/op 10.692 ms/op 1.05
forkChoice updateHead vc 600000 bc 64 eq 300000 21.665 ms/op 14.141 ms/op 1.53
computeDeltas 500000 validators 300 proto nodes 5.8899 ms/op 3.8564 ms/op 1.53
computeDeltas 500000 validators 1200 proto nodes 8.3804 ms/op 3.7871 ms/op 2.21
computeDeltas 500000 validators 7200 proto nodes 5.8700 ms/op 3.7869 ms/op 1.55
computeDeltas 750000 validators 300 proto nodes 6.0654 ms/op 5.6420 ms/op 1.08
computeDeltas 750000 validators 1200 proto nodes 5.9005 ms/op 5.6563 ms/op 1.04
computeDeltas 750000 validators 7200 proto nodes 5.9750 ms/op 5.7074 ms/op 1.05
computeDeltas 1400000 validators 300 proto nodes 10.795 ms/op 10.689 ms/op 1.01
computeDeltas 1400000 validators 1200 proto nodes 10.848 ms/op 10.650 ms/op 1.02
computeDeltas 1400000 validators 7200 proto nodes 10.966 ms/op 10.566 ms/op 1.04
computeDeltas 2100000 validators 300 proto nodes 17.404 ms/op 16.232 ms/op 1.07
computeDeltas 2100000 validators 1200 proto nodes 17.542 ms/op 15.820 ms/op 1.11
computeDeltas 2100000 validators 7200 proto nodes 16.703 ms/op 16.079 ms/op 1.04
altair processAttestation - 250000 vs - 7PWei normalcase 2.1890 ms/op 1.9393 ms/op 1.13
altair processAttestation - 250000 vs - 7PWei worstcase 3.1715 ms/op 2.8243 ms/op 1.12
altair processAttestation - setStatus - 1/6 committees join 136.03 us/op 116.81 us/op 1.16
altair processAttestation - setStatus - 1/3 committees join 262.28 us/op 233.85 us/op 1.12
altair processAttestation - setStatus - 1/2 committees join 358.98 us/op 327.25 us/op 1.10
altair processAttestation - setStatus - 2/3 committees join 464.51 us/op 420.82 us/op 1.10
altair processAttestation - setStatus - 4/5 committees join 609.06 us/op 592.96 us/op 1.03
altair processAttestation - setStatus - 100% committees join 749.62 us/op 680.36 us/op 1.10
altair processBlock - 250000 vs - 7PWei normalcase 4.8707 ms/op 4.3642 ms/op 1.12
altair processBlock - 250000 vs - 7PWei normalcase hashState 32.402 ms/op 39.772 ms/op 0.81
altair processBlock - 250000 vs - 7PWei worstcase 38.515 ms/op 49.907 ms/op 0.77
altair processBlock - 250000 vs - 7PWei worstcase hashState 84.895 ms/op 104.98 ms/op 0.81
phase0 processBlock - 250000 vs - 7PWei normalcase 1.7333 ms/op 2.2971 ms/op 0.75
phase0 processBlock - 250000 vs - 7PWei worstcase 24.555 ms/op 32.930 ms/op 0.75
altair processEth1Data - 250000 vs - 7PWei normalcase 364.56 us/op 353.53 us/op 1.03
getExpectedWithdrawals 250000 eb:1,eth1:1,we:0,wn:0,smpl:15 9.1910 us/op 9.4390 us/op 0.97
getExpectedWithdrawals 250000 eb:0.95,eth1:0.1,we:0.05,wn:0,smpl:219 56.818 us/op 55.154 us/op 1.03
getExpectedWithdrawals 250000 eb:0.95,eth1:0.3,we:0.05,wn:0,smpl:42 13.299 us/op 15.799 us/op 0.84
getExpectedWithdrawals 250000 eb:0.95,eth1:0.7,we:0.05,wn:0,smpl:18 8.8890 us/op 10.411 us/op 0.85
getExpectedWithdrawals 250000 eb:0.1,eth1:0.1,we:0,wn:0,smpl:1020 185.73 us/op 235.45 us/op 0.79
getExpectedWithdrawals 250000 eb:0.03,eth1:0.03,we:0,wn:0,smpl:11777 1.9640 ms/op 1.6480 ms/op 1.19
getExpectedWithdrawals 250000 eb:0.01,eth1:0.01,we:0,wn:0,smpl:16384 2.4226 ms/op 2.0199 ms/op 1.20
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,smpl:16384 2.3855 ms/op 2.1354 ms/op 1.12
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,nocache,smpl:16384 5.1649 ms/op 4.2430 ms/op 1.22
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,smpl:16384 2.4377 ms/op 2.2561 ms/op 1.08
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,nocache,smpl:16384 4.9667 ms/op 4.4165 ms/op 1.12
Tree 40 250000 create 587.28 ms/op 407.01 ms/op 1.44
Tree 40 250000 get(125000) 148.49 ns/op 141.00 ns/op 1.05
Tree 40 250000 set(125000) 1.5392 us/op 1.4239 us/op 1.08
Tree 40 250000 toArray() 20.924 ms/op 15.309 ms/op 1.37
Tree 40 250000 iterate all - toArray() + loop 21.677 ms/op 15.087 ms/op 1.44
Tree 40 250000 iterate all - get(i) 59.473 ms/op 49.117 ms/op 1.21
Array 250000 create 3.6549 ms/op 2.3681 ms/op 1.54
Array 250000 clone - spread 1.4260 ms/op 796.57 us/op 1.79
Array 250000 get(125000) 0.42800 ns/op 0.39800 ns/op 1.08
Array 250000 set(125000) 0.43300 ns/op 0.42300 ns/op 1.02
Array 250000 iterate all - loop 113.15 us/op 108.85 us/op 1.04
phase0 afterProcessEpoch - 250000 vs - 7PWei 42.675 ms/op 41.441 ms/op 1.03
Array.fill - length 1000000 3.5783 ms/op 3.5723 ms/op 1.00
Array push - length 1000000 14.717 ms/op 12.549 ms/op 1.17
Array.get 0.28173 ns/op 0.27040 ns/op 1.04
Uint8Array.get 0.45077 ns/op 0.43686 ns/op 1.03
phase0 beforeProcessEpoch - 250000 vs - 7PWei 20.719 ms/op 15.156 ms/op 1.37
altair processEpoch - mainnet_e81889 297.16 ms/op 290.75 ms/op 1.02
mainnet_e81889 - altair beforeProcessEpoch 19.574 ms/op 18.423 ms/op 1.06
mainnet_e81889 - altair processJustificationAndFinalization 5.4290 us/op 7.3000 us/op 0.74
mainnet_e81889 - altair processInactivityUpdates 6.4505 ms/op 4.1346 ms/op 1.56
mainnet_e81889 - altair processRewardsAndPenalties 40.393 ms/op 43.403 ms/op 0.93
mainnet_e81889 - altair processRegistryUpdates 717.00 ns/op 855.00 ns/op 0.84
mainnet_e81889 - altair processSlashings 180.00 ns/op 183.00 ns/op 0.98
mainnet_e81889 - altair processEth1DataReset 176.00 ns/op 173.00 ns/op 1.02
mainnet_e81889 - altair processEffectiveBalanceUpdates 1.2394 ms/op 1.1650 ms/op 1.06
mainnet_e81889 - altair processSlashingsReset 882.00 ns/op 1.1100 us/op 0.79
mainnet_e81889 - altair processRandaoMixesReset 1.0940 us/op 1.7540 us/op 0.62
mainnet_e81889 - altair processHistoricalRootsUpdate 176.00 ns/op 168.00 ns/op 1.05
mainnet_e81889 - altair processParticipationFlagUpdates 523.00 ns/op 507.00 ns/op 1.03
mainnet_e81889 - altair processSyncCommitteeUpdates 140.00 ns/op 145.00 ns/op 0.97
mainnet_e81889 - altair afterProcessEpoch 44.975 ms/op 41.377 ms/op 1.09
capella processEpoch - mainnet_e217614 1.0148 s/op 996.04 ms/op 1.02
mainnet_e217614 - capella beforeProcessEpoch 60.460 ms/op 62.697 ms/op 0.96
mainnet_e217614 - capella processJustificationAndFinalization 5.2130 us/op 4.9950 us/op 1.04
mainnet_e217614 - capella processInactivityUpdates 14.574 ms/op 14.261 ms/op 1.02
mainnet_e217614 - capella processRewardsAndPenalties 179.76 ms/op 208.27 ms/op 0.86
mainnet_e217614 - capella processRegistryUpdates 6.5420 us/op 7.7440 us/op 0.84
mainnet_e217614 - capella processSlashings 174.00 ns/op 250.00 ns/op 0.70
mainnet_e217614 - capella processEth1DataReset 174.00 ns/op 174.00 ns/op 1.00
mainnet_e217614 - capella processEffectiveBalanceUpdates 4.2285 ms/op 4.0862 ms/op 1.03
mainnet_e217614 - capella processSlashingsReset 903.00 ns/op 914.00 ns/op 0.99
mainnet_e217614 - capella processRandaoMixesReset 1.1980 us/op 1.1630 us/op 1.03
mainnet_e217614 - capella processHistoricalRootsUpdate 176.00 ns/op 182.00 ns/op 0.97
mainnet_e217614 - capella processParticipationFlagUpdates 540.00 ns/op 572.00 ns/op 0.94
mainnet_e217614 - capella afterProcessEpoch 117.53 ms/op 114.85 ms/op 1.02
phase0 processEpoch - mainnet_e58758 286.20 ms/op 318.81 ms/op 0.90
mainnet_e58758 - phase0 beforeProcessEpoch 81.554 ms/op 79.926 ms/op 1.02
mainnet_e58758 - phase0 processJustificationAndFinalization 5.7550 us/op 8.0180 us/op 0.72
mainnet_e58758 - phase0 processRewardsAndPenalties 34.971 ms/op 43.961 ms/op 0.80
mainnet_e58758 - phase0 processRegistryUpdates 3.0950 us/op 3.0550 us/op 1.01
mainnet_e58758 - phase0 processSlashings 176.00 ns/op 176.00 ns/op 1.00
mainnet_e58758 - phase0 processEth1DataReset 174.00 ns/op 183.00 ns/op 0.95
mainnet_e58758 - phase0 processEffectiveBalanceUpdates 2.5924 ms/op 1.1436 ms/op 2.27
mainnet_e58758 - phase0 processSlashingsReset 957.00 ns/op 892.00 ns/op 1.07
mainnet_e58758 - phase0 processRandaoMixesReset 1.1880 us/op 1.3770 us/op 0.86
mainnet_e58758 - phase0 processHistoricalRootsUpdate 174.00 ns/op 181.00 ns/op 0.96
mainnet_e58758 - phase0 processParticipationRecordUpdates 873.00 ns/op 925.00 ns/op 0.94
mainnet_e58758 - phase0 afterProcessEpoch 35.939 ms/op 35.324 ms/op 1.02
phase0 processEffectiveBalanceUpdates - 250000 normalcase 1.3144 ms/op 2.4308 ms/op 0.54
phase0 processEffectiveBalanceUpdates - 250000 worstcase 0.5 2.0899 ms/op 1.9389 ms/op 1.08
altair processInactivityUpdates - 250000 normalcase 18.630 ms/op 28.374 ms/op 0.66
altair processInactivityUpdates - 250000 worstcase 17.085 ms/op 20.455 ms/op 0.84
phase0 processRegistryUpdates - 250000 normalcase 7.5250 us/op 10.730 us/op 0.70
phase0 processRegistryUpdates - 250000 badcase_full_deposits 276.69 us/op 425.88 us/op 0.65
phase0 processRegistryUpdates - 250000 worstcase 0.5 109.24 ms/op 116.17 ms/op 0.94
altair processRewardsAndPenalties - 250000 normalcase 27.495 ms/op 31.493 ms/op 0.87
altair processRewardsAndPenalties - 250000 worstcase 27.070 ms/op 37.750 ms/op 0.72
phase0 getAttestationDeltas - 250000 normalcase 8.8441 ms/op 6.4551 ms/op 1.37
phase0 getAttestationDeltas - 250000 worstcase 6.2508 ms/op 5.9224 ms/op 1.06
phase0 processSlashings - 250000 worstcase 105.10 us/op 128.34 us/op 0.82
altair processSyncCommitteeUpdates - 250000 11.810 ms/op 10.939 ms/op 1.08
BeaconState.hashTreeRoot - No change 284.00 ns/op 215.00 ns/op 1.32
BeaconState.hashTreeRoot - 1 full validator 83.627 us/op 83.713 us/op 1.00
BeaconState.hashTreeRoot - 32 full validator 1.0085 ms/op 1.3670 ms/op 0.74
BeaconState.hashTreeRoot - 512 full validator 12.986 ms/op 10.826 ms/op 1.20
BeaconState.hashTreeRoot - 1 validator.effectiveBalance 100.77 us/op 158.44 us/op 0.64
BeaconState.hashTreeRoot - 32 validator.effectiveBalance 1.3116 ms/op 1.5704 ms/op 0.84
BeaconState.hashTreeRoot - 512 validator.effectiveBalance 19.491 ms/op 29.098 ms/op 0.67
BeaconState.hashTreeRoot - 1 balances 69.848 us/op 90.149 us/op 0.77
BeaconState.hashTreeRoot - 32 balances 666.68 us/op 1.1326 ms/op 0.59
BeaconState.hashTreeRoot - 512 balances 8.6956 ms/op 10.051 ms/op 0.87
BeaconState.hashTreeRoot - 250000 balances 190.96 ms/op 209.31 ms/op 0.91
aggregationBits - 2048 els - zipIndexesInBitList 26.235 us/op 20.956 us/op 1.25
byteArrayEquals 32 54.222 ns/op 52.932 ns/op 1.02
Buffer.compare 32 17.197 ns/op 17.098 ns/op 1.01
byteArrayEquals 1024 1.6083 us/op 1.5750 us/op 1.02
Buffer.compare 1024 26.234 ns/op 24.283 ns/op 1.08
byteArrayEquals 16384 25.609 us/op 25.089 us/op 1.02
Buffer.compare 16384 206.80 ns/op 202.08 ns/op 1.02
byteArrayEquals 123687377 193.99 ms/op 188.87 ms/op 1.03
Buffer.compare 123687377 6.4714 ms/op 6.2359 ms/op 1.04
byteArrayEquals 32 - diff last byte 52.243 ns/op 52.176 ns/op 1.00
Buffer.compare 32 - diff last byte 16.889 ns/op 16.870 ns/op 1.00
byteArrayEquals 1024 - diff last byte 1.5801 us/op 1.5665 us/op 1.01
Buffer.compare 1024 - diff last byte 25.196 ns/op 24.565 ns/op 1.03
byteArrayEquals 16384 - diff last byte 25.266 us/op 25.048 us/op 1.01
Buffer.compare 16384 - diff last byte 189.03 ns/op 174.66 ns/op 1.08
byteArrayEquals 123687377 - diff last byte 192.35 ms/op 188.49 ms/op 1.02
Buffer.compare 123687377 - diff last byte 6.8919 ms/op 6.4482 ms/op 1.07
byteArrayEquals 32 - random bytes 5.0790 ns/op 5.0520 ns/op 1.01
Buffer.compare 32 - random bytes 16.917 ns/op 16.815 ns/op 1.01
byteArrayEquals 1024 - random bytes 5.0340 ns/op 5.0580 ns/op 1.00
Buffer.compare 1024 - random bytes 16.967 ns/op 16.863 ns/op 1.01
byteArrayEquals 16384 - random bytes 5.0670 ns/op 5.0500 ns/op 1.00
Buffer.compare 16384 - random bytes 16.786 ns/op 16.827 ns/op 1.00
byteArrayEquals 123687377 - random bytes 6.3400 ns/op 6.3200 ns/op 1.00
Buffer.compare 123687377 - random bytes 18.250 ns/op 18.290 ns/op 1.00
regular array get 100000 times 32.894 us/op 35.967 us/op 0.91
wrappedArray get 100000 times 32.781 us/op 32.875 us/op 1.00
arrayWithProxy get 100000 times 12.027 ms/op 12.072 ms/op 1.00
ssz.Root.equals 46.131 ns/op 45.859 ns/op 1.01
byteArrayEquals 45.032 ns/op 45.022 ns/op 1.00
Buffer.compare 10.289 ns/op 10.341 ns/op 0.99
processSlot - 1 slots 10.319 us/op 10.143 us/op 1.02
processSlot - 32 slots 2.5392 ms/op 2.8742 ms/op 0.88
getEffectiveBalanceIncrementsZeroInactive - 250000 vs - 7PWei 3.0729 ms/op 2.7673 ms/op 1.11
getCommitteeAssignments - req 1 vs - 250000 vc 2.0886 ms/op 1.9956 ms/op 1.05
getCommitteeAssignments - req 100 vs - 250000 vc 4.0865 ms/op 3.8882 ms/op 1.05
getCommitteeAssignments - req 1000 vs - 250000 vc 4.4003 ms/op 4.1535 ms/op 1.06
findModifiedValidators - 10000 modified validators 773.64 ms/op 730.81 ms/op 1.06
findModifiedValidators - 1000 modified validators 710.31 ms/op 700.02 ms/op 1.01
findModifiedValidators - 100 modified validators 244.41 ms/op 195.64 ms/op 1.25
findModifiedValidators - 10 modified validators 151.77 ms/op 242.38 ms/op 0.63
findModifiedValidators - 1 modified validators 154.46 ms/op 147.07 ms/op 1.05
findModifiedValidators - no difference 152.33 ms/op 154.69 ms/op 0.98
compare ViewDUs 6.2954 s/op 6.2750 s/op 1.00
compare each validator Uint8Array 1.2472 s/op 1.6606 s/op 0.75
compare ViewDU to Uint8Array 1.0155 s/op 920.47 ms/op 1.10
migrate state 1000000 validators, 24 modified, 0 new 894.93 ms/op 916.52 ms/op 0.98
migrate state 1000000 validators, 1700 modified, 1000 new 1.2004 s/op 1.2181 s/op 0.99
migrate state 1000000 validators, 3400 modified, 2000 new 1.4230 s/op 1.3255 s/op 1.07
migrate state 1500000 validators, 24 modified, 0 new 947.91 ms/op 978.80 ms/op 0.97
migrate state 1500000 validators, 1700 modified, 1000 new 1.4155 s/op 1.1827 s/op 1.20
migrate state 1500000 validators, 3400 modified, 2000 new 1.5957 s/op 1.3476 s/op 1.18
RootCache.getBlockRootAtSlot - 250000 vs - 7PWei 4.3400 ns/op 4.1200 ns/op 1.05
state getBlockRootAtSlot - 250000 vs - 7PWei 563.11 ns/op 958.43 ns/op 0.59
naive computeProposerIndex 100000 validators 64.330 ms/op 51.061 ms/op 1.26
computeProposerIndex 100000 validators 1.5350 ms/op 1.4863 ms/op 1.03
naiveGetNextSyncCommitteeIndices 1000 validators 8.4144 s/op 7.1831 s/op 1.17
getNextSyncCommitteeIndices 1000 validators 122.69 ms/op 113.19 ms/op 1.08
naiveGetNextSyncCommitteeIndices 10000 validators 8.8341 s/op 7.8758 s/op 1.12
getNextSyncCommitteeIndices 10000 validators 124.06 ms/op 113.89 ms/op 1.09
naiveGetNextSyncCommitteeIndices 100000 validators 9.2039 s/op 7.3993 s/op 1.24
getNextSyncCommitteeIndices 100000 validators 133.04 ms/op 114.00 ms/op 1.17
naive computeShuffledIndex 100000 validators 27.801 s/op 24.464 s/op 1.14
cached computeShuffledIndex 100000 validators 587.99 ms/op 548.67 ms/op 1.07
naive computeShuffledIndex 2000000 validators 569.52 s/op 486.61 s/op 1.17
cached computeShuffledIndex 2000000 validators 39.644 s/op 28.714 s/op 1.38
computeProposers - vc 250000 610.81 us/op 619.04 us/op 0.99
computeEpochShuffling - vc 250000 44.769 ms/op 41.453 ms/op 1.08
getNextSyncCommittee - vc 250000 11.567 ms/op 10.245 ms/op 1.13
computeSigningRoot for AttestationData 22.161 us/op 21.716 us/op 1.02
hash AttestationData serialized data then Buffer.toString(base64) 1.6496 us/op 1.5529 us/op 1.06
toHexString serialized data 1.2457 us/op 1.0978 us/op 1.13
Buffer.toString(base64) 145.59 ns/op 153.97 ns/op 0.95
nodejs block root to RootHex using toHex 143.07 ns/op 145.03 ns/op 0.99
nodejs block root to RootHex using toRootHex 91.973 ns/op 88.822 ns/op 1.04
nodejs fromhex(blob) 123.00 ms/op 108.21 ms/op 1.14
nodejs fromHexInto(blob) 99.917 ms/op 93.606 ms/op 1.07
browser block root to RootHex using the deprecated toHexString 223.20 ns/op 208.54 ns/op 1.07
browser block root to RootHex using toHex 175.81 ns/op 170.62 ns/op 1.03
browser block root to RootHex using toRootHex 162.33 ns/op 158.40 ns/op 1.02
browser fromHexInto(blob) 833.44 us/op 812.76 us/op 1.03
browser fromHex(blob) 829.75 ms/op 774.47 ms/op 1.07

by benchmarkbot/action

@wemeetagain wemeetagain merged commit bb10d2b into unstable Sep 8, 2025
27 of 28 checks passed
@wemeetagain wemeetagain deleted the nflaig/db-metrics branch September 8, 2025 18:44
@wemeetagain
Copy link
Member

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

4 participants