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

Conversation

@nflaig
Copy link
Member

@nflaig nflaig commented Oct 20, 2025

Type checks are broken since we merged #8469.

@nflaig nflaig requested a review from a team as a code owner October 20, 2025 15:16
@gemini-code-assist
Copy link
Contributor

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 focuses on resolving an issue where type checks in the Merkle proof test suite were failing. The changes involve refining the conditional logic and type assertions used when processing blobKzgCommitments to correctly handle various Ethereum fork states, particularly incorporating ForkPreGloas conditions. This ensures the test accurately validates Merkle proofs under diverse network configurations, restoring the reliability of the type checking system.

Highlights

  • Type Check Fix: Addresses and resolves broken type checks within the merkleProof.test.ts file, which were introduced by a previous merge.
  • Fork Condition Refinement: Updates the conditional logic for determining the Merkle tree leaf to correctly account for ForkPreGloas conditions, in addition to ForkPostFulu, ensuring accurate behavior across different Ethereum forks.
  • Improved Type Assertions: Enhances type assertions for BeaconBlockBody to be more precise, reflecting specific fork conditions like ForkPostFulu & ForkPreGloas or ForkPostDeneb & ForkPreFulu, thereby improving type safety during test execution.
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 fixes a type-checking issue in the merkle proof tests by correctly narrowing types for different forks. While this resolves the compile-time error, the logic for handling forks is fragile and could lead to runtime errors if test configurations change. I've provided a suggestion to refactor the logic to be more robust and readable by explicitly handling each fork generation.

@codecov
Copy link

codecov bot commented Oct 20, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 52.18%. Comparing base (a0d00ac) to head (bb060fd).
⚠️ Report is 4 commits behind head on unstable.

Additional details and impacted files
@@             Coverage Diff              @@
##           unstable    #8550      +/-   ##
============================================
- Coverage     52.18%   52.18%   -0.01%     
============================================
  Files           852      852              
  Lines         65299    65317      +18     
  Branches       4793     4792       -1     
============================================
+ Hits          34079    34086       +7     
- Misses        31151    31162      +11     
  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.

@nflaig
Copy link
Member Author

nflaig commented Oct 20, 2025

/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

The pull request fixes type checks in the merkle proof test by adding support for ForkPreGloas and updating the logic for determining the leaf node. The changes include new imports, conditional logic for handling different forks, and a temporary error for the ForkPostGloas case.

@nflaig
Copy link
Member Author

nflaig commented Oct 20, 2025

/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 addresses broken type checks in the merkle proof tests. The changes introduce a necessary guard to skip tests for the gloas fork and beyond, where blobKzgCommitments is removed from BeaconBlockBody. The type assertions for the body object have also been refined with more specific fork types, which correctly resolves the type errors. The changes are accurate and effectively fix the issue.

@nflaig nflaig enabled auto-merge (squash) October 20, 2025 15:45
@nflaig nflaig merged commit 152445e into unstable Oct 20, 2025
25 of 26 checks passed
@nflaig nflaig deleted the nflaig/fix-check-types branch October 20, 2025 16:00
@github-actions
Copy link
Contributor

Performance Report

🚀🚀 Significant benchmark improvement detected

Benchmark suite Current: b8bf7fb Previous: e88fbeb Ratio
Array.fill - length 1000000 3.7153 ms/op 11.688 ms/op 0.32
Full benchmark results
Benchmark suite Current: b8bf7fb Previous: e88fbeb Ratio
getPubkeys - index2pubkey - req 1000 vs - 250000 vc 984.20 us/op 2.4892 ms/op 0.40
getPubkeys - validatorsArr - req 1000 vs - 250000 vc 35.118 us/op 47.815 us/op 0.73
BLS verify - blst 829.64 us/op 1.1986 ms/op 0.69
BLS verifyMultipleSignatures 3 - blst 1.9094 ms/op 1.5810 ms/op 1.21
BLS verifyMultipleSignatures 8 - blst 2.2148 ms/op 2.5603 ms/op 0.87
BLS verifyMultipleSignatures 32 - blst 5.5745 ms/op 7.6169 ms/op 0.73
BLS verifyMultipleSignatures 64 - blst 10.697 ms/op 12.423 ms/op 0.86
BLS verifyMultipleSignatures 128 - blst 17.182 ms/op 23.316 ms/op 0.74
BLS deserializing 10000 signatures 685.92 ms/op 803.45 ms/op 0.85
BLS deserializing 100000 signatures 6.9450 s/op 7.0333 s/op 0.99
BLS verifyMultipleSignatures - same message - 3 - blst 949.27 us/op 899.21 us/op 1.06
BLS verifyMultipleSignatures - same message - 8 - blst 1.0956 ms/op 1.0111 ms/op 1.08
BLS verifyMultipleSignatures - same message - 32 - blst 1.7561 ms/op 1.6770 ms/op 1.05
BLS verifyMultipleSignatures - same message - 64 - blst 2.6373 ms/op 2.6935 ms/op 0.98
BLS verifyMultipleSignatures - same message - 128 - blst 4.4379 ms/op 4.4201 ms/op 1.00
BLS aggregatePubkeys 32 - blst 19.290 us/op 19.254 us/op 1.00
BLS aggregatePubkeys 128 - blst 69.266 us/op 68.749 us/op 1.01
notSeenSlots=1 numMissedVotes=1 numBadVotes=10 58.024 ms/op 44.878 ms/op 1.29
notSeenSlots=1 numMissedVotes=0 numBadVotes=4 54.233 ms/op 46.259 ms/op 1.17
notSeenSlots=2 numMissedVotes=1 numBadVotes=10 40.947 ms/op 36.795 ms/op 1.11
getSlashingsAndExits - default max 82.487 us/op 73.136 us/op 1.13
getSlashingsAndExits - 2k 327.56 us/op 274.82 us/op 1.19
isKnown best case - 1 super set check 195.00 ns/op 202.00 ns/op 0.97
isKnown normal case - 2 super set checks 200.00 ns/op 198.00 ns/op 1.01
isKnown worse case - 16 super set checks 201.00 ns/op 200.00 ns/op 1.00
InMemoryCheckpointStateCache - add get delete 2.4440 us/op 2.2910 us/op 1.07
validate api signedAggregateAndProof - struct 1.3769 ms/op 1.3611 ms/op 1.01
validate gossip signedAggregateAndProof - struct 2.8087 ms/op 1.3451 ms/op 2.09
batch validate gossip attestation - vc 640000 - chunk 32 115.72 us/op 116.51 us/op 0.99
batch validate gossip attestation - vc 640000 - chunk 64 106.97 us/op 100.29 us/op 1.07
batch validate gossip attestation - vc 640000 - chunk 128 99.389 us/op 95.476 us/op 1.04
batch validate gossip attestation - vc 640000 - chunk 256 93.899 us/op 97.746 us/op 0.96
pickEth1Vote - no votes 957.66 us/op 976.92 us/op 0.98
pickEth1Vote - max votes 5.1723 ms/op 5.2063 ms/op 0.99
pickEth1Vote - Eth1Data hashTreeRoot value x2048 11.041 ms/op 10.449 ms/op 1.06
pickEth1Vote - Eth1Data hashTreeRoot tree x2048 19.900 ms/op 14.438 ms/op 1.38
pickEth1Vote - Eth1Data fastSerialize value x2048 433.65 us/op 455.32 us/op 0.95
pickEth1Vote - Eth1Data fastSerialize tree x2048 3.7758 ms/op 2.2467 ms/op 1.68
bytes32 toHexString 345.00 ns/op 366.00 ns/op 0.94
bytes32 Buffer.toString(hex) 250.00 ns/op 242.00 ns/op 1.03
bytes32 Buffer.toString(hex) from Uint8Array 337.00 ns/op 325.00 ns/op 1.04
bytes32 Buffer.toString(hex) + 0x 249.00 ns/op 250.00 ns/op 1.00
Object access 1 prop 0.11600 ns/op 0.11400 ns/op 1.02
Map access 1 prop 0.12000 ns/op 0.11700 ns/op 1.03
Object get x1000 5.4770 ns/op 5.7910 ns/op 0.95
Map get x1000 6.3050 ns/op 6.3620 ns/op 0.99
Object set x1000 26.765 ns/op 28.877 ns/op 0.93
Map set x1000 18.136 ns/op 19.849 ns/op 0.91
Return object 10000 times 0.26880 ns/op 0.28680 ns/op 0.94
Throw Error 10000 times 4.1112 us/op 4.3184 us/op 0.95
toHex 129.59 ns/op 131.53 ns/op 0.99
Buffer.from 110.78 ns/op 124.27 ns/op 0.89
shared Buffer 74.510 ns/op 79.514 ns/op 0.94
fastMsgIdFn sha256 / 200 bytes 2.0340 us/op 2.1690 us/op 0.94
fastMsgIdFn h32 xxhash / 200 bytes 193.00 ns/op 204.00 ns/op 0.95
fastMsgIdFn h64 xxhash / 200 bytes 250.00 ns/op 261.00 ns/op 0.96
fastMsgIdFn sha256 / 1000 bytes 7.1540 us/op 7.1010 us/op 1.01
fastMsgIdFn h32 xxhash / 1000 bytes 322.00 ns/op 337.00 ns/op 0.96
fastMsgIdFn h64 xxhash / 1000 bytes 324.00 ns/op 336.00 ns/op 0.96
fastMsgIdFn sha256 / 10000 bytes 61.424 us/op 64.685 us/op 0.95
fastMsgIdFn h32 xxhash / 10000 bytes 1.7050 us/op 1.8350 us/op 0.93
fastMsgIdFn h64 xxhash / 10000 bytes 1.1280 us/op 1.2210 us/op 0.92
send data - 1000 256B messages 14.973 ms/op 14.813 ms/op 1.01
send data - 1000 512B messages 18.304 ms/op 20.183 ms/op 0.91
send data - 1000 1024B messages 25.485 ms/op 27.279 ms/op 0.93
send data - 1000 1200B messages 23.626 ms/op 22.512 ms/op 1.05
send data - 1000 2048B messages 23.927 ms/op 23.312 ms/op 1.03
send data - 1000 4096B messages 28.083 ms/op 25.948 ms/op 1.08
send data - 1000 16384B messages 42.487 ms/op 42.141 ms/op 1.01
send data - 1000 65536B messages 108.98 ms/op 112.17 ms/op 0.97
enrSubnets - fastDeserialize 64 bits 845.00 ns/op 914.00 ns/op 0.92
enrSubnets - ssz BitVector 64 bits 317.00 ns/op 335.00 ns/op 0.95
enrSubnets - fastDeserialize 4 bits 127.00 ns/op 126.00 ns/op 1.01
enrSubnets - ssz BitVector 4 bits 325.00 ns/op 333.00 ns/op 0.98
prioritizePeers score -10:0 att 32-0.1 sync 2-0 224.98 us/op 231.40 us/op 0.97
prioritizePeers score 0:0 att 32-0.25 sync 2-0.25 254.35 us/op 258.63 us/op 0.98
prioritizePeers score 0:0 att 32-0.5 sync 2-0.5 377.66 us/op 375.52 us/op 1.01
prioritizePeers score 0:0 att 64-0.75 sync 4-0.75 709.76 us/op 701.95 us/op 1.01
prioritizePeers score 0:0 att 64-1 sync 4-1 857.51 us/op 843.95 us/op 1.02
array of 16000 items push then shift 1.6360 us/op 1.6239 us/op 1.01
LinkedList of 16000 items push then shift 7.2710 ns/op 7.2110 ns/op 1.01
array of 16000 items push then pop 76.433 ns/op 76.557 ns/op 1.00
LinkedList of 16000 items push then pop 7.2130 ns/op 7.1420 ns/op 1.01
array of 24000 items push then shift 2.4134 us/op 2.3708 us/op 1.02
LinkedList of 24000 items push then shift 7.2720 ns/op 7.3760 ns/op 0.99
array of 24000 items push then pop 101.76 ns/op 102.67 ns/op 0.99
LinkedList of 24000 items push then pop 6.7510 ns/op 7.0550 ns/op 0.96
intersect bitArray bitLen 8 6.0340 ns/op 6.3670 ns/op 0.95
intersect array and set length 8 36.178 ns/op 37.832 ns/op 0.96
intersect bitArray bitLen 128 28.486 ns/op 29.664 ns/op 0.96
intersect array and set length 128 594.61 ns/op 624.50 ns/op 0.95
bitArray.getTrueBitIndexes() bitLen 128 972.00 ns/op 989.00 ns/op 0.98
bitArray.getTrueBitIndexes() bitLen 248 1.7150 us/op 1.7410 us/op 0.99
bitArray.getTrueBitIndexes() bitLen 512 3.4890 us/op 3.5710 us/op 0.98
Buffer.concat 32 items 586.00 ns/op 603.00 ns/op 0.97
Uint8Array.set 32 items 1.1630 us/op 905.00 ns/op 1.29
Buffer.copy 1.9980 us/op 1.9470 us/op 1.03
Uint8Array.set - with subarray 1.7350 us/op 1.5070 us/op 1.15
Uint8Array.set - without subarray 1.1720 us/op 879.00 ns/op 1.33
getUint32 - dataview 194.00 ns/op 193.00 ns/op 1.01
getUint32 - manual 145.00 ns/op 118.00 ns/op 1.23
Set add up to 64 items then delete first 2.1429 us/op 2.1934 us/op 0.98
OrderedSet add up to 64 items then delete first 3.2502 us/op 3.3365 us/op 0.97
Set add up to 64 items then delete last 2.2665 us/op 2.5143 us/op 0.90
OrderedSet add up to 64 items then delete last 3.9046 us/op 3.6936 us/op 1.06
Set add up to 64 items then delete middle 2.4869 us/op 2.4991 us/op 1.00
OrderedSet add up to 64 items then delete middle 5.2242 us/op 5.3823 us/op 0.97
Set add up to 128 items then delete first 5.0370 us/op 5.1097 us/op 0.99
OrderedSet add up to 128 items then delete first 7.8148 us/op 8.2887 us/op 0.94
Set add up to 128 items then delete last 4.8505 us/op 5.3838 us/op 0.90
OrderedSet add up to 128 items then delete last 7.3070 us/op 7.6511 us/op 0.96
Set add up to 128 items then delete middle 4.7969 us/op 5.0249 us/op 0.95
OrderedSet add up to 128 items then delete middle 13.658 us/op 14.235 us/op 0.96
Set add up to 256 items then delete first 10.032 us/op 10.096 us/op 0.99
OrderedSet add up to 256 items then delete first 16.220 us/op 15.619 us/op 1.04
Set add up to 256 items then delete last 9.6580 us/op 9.4978 us/op 1.02
OrderedSet add up to 256 items then delete last 14.528 us/op 14.464 us/op 1.00
Set add up to 256 items then delete middle 9.5042 us/op 9.5637 us/op 0.99
OrderedSet add up to 256 items then delete middle 41.116 us/op 42.153 us/op 0.98
transfer serialized Status (84 B) 2.2500 us/op 2.1570 us/op 1.04
copy serialized Status (84 B) 1.2030 us/op 1.1320 us/op 1.06
transfer serialized SignedVoluntaryExit (112 B) 2.2580 us/op 2.2730 us/op 0.99
copy serialized SignedVoluntaryExit (112 B) 1.2000 us/op 1.2420 us/op 0.97
transfer serialized ProposerSlashing (416 B) 2.2380 us/op 2.5310 us/op 0.88
copy serialized ProposerSlashing (416 B) 1.5270 us/op 1.3180 us/op 1.16
transfer serialized Attestation (485 B) 2.2840 us/op 2.6690 us/op 0.86
copy serialized Attestation (485 B) 1.3270 us/op 1.3320 us/op 1.00
transfer serialized AttesterSlashing (33232 B) 2.5540 us/op 2.7680 us/op 0.92
copy serialized AttesterSlashing (33232 B) 3.8260 us/op 3.8200 us/op 1.00
transfer serialized Small SignedBeaconBlock (128000 B) 3.1280 us/op 3.3410 us/op 0.94
copy serialized Small SignedBeaconBlock (128000 B) 8.7730 us/op 9.0700 us/op 0.97
transfer serialized Avg SignedBeaconBlock (200000 B) 3.3550 us/op 3.7610 us/op 0.89
copy serialized Avg SignedBeaconBlock (200000 B) 14.079 us/op 13.224 us/op 1.06
transfer serialized BlobsSidecar (524380 B) 3.3000 us/op 3.7480 us/op 0.88
copy serialized BlobsSidecar (524380 B) 83.283 us/op 100.73 us/op 0.83
transfer serialized Big SignedBeaconBlock (1000000 B) 3.6970 us/op 3.8670 us/op 0.96
copy serialized Big SignedBeaconBlock (1000000 B) 240.55 us/op 109.69 us/op 2.19
pass gossip attestations to forkchoice per slot 2.7152 ms/op 2.7249 ms/op 1.00
forkChoice updateHead vc 100000 bc 64 eq 0 497.99 us/op 533.63 us/op 0.93
forkChoice updateHead vc 600000 bc 64 eq 0 3.0327 ms/op 3.1277 ms/op 0.97
forkChoice updateHead vc 1000000 bc 64 eq 0 5.1754 ms/op 5.3405 ms/op 0.97
forkChoice updateHead vc 600000 bc 320 eq 0 3.0387 ms/op 3.0153 ms/op 1.01
forkChoice updateHead vc 600000 bc 1200 eq 0 3.0890 ms/op 3.0641 ms/op 1.01
forkChoice updateHead vc 600000 bc 7200 eq 0 3.3869 ms/op 3.3787 ms/op 1.00
forkChoice updateHead vc 600000 bc 64 eq 1000 2.9734 ms/op 3.0128 ms/op 0.99
forkChoice updateHead vc 600000 bc 64 eq 10000 3.2085 ms/op 3.1171 ms/op 1.03
forkChoice updateHead vc 600000 bc 64 eq 300000 9.2861 ms/op 9.5958 ms/op 0.97
computeDeltas 1400000 validators 300 proto nodes 12.006 ms/op 19.274 ms/op 0.62
computeDeltas 1400000 validators 1200 proto nodes 12.163 ms/op 12.160 ms/op 1.00
computeDeltas 1400000 validators 7200 proto nodes 12.224 ms/op 12.212 ms/op 1.00
computeDeltas 2100000 validators 300 proto nodes 18.608 ms/op 18.123 ms/op 1.03
computeDeltas 2100000 validators 1200 proto nodes 18.446 ms/op 18.335 ms/op 1.01
computeDeltas 2100000 validators 7200 proto nodes 20.586 ms/op 18.647 ms/op 1.10
altair processAttestation - 250000 vs - 7PWei normalcase 2.0894 ms/op 2.8778 ms/op 0.73
altair processAttestation - 250000 vs - 7PWei worstcase 5.1452 ms/op 3.6874 ms/op 1.40
altair processAttestation - setStatus - 1/6 committees join 130.41 us/op 155.41 us/op 0.84
altair processAttestation - setStatus - 1/3 committees join 270.91 us/op 293.25 us/op 0.92
altair processAttestation - setStatus - 1/2 committees join 373.30 us/op 430.47 us/op 0.87
altair processAttestation - setStatus - 2/3 committees join 505.72 us/op 532.28 us/op 0.95
altair processAttestation - setStatus - 4/5 committees join 644.78 us/op 661.41 us/op 0.97
altair processAttestation - setStatus - 100% committees join 759.25 us/op 931.71 us/op 0.81
altair processBlock - 250000 vs - 7PWei normalcase 5.5499 ms/op 6.0396 ms/op 0.92
altair processBlock - 250000 vs - 7PWei normalcase hashState 34.907 ms/op 47.944 ms/op 0.73
altair processBlock - 250000 vs - 7PWei worstcase 41.852 ms/op 52.574 ms/op 0.80
altair processBlock - 250000 vs - 7PWei worstcase hashState 104.45 ms/op 94.932 ms/op 1.10
phase0 processBlock - 250000 vs - 7PWei normalcase 2.0088 ms/op 1.9410 ms/op 1.03
phase0 processBlock - 250000 vs - 7PWei worstcase 25.799 ms/op 33.310 ms/op 0.77
altair processEth1Data - 250000 vs - 7PWei normalcase 345.77 us/op 415.07 us/op 0.83
getExpectedWithdrawals 250000 eb:1,eth1:1,we:0,wn:0,smpl:15 7.8050 us/op 10.763 us/op 0.73
getExpectedWithdrawals 250000 eb:0.95,eth1:0.1,we:0.05,wn:0,smpl:219 61.650 us/op 67.598 us/op 0.91
getExpectedWithdrawals 250000 eb:0.95,eth1:0.3,we:0.05,wn:0,smpl:42 13.422 us/op 23.019 us/op 0.58
getExpectedWithdrawals 250000 eb:0.95,eth1:0.7,we:0.05,wn:0,smpl:18 7.7140 us/op 12.085 us/op 0.64
getExpectedWithdrawals 250000 eb:0.1,eth1:0.1,we:0,wn:0,smpl:1020 212.00 us/op 216.62 us/op 0.98
getExpectedWithdrawals 250000 eb:0.03,eth1:0.03,we:0,wn:0,smpl:11777 2.3760 ms/op 2.0236 ms/op 1.17
getExpectedWithdrawals 250000 eb:0.01,eth1:0.01,we:0,wn:0,smpl:16384 2.6274 ms/op 3.0286 ms/op 0.87
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,smpl:16384 2.7618 ms/op 2.9535 ms/op 0.94
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,nocache,smpl:16384 4.9801 ms/op 8.1656 ms/op 0.61
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,smpl:16384 2.6496 ms/op 3.2004 ms/op 0.83
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,nocache,smpl:16384 4.9248 ms/op 7.0166 ms/op 0.70
Tree 40 250000 create 446.82 ms/op 831.17 ms/op 0.54
Tree 40 250000 get(125000) 144.28 ns/op 156.56 ns/op 0.92
Tree 40 250000 set(125000) 1.6174 us/op 2.9494 us/op 0.55
Tree 40 250000 toArray() 17.791 ms/op 28.804 ms/op 0.62
Tree 40 250000 iterate all - toArray() + loop 17.329 ms/op 29.442 ms/op 0.59
Tree 40 250000 iterate all - get(i) 58.764 ms/op 75.913 ms/op 0.77
Array 250000 create 3.5800 ms/op 4.8636 ms/op 0.74
Array 250000 clone - spread 816.48 us/op 5.9769 ms/op 0.14
Array 250000 get(125000) 0.41800 ns/op 0.59200 ns/op 0.71
Array 250000 set(125000) 0.44300 ns/op 0.89700 ns/op 0.49
Array 250000 iterate all - loop 93.776 us/op 110.25 us/op 0.85
phase0 afterProcessEpoch - 250000 vs - 7PWei 43.218 ms/op 47.368 ms/op 0.91
Array.fill - length 1000000 3.7153 ms/op 11.688 ms/op 0.32
Array push - length 1000000 17.319 ms/op 47.740 ms/op 0.36
Array.get 0.28939 ns/op 0.28837 ns/op 1.00
Uint8Array.get 0.45972 ns/op 0.47227 ns/op 0.97
phase0 beforeProcessEpoch - 250000 vs - 7PWei 19.392 ms/op 23.530 ms/op 0.82
altair processEpoch - mainnet_e81889 325.79 ms/op 359.85 ms/op 0.91
mainnet_e81889 - altair beforeProcessEpoch 22.336 ms/op 29.306 ms/op 0.76
mainnet_e81889 - altair processJustificationAndFinalization 7.3200 us/op 11.112 us/op 0.66
mainnet_e81889 - altair processInactivityUpdates 6.3496 ms/op 6.6203 ms/op 0.96
mainnet_e81889 - altair processRewardsAndPenalties 45.151 ms/op 63.537 ms/op 0.71
mainnet_e81889 - altair processRegistryUpdates 791.00 ns/op 1.1780 us/op 0.67
mainnet_e81889 - altair processSlashings 197.00 ns/op 271.00 ns/op 0.73
mainnet_e81889 - altair processEth1DataReset 186.00 ns/op 200.00 ns/op 0.93
mainnet_e81889 - altair processEffectiveBalanceUpdates 1.3181 ms/op 1.2781 ms/op 1.03
mainnet_e81889 - altair processSlashingsReset 1.0670 us/op 1.3340 us/op 0.80
mainnet_e81889 - altair processRandaoMixesReset 2.1810 us/op 1.9420 us/op 1.12
mainnet_e81889 - altair processHistoricalRootsUpdate 246.00 ns/op 371.00 ns/op 0.66
mainnet_e81889 - altair processParticipationFlagUpdates 818.00 ns/op 1.1040 us/op 0.74
mainnet_e81889 - altair processSyncCommitteeUpdates 152.00 ns/op 220.00 ns/op 0.69
mainnet_e81889 - altair afterProcessEpoch 46.725 ms/op 49.249 ms/op 0.95
capella processEpoch - mainnet_e217614 984.29 ms/op 968.07 ms/op 1.02
mainnet_e217614 - capella beforeProcessEpoch 66.308 ms/op 68.536 ms/op 0.97
mainnet_e217614 - capella processJustificationAndFinalization 5.3560 us/op 5.7090 us/op 0.94
mainnet_e217614 - capella processInactivityUpdates 15.297 ms/op 15.209 ms/op 1.01
mainnet_e217614 - capella processRewardsAndPenalties 206.02 ms/op 192.93 ms/op 1.07
mainnet_e217614 - capella processRegistryUpdates 6.4510 us/op 6.5580 us/op 0.98
mainnet_e217614 - capella processSlashings 186.00 ns/op 185.00 ns/op 1.01
mainnet_e217614 - capella processEth1DataReset 178.00 ns/op 177.00 ns/op 1.01
mainnet_e217614 - capella processEffectiveBalanceUpdates 11.278 ms/op 14.310 ms/op 0.79
mainnet_e217614 - capella processSlashingsReset 912.00 ns/op 912.00 ns/op 1.00
mainnet_e217614 - capella processRandaoMixesReset 1.2910 us/op 1.2250 us/op 1.05
mainnet_e217614 - capella processHistoricalRootsUpdate 181.00 ns/op 187.00 ns/op 0.97
mainnet_e217614 - capella processParticipationFlagUpdates 517.00 ns/op 568.00 ns/op 0.91
mainnet_e217614 - capella afterProcessEpoch 113.38 ms/op 116.87 ms/op 0.97
phase0 processEpoch - mainnet_e58758 397.37 ms/op 324.12 ms/op 1.23
mainnet_e58758 - phase0 beforeProcessEpoch 93.701 ms/op 80.692 ms/op 1.16
mainnet_e58758 - phase0 processJustificationAndFinalization 5.6680 us/op 5.7570 us/op 0.98
mainnet_e58758 - phase0 processRewardsAndPenalties 51.450 ms/op 36.239 ms/op 1.42
mainnet_e58758 - phase0 processRegistryUpdates 6.8230 us/op 3.2210 us/op 2.12
mainnet_e58758 - phase0 processSlashings 355.00 ns/op 184.00 ns/op 1.93
mainnet_e58758 - phase0 processEth1DataReset 370.00 ns/op 177.00 ns/op 2.09
mainnet_e58758 - phase0 processEffectiveBalanceUpdates 6.2860 ms/op 1.2209 ms/op 5.15
mainnet_e58758 - phase0 processSlashingsReset 1.6910 us/op 951.00 ns/op 1.78
mainnet_e58758 - phase0 processRandaoMixesReset 2.9290 us/op 1.1960 us/op 2.45
mainnet_e58758 - phase0 processHistoricalRootsUpdate 346.00 ns/op 177.00 ns/op 1.95
mainnet_e58758 - phase0 processParticipationRecordUpdates 1.9210 us/op 922.00 ns/op 2.08
mainnet_e58758 - phase0 afterProcessEpoch 41.684 ms/op 36.217 ms/op 1.15
phase0 processEffectiveBalanceUpdates - 250000 normalcase 1.5500 ms/op 1.4791 ms/op 1.05
phase0 processEffectiveBalanceUpdates - 250000 worstcase 0.5 5.2676 ms/op 4.5934 ms/op 1.15
altair processInactivityUpdates - 250000 normalcase 35.087 ms/op 19.447 ms/op 1.80
altair processInactivityUpdates - 250000 worstcase 35.999 ms/op 18.956 ms/op 1.90
phase0 processRegistryUpdates - 250000 normalcase 16.166 us/op 7.2270 us/op 2.24
phase0 processRegistryUpdates - 250000 badcase_full_deposits 507.63 us/op 355.59 us/op 1.43
phase0 processRegistryUpdates - 250000 worstcase 0.5 258.26 ms/op 99.100 ms/op 2.61
altair processRewardsAndPenalties - 250000 normalcase 40.474 ms/op 27.081 ms/op 1.49
altair processRewardsAndPenalties - 250000 worstcase 39.892 ms/op 26.984 ms/op 1.48
phase0 getAttestationDeltas - 250000 normalcase 17.346 ms/op 8.1037 ms/op 2.14
phase0 getAttestationDeltas - 250000 worstcase 10.654 ms/op 8.1351 ms/op 1.31
phase0 processSlashings - 250000 worstcase 170.13 us/op 104.70 us/op 1.62
altair processSyncCommitteeUpdates - 250000 21.091 ms/op 11.377 ms/op 1.85
BeaconState.hashTreeRoot - No change 415.00 ns/op 243.00 ns/op 1.71
BeaconState.hashTreeRoot - 1 full validator 138.60 us/op 76.622 us/op 1.81
BeaconState.hashTreeRoot - 32 full validator 2.2135 ms/op 1.1256 ms/op 1.97
BeaconState.hashTreeRoot - 512 full validator 16.621 ms/op 12.304 ms/op 1.35
BeaconState.hashTreeRoot - 1 validator.effectiveBalance 243.26 us/op 95.895 us/op 2.54
BeaconState.hashTreeRoot - 32 validator.effectiveBalance 2.1903 ms/op 1.4166 ms/op 1.55
BeaconState.hashTreeRoot - 512 validator.effectiveBalance 48.376 ms/op 27.102 ms/op 1.78
BeaconState.hashTreeRoot - 1 balances 119.61 us/op 86.249 us/op 1.39
BeaconState.hashTreeRoot - 32 balances 1.6352 ms/op 815.21 us/op 2.01
BeaconState.hashTreeRoot - 512 balances 15.268 ms/op 9.3632 ms/op 1.63
BeaconState.hashTreeRoot - 250000 balances 276.93 ms/op 171.19 ms/op 1.62
aggregationBits - 2048 els - zipIndexesInBitList 40.057 us/op 24.058 us/op 1.67
byteArrayEquals 32 58.692 ns/op 55.141 ns/op 1.06
Buffer.compare 32 19.730 ns/op 22.088 ns/op 0.89
byteArrayEquals 1024 1.7839 us/op 1.6922 us/op 1.05
Buffer.compare 1024 28.950 ns/op 28.859 ns/op 1.00
byteArrayEquals 16384 27.457 us/op 27.493 us/op 1.00
Buffer.compare 16384 217.56 ns/op 201.57 ns/op 1.08
byteArrayEquals 123687377 215.82 ms/op 204.81 ms/op 1.05
Buffer.compare 123687377 6.2849 ms/op 10.623 ms/op 0.59
byteArrayEquals 32 - diff last byte 51.775 ns/op 55.805 ns/op 0.93
Buffer.compare 32 - diff last byte 16.466 ns/op 19.746 ns/op 0.83
byteArrayEquals 1024 - diff last byte 1.5115 us/op 1.7706 us/op 0.85
Buffer.compare 1024 - diff last byte 24.899 ns/op 32.270 ns/op 0.77
byteArrayEquals 16384 - diff last byte 24.850 us/op 28.279 us/op 0.88
Buffer.compare 16384 - diff last byte 197.94 ns/op 207.03 ns/op 0.96
byteArrayEquals 123687377 - diff last byte 200.42 ms/op 218.06 ms/op 0.92
Buffer.compare 123687377 - diff last byte 8.3052 ms/op 17.481 ms/op 0.48
byteArrayEquals 32 - random bytes 5.5920 ns/op 6.6320 ns/op 0.84
Buffer.compare 32 - random bytes 18.928 ns/op 18.642 ns/op 1.02
byteArrayEquals 1024 - random bytes 5.4870 ns/op 5.9700 ns/op 0.92
Buffer.compare 1024 - random bytes 18.523 ns/op 22.195 ns/op 0.83
byteArrayEquals 16384 - random bytes 5.5010 ns/op 5.9170 ns/op 0.93
Buffer.compare 16384 - random bytes 17.909 ns/op 19.338 ns/op 0.93
byteArrayEquals 123687377 - random bytes 7.1400 ns/op 9.0700 ns/op 0.79
Buffer.compare 123687377 - random bytes 19.530 ns/op 20.810 ns/op 0.94
regular array get 100000 times 35.091 us/op 48.334 us/op 0.73
wrappedArray get 100000 times 35.367 us/op 36.133 us/op 0.98
arrayWithProxy get 100000 times 12.931 ms/op 14.900 ms/op 0.87
ssz.Root.equals 49.813 ns/op 60.566 ns/op 0.82
byteArrayEquals 49.026 ns/op 50.196 ns/op 0.98
Buffer.compare 10.944 ns/op 11.257 ns/op 0.97
processSlot - 1 slots 10.799 us/op 13.797 us/op 0.78
processSlot - 32 slots 2.6143 ms/op 3.1667 ms/op 0.83
getEffectiveBalanceIncrementsZeroInactive - 250000 vs - 7PWei 3.2888 ms/op 6.3458 ms/op 0.52
getCommitteeAssignments - req 1 vs - 250000 vc 2.2251 ms/op 2.3369 ms/op 0.95
getCommitteeAssignments - req 100 vs - 250000 vc 4.3485 ms/op 4.7475 ms/op 0.92
getCommitteeAssignments - req 1000 vs - 250000 vc 4.6213 ms/op 4.9758 ms/op 0.93
findModifiedValidators - 10000 modified validators 761.04 ms/op 1.1009 s/op 0.69
findModifiedValidators - 1000 modified validators 776.30 ms/op 928.37 ms/op 0.84
findModifiedValidators - 100 modified validators 192.67 ms/op 389.72 ms/op 0.49
findModifiedValidators - 10 modified validators 250.06 ms/op 238.51 ms/op 1.05
findModifiedValidators - 1 modified validators 182.91 ms/op 269.66 ms/op 0.68
findModifiedValidators - no difference 175.07 ms/op 378.49 ms/op 0.46
compare ViewDUs 7.0441 s/op 9.1545 s/op 0.77
compare each validator Uint8Array 1.4733 s/op 2.1891 s/op 0.67
compare ViewDU to Uint8Array 1.4654 s/op 1.4954 s/op 0.98
migrate state 1000000 validators, 24 modified, 0 new 909.14 ms/op 1.1502 s/op 0.79
migrate state 1000000 validators, 1700 modified, 1000 new 1.2129 s/op 1.4814 s/op 0.82
migrate state 1000000 validators, 3400 modified, 2000 new 1.2187 s/op 1.4862 s/op 0.82
migrate state 1500000 validators, 24 modified, 0 new 960.22 ms/op 1.0344 s/op 0.93
migrate state 1500000 validators, 1700 modified, 1000 new 1.1992 s/op 1.1716 s/op 1.02
migrate state 1500000 validators, 3400 modified, 2000 new 1.3875 s/op 1.4428 s/op 0.96
RootCache.getBlockRootAtSlot - 250000 vs - 7PWei 6.7000 ns/op 4.6000 ns/op 1.46
state getBlockRootAtSlot - 250000 vs - 7PWei 677.68 ns/op 731.88 ns/op 0.93
naive computeProposerIndex 100000 validators 62.975 ms/op 74.326 ms/op 0.85
computeProposerIndex 100000 validators 1.5417 ms/op 1.5661 ms/op 0.98
naiveGetNextSyncCommitteeIndices 1000 validators 8.9104 s/op 10.339 s/op 0.86
getNextSyncCommitteeIndices 1000 validators 120.11 ms/op 141.66 ms/op 0.85
naiveGetNextSyncCommitteeIndices 10000 validators 9.5643 s/op 9.8505 s/op 0.97
getNextSyncCommitteeIndices 10000 validators 119.26 ms/op 146.20 ms/op 0.82
naiveGetNextSyncCommitteeIndices 100000 validators 9.3061 s/op 10.950 s/op 0.85
getNextSyncCommitteeIndices 100000 validators 117.90 ms/op 146.58 ms/op 0.80
naive computeShuffledIndex 100000 validators 24.112 s/op 28.390 s/op 0.85
cached computeShuffledIndex 100000 validators 544.66 ms/op 612.74 ms/op 0.89
naive computeShuffledIndex 2000000 validators 481.29 s/op 551.50 s/op 0.87
cached computeShuffledIndex 2000000 validators 32.020 s/op 55.317 s/op 0.58
computeProposers - vc 250000 609.58 us/op 640.32 us/op 0.95
computeEpochShuffling - vc 250000 38.863 ms/op 46.996 ms/op 0.83
getNextSyncCommittee - vc 250000 9.7103 ms/op 12.262 ms/op 0.79
computeSigningRoot for AttestationData 19.837 us/op 23.527 us/op 0.84
hash AttestationData serialized data then Buffer.toString(base64) 1.5359 us/op 1.7553 us/op 0.87
toHexString serialized data 1.0609 us/op 1.4380 us/op 0.74
Buffer.toString(base64) 143.11 ns/op 169.84 ns/op 0.84
nodejs block root to RootHex using toHex 147.46 ns/op 157.96 ns/op 0.93
nodejs block root to RootHex using toRootHex 83.669 ns/op 87.809 ns/op 0.95
nodejs fromhex(blob) 108.23 ms/op 121.22 ms/op 0.89
nodejs fromHexInto(blob) 93.834 ms/op 98.237 ms/op 0.96
browser block root to RootHex using the deprecated toHexString 208.56 ns/op 232.38 ns/op 0.90
browser block root to RootHex using toHex 168.14 ns/op 185.85 ns/op 0.90
browser block root to RootHex using toRootHex 157.87 ns/op 170.07 ns/op 0.93
browser fromHexInto(blob) 803.19 us/op 907.74 us/op 0.88
browser fromHex(blob) 753.60 ms/op 848.81 ms/op 0.89

by benchmarkbot/action

@wemeetagain
Copy link
Member

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

3 participants