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

Conversation

@wemeetagain
Copy link
Member

Motivation

Description

  • Add "bun" export to all packages that points to the typescript source rather than the transpiled javascript
  • Allows for bun to use typescript directly

@wemeetagain wemeetagain requested a review from a team as a code owner September 22, 2025 21:44
@gemini-code-assist
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 enhances the project's compatibility with the Bun JavaScript runtime by introducing specific bun export conditions in the package.json files of numerous packages. This configuration enables Bun to directly consume the TypeScript source code, bypassing the need for intermediate transpiled JavaScript files and simplifying the development workflow for Bun users.

Highlights

  • Bun Exports Added: All package.json files across various packages now include bun export conditions.
  • Direct TypeScript Sourcing: These new bun exports point directly to the TypeScript source files (./src/*.ts) instead of the transpiled JavaScript (./lib/*.js), enabling Bun to use TypeScript directly.
  • Bun CLI Integration: A new executable script packages/cli/bin/lodestar.ts has been added, allowing the lodestar CLI to be run directly with Bun.
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

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 adds support for the Bun runtime by introducing a "bun" export condition in the package.json files across multiple packages. This change enables Bun to directly consume TypeScript source files, which is a significant enhancement for development workflows. The modifications are consistently applied and correctly structured within the exports map. The addition of a new lodestar.ts binary for Bun is also a logical step. The changes appear correct and well-implemented.

@codecov
Copy link

codecov bot commented Sep 22, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 52.24%. Comparing base (092cc39) to head (90d4498).
⚠️ Report is 3 commits behind head on unstable.

Additional details and impacted files
@@             Coverage Diff              @@
##           unstable    #8448      +/-   ##
============================================
- Coverage     52.25%   52.24%   -0.01%     
============================================
  Files           853      853              
  Lines         64770    64770              
  Branches       4768     4766       -2     
============================================
- Hits          33844    33841       -3     
- Misses        30856    30859       +3     
  Partials         70       70              
🚀 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

Performance Report

✔️ no performance regression detected

Full benchmark results
Benchmark suite Current: 5bcc34d Previous: c0078a1 Ratio
getPubkeys - index2pubkey - req 1000 vs - 250000 vc 792.89 us/op 1.2437 ms/op 0.64
getPubkeys - validatorsArr - req 1000 vs - 250000 vc 30.836 us/op 38.726 us/op 0.80
BLS verify - blst 909.70 us/op 1.0814 ms/op 0.84
BLS verifyMultipleSignatures 3 - blst 1.3315 ms/op 1.4463 ms/op 0.92
BLS verifyMultipleSignatures 8 - blst 1.6804 ms/op 2.1838 ms/op 0.77
BLS verifyMultipleSignatures 32 - blst 5.0610 ms/op 7.3518 ms/op 0.69
BLS verifyMultipleSignatures 64 - blst 8.9436 ms/op 11.516 ms/op 0.78
BLS verifyMultipleSignatures 128 - blst 15.993 ms/op 18.774 ms/op 0.85
BLS deserializing 10000 signatures 626.41 ms/op 747.36 ms/op 0.84
BLS deserializing 100000 signatures 6.0149 s/op 7.4261 s/op 0.81
BLS verifyMultipleSignatures - same message - 3 - blst 958.78 us/op 1.1128 ms/op 0.86
BLS verifyMultipleSignatures - same message - 8 - blst 1.0675 ms/op 1.2361 ms/op 0.86
BLS verifyMultipleSignatures - same message - 32 - blst 1.7206 ms/op 1.9471 ms/op 0.88
BLS verifyMultipleSignatures - same message - 64 - blst 2.5659 ms/op 3.0423 ms/op 0.84
BLS verifyMultipleSignatures - same message - 128 - blst 4.1864 ms/op 4.8919 ms/op 0.86
BLS aggregatePubkeys 32 - blst 17.606 us/op 22.738 us/op 0.77
BLS aggregatePubkeys 128 - blst 62.693 us/op 74.896 us/op 0.84
notSeenSlots=1 numMissedVotes=1 numBadVotes=10 36.261 ms/op 65.195 ms/op 0.56
notSeenSlots=1 numMissedVotes=0 numBadVotes=4 36.677 ms/op 59.742 ms/op 0.61
notSeenSlots=2 numMissedVotes=1 numBadVotes=10 34.098 ms/op 44.838 ms/op 0.76
getSlashingsAndExits - default max 47.804 us/op 109.31 us/op 0.44
getSlashingsAndExits - 2k 290.42 us/op 368.82 us/op 0.79
isKnown best case - 1 super set check 406.00 ns/op 229.00 ns/op 1.77
isKnown normal case - 2 super set checks 398.00 ns/op 227.00 ns/op 1.75
isKnown worse case - 16 super set checks 402.00 ns/op 230.00 ns/op 1.75
InMemoryCheckpointStateCache - add get delete 2.4230 us/op 2.4470 us/op 0.99
validate api signedAggregateAndProof - struct 1.3883 ms/op 1.4114 ms/op 0.98
validate gossip signedAggregateAndProof - struct 1.4170 ms/op 1.7525 ms/op 0.81
batch validate gossip attestation - vc 640000 - chunk 32 106.12 us/op 118.92 us/op 0.89
batch validate gossip attestation - vc 640000 - chunk 64 92.694 us/op 104.71 us/op 0.89
batch validate gossip attestation - vc 640000 - chunk 128 87.078 us/op 97.354 us/op 0.89
batch validate gossip attestation - vc 640000 - chunk 256 89.884 us/op 105.85 us/op 0.85
pickEth1Vote - no votes 786.26 us/op 1.0027 ms/op 0.78
pickEth1Vote - max votes 4.0546 ms/op 7.0464 ms/op 0.58
pickEth1Vote - Eth1Data hashTreeRoot value x2048 8.5096 ms/op 13.434 ms/op 0.63
pickEth1Vote - Eth1Data hashTreeRoot tree x2048 11.050 ms/op 19.825 ms/op 0.56
pickEth1Vote - Eth1Data fastSerialize value x2048 361.63 us/op 454.79 us/op 0.80
pickEth1Vote - Eth1Data fastSerialize tree x2048 2.1036 ms/op 3.8498 ms/op 0.55
bytes32 toHexString 508.00 ns/op 433.00 ns/op 1.17
bytes32 Buffer.toString(hex) 405.00 ns/op 296.00 ns/op 1.37
bytes32 Buffer.toString(hex) from Uint8Array 492.00 ns/op 339.00 ns/op 1.45
bytes32 Buffer.toString(hex) + 0x 407.00 ns/op 318.00 ns/op 1.28
Object access 1 prop 0.30000 ns/op 0.12200 ns/op 2.46
Map access 1 prop 0.31100 ns/op 0.14800 ns/op 2.10
Object get x1000 5.1260 ns/op 6.0430 ns/op 0.85
Map get x1000 5.8240 ns/op 6.6800 ns/op 0.87
Object set x1000 18.648 ns/op 31.039 ns/op 0.60
Map set x1000 16.276 ns/op 21.433 ns/op 0.76
Return object 10000 times 0.35580 ns/op 0.32170 ns/op 1.11
Throw Error 10000 times 3.4622 us/op 4.6449 us/op 0.75
toHex 104.24 ns/op 135.23 ns/op 0.77
Buffer.from 95.663 ns/op 120.68 ns/op 0.79
shared Buffer 68.684 ns/op 81.890 ns/op 0.84
fastMsgIdFn sha256 / 200 bytes 1.9100 us/op 2.2850 us/op 0.84
fastMsgIdFn h32 xxhash / 200 bytes 460.00 ns/op 221.00 ns/op 2.08
fastMsgIdFn h64 xxhash / 200 bytes 425.00 ns/op 306.00 ns/op 1.39
fastMsgIdFn sha256 / 1000 bytes 5.6680 us/op 7.6080 us/op 0.75
fastMsgIdFn h32 xxhash / 1000 bytes 498.00 ns/op 343.00 ns/op 1.45
fastMsgIdFn h64 xxhash / 1000 bytes 496.00 ns/op 350.00 ns/op 1.42
fastMsgIdFn sha256 / 10000 bytes 48.729 us/op 67.022 us/op 0.73
fastMsgIdFn h32 xxhash / 10000 bytes 1.8630 us/op 1.8960 us/op 0.98
fastMsgIdFn h64 xxhash / 10000 bytes 1.2940 us/op 1.2530 us/op 1.03
send data - 1000 256B messages 11.685 ms/op 19.244 ms/op 0.61
send data - 1000 512B messages 14.572 ms/op 22.516 ms/op 0.65
send data - 1000 1024B messages 20.742 ms/op 31.150 ms/op 0.67
send data - 1000 1200B messages 14.598 ms/op 29.678 ms/op 0.49
send data - 1000 2048B messages 14.791 ms/op 28.723 ms/op 0.51
send data - 1000 4096B messages 16.239 ms/op 33.917 ms/op 0.48
send data - 1000 16384B messages 23.652 ms/op 50.215 ms/op 0.47
send data - 1000 65536B messages 62.508 ms/op 132.38 ms/op 0.47
enrSubnets - fastDeserialize 64 bits 964.00 ns/op 908.00 ns/op 1.06
enrSubnets - ssz BitVector 64 bits 491.00 ns/op 342.00 ns/op 1.44
enrSubnets - fastDeserialize 4 bits 316.00 ns/op 131.00 ns/op 2.41
enrSubnets - ssz BitVector 4 bits 500.00 ns/op 351.00 ns/op 1.42
prioritizePeers score -10:0 att 32-0.1 sync 2-0 197.68 us/op 253.95 us/op 0.78
prioritizePeers score 0:0 att 32-0.25 sync 2-0.25 228.50 us/op 280.71 us/op 0.81
prioritizePeers score 0:0 att 32-0.5 sync 2-0.5 368.13 us/op 417.80 us/op 0.88
prioritizePeers score 0:0 att 64-0.75 sync 4-0.75 632.62 us/op 759.33 us/op 0.83
prioritizePeers score 0:0 att 64-1 sync 4-1 748.75 us/op 913.47 us/op 0.82
array of 16000 items push then shift 1.1913 us/op 1.6975 us/op 0.70
LinkedList of 16000 items push then shift 6.6340 ns/op 7.9700 ns/op 0.83
array of 16000 items push then pop 61.996 ns/op 86.142 ns/op 0.72
LinkedList of 16000 items push then pop 5.9230 ns/op 7.6430 ns/op 0.77
array of 24000 items push then shift 1.7111 us/op 2.5380 us/op 0.67
LinkedList of 24000 items push then shift 6.2430 ns/op 7.8450 ns/op 0.80
array of 24000 items push then pop 85.422 ns/op 113.79 ns/op 0.75
LinkedList of 24000 items push then pop 5.8540 ns/op 7.5070 ns/op 0.78
intersect bitArray bitLen 8 5.0980 ns/op 6.7580 ns/op 0.75
intersect array and set length 8 30.028 ns/op 41.367 ns/op 0.73
intersect bitArray bitLen 128 24.717 ns/op 30.484 ns/op 0.81
intersect array and set length 128 502.41 ns/op 635.34 ns/op 0.79
bitArray.getTrueBitIndexes() bitLen 128 1.0840 us/op 1.1370 us/op 0.95
bitArray.getTrueBitIndexes() bitLen 248 1.7580 us/op 1.9030 us/op 0.92
bitArray.getTrueBitIndexes() bitLen 512 3.4520 us/op 3.9600 us/op 0.87
Buffer.concat 32 items 774.00 ns/op 625.00 ns/op 1.24
Uint8Array.set 32 items 1.1680 us/op 1.6630 us/op 0.70
Buffer.copy 1.9070 us/op 2.6510 us/op 0.72
Uint8Array.set - with subarray 1.6740 us/op 1.6570 us/op 1.01
Uint8Array.set - without subarray 956.00 ns/op 1.1000 us/op 0.87
getUint32 - dataview 362.00 ns/op 201.00 ns/op 1.80
getUint32 - manual 292.00 ns/op 121.00 ns/op 2.41
Set add up to 64 items then delete first 1.7034 us/op 2.3474 us/op 0.73
OrderedSet add up to 64 items then delete first 2.6722 us/op 3.5812 us/op 0.75
Set add up to 64 items then delete last 1.9406 us/op 2.7094 us/op 0.72
OrderedSet add up to 64 items then delete last 2.9600 us/op 3.9637 us/op 0.75
Set add up to 64 items then delete middle 1.9226 us/op 2.4344 us/op 0.79
OrderedSet add up to 64 items then delete middle 4.3215 us/op 5.8293 us/op 0.74
Set add up to 128 items then delete first 3.8393 us/op 5.7916 us/op 0.66
OrderedSet add up to 128 items then delete first 6.0083 us/op 10.155 us/op 0.59
Set add up to 128 items then delete last 3.6838 us/op 5.3782 us/op 0.68
OrderedSet add up to 128 items then delete last 5.8363 us/op 8.1215 us/op 0.72
Set add up to 128 items then delete middle 3.7153 us/op 5.5263 us/op 0.67
OrderedSet add up to 128 items then delete middle 11.825 us/op 17.224 us/op 0.69
Set add up to 256 items then delete first 7.9047 us/op 12.799 us/op 0.62
OrderedSet add up to 256 items then delete first 12.470 us/op 18.746 us/op 0.67
Set add up to 256 items then delete last 7.7810 us/op 12.895 us/op 0.60
OrderedSet add up to 256 items then delete last 11.856 us/op 16.020 us/op 0.74
Set add up to 256 items then delete middle 7.6576 us/op 11.585 us/op 0.66
OrderedSet add up to 256 items then delete middle 34.828 us/op 48.885 us/op 0.71
transfer serialized Status (84 B) 1.8850 us/op 2.4060 us/op 0.78
copy serialized Status (84 B) 1.1820 us/op 1.3380 us/op 0.88
transfer serialized SignedVoluntaryExit (112 B) 1.9120 us/op 2.4330 us/op 0.79
copy serialized SignedVoluntaryExit (112 B) 1.2150 us/op 1.5550 us/op 0.78
transfer serialized ProposerSlashing (416 B) 1.9770 us/op 2.6000 us/op 0.76
copy serialized ProposerSlashing (416 B) 1.3260 us/op 2.0570 us/op 0.64
transfer serialized Attestation (485 B) 1.9900 us/op 3.6310 us/op 0.55
copy serialized Attestation (485 B) 1.4590 us/op 1.6020 us/op 0.91
transfer serialized AttesterSlashing (33232 B) 1.9750 us/op 2.9960 us/op 0.66
copy serialized AttesterSlashing (33232 B) 3.2620 us/op 5.0750 us/op 0.64
transfer serialized Small SignedBeaconBlock (128000 B) 2.2040 us/op 3.3940 us/op 0.65
copy serialized Small SignedBeaconBlock (128000 B) 5.5740 us/op 10.466 us/op 0.53
transfer serialized Avg SignedBeaconBlock (200000 B) 2.2260 us/op 4.4140 us/op 0.50
copy serialized Avg SignedBeaconBlock (200000 B) 7.8460 us/op 17.046 us/op 0.46
transfer serialized BlobsSidecar (524380 B) 2.7840 us/op 3.7650 us/op 0.74
copy serialized BlobsSidecar (524380 B) 58.311 us/op 68.485 us/op 0.85
transfer serialized Big SignedBeaconBlock (1000000 B) 3.2340 us/op 4.3290 us/op 0.75
copy serialized Big SignedBeaconBlock (1000000 B) 107.84 us/op 122.75 us/op 0.88
pass gossip attestations to forkchoice per slot 2.2367 ms/op 2.9792 ms/op 0.75
forkChoice updateHead vc 100000 bc 64 eq 0 327.24 us/op 474.00 us/op 0.69
forkChoice updateHead vc 600000 bc 64 eq 0 2.0584 ms/op 3.0227 ms/op 0.68
forkChoice updateHead vc 1000000 bc 64 eq 0 3.8154 ms/op 5.1763 ms/op 0.74
forkChoice updateHead vc 600000 bc 320 eq 0 2.3110 ms/op 3.0740 ms/op 0.75
forkChoice updateHead vc 600000 bc 1200 eq 0 2.1814 ms/op 3.7413 ms/op 0.58
forkChoice updateHead vc 600000 bc 7200 eq 0 2.5603 ms/op 4.6166 ms/op 0.55
forkChoice updateHead vc 600000 bc 64 eq 1000 9.0208 ms/op 10.763 ms/op 0.84
forkChoice updateHead vc 600000 bc 64 eq 10000 8.1916 ms/op 10.714 ms/op 0.76
forkChoice updateHead vc 600000 bc 64 eq 300000 11.140 ms/op 16.044 ms/op 0.69
computeDeltas 500000 validators 300 proto nodes 3.0507 ms/op 4.1274 ms/op 0.74
computeDeltas 500000 validators 1200 proto nodes 3.0551 ms/op 4.3609 ms/op 0.70
computeDeltas 500000 validators 7200 proto nodes 3.0408 ms/op 4.0794 ms/op 0.75
computeDeltas 750000 validators 300 proto nodes 4.7523 ms/op 5.8772 ms/op 0.81
computeDeltas 750000 validators 1200 proto nodes 4.7828 ms/op 5.8235 ms/op 0.82
computeDeltas 750000 validators 7200 proto nodes 4.6605 ms/op 5.8386 ms/op 0.80
computeDeltas 1400000 validators 300 proto nodes 9.0698 ms/op 10.942 ms/op 0.83
computeDeltas 1400000 validators 1200 proto nodes 8.9799 ms/op 10.972 ms/op 0.82
computeDeltas 1400000 validators 7200 proto nodes 8.6685 ms/op 11.226 ms/op 0.77
computeDeltas 2100000 validators 300 proto nodes 13.803 ms/op 17.722 ms/op 0.78
computeDeltas 2100000 validators 1200 proto nodes 13.769 ms/op 18.897 ms/op 0.73
computeDeltas 2100000 validators 7200 proto nodes 13.904 ms/op 22.095 ms/op 0.63
altair processAttestation - 250000 vs - 7PWei normalcase 1.7281 ms/op 2.2707 ms/op 0.76
altair processAttestation - 250000 vs - 7PWei worstcase 2.4173 ms/op 3.7610 ms/op 0.64
altair processAttestation - setStatus - 1/6 committees join 139.92 us/op 156.35 us/op 0.89
altair processAttestation - setStatus - 1/3 committees join 215.81 us/op 269.66 us/op 0.80
altair processAttestation - setStatus - 1/2 committees join 271.51 us/op 384.75 us/op 0.71
altair processAttestation - setStatus - 2/3 committees join 361.43 us/op 488.11 us/op 0.74
altair processAttestation - setStatus - 4/5 committees join 505.19 us/op 677.58 us/op 0.75
altair processAttestation - setStatus - 100% committees join 572.28 us/op 805.22 us/op 0.71
altair processBlock - 250000 vs - 7PWei normalcase 4.6669 ms/op 6.1598 ms/op 0.76
altair processBlock - 250000 vs - 7PWei normalcase hashState 31.823 ms/op 34.901 ms/op 0.91
altair processBlock - 250000 vs - 7PWei worstcase 34.695 ms/op 42.442 ms/op 0.82
altair processBlock - 250000 vs - 7PWei worstcase hashState 82.287 ms/op 92.145 ms/op 0.89
phase0 processBlock - 250000 vs - 7PWei normalcase 1.7033 ms/op 2.0377 ms/op 0.84
phase0 processBlock - 250000 vs - 7PWei worstcase 22.130 ms/op 29.786 ms/op 0.74
altair processEth1Data - 250000 vs - 7PWei normalcase 259.61 us/op 352.71 us/op 0.74
getExpectedWithdrawals 250000 eb:1,eth1:1,we:0,wn:0,smpl:15 5.4950 us/op 7.2330 us/op 0.76
getExpectedWithdrawals 250000 eb:0.95,eth1:0.1,we:0.05,wn:0,smpl:219 34.722 us/op 53.695 us/op 0.65
getExpectedWithdrawals 250000 eb:0.95,eth1:0.3,we:0.05,wn:0,smpl:42 5.5060 us/op 14.337 us/op 0.38
getExpectedWithdrawals 250000 eb:0.95,eth1:0.7,we:0.05,wn:0,smpl:18 11.048 us/op 7.8000 us/op 1.42
getExpectedWithdrawals 250000 eb:0.1,eth1:0.1,we:0,wn:0,smpl:1020 151.32 us/op 220.75 us/op 0.69
getExpectedWithdrawals 250000 eb:0.03,eth1:0.03,we:0,wn:0,smpl:11777 1.4102 ms/op 1.9338 ms/op 0.73
getExpectedWithdrawals 250000 eb:0.01,eth1:0.01,we:0,wn:0,smpl:16384 1.9175 ms/op 2.4630 ms/op 0.78
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,smpl:16384 1.7796 ms/op 2.4457 ms/op 0.73
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,nocache,smpl:16384 4.3123 ms/op 4.8189 ms/op 0.89
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,smpl:16384 1.8640 ms/op 2.4481 ms/op 0.76
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,nocache,smpl:16384 3.7680 ms/op 4.8150 ms/op 0.78
Tree 40 250000 create 418.61 ms/op 469.92 ms/op 0.89
Tree 40 250000 get(125000) 103.05 ns/op 144.16 ns/op 0.71
Tree 40 250000 set(125000) 1.3112 us/op 1.6425 us/op 0.80
Tree 40 250000 toArray() 19.126 ms/op 19.462 ms/op 0.98
Tree 40 250000 iterate all - toArray() + loop 18.280 ms/op 19.618 ms/op 0.93
Tree 40 250000 iterate all - get(i) 49.449 ms/op 54.694 ms/op 0.90
Array 250000 create 2.8684 ms/op 2.5124 ms/op 1.14
Array 250000 clone - spread 694.70 us/op 822.62 us/op 0.84
Array 250000 get(125000) 0.57900 ns/op 0.42700 ns/op 1.36
Array 250000 set(125000) 0.59800 ns/op 0.43700 ns/op 1.37
Array 250000 iterate all - loop 103.64 us/op 84.903 us/op 1.22
phase0 afterProcessEpoch - 250000 vs - 7PWei 39.214 ms/op 42.898 ms/op 0.91
Array.fill - length 1000000 2.6018 ms/op 3.6272 ms/op 0.72
Array push - length 1000000 18.075 ms/op 15.947 ms/op 1.13
Array.get 0.25007 ns/op 0.29349 ns/op 0.85
Uint8Array.get 0.40127 ns/op 0.45025 ns/op 0.89
phase0 beforeProcessEpoch - 250000 vs - 7PWei 21.565 ms/op 18.191 ms/op 1.19
altair processEpoch - mainnet_e81889 296.86 ms/op 302.62 ms/op 0.98
mainnet_e81889 - altair beforeProcessEpoch 16.965 ms/op 22.290 ms/op 0.76
mainnet_e81889 - altair processJustificationAndFinalization 4.8590 us/op 5.4610 us/op 0.89
mainnet_e81889 - altair processInactivityUpdates 3.6669 ms/op 4.8164 ms/op 0.76
mainnet_e81889 - altair processRewardsAndPenalties 43.779 ms/op 42.621 ms/op 1.03
mainnet_e81889 - altair processRegistryUpdates 898.00 ns/op 693.00 ns/op 1.30
mainnet_e81889 - altair processSlashings 390.00 ns/op 213.00 ns/op 1.83
mainnet_e81889 - altair processEth1DataReset 389.00 ns/op 216.00 ns/op 1.80
mainnet_e81889 - altair processEffectiveBalanceUpdates 1.1320 ms/op 1.2207 ms/op 0.93
mainnet_e81889 - altair processSlashingsReset 1.2260 us/op 1.0260 us/op 1.19
mainnet_e81889 - altair processRandaoMixesReset 1.2740 us/op 1.2720 us/op 1.00
mainnet_e81889 - altair processHistoricalRootsUpdate 406.00 ns/op 206.00 ns/op 1.97
mainnet_e81889 - altair processParticipationFlagUpdates 777.00 ns/op 555.00 ns/op 1.40
mainnet_e81889 - altair processSyncCommitteeUpdates 414.00 ns/op 161.00 ns/op 2.57
mainnet_e81889 - altair afterProcessEpoch 40.918 ms/op 45.221 ms/op 0.90
capella processEpoch - mainnet_e217614 877.22 ms/op 987.40 ms/op 0.89
mainnet_e217614 - capella beforeProcessEpoch 56.932 ms/op 69.796 ms/op 0.82
mainnet_e217614 - capella processJustificationAndFinalization 4.3160 us/op 5.4850 us/op 0.79
mainnet_e217614 - capella processInactivityUpdates 11.200 ms/op 14.807 ms/op 0.76
mainnet_e217614 - capella processRewardsAndPenalties 203.08 ms/op 191.89 ms/op 1.06
mainnet_e217614 - capella processRegistryUpdates 6.0350 us/op 7.6720 us/op 0.79
mainnet_e217614 - capella processSlashings 380.00 ns/op 210.00 ns/op 1.81
mainnet_e217614 - capella processEth1DataReset 378.00 ns/op 195.00 ns/op 1.94
mainnet_e217614 - capella processEffectiveBalanceUpdates 10.220 ms/op 15.166 ms/op 0.67
mainnet_e217614 - capella processSlashingsReset 1.0980 us/op 967.00 ns/op 1.14
mainnet_e217614 - capella processRandaoMixesReset 1.3650 us/op 1.3470 us/op 1.01
mainnet_e217614 - capella processHistoricalRootsUpdate 380.00 ns/op 203.00 ns/op 1.87
mainnet_e217614 - capella processParticipationFlagUpdates 683.00 ns/op 603.00 ns/op 1.13
mainnet_e217614 - capella afterProcessEpoch 110.35 ms/op 122.50 ms/op 0.90
phase0 processEpoch - mainnet_e58758 289.41 ms/op 316.93 ms/op 0.91
mainnet_e58758 - phase0 beforeProcessEpoch 70.438 ms/op 87.749 ms/op 0.80
mainnet_e58758 - phase0 processJustificationAndFinalization 4.9680 us/op 6.3270 us/op 0.79
mainnet_e58758 - phase0 processRewardsAndPenalties 39.879 ms/op 42.066 ms/op 0.95
mainnet_e58758 - phase0 processRegistryUpdates 2.7770 us/op 4.0340 us/op 0.69
mainnet_e58758 - phase0 processSlashings 395.00 ns/op 323.00 ns/op 1.22
mainnet_e58758 - phase0 processEth1DataReset 389.00 ns/op 227.00 ns/op 1.71
mainnet_e58758 - phase0 processEffectiveBalanceUpdates 975.75 us/op 1.3700 ms/op 0.71
mainnet_e58758 - phase0 processSlashingsReset 961.00 ns/op 976.00 ns/op 0.98
mainnet_e58758 - phase0 processRandaoMixesReset 1.2060 us/op 1.2870 us/op 0.94
mainnet_e58758 - phase0 processHistoricalRootsUpdate 396.00 ns/op 201.00 ns/op 1.97
mainnet_e58758 - phase0 processParticipationRecordUpdates 1.1590 us/op 990.00 ns/op 1.17
mainnet_e58758 - phase0 afterProcessEpoch 29.378 ms/op 36.623 ms/op 0.80
phase0 processEffectiveBalanceUpdates - 250000 normalcase 1.0058 ms/op 1.3838 ms/op 0.73
phase0 processEffectiveBalanceUpdates - 250000 worstcase 0.5 1.4077 ms/op 3.3172 ms/op 0.42
altair processInactivityUpdates - 250000 normalcase 15.205 ms/op 20.320 ms/op 0.75
altair processInactivityUpdates - 250000 worstcase 18.775 ms/op 19.231 ms/op 0.98
phase0 processRegistryUpdates - 250000 normalcase 4.7880 us/op 6.5770 us/op 0.73
phase0 processRegistryUpdates - 250000 badcase_full_deposits 311.26 us/op 285.90 us/op 1.09
phase0 processRegistryUpdates - 250000 worstcase 0.5 109.71 ms/op 119.51 ms/op 0.92
altair processRewardsAndPenalties - 250000 normalcase 24.131 ms/op 37.875 ms/op 0.64
altair processRewardsAndPenalties - 250000 worstcase 29.167 ms/op 25.740 ms/op 1.13
phase0 getAttestationDeltas - 250000 normalcase 5.3554 ms/op 8.5499 ms/op 0.63
phase0 getAttestationDeltas - 250000 worstcase 4.8377 ms/op 6.1334 ms/op 0.79
phase0 processSlashings - 250000 worstcase 89.199 us/op 131.30 us/op 0.68
altair processSyncCommitteeUpdates - 250000 9.7120 ms/op 11.299 ms/op 0.86
BeaconState.hashTreeRoot - No change 425.00 ns/op 289.00 ns/op 1.47
BeaconState.hashTreeRoot - 1 full validator 66.391 us/op 75.302 us/op 0.88
BeaconState.hashTreeRoot - 32 full validator 850.43 us/op 876.61 us/op 0.97
BeaconState.hashTreeRoot - 512 full validator 10.268 ms/op 9.5722 ms/op 1.07
BeaconState.hashTreeRoot - 1 validator.effectiveBalance 89.062 us/op 91.228 us/op 0.98
BeaconState.hashTreeRoot - 32 validator.effectiveBalance 1.1932 ms/op 1.6963 ms/op 0.70
BeaconState.hashTreeRoot - 512 validator.effectiveBalance 23.665 ms/op 29.283 ms/op 0.81
BeaconState.hashTreeRoot - 1 balances 63.212 us/op 75.922 us/op 0.83
BeaconState.hashTreeRoot - 32 balances 708.60 us/op 674.10 us/op 1.05
BeaconState.hashTreeRoot - 512 balances 5.5068 ms/op 8.8320 ms/op 0.62
BeaconState.hashTreeRoot - 250000 balances 158.49 ms/op 166.76 ms/op 0.95
aggregationBits - 2048 els - zipIndexesInBitList 17.984 us/op 22.010 us/op 0.82
byteArrayEquals 32 39.525 ns/op 54.231 ns/op 0.73
Buffer.compare 32 14.210 ns/op 17.524 ns/op 0.81
byteArrayEquals 1024 1.1520 us/op 1.6104 us/op 0.72
Buffer.compare 1024 21.980 ns/op 25.066 ns/op 0.88
byteArrayEquals 16384 18.333 us/op 25.701 us/op 0.71
Buffer.compare 16384 175.56 ns/op 203.35 ns/op 0.86
byteArrayEquals 123687377 149.57 ms/op 193.24 ms/op 0.77
Buffer.compare 123687377 3.9734 ms/op 7.9755 ms/op 0.50
byteArrayEquals 32 - diff last byte 42.066 ns/op 53.195 ns/op 0.79
Buffer.compare 32 - diff last byte 15.860 ns/op 17.392 ns/op 0.91
byteArrayEquals 1024 - diff last byte 1.2602 us/op 1.6108 us/op 0.78
Buffer.compare 1024 - diff last byte 24.676 ns/op 25.594 ns/op 0.96
byteArrayEquals 16384 - diff last byte 20.057 us/op 26.138 us/op 0.77
Buffer.compare 16384 - diff last byte 167.57 ns/op 204.38 ns/op 0.82
byteArrayEquals 123687377 - diff last byte 151.59 ms/op 195.67 ms/op 0.77
Buffer.compare 123687377 - diff last byte 3.8968 ms/op 8.2003 ms/op 0.48
byteArrayEquals 32 - random bytes 4.8740 ns/op 5.1940 ns/op 0.94
Buffer.compare 32 - random bytes 16.204 ns/op 17.546 ns/op 0.92
byteArrayEquals 1024 - random bytes 4.8440 ns/op 5.2880 ns/op 0.92
Buffer.compare 1024 - random bytes 15.041 ns/op 17.449 ns/op 0.86
byteArrayEquals 16384 - random bytes 4.8430 ns/op 5.1500 ns/op 0.94
Buffer.compare 16384 - random bytes 15.940 ns/op 17.058 ns/op 0.93
byteArrayEquals 123687377 - random bytes 7.8800 ns/op 6.6000 ns/op 1.19
Buffer.compare 123687377 - random bytes 19.190 ns/op 19.050 ns/op 1.01
regular array get 100000 times 40.578 us/op 42.282 us/op 0.96
wrappedArray get 100000 times 40.579 us/op 45.439 us/op 0.89
arrayWithProxy get 100000 times 10.058 ms/op 12.482 ms/op 0.81
ssz.Root.equals 39.562 ns/op 47.935 ns/op 0.83
byteArrayEquals 38.964 ns/op 47.674 ns/op 0.82
Buffer.compare 9.4830 ns/op 10.740 ns/op 0.88
processSlot - 1 slots 8.2240 us/op 11.176 us/op 0.74
processSlot - 32 slots 1.8592 ms/op 2.7323 ms/op 0.68
getEffectiveBalanceIncrementsZeroInactive - 250000 vs - 7PWei 2.0656 ms/op 3.5725 ms/op 0.58
getCommitteeAssignments - req 1 vs - 250000 vc 1.7988 ms/op 2.2179 ms/op 0.81
getCommitteeAssignments - req 100 vs - 250000 vc 3.5207 ms/op 4.2730 ms/op 0.82
getCommitteeAssignments - req 1000 vs - 250000 vc 3.7513 ms/op 4.5137 ms/op 0.83
findModifiedValidators - 10000 modified validators 753.35 ms/op 783.36 ms/op 0.96
findModifiedValidators - 1000 modified validators 653.53 ms/op 744.93 ms/op 0.88
findModifiedValidators - 100 modified validators 170.50 ms/op 282.58 ms/op 0.60
findModifiedValidators - 10 modified validators 119.70 ms/op 147.12 ms/op 0.81
findModifiedValidators - 1 modified validators 158.40 ms/op 154.18 ms/op 1.03
findModifiedValidators - no difference 169.64 ms/op 154.66 ms/op 1.10
compare ViewDUs 5.8301 s/op 6.6787 s/op 0.87
compare each validator Uint8Array 1.4695 s/op 1.8794 s/op 0.78
compare ViewDU to Uint8Array 822.05 ms/op 1.2292 s/op 0.67
migrate state 1000000 validators, 24 modified, 0 new 798.40 ms/op 896.91 ms/op 0.89
migrate state 1000000 validators, 1700 modified, 1000 new 999.76 ms/op 1.2120 s/op 0.82
migrate state 1000000 validators, 3400 modified, 2000 new 1.2982 s/op 1.4699 s/op 0.88
migrate state 1500000 validators, 24 modified, 0 new 936.02 ms/op 971.57 ms/op 0.96
migrate state 1500000 validators, 1700 modified, 1000 new 1.1915 s/op 1.2424 s/op 0.96
migrate state 1500000 validators, 3400 modified, 2000 new 1.3334 s/op 1.3291 s/op 1.00
RootCache.getBlockRootAtSlot - 250000 vs - 7PWei 5.8300 ns/op 4.1800 ns/op 1.39
state getBlockRootAtSlot - 250000 vs - 7PWei 432.01 ns/op 692.33 ns/op 0.62
naive computeProposerIndex 100000 validators 38.567 ms/op 52.115 ms/op 0.74
computeProposerIndex 100000 validators 1.3213 ms/op 1.5562 ms/op 0.85
naiveGetNextSyncCommitteeIndices 1000 validators 5.8488 s/op 8.3022 s/op 0.70
getNextSyncCommitteeIndices 1000 validators 93.704 ms/op 116.92 ms/op 0.80
naiveGetNextSyncCommitteeIndices 10000 validators 7.2238 s/op 7.7506 s/op 0.93
getNextSyncCommitteeIndices 10000 validators 88.043 ms/op 132.62 ms/op 0.66
naiveGetNextSyncCommitteeIndices 100000 validators 6.6835 s/op 8.8127 s/op 0.76
getNextSyncCommitteeIndices 100000 validators 92.558 ms/op 112.80 ms/op 0.82
naive computeShuffledIndex 100000 validators 20.285 s/op 26.645 s/op 0.76
cached computeShuffledIndex 100000 validators 463.61 ms/op 561.43 ms/op 0.83
naive computeShuffledIndex 2000000 validators 410.90 s/op 509.91 s/op 0.81
cached computeShuffledIndex 2000000 validators 18.176 s/op 39.765 s/op 0.46
computeProposers - vc 250000 544.48 us/op 620.00 us/op 0.88
computeEpochShuffling - vc 250000 38.650 ms/op 43.662 ms/op 0.89
getNextSyncCommittee - vc 250000 9.2564 ms/op 10.859 ms/op 0.85
computeSigningRoot for AttestationData 15.556 us/op 23.505 us/op 0.66
hash AttestationData serialized data then Buffer.toString(base64) 1.1683 us/op 1.5771 us/op 0.74
toHexString serialized data 952.32 ns/op 1.2804 us/op 0.74
Buffer.toString(base64) 102.03 ns/op 155.38 ns/op 0.66
nodejs block root to RootHex using toHex 110.20 ns/op 142.53 ns/op 0.77
nodejs block root to RootHex using toRootHex 76.970 ns/op 86.528 ns/op 0.89
nodejs fromhex(blob) 84.280 ms/op 115.85 ms/op 0.73
nodejs fromHexInto(blob) 80.605 ms/op 94.326 ms/op 0.85
browser block root to RootHex using the deprecated toHexString 187.79 ns/op 214.50 ns/op 0.88
browser block root to RootHex using toHex 151.04 ns/op 172.22 ns/op 0.88
browser block root to RootHex using toRootHex 137.67 ns/op 165.65 ns/op 0.83
browser fromHexInto(blob) 627.17 us/op 828.66 us/op 0.76
browser fromHex(blob) 603.57 ms/op 790.68 ms/op 0.76

by benchmarkbot/action

@nflaig nflaig merged commit 6494939 into unstable Sep 23, 2025
28 of 33 checks passed
@nflaig nflaig deleted the cayman/bun-exports branch September 23, 2025 11:19
nflaig pushed a commit that referenced this pull request Sep 23, 2025
**Motivation**

- #7280 

**Description**

- combined with #8448, `surpressTranspileTS: true` is needed for workers
to use typescript source directly without transpiling it (and
incorrectly loading it via a commonjs loader)
- avoid worker `resourceLimits` - Bun doesn't implement it, it throws if
you use it
- use `datastore-fs` instead of `datastore-level` for backing our libp2p
database -- Note this is changed unilaterally (affecting current nodejs
usage)
- use assemblyscript chacha20-poly1305 - bun doesn't support the native
crypto implementation
@wemeetagain
Copy link
Member Author

🎉 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