Skip to content

Conversation

@rnfairchild
Copy link

@rnfairchild rnfairchild commented Jan 26, 2026

Motivation

Description

  • Replace bigint-buffer with @vekexasia/bigint-buffer2
  • The old implementation returned a buffer regardless of context, new implementation returns a buffer when in a browser and an Uint8Array in Node, unit/browser tests were fixed to accept either.

Closes #8771

@rnfairchild rnfairchild requested a review from a team as a code owner January 26, 2026 22:36
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @rnfairchild, 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 systematically replaces the bigint-buffer dependency with @vekexasia/bigint-buffer2 across several core packages. The change involves updating package manifests, modifying import statements in relevant source and test files, and regenerating the lockfile to reflect the new dependency. This update is a maintenance chore aimed at improving the underlying BigInt to Buffer conversion utility.

Highlights

  • Dependency Update: The bigint-buffer library has been replaced with @vekexasia/bigint-buffer2 across the codebase.
  • Scope of Change: This change affects the state-transition, utils, and validator packages, including their package.json files, source code, and test files.
  • Motivation: This replacement addresses issue Consider switching to @vekexasia/bigint-buffer2 #8771, aiming to improve or update the handling of BigInt to Buffer conversions.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

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 successfully replaces the bigint-buffer package with @vekexasia/bigint-buffer2 across the codebase. The changes are consistent in package.json files, import statements, and the pnpm-lock.yaml file. A positive side effect of this replacement is the removal of several transitive dependencies (bindings, file-uri-to-path), which simplifies the dependency tree. The changes appear correct and well-contained to the stated motivation.

@github-actions
Copy link
Contributor

github-actions bot commented Jan 26, 2026

Performance Report

✔️ no performance regression detected

Full benchmark results
Benchmark suite Current: 3128d07 Previous: ba0be92 Ratio
getPubkeys - index2pubkey - req 1000 vs - 250000 vc 1.0164 ms/op 950.89 us/op 1.07
getPubkeys - validatorsArr - req 1000 vs - 250000 vc 32.087 us/op 31.925 us/op 1.01
BLS verify - blst 909.46 us/op 903.64 us/op 1.01
BLS verifyMultipleSignatures 3 - blst 1.3082 ms/op 1.2893 ms/op 1.01
BLS verifyMultipleSignatures 8 - blst 2.0572 ms/op 1.9234 ms/op 1.07
BLS verifyMultipleSignatures 32 - blst 4.5133 ms/op 4.4931 ms/op 1.00
BLS verifyMultipleSignatures 64 - blst 8.5056 ms/op 8.1819 ms/op 1.04
BLS verifyMultipleSignatures 128 - blst 16.012 ms/op 15.756 ms/op 1.02
BLS deserializing 10000 signatures 606.13 ms/op 600.03 ms/op 1.01
BLS deserializing 100000 signatures 6.0838 s/op 6.0865 s/op 1.00
BLS verifyMultipleSignatures - same message - 3 - blst 953.58 us/op 973.61 us/op 0.98
BLS verifyMultipleSignatures - same message - 8 - blst 1.0865 ms/op 1.0377 ms/op 1.05
BLS verifyMultipleSignatures - same message - 32 - blst 1.5549 ms/op 1.7268 ms/op 0.90
BLS verifyMultipleSignatures - same message - 64 - blst 2.4671 ms/op 2.5123 ms/op 0.98
BLS verifyMultipleSignatures - same message - 128 - blst 4.2900 ms/op 4.1244 ms/op 1.04
BLS aggregatePubkeys 32 - blst 17.777 us/op 17.833 us/op 1.00
BLS aggregatePubkeys 128 - blst 63.144 us/op 62.295 us/op 1.01
getSlashingsAndExits - default max 53.901 us/op 42.961 us/op 1.25
getSlashingsAndExits - 2k 359.49 us/op 329.31 us/op 1.09
isKnown best case - 1 super set check 412.00 ns/op 397.00 ns/op 1.04
isKnown normal case - 2 super set checks 404.00 ns/op 394.00 ns/op 1.03
isKnown worse case - 16 super set checks 400.00 ns/op 394.00 ns/op 1.02
InMemoryCheckpointStateCache - add get delete 2.0340 us/op 2.1550 us/op 0.94
validate api signedAggregateAndProof - struct 1.3777 ms/op 1.5184 ms/op 0.91
validate gossip signedAggregateAndProof - struct 1.5963 ms/op 1.4323 ms/op 1.11
batch validate gossip attestation - vc 640000 - chunk 32 107.07 us/op 105.60 us/op 1.01
batch validate gossip attestation - vc 640000 - chunk 64 93.105 us/op 92.710 us/op 1.00
batch validate gossip attestation - vc 640000 - chunk 128 85.808 us/op 84.402 us/op 1.02
batch validate gossip attestation - vc 640000 - chunk 256 81.390 us/op 80.215 us/op 1.01
bytes32 toHexString 515.00 ns/op 503.00 ns/op 1.02
bytes32 Buffer.toString(hex) 392.00 ns/op 387.00 ns/op 1.01
bytes32 Buffer.toString(hex) from Uint8Array 473.00 ns/op 467.00 ns/op 1.01
bytes32 Buffer.toString(hex) + 0x 394.00 ns/op 388.00 ns/op 1.02
Return object 10000 times 0.22470 ns/op 0.22550 ns/op 1.00
Throw Error 10000 times 3.1146 us/op 3.3130 us/op 0.94
toHex 95.933 ns/op 101.47 ns/op 0.95
Buffer.from 88.132 ns/op 94.268 ns/op 0.93
shared Buffer 57.893 ns/op 66.112 ns/op 0.88
fastMsgIdFn sha256 / 200 bytes 1.6270 us/op 1.7090 us/op 0.95
fastMsgIdFn h32 xxhash / 200 bytes 370.00 ns/op 365.00 ns/op 1.01
fastMsgIdFn h64 xxhash / 200 bytes 418.00 ns/op 533.00 ns/op 0.78
fastMsgIdFn sha256 / 1000 bytes 4.7590 us/op 5.0320 us/op 0.95
fastMsgIdFn h32 xxhash / 1000 bytes 453.00 ns/op 448.00 ns/op 1.01
fastMsgIdFn h64 xxhash / 1000 bytes 465.00 ns/op 462.00 ns/op 1.01
fastMsgIdFn sha256 / 10000 bytes 40.635 us/op 42.238 us/op 0.96
fastMsgIdFn h32 xxhash / 10000 bytes 1.4270 us/op 1.4690 us/op 0.97
fastMsgIdFn h64 xxhash / 10000 bytes 1.0050 us/op 1.0320 us/op 0.97
send data - 1000 256B messages 12.408 ms/op 10.965 ms/op 1.13
send data - 1000 512B messages 13.955 ms/op 12.538 ms/op 1.11
send data - 1000 1024B messages 21.293 ms/op 17.592 ms/op 1.21
send data - 1000 1200B messages 17.204 ms/op 18.117 ms/op 0.95
send data - 1000 2048B messages 19.762 ms/op 17.310 ms/op 1.14
send data - 1000 4096B messages 19.659 ms/op 16.364 ms/op 1.20
send data - 1000 16384B messages 98.408 ms/op 95.783 ms/op 1.03
send data - 1000 65536B messages 207.47 ms/op 180.69 ms/op 1.15
enrSubnets - fastDeserialize 64 bits 1000.0 ns/op 936.00 ns/op 1.07
enrSubnets - ssz BitVector 64 bits 506.00 ns/op 517.00 ns/op 0.98
enrSubnets - fastDeserialize 4 bits 323.00 ns/op 328.00 ns/op 0.98
enrSubnets - ssz BitVector 4 bits 502.00 ns/op 512.00 ns/op 0.98
prioritizePeers score -10:0 att 32-0.1 sync 2-0 206.23 us/op 256.78 us/op 0.80
prioritizePeers score 0:0 att 32-0.25 sync 2-0.25 257.09 us/op 283.40 us/op 0.91
prioritizePeers score 0:0 att 32-0.5 sync 2-0.5 347.82 us/op 390.28 us/op 0.89
prioritizePeers score 0:0 att 64-0.75 sync 4-0.75 657.98 us/op 744.12 us/op 0.88
prioritizePeers score 0:0 att 64-1 sync 4-1 761.61 us/op 837.61 us/op 0.91
array of 16000 items push then shift 1.2240 us/op 1.2801 us/op 0.96
LinkedList of 16000 items push then shift 7.8970 ns/op 7.0900 ns/op 1.11
array of 16000 items push then pop 66.784 ns/op 64.689 ns/op 1.03
LinkedList of 16000 items push then pop 6.6160 ns/op 6.3400 ns/op 1.04
array of 24000 items push then shift 1.9167 us/op 1.8895 us/op 1.01
LinkedList of 24000 items push then shift 7.1440 ns/op 6.6250 ns/op 1.08
array of 24000 items push then pop 94.577 ns/op 89.852 ns/op 1.05
LinkedList of 24000 items push then pop 6.5050 ns/op 6.3090 ns/op 1.03
intersect bitArray bitLen 8 4.9290 ns/op 5.0370 ns/op 0.98
intersect array and set length 8 30.038 ns/op 30.559 ns/op 0.98
intersect bitArray bitLen 128 26.336 ns/op 25.931 ns/op 1.02
intersect array and set length 128 496.77 ns/op 493.68 ns/op 1.01
bitArray.getTrueBitIndexes() bitLen 128 1.2140 us/op 1.2030 us/op 1.01
bitArray.getTrueBitIndexes() bitLen 248 1.8970 us/op 1.9080 us/op 0.99
bitArray.getTrueBitIndexes() bitLen 512 4.1320 us/op 3.7950 us/op 1.09
Full columns - reconstruct all 6 blobs 334.30 us/op 339.84 us/op 0.98
Full columns - reconstruct half of the blobs out of 6 95.146 us/op 91.483 us/op 1.04
Full columns - reconstruct single blob out of 6 27.993 us/op 33.157 us/op 0.84
Half columns - reconstruct all 6 blobs 241.54 ms/op 239.46 ms/op 1.01
Half columns - reconstruct half of the blobs out of 6 124.20 ms/op 121.11 ms/op 1.03
Half columns - reconstruct single blob out of 6 45.434 ms/op 43.814 ms/op 1.04
Full columns - reconstruct all 10 blobs 300.67 us/op 287.92 us/op 1.04
Full columns - reconstruct half of the blobs out of 10 155.75 us/op 180.81 us/op 0.86
Full columns - reconstruct single blob out of 10 28.723 us/op 29.007 us/op 0.99
Half columns - reconstruct all 10 blobs 399.37 ms/op 389.87 ms/op 1.02
Half columns - reconstruct half of the blobs out of 10 206.88 ms/op 195.68 ms/op 1.06
Half columns - reconstruct single blob out of 10 50.516 ms/op 45.189 ms/op 1.12
Full columns - reconstruct all 20 blobs 514.08 us/op 813.35 us/op 0.63
Full columns - reconstruct half of the blobs out of 20 303.76 us/op 402.96 us/op 0.75
Full columns - reconstruct single blob out of 20 28.179 us/op 26.137 us/op 1.08
Half columns - reconstruct all 20 blobs 984.39 ms/op 768.34 ms/op 1.28
Half columns - reconstruct half of the blobs out of 20 413.94 ms/op 389.89 ms/op 1.06
Half columns - reconstruct single blob out of 20 46.815 ms/op 44.209 ms/op 1.06
Set add up to 64 items then delete first 2.0048 us/op 1.4973 us/op 1.34
OrderedSet add up to 64 items then delete first 2.8839 us/op 2.3083 us/op 1.25
Set add up to 64 items then delete last 2.1107 us/op 1.7519 us/op 1.20
OrderedSet add up to 64 items then delete last 3.2963 us/op 2.6312 us/op 1.25
Set add up to 64 items then delete middle 2.3813 us/op 1.6923 us/op 1.41
OrderedSet add up to 64 items then delete middle 4.8196 us/op 4.1035 us/op 1.17
Set add up to 128 items then delete first 4.0757 us/op 3.4235 us/op 1.19
OrderedSet add up to 128 items then delete first 5.8494 us/op 5.1032 us/op 1.15
Set add up to 128 items then delete last 3.9032 us/op 3.3709 us/op 1.16
OrderedSet add up to 128 items then delete last 5.9837 us/op 5.1690 us/op 1.16
Set add up to 128 items then delete middle 3.8848 us/op 3.3138 us/op 1.17
OrderedSet add up to 128 items then delete middle 11.919 us/op 10.400 us/op 1.15
Set add up to 256 items then delete first 7.5620 us/op 6.6148 us/op 1.14
OrderedSet add up to 256 items then delete first 11.523 us/op 10.045 us/op 1.15
Set add up to 256 items then delete last 7.6556 us/op 6.4455 us/op 1.19
OrderedSet add up to 256 items then delete last 11.832 us/op 11.062 us/op 1.07
Set add up to 256 items then delete middle 7.5421 us/op 6.7650 us/op 1.11
OrderedSet add up to 256 items then delete middle 36.493 us/op 33.510 us/op 1.09
pass gossip attestations to forkchoice per slot 2.1323 ms/op 1.9516 ms/op 1.09
forkChoice updateHead vc 100000 bc 64 eq 0 391.75 us/op 363.45 us/op 1.08
forkChoice updateHead vc 600000 bc 64 eq 0 2.2278 ms/op 2.1466 ms/op 1.04
forkChoice updateHead vc 1000000 bc 64 eq 0 3.7265 ms/op 3.7488 ms/op 0.99
forkChoice updateHead vc 600000 bc 320 eq 0 2.2563 ms/op 2.1356 ms/op 1.06
forkChoice updateHead vc 600000 bc 1200 eq 0 2.2793 ms/op 2.1811 ms/op 1.05
forkChoice updateHead vc 600000 bc 7200 eq 0 2.6285 ms/op 3.0997 ms/op 0.85
forkChoice updateHead vc 600000 bc 64 eq 1000 2.9298 ms/op 3.2249 ms/op 0.91
forkChoice updateHead vc 600000 bc 64 eq 10000 2.9941 ms/op 3.2345 ms/op 0.93
forkChoice updateHead vc 600000 bc 64 eq 300000 7.2177 ms/op 7.5776 ms/op 0.95
computeDeltas 1400000 validators 0% inactive 12.720 ms/op 13.507 ms/op 0.94
computeDeltas 1400000 validators 10% inactive 11.854 ms/op 12.728 ms/op 0.93
computeDeltas 1400000 validators 20% inactive 10.802 ms/op 11.737 ms/op 0.92
computeDeltas 1400000 validators 50% inactive 8.4201 ms/op 9.2018 ms/op 0.92
computeDeltas 2100000 validators 0% inactive 19.108 ms/op 20.185 ms/op 0.95
computeDeltas 2100000 validators 10% inactive 17.877 ms/op 19.145 ms/op 0.93
computeDeltas 2100000 validators 20% inactive 16.310 ms/op 17.686 ms/op 0.92
computeDeltas 2100000 validators 50% inactive 12.636 ms/op 13.406 ms/op 0.94
altair processAttestation - 250000 vs - 7PWei normalcase 1.6273 ms/op 1.5824 ms/op 1.03
altair processAttestation - 250000 vs - 7PWei worstcase 2.3812 ms/op 2.3175 ms/op 1.03
altair processAttestation - setStatus - 1/6 committees join 86.786 us/op 85.341 us/op 1.02
altair processAttestation - setStatus - 1/3 committees join 167.00 us/op 161.84 us/op 1.03
altair processAttestation - setStatus - 1/2 committees join 248.94 us/op 250.35 us/op 0.99
altair processAttestation - setStatus - 2/3 committees join 330.39 us/op 326.99 us/op 1.01
altair processAttestation - setStatus - 4/5 committees join 470.96 us/op 464.16 us/op 1.01
altair processAttestation - setStatus - 100% committees join 559.03 us/op 556.14 us/op 1.01
altair processBlock - 250000 vs - 7PWei normalcase 3.6873 ms/op 3.4438 ms/op 1.07
altair processBlock - 250000 vs - 7PWei normalcase hashState 17.298 ms/op 15.219 ms/op 1.14
altair processBlock - 250000 vs - 7PWei worstcase 23.419 ms/op 21.966 ms/op 1.07
altair processBlock - 250000 vs - 7PWei worstcase hashState 50.590 ms/op 48.875 ms/op 1.04
phase0 processBlock - 250000 vs - 7PWei normalcase 1.4212 ms/op 1.1582 ms/op 1.23
phase0 processBlock - 250000 vs - 7PWei worstcase 22.437 ms/op 22.616 ms/op 0.99
altair processEth1Data - 250000 vs - 7PWei normalcase 279.95 us/op 260.57 us/op 1.07
getExpectedWithdrawals 250000 eb:1,eth1:1,we:0,wn:0,smpl:16 5.9560 us/op 3.0870 us/op 1.93
getExpectedWithdrawals 250000 eb:0.95,eth1:0.1,we:0.05,wn:0,smpl:220 35.555 us/op 25.167 us/op 1.41
getExpectedWithdrawals 250000 eb:0.95,eth1:0.3,we:0.05,wn:0,smpl:43 9.7850 us/op 8.9050 us/op 1.10
getExpectedWithdrawals 250000 eb:0.95,eth1:0.7,we:0.05,wn:0,smpl:19 6.8680 us/op 7.1580 us/op 0.96
getExpectedWithdrawals 250000 eb:0.1,eth1:0.1,we:0,wn:0,smpl:1021 151.16 us/op 128.72 us/op 1.17
getExpectedWithdrawals 250000 eb:0.03,eth1:0.03,we:0,wn:0,smpl:11778 1.3891 ms/op 1.3107 ms/op 1.06
getExpectedWithdrawals 250000 eb:0.01,eth1:0.01,we:0,wn:0,smpl:16384 1.8304 ms/op 1.7872 ms/op 1.02
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,smpl:16384 1.8044 ms/op 1.6873 ms/op 1.07
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,nocache,smpl:16384 3.5721 ms/op 3.6380 ms/op 0.98
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,smpl:16384 2.1542 ms/op 2.0008 ms/op 1.08
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,nocache,smpl:16384 4.0633 ms/op 3.9562 ms/op 1.03
Tree 40 250000 create 311.38 ms/op 301.41 ms/op 1.03
Tree 40 250000 get(125000) 92.883 ns/op 103.45 ns/op 0.90
Tree 40 250000 set(125000) 1.0308 us/op 1.0819 us/op 0.95
Tree 40 250000 toArray() 9.5671 ms/op 9.6596 ms/op 0.99
Tree 40 250000 iterate all - toArray() + loop 9.7230 ms/op 9.6392 ms/op 1.01
Tree 40 250000 iterate all - get(i) 33.234 ms/op 33.560 ms/op 0.99
Array 250000 create 2.1956 ms/op 2.0344 ms/op 1.08
Array 250000 clone - spread 649.57 us/op 618.45 us/op 1.05
Array 250000 get(125000) 0.51300 ns/op 0.48700 ns/op 1.05
Array 250000 set(125000) 0.51300 ns/op 0.49200 ns/op 1.04
Array 250000 iterate all - loop 57.723 us/op 54.824 us/op 1.05
phase0 afterProcessEpoch - 250000 vs - 7PWei 38.341 ms/op 36.643 ms/op 1.05
Array.fill - length 1000000 2.2345 ms/op 2.3074 ms/op 0.97
Array push - length 1000000 7.8172 ms/op 8.0809 ms/op 0.97
Array.get 0.20644 ns/op 0.19464 ns/op 1.06
Uint8Array.get 0.20870 ns/op 0.20328 ns/op 1.03
phase0 beforeProcessEpoch - 250000 vs - 7PWei 15.325 ms/op 13.850 ms/op 1.11
altair processEpoch - mainnet_e81889 224.59 ms/op 206.58 ms/op 1.09
mainnet_e81889 - altair beforeProcessEpoch 13.972 ms/op 13.937 ms/op 1.00
mainnet_e81889 - altair processJustificationAndFinalization 4.8350 us/op 4.7010 us/op 1.03
mainnet_e81889 - altair processInactivityUpdates 3.7154 ms/op 3.4870 ms/op 1.07
mainnet_e81889 - altair processRewardsAndPenalties 15.620 ms/op 15.851 ms/op 0.99
mainnet_e81889 - altair processRegistryUpdates 820.00 ns/op 805.00 ns/op 1.02
mainnet_e81889 - altair processSlashings 407.00 ns/op 434.00 ns/op 0.94
mainnet_e81889 - altair processEth1DataReset 385.00 ns/op 451.00 ns/op 0.85
mainnet_e81889 - altair processEffectiveBalanceUpdates 4.0776 ms/op 1.1961 ms/op 3.41
mainnet_e81889 - altair processSlashingsReset 1.1810 us/op 1.0520 us/op 1.12
mainnet_e81889 - altair processRandaoMixesReset 1.4190 us/op 1.1210 us/op 1.27
mainnet_e81889 - altair processHistoricalRootsUpdate 389.00 ns/op 359.00 ns/op 1.08
mainnet_e81889 - altair processParticipationFlagUpdates 713.00 ns/op 668.00 ns/op 1.07
mainnet_e81889 - altair processSyncCommitteeUpdates 356.00 ns/op 324.00 ns/op 1.10
mainnet_e81889 - altair afterProcessEpoch 39.635 ms/op 40.525 ms/op 0.98
capella processEpoch - mainnet_e217614 762.01 ms/op 801.81 ms/op 0.95
mainnet_e217614 - capella beforeProcessEpoch 56.835 ms/op 62.113 ms/op 0.92
mainnet_e217614 - capella processJustificationAndFinalization 5.1230 us/op 5.1430 us/op 1.00
mainnet_e217614 - capella processInactivityUpdates 18.449 ms/op 15.933 ms/op 1.16
mainnet_e217614 - capella processRewardsAndPenalties 89.695 ms/op 99.029 ms/op 0.91
mainnet_e217614 - capella processRegistryUpdates 4.9140 us/op 4.7900 us/op 1.03
mainnet_e217614 - capella processSlashings 396.00 ns/op 499.00 ns/op 0.79
mainnet_e217614 - capella processEth1DataReset 377.00 ns/op 353.00 ns/op 1.07
mainnet_e217614 - capella processEffectiveBalanceUpdates 6.1322 ms/op 22.382 ms/op 0.27
mainnet_e217614 - capella processSlashingsReset 995.00 ns/op 1.1270 us/op 0.88
mainnet_e217614 - capella processRandaoMixesReset 1.4590 us/op 1.4590 us/op 1.00
mainnet_e217614 - capella processHistoricalRootsUpdate 395.00 ns/op 393.00 ns/op 1.01
mainnet_e217614 - capella processParticipationFlagUpdates 711.00 ns/op 678.00 ns/op 1.05
mainnet_e217614 - capella afterProcessEpoch 106.91 ms/op 105.07 ms/op 1.02
phase0 processEpoch - mainnet_e58758 232.64 ms/op 225.51 ms/op 1.03
mainnet_e58758 - phase0 beforeProcessEpoch 66.407 ms/op 53.255 ms/op 1.25
mainnet_e58758 - phase0 processJustificationAndFinalization 6.0690 us/op 6.0710 us/op 1.00
mainnet_e58758 - phase0 processRewardsAndPenalties 15.646 ms/op 17.069 ms/op 0.92
mainnet_e58758 - phase0 processRegistryUpdates 2.6500 us/op 2.4890 us/op 1.06
mainnet_e58758 - phase0 processSlashings 391.00 ns/op 398.00 ns/op 0.98
mainnet_e58758 - phase0 processEth1DataReset 388.00 ns/op 399.00 ns/op 0.97
mainnet_e58758 - phase0 processEffectiveBalanceUpdates 816.95 us/op 1.1757 ms/op 0.69
mainnet_e58758 - phase0 processSlashingsReset 1.2290 us/op 1.2630 us/op 0.97
mainnet_e58758 - phase0 processRandaoMixesReset 1.3430 us/op 1.3740 us/op 0.98
mainnet_e58758 - phase0 processHistoricalRootsUpdate 422.00 ns/op 360.00 ns/op 1.17
mainnet_e58758 - phase0 processParticipationRecordUpdates 1.2120 us/op 1.1780 us/op 1.03
mainnet_e58758 - phase0 afterProcessEpoch 35.020 ms/op 34.296 ms/op 1.02
phase0 processEffectiveBalanceUpdates - 250000 normalcase 1.0280 ms/op 1.6168 ms/op 0.64
phase0 processEffectiveBalanceUpdates - 250000 worstcase 0.5 1.6080 ms/op 1.7449 ms/op 0.92
altair processInactivityUpdates - 250000 normalcase 11.318 ms/op 13.816 ms/op 0.82
altair processInactivityUpdates - 250000 worstcase 11.738 ms/op 12.131 ms/op 0.97
phase0 processRegistryUpdates - 250000 normalcase 6.6000 us/op 6.8010 us/op 0.97
phase0 processRegistryUpdates - 250000 badcase_full_deposits 213.78 us/op 159.08 us/op 1.34
phase0 processRegistryUpdates - 250000 worstcase 0.5 69.847 ms/op 75.097 ms/op 0.93
altair processRewardsAndPenalties - 250000 normalcase 15.500 ms/op 18.446 ms/op 0.84
altair processRewardsAndPenalties - 250000 worstcase 14.529 ms/op 15.434 ms/op 0.94
phase0 getAttestationDeltas - 250000 normalcase 4.5961 ms/op 5.9704 ms/op 0.77
phase0 getAttestationDeltas - 250000 worstcase 4.6880 ms/op 5.5272 ms/op 0.85
phase0 processSlashings - 250000 worstcase 74.899 us/op 94.918 us/op 0.79
altair processSyncCommitteeUpdates - 250000 10.400 ms/op 11.467 ms/op 0.91
BeaconState.hashTreeRoot - No change 428.00 ns/op 432.00 ns/op 0.99
BeaconState.hashTreeRoot - 1 full validator 73.553 us/op 81.371 us/op 0.90
BeaconState.hashTreeRoot - 32 full validator 1.1116 ms/op 779.25 us/op 1.43
BeaconState.hashTreeRoot - 512 full validator 7.0586 ms/op 10.042 ms/op 0.70
BeaconState.hashTreeRoot - 1 validator.effectiveBalance 87.795 us/op 111.32 us/op 0.79
BeaconState.hashTreeRoot - 32 validator.effectiveBalance 1.3013 ms/op 1.6722 ms/op 0.78
BeaconState.hashTreeRoot - 512 validator.effectiveBalance 13.863 ms/op 21.116 ms/op 0.66
BeaconState.hashTreeRoot - 1 balances 67.479 us/op 93.149 us/op 0.72
BeaconState.hashTreeRoot - 32 balances 625.31 us/op 795.10 us/op 0.79
BeaconState.hashTreeRoot - 512 balances 4.7670 ms/op 5.9871 ms/op 0.80
BeaconState.hashTreeRoot - 250000 balances 175.17 ms/op 189.57 ms/op 0.92
aggregationBits - 2048 els - zipIndexesInBitList 19.838 us/op 20.340 us/op 0.98
regular array get 100000 times 30.820 us/op 22.713 us/op 1.36
wrappedArray get 100000 times 23.056 us/op 26.560 us/op 0.87
arrayWithProxy get 100000 times 10.659 ms/op 11.261 ms/op 0.95
ssz.Root.equals 21.744 ns/op 21.541 ns/op 1.01
byteArrayEquals 21.044 ns/op 26.478 ns/op 0.79
Buffer.compare 9.2420 ns/op 8.8930 ns/op 1.04
processSlot - 1 slots 10.514 us/op 11.460 us/op 0.92
processSlot - 32 slots 2.3498 ms/op 2.3842 ms/op 0.99
getEffectiveBalanceIncrementsZeroInactive - 250000 vs - 7PWei 5.5497 ms/op 4.7699 ms/op 1.16
getCommitteeAssignments - req 1 vs - 250000 vc 1.7069 ms/op 1.6833 ms/op 1.01
getCommitteeAssignments - req 100 vs - 250000 vc 3.4352 ms/op 3.5185 ms/op 0.98
getCommitteeAssignments - req 1000 vs - 250000 vc 3.6767 ms/op 3.7116 ms/op 0.99
findModifiedValidators - 10000 modified validators 579.98 ms/op 631.00 ms/op 0.92
findModifiedValidators - 1000 modified validators 414.73 ms/op 408.78 ms/op 1.01
findModifiedValidators - 100 modified validators 302.91 ms/op 292.73 ms/op 1.03
findModifiedValidators - 10 modified validators 220.13 ms/op 240.86 ms/op 0.91
findModifiedValidators - 1 modified validators 126.47 ms/op 206.33 ms/op 0.61
findModifiedValidators - no difference 141.55 ms/op 202.03 ms/op 0.70
migrate state 1500000 validators, 3400 modified, 2000 new 905.37 ms/op 884.99 ms/op 1.02
RootCache.getBlockRootAtSlot - 250000 vs - 7PWei 5.8900 ns/op 5.9200 ns/op 0.99
state getBlockRootAtSlot - 250000 vs - 7PWei 425.43 ns/op 522.23 ns/op 0.81
computeProposerIndex 100000 validators 1.3793 ms/op 1.3468 ms/op 1.02
getNextSyncCommitteeIndices 1000 validators 103.01 ms/op 105.58 ms/op 0.98
getNextSyncCommitteeIndices 10000 validators 103.14 ms/op 102.90 ms/op 1.00
getNextSyncCommitteeIndices 100000 validators 103.35 ms/op 110.98 ms/op 0.93
computeProposers - vc 250000 551.13 us/op 636.11 us/op 0.87
computeEpochShuffling - vc 250000 38.630 ms/op 40.422 ms/op 0.96
getNextSyncCommittee - vc 250000 9.6058 ms/op 10.154 ms/op 0.95
nodejs block root to RootHex using toHex 111.35 ns/op 112.43 ns/op 0.99
nodejs block root to RootHex using toRootHex 72.336 ns/op 73.057 ns/op 0.99
nodejs fromHex(blob) 214.74 us/op 383.36 us/op 0.56
nodejs fromHexInto(blob) 593.26 us/op 699.56 us/op 0.85
nodejs block root to RootHex using the deprecated toHexString 178.87 ns/op 533.22 ns/op 0.34
browser block root to RootHex using toHex 134.99 ns/op 294.07 ns/op 0.46
browser block root to RootHex using toRootHex 122.50 ns/op 135.48 ns/op 0.90
browser fromHex(blob) 969.08 us/op 1.0480 ms/op 0.92
browser fromHexInto(blob) 621.15 us/op 687.45 us/op 0.90
browser block root to RootHex using the deprecated toHexString 512.66 ns/op 365.71 ns/op 1.40

by benchmarkbot/action

This reverts commit 62c43f3.
browser tests return Uint8Array, unit tests return Buffer due to new library implementation
Copy link
Member

@matthewkeil matthewkeil left a comment

Choose a reason for hiding this comment

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

WAY TO GO ROBBY!!!! 🎉 🎉

This is epic work dude! I'm really proud of you!

Just want to give some others on the team time to digest the rust code. I glanced through and it looks to be well structured and has unit tests. I am a bit hesitant to approve though as there is very low adoption on the package. This is the package that @nflaig suggested that we use so I will look to him for final approval. I think it also good to get @wemeetagain to give his blessing as well as he is a Rustacion. In particular I think we may want to look at the test cases in the lib to make sure they are covering the edge cases.

Overall this is great and I LOVE the initiative! Keep it up dude, you 🪨 thoroughly!!

@matthewkeil
Copy link
Member

FYI @nflaig and @wemeetagain I have asked Robby to use Gemini to audit the rust code and tests. He will post his results as a first pass of the lib. We can go from there

@nflaig
Copy link
Member

nflaig commented Jan 29, 2026

new implementation returns a buffer when in a browser

what you mean by "buffer" here, browsers don't support Buffer

@nflaig
Copy link
Member

nflaig commented Jan 29, 2026

@nflaig suggested that we use so I will look to him for final approval

I am a bit hesitant to switch to this library just yet, I would like this see more adoption first, we also want to have this running on a feat group for a while to make sure it's stable and performant

the current library has it's own issue but the known security vulnerabilities do not affect us from last time I checked

@wemeetagain
Copy link
Member

wemeetagain commented Jan 30, 2026

Looked into the upstream library. It looks solid.

Only critique I could find was how it selects native vs browser implementations. It dynamically loads native vs browser, instead of using conditional exports via package.json.

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.

Consider switching to @vekexasia/bigint-buffer2

5 participants