Skip to content

Conversation

wemeetagain
Copy link
Member

Motivation

Description

@wemeetagain wemeetagain requested a review from a team as a code owner October 13, 2025 14:02
Copy link
Contributor

Summary of Changes

Hello @wemeetagain, 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 resolves a critical issue in the Bun LevelDB controller where database iteration methods failed to properly apply reverse and limit options. The changes introduce a new utility function to standardize filter option consumption and integrate it into all relevant data retrieval methods, ensuring that database queries now accurately reflect the specified iteration direction and result count.

Highlights

  • Bug Fix: reverse and limit options: The LevelDB controller in Bun now correctly respects the reverse and limit options when performing database iteration operations. Previously, these options were not being applied, leading to incorrect data retrieval.
  • New Helper Function: A new helper function, consumeFilterOptions, has been introduced to centralize the logic for processing filter options, including reverse and limit, and to determine the appropriate iterator movement functions and comparison predicates.
  • Iterator Enhancements: The keysStream, keys, valuesStream, values, entriesStream, and entries methods have been updated to utilize the new consumeFilterOptions helper, ensuring consistent and correct application of filtering logic across all iteration methods.
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 by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

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 pull request 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 aims to add support for reverse and limit options in the bun leveldb controller. While the limit option is implemented correctly, the implementation for reverse has a critical issue where the iteration direction is inverted. Additionally, there's a bug in the seeking logic for reverse iteration with an lte filter, which can lead to incorrect results. I've also noted significant code duplication in the new implementation that could be refactored for better maintainability. My review includes suggestions to fix these issues.

@wemeetagain
Copy link
Member Author

/gemini review

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 effectively addresses the issue of reverse and limit options not being respected in the bun leveldb controller. The introduction of the consumeFilterOptions helper function is an excellent change, as it not only fixes the bug but also significantly improves the code by centralizing the complex filter logic and removing duplication across multiple methods. The implementation appears correct and robust. I have one suggestion to further enhance the readability and maintainability of the new helper function by using a more declarative style.

Copy link

codecov bot commented Oct 13, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 52.22%. Comparing base (6604fa5) to head (e04522b).
⚠️ Report is 1 commits behind head on unstable.

Additional details and impacted files
@@             Coverage Diff              @@
##           unstable    #8529      +/-   ##
============================================
+ Coverage     52.19%   52.22%   +0.02%     
============================================
  Files           852      852              
  Lines         65073    65101      +28     
  Branches       4773     4772       -1     
============================================
+ Hits          33967    33998      +31     
+ Misses        31037    31034       -3     
  Partials         69       69              
🚀 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.

Copy link
Contributor

⚠️ 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: 1ffed9b Previous: 6604fa5 Ratio
phase0 getAttestationDeltas - 250000 normalcase 23.025 ms/op 6.5478 ms/op 3.52
Full benchmark results
Benchmark suite Current: 1ffed9b Previous: 6604fa5 Ratio
getPubkeys - index2pubkey - req 1000 vs - 250000 vc 1.1492 ms/op 1.5075 ms/op 0.76
getPubkeys - validatorsArr - req 1000 vs - 250000 vc 39.777 us/op 44.741 us/op 0.89
BLS verify - blst 993.58 us/op 970.79 us/op 1.02
BLS verifyMultipleSignatures 3 - blst 1.7101 ms/op 1.4434 ms/op 1.18
BLS verifyMultipleSignatures 8 - blst 2.2294 ms/op 2.3834 ms/op 0.94
BLS verifyMultipleSignatures 32 - blst 6.5016 ms/op 7.2305 ms/op 0.90
BLS verifyMultipleSignatures 64 - blst 12.466 ms/op 11.398 ms/op 1.09
BLS verifyMultipleSignatures 128 - blst 21.922 ms/op 20.228 ms/op 1.08
BLS deserializing 10000 signatures 845.65 ms/op 807.71 ms/op 1.05
BLS deserializing 100000 signatures 8.0666 s/op 8.0517 s/op 1.00
BLS verifyMultipleSignatures - same message - 3 - blst 1.2171 ms/op 1.0692 ms/op 1.14
BLS verifyMultipleSignatures - same message - 8 - blst 1.1520 ms/op 1.3090 ms/op 0.88
BLS verifyMultipleSignatures - same message - 32 - blst 1.8466 ms/op 2.0960 ms/op 0.88
BLS verifyMultipleSignatures - same message - 64 - blst 3.1699 ms/op 3.2644 ms/op 0.97
BLS verifyMultipleSignatures - same message - 128 - blst 4.4602 ms/op 4.9500 ms/op 0.90
BLS aggregatePubkeys 32 - blst 20.209 us/op 22.920 us/op 0.88
BLS aggregatePubkeys 128 - blst 72.367 us/op 91.225 us/op 0.79
notSeenSlots=1 numMissedVotes=1 numBadVotes=10 64.914 ms/op 64.784 ms/op 1.00
notSeenSlots=1 numMissedVotes=0 numBadVotes=4 58.999 ms/op 59.316 ms/op 0.99
notSeenSlots=2 numMissedVotes=1 numBadVotes=10 46.318 ms/op 47.705 ms/op 0.97
getSlashingsAndExits - default max 79.850 us/op 191.03 us/op 0.42
getSlashingsAndExits - 2k 404.30 us/op 446.92 us/op 0.90
isKnown best case - 1 super set check 269.00 ns/op 241.00 ns/op 1.12
isKnown normal case - 2 super set checks 266.00 ns/op 215.00 ns/op 1.24
isKnown worse case - 16 super set checks 258.00 ns/op 234.00 ns/op 1.10
InMemoryCheckpointStateCache - add get delete 2.8660 us/op 2.6030 us/op 1.10
validate api signedAggregateAndProof - struct 2.9486 ms/op 1.5471 ms/op 1.91
validate gossip signedAggregateAndProof - struct 1.8805 ms/op 1.4917 ms/op 1.26
batch validate gossip attestation - vc 640000 - chunk 32 144.10 us/op 132.94 us/op 1.08
batch validate gossip attestation - vc 640000 - chunk 64 156.90 us/op 114.84 us/op 1.37
batch validate gossip attestation - vc 640000 - chunk 128 167.57 us/op 104.06 us/op 1.61
batch validate gossip attestation - vc 640000 - chunk 256 160.95 us/op 108.15 us/op 1.49
pickEth1Vote - no votes 1.2408 ms/op 1.0638 ms/op 1.17
pickEth1Vote - max votes 7.4471 ms/op 6.4997 ms/op 1.15
pickEth1Vote - Eth1Data hashTreeRoot value x2048 13.375 ms/op 12.728 ms/op 1.05
pickEth1Vote - Eth1Data hashTreeRoot tree x2048 25.455 ms/op 18.058 ms/op 1.41
pickEth1Vote - Eth1Data fastSerialize value x2048 702.45 us/op 494.49 us/op 1.42
pickEth1Vote - Eth1Data fastSerialize tree x2048 4.1531 ms/op 2.3888 ms/op 1.74
bytes32 toHexString 597.00 ns/op 389.00 ns/op 1.53
bytes32 Buffer.toString(hex) 464.00 ns/op 267.00 ns/op 1.74
bytes32 Buffer.toString(hex) from Uint8Array 584.00 ns/op 356.00 ns/op 1.64
bytes32 Buffer.toString(hex) + 0x 359.00 ns/op 278.00 ns/op 1.29
Object access 1 prop 0.16500 ns/op 0.12600 ns/op 1.31
Map access 1 prop 0.23700 ns/op 0.13300 ns/op 1.78
Object get x1000 11.978 ns/op 6.3570 ns/op 1.88
Map get x1000 10.688 ns/op 6.9200 ns/op 1.54
Object set x1000 42.481 ns/op 34.959 ns/op 1.22
Map set x1000 34.746 ns/op 25.758 ns/op 1.35
Return object 10000 times 0.39650 ns/op 0.30820 ns/op 1.29
Throw Error 10000 times 5.6582 us/op 4.6535 us/op 1.22
toHex 164.63 ns/op 144.42 ns/op 1.14
Buffer.from 172.46 ns/op 136.07 ns/op 1.27
shared Buffer 104.33 ns/op 90.854 ns/op 1.15
fastMsgIdFn sha256 / 200 bytes 3.0220 us/op 2.3040 us/op 1.31
fastMsgIdFn h32 xxhash / 200 bytes 301.00 ns/op 216.00 ns/op 1.39
fastMsgIdFn h64 xxhash / 200 bytes 444.00 ns/op 273.00 ns/op 1.63
fastMsgIdFn sha256 / 1000 bytes 9.9260 us/op 7.6770 us/op 1.29
fastMsgIdFn h32 xxhash / 1000 bytes 490.00 ns/op 351.00 ns/op 1.40
fastMsgIdFn h64 xxhash / 1000 bytes 446.00 ns/op 355.00 ns/op 1.26
fastMsgIdFn sha256 / 10000 bytes 100.38 us/op 68.072 us/op 1.47
fastMsgIdFn h32 xxhash / 10000 bytes 2.3410 us/op 1.9200 us/op 1.22
fastMsgIdFn h64 xxhash / 10000 bytes 1.8370 us/op 1.2940 us/op 1.42
send data - 1000 256B messages 24.605 ms/op 19.693 ms/op 1.25
send data - 1000 512B messages 43.259 ms/op 22.287 ms/op 1.94
send data - 1000 1024B messages 38.177 ms/op 29.125 ms/op 1.31
send data - 1000 1200B messages 46.987 ms/op 23.381 ms/op 2.01
send data - 1000 2048B messages 46.161 ms/op 23.434 ms/op 1.97
send data - 1000 4096B messages 57.835 ms/op 31.818 ms/op 1.82
send data - 1000 16384B messages 90.861 ms/op 47.881 ms/op 1.90
send data - 1000 65536B messages 165.69 ms/op 133.61 ms/op 1.24
enrSubnets - fastDeserialize 64 bits 1.1230 us/op 936.00 ns/op 1.20
enrSubnets - ssz BitVector 64 bits 432.00 ns/op 345.00 ns/op 1.25
enrSubnets - fastDeserialize 4 bits 260.00 ns/op 134.00 ns/op 1.94
enrSubnets - ssz BitVector 4 bits 690.00 ns/op 346.00 ns/op 1.99
prioritizePeers score -10:0 att 32-0.1 sync 2-0 353.14 us/op 263.80 us/op 1.34
prioritizePeers score 0:0 att 32-0.25 sync 2-0.25 454.00 us/op 301.13 us/op 1.51
prioritizePeers score 0:0 att 32-0.5 sync 2-0.5 903.20 us/op 428.10 us/op 2.11
prioritizePeers score 0:0 att 64-0.75 sync 4-0.75 2.0242 ms/op 815.19 us/op 2.48
prioritizePeers score 0:0 att 64-1 sync 4-1 2.0377 ms/op 991.79 us/op 2.05
array of 16000 items push then shift 3.4836 us/op 1.7589 us/op 1.98
LinkedList of 16000 items push then shift 10.159 ns/op 9.6320 ns/op 1.05
array of 16000 items push then pop 142.72 ns/op 85.020 ns/op 1.68
LinkedList of 16000 items push then pop 16.679 ns/op 8.1110 ns/op 2.06
array of 24000 items push then shift 3.8953 us/op 2.5563 us/op 1.52
LinkedList of 24000 items push then shift 8.9380 ns/op 8.4840 ns/op 1.05
array of 24000 items push then pop 179.36 ns/op 116.28 ns/op 1.54
LinkedList of 24000 items push then pop 12.653 ns/op 8.0690 ns/op 1.57
intersect bitArray bitLen 8 11.971 ns/op 6.8660 ns/op 1.74
intersect array and set length 8 61.791 ns/op 41.481 ns/op 1.49
intersect bitArray bitLen 128 55.971 ns/op 32.854 ns/op 1.70
intersect array and set length 128 1.1629 us/op 682.90 ns/op 1.70
bitArray.getTrueBitIndexes() bitLen 128 1.7530 us/op 1.2940 us/op 1.35
bitArray.getTrueBitIndexes() bitLen 248 3.5470 us/op 2.0730 us/op 1.71
bitArray.getTrueBitIndexes() bitLen 512 6.3450 us/op 4.1540 us/op 1.53
Buffer.concat 32 items 1.1620 us/op 787.00 ns/op 1.48
Uint8Array.set 32 items 1.7140 us/op 996.00 ns/op 1.72
Buffer.copy 4.5280 us/op 2.2150 us/op 2.04
Uint8Array.set - with subarray 2.8580 us/op 1.7000 us/op 1.68
Uint8Array.set - without subarray 1.7370 us/op 1.0900 us/op 1.59
getUint32 - dataview 336.00 ns/op 210.00 ns/op 1.60
getUint32 - manual 203.00 ns/op 127.00 ns/op 1.60
Set add up to 64 items then delete first 3.4268 us/op 2.8128 us/op 1.22
OrderedSet add up to 64 items then delete first 5.2025 us/op 4.0897 us/op 1.27
Set add up to 64 items then delete last 3.6376 us/op 3.3435 us/op 1.09
OrderedSet add up to 64 items then delete last 6.0617 us/op 5.3861 us/op 1.13
Set add up to 64 items then delete middle 4.8222 us/op 3.5525 us/op 1.36
OrderedSet add up to 64 items then delete middle 11.365 us/op 8.8667 us/op 1.28
Set add up to 128 items then delete first 7.5133 us/op 8.5312 us/op 0.88
OrderedSet add up to 128 items then delete first 10.140 us/op 11.567 us/op 0.88
Set add up to 128 items then delete last 8.5045 us/op 9.0016 us/op 0.94
OrderedSet add up to 128 items then delete last 15.747 us/op 12.582 us/op 1.25
Set add up to 128 items then delete middle 8.6796 us/op 7.2730 us/op 1.19
OrderedSet add up to 128 items then delete middle 26.526 us/op 18.997 us/op 1.40
Set add up to 256 items then delete first 15.200 us/op 14.060 us/op 1.08
OrderedSet add up to 256 items then delete first 23.370 us/op 23.035 us/op 1.01
Set add up to 256 items then delete last 15.490 us/op 13.346 us/op 1.16
OrderedSet add up to 256 items then delete last 25.775 us/op 23.374 us/op 1.10
Set add up to 256 items then delete middle 17.916 us/op 12.334 us/op 1.45
OrderedSet add up to 256 items then delete middle 73.560 us/op 52.186 us/op 1.41
transfer serialized Status (84 B) 3.5890 us/op 2.3970 us/op 1.50
copy serialized Status (84 B) 1.6350 us/op 1.2190 us/op 1.34
transfer serialized SignedVoluntaryExit (112 B) 3.5490 us/op 2.4770 us/op 1.43
copy serialized SignedVoluntaryExit (112 B) 2.4400 us/op 1.2560 us/op 1.94
transfer serialized ProposerSlashing (416 B) 4.1360 us/op 2.5570 us/op 1.62
copy serialized ProposerSlashing (416 B) 2.2630 us/op 1.4980 us/op 1.51
transfer serialized Attestation (485 B) 4.1970 us/op 2.5250 us/op 1.66
copy serialized Attestation (485 B) 2.2550 us/op 1.9290 us/op 1.17
transfer serialized AttesterSlashing (33232 B) 3.4130 us/op 2.7570 us/op 1.24
copy serialized AttesterSlashing (33232 B) 7.8450 us/op 3.9650 us/op 1.98
transfer serialized Small SignedBeaconBlock (128000 B) 6.2410 us/op 3.2500 us/op 1.92
copy serialized Small SignedBeaconBlock (128000 B) 16.833 us/op 10.619 us/op 1.59
transfer serialized Avg SignedBeaconBlock (200000 B) 7.6750 us/op 3.8160 us/op 2.01
copy serialized Avg SignedBeaconBlock (200000 B) 22.813 us/op 15.519 us/op 1.47
transfer serialized BlobsSidecar (524380 B) 5.2500 us/op 3.8250 us/op 1.37
copy serialized BlobsSidecar (524380 B) 141.35 us/op 60.133 us/op 2.35
transfer serialized Big SignedBeaconBlock (1000000 B) 7.6090 us/op 4.1100 us/op 1.85
copy serialized Big SignedBeaconBlock (1000000 B) 139.94 us/op 133.70 us/op 1.05
pass gossip attestations to forkchoice per slot 5.1023 ms/op 3.8310 ms/op 1.33
forkChoice updateHead vc 100000 bc 64 eq 0 1.0849 ms/op 570.23 us/op 1.90
forkChoice updateHead vc 600000 bc 64 eq 0 7.0143 ms/op 3.3628 ms/op 2.09
forkChoice updateHead vc 1000000 bc 64 eq 0 11.720 ms/op 6.2235 ms/op 1.88
forkChoice updateHead vc 600000 bc 320 eq 0 6.6752 ms/op 3.6487 ms/op 1.83
forkChoice updateHead vc 600000 bc 1200 eq 0 6.0739 ms/op 3.6401 ms/op 1.67
forkChoice updateHead vc 600000 bc 7200 eq 0 7.8128 ms/op 4.4716 ms/op 1.75
forkChoice updateHead vc 600000 bc 64 eq 1000 5.6427 ms/op 3.5240 ms/op 1.60
forkChoice updateHead vc 600000 bc 64 eq 10000 6.4228 ms/op 3.6127 ms/op 1.78
forkChoice updateHead vc 600000 bc 64 eq 300000 26.066 ms/op 10.613 ms/op 2.46
computeDeltas 1400000 validators 300 proto nodes 19.847 ms/op 12.731 ms/op 1.56
computeDeltas 1400000 validators 1200 proto nodes 25.370 ms/op 12.683 ms/op 2.00
computeDeltas 1400000 validators 7200 proto nodes 23.664 ms/op 14.463 ms/op 1.64
computeDeltas 2100000 validators 300 proto nodes 37.470 ms/op 21.497 ms/op 1.74
computeDeltas 2100000 validators 1200 proto nodes 37.628 ms/op 22.114 ms/op 1.70
computeDeltas 2100000 validators 7200 proto nodes 33.646 ms/op 20.246 ms/op 1.66
altair processAttestation - 250000 vs - 7PWei normalcase 3.1966 ms/op 2.5359 ms/op 1.26
altair processAttestation - 250000 vs - 7PWei worstcase 4.3998 ms/op 3.7049 ms/op 1.19
altair processAttestation - setStatus - 1/6 committees join 165.91 us/op 156.52 us/op 1.06
altair processAttestation - setStatus - 1/3 committees join 383.42 us/op 273.67 us/op 1.40
altair processAttestation - setStatus - 1/2 committees join 556.03 us/op 412.26 us/op 1.35
altair processAttestation - setStatus - 2/3 committees join 690.55 us/op 535.61 us/op 1.29
altair processAttestation - setStatus - 4/5 committees join 728.98 us/op 731.77 us/op 1.00
altair processAttestation - setStatus - 100% committees join 973.22 us/op 809.32 us/op 1.20
altair processBlock - 250000 vs - 7PWei normalcase 10.321 ms/op 5.6114 ms/op 1.84
altair processBlock - 250000 vs - 7PWei normalcase hashState 39.435 ms/op 37.508 ms/op 1.05
altair processBlock - 250000 vs - 7PWei worstcase 51.141 ms/op 45.086 ms/op 1.13
altair processBlock - 250000 vs - 7PWei worstcase hashState 108.02 ms/op 83.720 ms/op 1.29
phase0 processBlock - 250000 vs - 7PWei normalcase 2.7416 ms/op 1.8439 ms/op 1.49
phase0 processBlock - 250000 vs - 7PWei worstcase 31.276 ms/op 26.647 ms/op 1.17
altair processEth1Data - 250000 vs - 7PWei normalcase 451.08 us/op 386.15 us/op 1.17
getExpectedWithdrawals 250000 eb:1,eth1:1,we:0,wn:0,smpl:15 14.035 us/op 12.513 us/op 1.12
getExpectedWithdrawals 250000 eb:0.95,eth1:0.1,we:0.05,wn:0,smpl:219 46.145 us/op 42.645 us/op 1.08
getExpectedWithdrawals 250000 eb:0.95,eth1:0.3,we:0.05,wn:0,smpl:42 24.572 us/op 14.875 us/op 1.65
getExpectedWithdrawals 250000 eb:0.95,eth1:0.7,we:0.05,wn:0,smpl:18 6.2390 us/op 12.045 us/op 0.52
getExpectedWithdrawals 250000 eb:0.1,eth1:0.1,we:0,wn:0,smpl:1020 174.13 us/op 218.86 us/op 0.80
getExpectedWithdrawals 250000 eb:0.03,eth1:0.03,we:0,wn:0,smpl:11777 2.3416 ms/op 2.1103 ms/op 1.11
getExpectedWithdrawals 250000 eb:0.01,eth1:0.01,we:0,wn:0,smpl:16384 3.0886 ms/op 2.8987 ms/op 1.07
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,smpl:16384 3.2341 ms/op 3.5573 ms/op 0.91
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,nocache,smpl:16384 6.0308 ms/op 6.8473 ms/op 0.88
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,smpl:16384 3.3360 ms/op 3.0313 ms/op 1.10
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,nocache,smpl:16384 4.9747 ms/op 5.9085 ms/op 0.84
Tree 40 250000 create 480.08 ms/op 723.28 ms/op 0.66
Tree 40 250000 get(125000) 161.55 ns/op 169.21 ns/op 0.95
Tree 40 250000 set(125000) 2.2495 us/op 2.4118 us/op 0.93
Tree 40 250000 toArray() 18.703 ms/op 24.486 ms/op 0.76
Tree 40 250000 iterate all - toArray() + loop 21.877 ms/op 23.945 ms/op 0.91
Tree 40 250000 iterate all - get(i) 60.288 ms/op 66.128 ms/op 0.91
Array 250000 create 2.6392 ms/op 4.5690 ms/op 0.58
Array 250000 clone - spread 1.5673 ms/op 1.8863 ms/op 0.83
Array 250000 get(125000) 0.51300 ns/op 0.68400 ns/op 0.75
Array 250000 set(125000) 0.54200 ns/op 0.53000 ns/op 1.02
Array 250000 iterate all - loop 132.09 us/op 116.52 us/op 1.13
phase0 afterProcessEpoch - 250000 vs - 7PWei 48.965 ms/op 45.611 ms/op 1.07
Array.fill - length 1000000 3.8246 ms/op 4.7289 ms/op 0.81
Array push - length 1000000 14.073 ms/op 18.263 ms/op 0.77
Array.get 0.29668 ns/op 0.32402 ns/op 0.92
Uint8Array.get 0.49553 ns/op 0.48009 ns/op 1.03
phase0 beforeProcessEpoch - 250000 vs - 7PWei 22.326 ms/op 23.573 ms/op 0.95
altair processEpoch - mainnet_e81889 283.84 ms/op 297.77 ms/op 0.95
mainnet_e81889 - altair beforeProcessEpoch 23.437 ms/op 20.195 ms/op 1.16
mainnet_e81889 - altair processJustificationAndFinalization 8.9420 us/op 5.9780 us/op 1.50
mainnet_e81889 - altair processInactivityUpdates 5.7752 ms/op 5.6786 ms/op 1.02
mainnet_e81889 - altair processRewardsAndPenalties 45.237 ms/op 44.074 ms/op 1.03
mainnet_e81889 - altair processRegistryUpdates 1.1820 us/op 773.00 ns/op 1.53
mainnet_e81889 - altair processSlashings 226.00 ns/op 195.00 ns/op 1.16
mainnet_e81889 - altair processEth1DataReset 262.00 ns/op 190.00 ns/op 1.38
mainnet_e81889 - altair processEffectiveBalanceUpdates 1.7481 ms/op 1.3239 ms/op 1.32
mainnet_e81889 - altair processSlashingsReset 958.00 ns/op 919.00 ns/op 1.04
mainnet_e81889 - altair processRandaoMixesReset 1.4280 us/op 1.2340 us/op 1.16
mainnet_e81889 - altair processHistoricalRootsUpdate 207.00 ns/op 204.00 ns/op 1.01
mainnet_e81889 - altair processParticipationFlagUpdates 558.00 ns/op 586.00 ns/op 0.95
mainnet_e81889 - altair processSyncCommitteeUpdates 185.00 ns/op 147.00 ns/op 1.26
mainnet_e81889 - altair afterProcessEpoch 47.852 ms/op 47.269 ms/op 1.01
capella processEpoch - mainnet_e217614 1.2580 s/op 1.0412 s/op 1.21
mainnet_e217614 - capella beforeProcessEpoch 75.166 ms/op 76.068 ms/op 0.99
mainnet_e217614 - capella processJustificationAndFinalization 6.6430 us/op 6.1850 us/op 1.07
mainnet_e217614 - capella processInactivityUpdates 16.842 ms/op 16.134 ms/op 1.04
mainnet_e217614 - capella processRewardsAndPenalties 220.06 ms/op 205.35 ms/op 1.07
mainnet_e217614 - capella processRegistryUpdates 7.8280 us/op 6.9180 us/op 1.13
mainnet_e217614 - capella processSlashings 290.00 ns/op 186.00 ns/op 1.56
mainnet_e217614 - capella processEth1DataReset 213.00 ns/op 181.00 ns/op 1.18
mainnet_e217614 - capella processEffectiveBalanceUpdates 6.7234 ms/op 4.5184 ms/op 1.49
mainnet_e217614 - capella processSlashingsReset 1.5600 us/op 1.0340 us/op 1.51
mainnet_e217614 - capella processRandaoMixesReset 2.0670 us/op 1.2600 us/op 1.64
mainnet_e217614 - capella processHistoricalRootsUpdate 274.00 ns/op 190.00 ns/op 1.44
mainnet_e217614 - capella processParticipationFlagUpdates 679.00 ns/op 704.00 ns/op 0.96
mainnet_e217614 - capella afterProcessEpoch 149.64 ms/op 125.32 ms/op 1.19
phase0 processEpoch - mainnet_e58758 389.17 ms/op 383.28 ms/op 1.02
mainnet_e58758 - phase0 beforeProcessEpoch 83.949 ms/op 96.686 ms/op 0.87
mainnet_e58758 - phase0 processJustificationAndFinalization 8.5470 us/op 7.6160 us/op 1.12
mainnet_e58758 - phase0 processRewardsAndPenalties 60.527 ms/op 39.158 ms/op 1.55
mainnet_e58758 - phase0 processRegistryUpdates 4.5280 us/op 3.4320 us/op 1.32
mainnet_e58758 - phase0 processSlashings 317.00 ns/op 182.00 ns/op 1.74
mainnet_e58758 - phase0 processEth1DataReset 284.00 ns/op 184.00 ns/op 1.54
mainnet_e58758 - phase0 processEffectiveBalanceUpdates 1.9812 ms/op 1.3077 ms/op 1.52
mainnet_e58758 - phase0 processSlashingsReset 1.3480 us/op 1.0150 us/op 1.33
mainnet_e58758 - phase0 processRandaoMixesReset 1.5690 us/op 1.2090 us/op 1.30
mainnet_e58758 - phase0 processHistoricalRootsUpdate 350.00 ns/op 183.00 ns/op 1.91
mainnet_e58758 - phase0 processParticipationRecordUpdates 1.3760 us/op 925.00 ns/op 1.49
mainnet_e58758 - phase0 afterProcessEpoch 46.008 ms/op 37.024 ms/op 1.24
phase0 processEffectiveBalanceUpdates - 250000 normalcase 1.9142 ms/op 1.4236 ms/op 1.34
phase0 processEffectiveBalanceUpdates - 250000 worstcase 0.5 3.2595 ms/op 1.9984 ms/op 1.63
altair processInactivityUpdates - 250000 normalcase 24.701 ms/op 21.758 ms/op 1.14
altair processInactivityUpdates - 250000 worstcase 24.204 ms/op 22.541 ms/op 1.07
phase0 processRegistryUpdates - 250000 normalcase 7.3320 us/op 6.7830 us/op 1.08
phase0 processRegistryUpdates - 250000 badcase_full_deposits 310.23 us/op 300.63 us/op 1.03
phase0 processRegistryUpdates - 250000 worstcase 0.5 124.63 ms/op 130.91 ms/op 0.95
altair processRewardsAndPenalties - 250000 normalcase 33.801 ms/op 28.399 ms/op 1.19
altair processRewardsAndPenalties - 250000 worstcase 30.764 ms/op 29.911 ms/op 1.03
phase0 getAttestationDeltas - 250000 normalcase 23.025 ms/op 6.5478 ms/op 3.52
phase0 getAttestationDeltas - 250000 worstcase 8.6625 ms/op 6.8311 ms/op 1.27
phase0 processSlashings - 250000 worstcase 94.629 us/op 105.38 us/op 0.90
altair processSyncCommitteeUpdates - 250000 14.431 ms/op 13.188 ms/op 1.09
BeaconState.hashTreeRoot - No change 336.00 ns/op 252.00 ns/op 1.33
BeaconState.hashTreeRoot - 1 full validator 170.18 us/op 87.034 us/op 1.96
BeaconState.hashTreeRoot - 32 full validator 1.4560 ms/op 1.0425 ms/op 1.40
BeaconState.hashTreeRoot - 512 full validator 11.657 ms/op 11.713 ms/op 1.00
BeaconState.hashTreeRoot - 1 validator.effectiveBalance 134.24 us/op 109.64 us/op 1.22
BeaconState.hashTreeRoot - 32 validator.effectiveBalance 2.0375 ms/op 1.5909 ms/op 1.28
BeaconState.hashTreeRoot - 512 validator.effectiveBalance 25.660 ms/op 25.940 ms/op 0.99
BeaconState.hashTreeRoot - 1 balances 91.135 us/op 81.075 us/op 1.12
BeaconState.hashTreeRoot - 32 balances 875.73 us/op 1.2807 ms/op 0.68
BeaconState.hashTreeRoot - 512 balances 10.273 ms/op 9.3073 ms/op 1.10
BeaconState.hashTreeRoot - 250000 balances 241.72 ms/op 193.02 ms/op 1.25
aggregationBits - 2048 els - zipIndexesInBitList 26.961 us/op 24.978 us/op 1.08
byteArrayEquals 32 67.196 ns/op 57.082 ns/op 1.18
Buffer.compare 32 30.430 ns/op 20.796 ns/op 1.46
byteArrayEquals 1024 2.3102 us/op 1.6685 us/op 1.38
Buffer.compare 1024 40.324 ns/op 26.447 ns/op 1.52
byteArrayEquals 16384 33.441 us/op 27.035 us/op 1.24
Buffer.compare 16384 277.36 ns/op 203.32 ns/op 1.36
byteArrayEquals 123687377 267.72 ms/op 209.52 ms/op 1.28
Buffer.compare 123687377 8.6962 ms/op 12.340 ms/op 0.70
byteArrayEquals 32 - diff last byte 60.355 ns/op 57.559 ns/op 1.05
Buffer.compare 32 - diff last byte 19.354 ns/op 17.773 ns/op 1.09
byteArrayEquals 1024 - diff last byte 2.0302 us/op 1.6561 us/op 1.23
Buffer.compare 1024 - diff last byte 30.349 ns/op 27.856 ns/op 1.09
byteArrayEquals 16384 - diff last byte 29.240 us/op 26.858 us/op 1.09
Buffer.compare 16384 - diff last byte 208.16 ns/op 187.00 ns/op 1.11
byteArrayEquals 123687377 - diff last byte 285.46 ms/op 201.90 ms/op 1.41
Buffer.compare 123687377 - diff last byte 10.761 ms/op 8.5449 ms/op 1.26
byteArrayEquals 32 - random bytes 7.8570 ns/op 5.3010 ns/op 1.48
Buffer.compare 32 - random bytes 25.054 ns/op 17.994 ns/op 1.39
byteArrayEquals 1024 - random bytes 7.6280 ns/op 5.3540 ns/op 1.42
Buffer.compare 1024 - random bytes 24.885 ns/op 18.926 ns/op 1.31
byteArrayEquals 16384 - random bytes 7.7220 ns/op 5.4020 ns/op 1.43
Buffer.compare 16384 - random bytes 26.404 ns/op 18.205 ns/op 1.45
byteArrayEquals 123687377 - random bytes 11.330 ns/op 6.7700 ns/op 1.67
Buffer.compare 123687377 - random bytes 31.960 ns/op 19.200 ns/op 1.66
regular array get 100000 times 55.413 us/op 34.660 us/op 1.60
wrappedArray get 100000 times 50.380 us/op 42.067 us/op 1.20
arrayWithProxy get 100000 times 21.766 ms/op 21.057 ms/op 1.03
ssz.Root.equals 73.979 ns/op 50.610 ns/op 1.46
byteArrayEquals 61.040 ns/op 48.493 ns/op 1.26
Buffer.compare 15.245 ns/op 11.667 ns/op 1.31
processSlot - 1 slots 20.398 us/op 10.710 us/op 1.90
processSlot - 32 slots 3.8014 ms/op 2.1211 ms/op 1.79
getEffectiveBalanceIncrementsZeroInactive - 250000 vs - 7PWei 5.6973 ms/op 3.4212 ms/op 1.67
getCommitteeAssignments - req 1 vs - 250000 vc 5.3026 ms/op 2.2663 ms/op 2.34
getCommitteeAssignments - req 100 vs - 250000 vc 9.9995 ms/op 4.2856 ms/op 2.33
getCommitteeAssignments - req 1000 vs - 250000 vc 10.307 ms/op 4.7095 ms/op 2.19
findModifiedValidators - 10000 modified validators 1.3092 s/op 785.67 ms/op 1.67
findModifiedValidators - 1000 modified validators 851.51 ms/op 753.60 ms/op 1.13
findModifiedValidators - 100 modified validators 632.55 ms/op 282.76 ms/op 2.24
findModifiedValidators - 10 modified validators 400.95 ms/op 189.67 ms/op 2.11
findModifiedValidators - 1 modified validators 418.32 ms/op 165.93 ms/op 2.52
findModifiedValidators - no difference 470.57 ms/op 178.75 ms/op 2.63
compare ViewDUs 10.848 s/op 6.7730 s/op 1.60
compare each validator Uint8Array 1.9066 s/op 1.5992 s/op 1.19
compare ViewDU to Uint8Array 1.2182 s/op 1.5625 s/op 0.78
migrate state 1000000 validators, 24 modified, 0 new 964.80 ms/op 997.61 ms/op 0.97
migrate state 1000000 validators, 1700 modified, 1000 new 1.2866 s/op 1.1812 s/op 1.09
migrate state 1000000 validators, 3400 modified, 2000 new 1.5533 s/op 1.3405 s/op 1.16
migrate state 1500000 validators, 24 modified, 0 new 876.06 ms/op 934.55 ms/op 0.94
migrate state 1500000 validators, 1700 modified, 1000 new 1.3440 s/op 1.2636 s/op 1.06
migrate state 1500000 validators, 3400 modified, 2000 new 1.4274 s/op 1.5853 s/op 0.90
RootCache.getBlockRootAtSlot - 250000 vs - 7PWei 5.4700 ns/op 4.8100 ns/op 1.14
state getBlockRootAtSlot - 250000 vs - 7PWei 498.99 ns/op 560.27 ns/op 0.89
naive computeProposerIndex 100000 validators 59.021 ms/op 62.270 ms/op 0.95
computeProposerIndex 100000 validators 1.5227 ms/op 1.6693 ms/op 0.91
naiveGetNextSyncCommitteeIndices 1000 validators 8.4464 s/op 8.8530 s/op 0.95
getNextSyncCommitteeIndices 1000 validators 131.92 ms/op 129.57 ms/op 1.02
naiveGetNextSyncCommitteeIndices 10000 validators 8.7487 s/op 8.8452 s/op 0.99
getNextSyncCommitteeIndices 10000 validators 121.01 ms/op 125.06 ms/op 0.97
naiveGetNextSyncCommitteeIndices 100000 validators 8.4496 s/op 8.2772 s/op 1.02
getNextSyncCommitteeIndices 100000 validators 120.61 ms/op 111.17 ms/op 1.08
naive computeShuffledIndex 100000 validators 25.871 s/op 23.796 s/op 1.09
cached computeShuffledIndex 100000 validators 654.40 ms/op 523.60 ms/op 1.25
naive computeShuffledIndex 2000000 validators 737.13 s/op 572.22 s/op 1.29
cached computeShuffledIndex 2000000 validators 30.274 s/op 55.578 s/op 0.54
computeProposers - vc 250000 631.58 us/op 663.86 us/op 0.95
computeEpochShuffling - vc 250000 41.949 ms/op 47.469 ms/op 0.88
getNextSyncCommittee - vc 250000 10.422 ms/op 12.073 ms/op 0.86
computeSigningRoot for AttestationData 18.627 us/op 23.690 us/op 0.79
hash AttestationData serialized data then Buffer.toString(base64) 1.5857 us/op 1.7162 us/op 0.92
toHexString serialized data 1.1183 us/op 1.4987 us/op 0.75
Buffer.toString(base64) 157.51 ns/op 170.88 ns/op 0.92
nodejs block root to RootHex using toHex 148.35 ns/op 163.76 ns/op 0.91
nodejs block root to RootHex using toRootHex 108.54 ns/op 100.89 ns/op 1.08
nodejs fromhex(blob) 122.32 ms/op 132.57 ms/op 0.92
nodejs fromHexInto(blob) 101.67 ms/op 107.81 ms/op 0.94
browser block root to RootHex using the deprecated toHexString 223.69 ns/op 249.49 ns/op 0.90
browser block root to RootHex using toHex 171.99 ns/op 184.60 ns/op 0.93
browser block root to RootHex using toRootHex 161.74 ns/op 174.62 ns/op 0.93
browser fromHexInto(blob) 835.36 us/op 891.08 us/op 0.94
browser fromHex(blob) 800.70 ms/op 855.99 ms/op 0.94

by benchmarkbot/action

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.

1 participant