Skip to content

refactor: use map to lookup combined beacon committee selection for duty - #8710

Merged
wemeetagain merged 1 commit into
unstablefrom
nflaig/use-map
Dec 31, 2025
Merged

refactor: use map to lookup combined beacon committee selection for duty#8710
wemeetagain merged 1 commit into
unstablefrom
nflaig/use-map

Conversation

@nflaig

@nflaig nflaig commented Dec 20, 2025

Copy link
Copy Markdown
Member

@nflaig
nflaig requested a review from a team as a code owner December 20, 2025 11:09
@gemini-code-assist

Copy link
Copy Markdown
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 introduces a significant performance enhancement within the AttestationDutiesService by optimizing how combined beacon committee selections are retrieved. The change involves migrating from an inefficient array iteration to a direct map lookup, which drastically speeds up the process. Additionally, a new check ensures the integrity of the retrieved data by verifying that the selection's slot matches the expected slot, thus improving both performance and data reliability.

Highlights

  • Performance Optimization: The lookup mechanism for combined beacon committee selections has been optimized by replacing an array-based search with a Map lookup, significantly improving efficiency from O(N) to O(1).
  • Data Structure Change: The combinedSelections variable, which previously stored an array of selections, has been refactored to use a Map where ValidatorIndex serves as the key for direct access.
  • Slot Consistency Check: A new validation step has been introduced to ensure that the BeaconCommitteeSelection retrieved from the map corresponds to the expected slot, logging a debug message if a mismatch occurs.

🧠 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.

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

Copy link
Copy Markdown
Contributor

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 refactors the lookup of combined beacon committee selections to use a Map for better performance. However, the current implementation introduces a bug by using only the validatorIndex as the map key. This can cause duties to be missed if a validator has multiple duties in an epoch. I've provided suggestions to fix this by using a composite key of validatorIndex and slot.

Comment thread packages/validator/src/services/attestationDuties.ts
Comment thread packages/validator/src/services/attestationDuties.ts
@github-actions

Copy link
Copy Markdown
Contributor

Performance Report

✔️ no performance regression detected

Full benchmark results
Benchmark suite Current: 5983a88 Previous: 39dac0f Ratio
getPubkeys - index2pubkey - req 1000 vs - 250000 vc 1.1614 ms/op 1.2931 ms/op 0.90
getPubkeys - validatorsArr - req 1000 vs - 250000 vc 37.842 us/op 40.482 us/op 0.93
BLS verify - blst 1.5273 ms/op 866.34 us/op 1.76
BLS verifyMultipleSignatures 3 - blst 2.2443 ms/op 1.2588 ms/op 1.78
BLS verifyMultipleSignatures 8 - blst 2.4897 ms/op 1.9257 ms/op 1.29
BLS verifyMultipleSignatures 32 - blst 6.5018 ms/op 5.7864 ms/op 1.12
BLS verifyMultipleSignatures 64 - blst 10.257 ms/op 11.039 ms/op 0.93
BLS verifyMultipleSignatures 128 - blst 16.977 ms/op 18.587 ms/op 0.91
BLS deserializing 10000 signatures 672.11 ms/op 720.54 ms/op 0.93
BLS deserializing 100000 signatures 6.7292 s/op 7.0455 s/op 0.96
BLS verifyMultipleSignatures - same message - 3 - blst 1.3860 ms/op 881.38 us/op 1.57
BLS verifyMultipleSignatures - same message - 8 - blst 1.6242 ms/op 1.8567 ms/op 0.87
BLS verifyMultipleSignatures - same message - 32 - blst 1.9263 ms/op 1.6982 ms/op 1.13
BLS verifyMultipleSignatures - same message - 64 - blst 2.7926 ms/op 2.5646 ms/op 1.09
BLS verifyMultipleSignatures - same message - 128 - blst 4.4181 ms/op 4.3590 ms/op 1.01
BLS aggregatePubkeys 32 - blst 18.906 us/op 19.478 us/op 0.97
BLS aggregatePubkeys 128 - blst 67.641 us/op 68.949 us/op 0.98
getSlashingsAndExits - default max 75.629 us/op 95.016 us/op 0.80
getSlashingsAndExits - 2k 329.82 us/op 342.02 us/op 0.96
isKnown best case - 1 super set check 194.00 ns/op 195.00 ns/op 0.99
isKnown normal case - 2 super set checks 193.00 ns/op 194.00 ns/op 0.99
isKnown worse case - 16 super set checks 197.00 ns/op 194.00 ns/op 1.02
InMemoryCheckpointStateCache - add get delete 2.3030 us/op 2.3190 us/op 0.99
validate api signedAggregateAndProof - struct 2.5889 ms/op 1.5037 ms/op 1.72
validate gossip signedAggregateAndProof - struct 2.5852 ms/op 1.7441 ms/op 1.48
batch validate gossip attestation - vc 640000 - chunk 32 118.24 us/op 126.90 us/op 0.93
batch validate gossip attestation - vc 640000 - chunk 64 102.66 us/op 117.01 us/op 0.88
batch validate gossip attestation - vc 640000 - chunk 128 95.606 us/op 117.13 us/op 0.82
batch validate gossip attestation - vc 640000 - chunk 256 91.367 us/op 94.512 us/op 0.97
bytes32 toHexString 442.00 ns/op 468.00 ns/op 0.94
bytes32 Buffer.toString(hex) 224.00 ns/op 237.00 ns/op 0.95
bytes32 Buffer.toString(hex) from Uint8Array 312.00 ns/op 339.00 ns/op 0.92
bytes32 Buffer.toString(hex) + 0x 228.00 ns/op 250.00 ns/op 0.91
Object access 1 prop 0.20400 ns/op 0.11500 ns/op 1.77
Map access 1 prop 0.14800 ns/op 0.14500 ns/op 1.02
Object get x1000 5.1500 ns/op 5.2940 ns/op 0.97
Map get x1000 0.36300 ns/op 0.37200 ns/op 0.98
Object set x1000 27.667 ns/op 29.199 ns/op 0.95
Map set x1000 19.434 ns/op 20.294 ns/op 0.96
Return object 10000 times 0.22230 ns/op 0.22920 ns/op 0.97
Throw Error 10000 times 4.1047 us/op 4.0271 us/op 1.02
toHex 133.58 ns/op 133.82 ns/op 1.00
Buffer.from 127.84 ns/op 124.19 ns/op 1.03
shared Buffer 86.870 ns/op 75.023 ns/op 1.16
fastMsgIdFn sha256 / 200 bytes 1.7960 us/op 1.8220 us/op 0.99
fastMsgIdFn h32 xxhash / 200 bytes 250.00 ns/op 181.00 ns/op 1.38
fastMsgIdFn h64 xxhash / 200 bytes 345.00 ns/op 305.00 ns/op 1.13
fastMsgIdFn sha256 / 1000 bytes 5.7480 us/op 5.9160 us/op 0.97
fastMsgIdFn h32 xxhash / 1000 bytes 431.00 ns/op 325.00 ns/op 1.33
fastMsgIdFn h64 xxhash / 1000 bytes 306.00 ns/op 299.00 ns/op 1.02
fastMsgIdFn sha256 / 10000 bytes 50.786 us/op 51.291 us/op 0.99
fastMsgIdFn h32 xxhash / 10000 bytes 1.3360 us/op 1.3750 us/op 0.97
fastMsgIdFn h64 xxhash / 10000 bytes 890.00 ns/op 916.00 ns/op 0.97
100 bytes - compress - snappyjs 1.0885 us/op 1.2463 us/op 0.87
100 bytes - compress - snappy 1.0754 us/op 1.1770 us/op 0.91
100 bytes - compress - snappy-wasm 1.0293 us/op 673.66 ns/op 1.53
100 bytes - compress - snappy-wasm - prealloc 1.1477 us/op 1.3476 us/op 0.85
200 bytes - compress - snappyjs 1.8746 us/op 1.9028 us/op 0.99
200 bytes - compress - snappy 1.2231 us/op 1.3806 us/op 0.89
200 bytes - compress - snappy-wasm 886.83 ns/op 682.24 ns/op 1.30
200 bytes - compress - snappy-wasm - prealloc 1.5821 us/op 1.0599 us/op 1.49
300 bytes - compress - snappyjs 2.3565 us/op 2.0057 us/op 1.17
300 bytes - compress - snappy 1.4179 us/op 1.2556 us/op 1.13
300 bytes - compress - snappy-wasm 980.80 ns/op 883.40 ns/op 1.11
300 bytes - compress - snappy-wasm - prealloc 1.7017 us/op 1.9637 us/op 0.87
400 bytes - compress - snappyjs 2.2242 us/op 2.1012 us/op 1.06
400 bytes - compress - snappy 1.3571 us/op 1.4033 us/op 0.97
400 bytes - compress - snappy-wasm 936.94 ns/op 910.11 ns/op 1.03
400 bytes - compress - snappy-wasm - prealloc 1.7023 us/op 2.0584 us/op 0.83
500 bytes - compress - snappyjs 2.5048 us/op 2.5769 us/op 0.97
500 bytes - compress - snappy 1.3648 us/op 1.4885 us/op 0.92
500 bytes - compress - snappy-wasm 1.1362 us/op 979.13 ns/op 1.16
500 bytes - compress - snappy-wasm - prealloc 1.6021 us/op 1.5076 us/op 1.06
1000 bytes - compress - snappyjs 5.0460 us/op 5.3236 us/op 0.95
1000 bytes - compress - snappy 1.5186 us/op 1.9517 us/op 0.78
1000 bytes - compress - snappy-wasm 1.9115 us/op 2.0841 us/op 0.92
1000 bytes - compress - snappy-wasm - prealloc 1.7037 us/op 2.4415 us/op 0.70
10000 bytes - compress - snappyjs 24.307 us/op 23.733 us/op 1.02
10000 bytes - compress - snappy 22.746 us/op 41.230 us/op 0.55
10000 bytes - compress - snappy-wasm 26.819 us/op 22.800 us/op 1.18
10000 bytes - compress - snappy-wasm - prealloc 17.454 us/op 16.023 us/op 1.09
100 bytes - uncompress - snappyjs 667.34 ns/op 701.98 ns/op 0.95
100 bytes - uncompress - snappy 1.0485 us/op 1.1322 us/op 0.93
100 bytes - uncompress - snappy-wasm 1.0490 us/op 882.76 ns/op 1.19
100 bytes - uncompress - snappy-wasm - prealloc 1.0265 us/op 752.59 ns/op 1.36
200 bytes - uncompress - snappyjs 1.0204 us/op 873.05 ns/op 1.17
200 bytes - uncompress - snappy 1.3525 us/op 1.3693 us/op 0.99
200 bytes - uncompress - snappy-wasm 1.3200 us/op 1.0944 us/op 1.21
200 bytes - uncompress - snappy-wasm - prealloc 1.4394 us/op 930.70 ns/op 1.55
300 bytes - uncompress - snappyjs 2.0007 us/op 959.42 ns/op 2.09
300 bytes - uncompress - snappy 1.7850 us/op 1.3739 us/op 1.30
300 bytes - uncompress - snappy-wasm 968.98 ns/op 793.49 ns/op 1.22
300 bytes - uncompress - snappy-wasm - prealloc 1.0870 us/op 952.50 ns/op 1.14
400 bytes - uncompress - snappyjs 1.6939 us/op 1.6980 us/op 1.00
400 bytes - uncompress - snappy 1.3170 us/op 1.4520 us/op 0.91
400 bytes - uncompress - snappy-wasm 825.66 ns/op 705.22 ns/op 1.17
400 bytes - uncompress - snappy-wasm - prealloc 1.3696 us/op 1.3528 us/op 1.01
500 bytes - uncompress - snappyjs 2.0031 us/op 1.3598 us/op 1.47
500 bytes - uncompress - snappy 1.9068 us/op 1.7818 us/op 1.07
500 bytes - uncompress - snappy-wasm 985.06 ns/op 1.1145 us/op 0.88
500 bytes - uncompress - snappy-wasm - prealloc 1.3731 us/op 1.5353 us/op 0.89
1000 bytes - uncompress - snappyjs 2.5211 us/op 2.4719 us/op 1.02
1000 bytes - uncompress - snappy 1.5432 us/op 1.6054 us/op 0.96
1000 bytes - uncompress - snappy-wasm 1.1011 us/op 1.2191 us/op 0.90
1000 bytes - uncompress - snappy-wasm - prealloc 1.2824 us/op 1.2040 us/op 1.07
10000 bytes - uncompress - snappyjs 18.679 us/op 19.668 us/op 0.95
10000 bytes - uncompress - snappy 25.318 us/op 29.110 us/op 0.87
10000 bytes - uncompress - snappy-wasm 14.441 us/op 25.941 us/op 0.56
10000 bytes - uncompress - snappy-wasm - prealloc 13.782 us/op 18.764 us/op 0.73
send data - 1000 256B messages 17.015 ms/op 14.383 ms/op 1.18
send data - 1000 512B messages 16.116 ms/op 17.289 ms/op 0.93
send data - 1000 1024B messages 33.817 ms/op 26.253 ms/op 1.29
send data - 1000 1200B messages 28.155 ms/op 28.443 ms/op 0.99
send data - 1000 2048B messages 29.929 ms/op 30.812 ms/op 0.97
send data - 1000 4096B messages 32.378 ms/op 55.332 ms/op 0.59
send data - 1000 16384B messages 107.79 ms/op 150.62 ms/op 0.72
send data - 1000 65536B messages 313.92 ms/op 294.32 ms/op 1.07
enrSubnets - fastDeserialize 64 bits 871.00 ns/op 899.00 ns/op 0.97
enrSubnets - ssz BitVector 64 bits 327.00 ns/op 427.00 ns/op 0.77
enrSubnets - fastDeserialize 4 bits 164.00 ns/op 185.00 ns/op 0.89
enrSubnets - ssz BitVector 4 bits 330.00 ns/op 406.00 ns/op 0.81
prioritizePeers score -10:0 att 32-0.1 sync 2-0 302.80 us/op 306.76 us/op 0.99
prioritizePeers score 0:0 att 32-0.25 sync 2-0.25 254.94 us/op 307.01 us/op 0.83
prioritizePeers score 0:0 att 32-0.5 sync 2-0.5 433.32 us/op 487.20 us/op 0.89
prioritizePeers score 0:0 att 64-0.75 sync 4-0.75 812.52 us/op 685.82 us/op 1.18
prioritizePeers score 0:0 att 64-1 sync 4-1 1.0772 ms/op 1.1901 ms/op 0.91
array of 16000 items push then shift 1.5536 us/op 1.5867 us/op 0.98
LinkedList of 16000 items push then shift 7.1880 ns/op 7.2630 ns/op 0.99
array of 16000 items push then pop 74.029 ns/op 74.384 ns/op 1.00
LinkedList of 16000 items push then pop 6.9740 ns/op 7.0570 ns/op 0.99
array of 24000 items push then shift 2.3023 us/op 2.4139 us/op 0.95
LinkedList of 24000 items push then shift 7.2680 ns/op 7.5030 ns/op 0.97
array of 24000 items push then pop 104.49 ns/op 104.62 ns/op 1.00
LinkedList of 24000 items push then pop 7.0240 ns/op 7.0820 ns/op 0.99
intersect bitArray bitLen 8 5.5730 ns/op 5.6620 ns/op 0.98
intersect array and set length 8 32.635 ns/op 33.209 ns/op 0.98
intersect bitArray bitLen 128 25.078 ns/op 27.472 ns/op 0.91
intersect array and set length 128 539.40 ns/op 544.56 ns/op 0.99
bitArray.getTrueBitIndexes() bitLen 128 1.0370 us/op 1.1740 us/op 0.88
bitArray.getTrueBitIndexes() bitLen 248 2.0120 us/op 1.7860 us/op 1.13
bitArray.getTrueBitIndexes() bitLen 512 3.6680 us/op 3.6500 us/op 1.00
Full columns - reconstruct all 6 blobs 315.93 us/op 301.03 us/op 1.05
Full columns - reconstruct half of the blobs out of 6 99.474 us/op 98.605 us/op 1.01
Full columns - reconstruct single blob out of 6 45.609 us/op 42.603 us/op 1.07
Half columns - reconstruct all 6 blobs 255.82 ms/op 263.85 ms/op 0.97
Half columns - reconstruct half of the blobs out of 6 129.96 ms/op 132.96 ms/op 0.98
Half columns - reconstruct single blob out of 6 47.753 ms/op 49.086 ms/op 0.97
Full columns - reconstruct all 10 blobs 281.03 us/op 293.74 us/op 0.96
Full columns - reconstruct half of the blobs out of 10 195.23 us/op 149.13 us/op 1.31
Full columns - reconstruct single blob out of 10 44.353 us/op 40.980 us/op 1.08
Half columns - reconstruct all 10 blobs 425.93 ms/op 438.63 ms/op 0.97
Half columns - reconstruct half of the blobs out of 10 218.20 ms/op 221.63 ms/op 0.98
Half columns - reconstruct single blob out of 10 47.228 ms/op 49.169 ms/op 0.96
Full columns - reconstruct all 20 blobs 1.1233 ms/op 683.38 us/op 1.64
Full columns - reconstruct half of the blobs out of 20 283.34 us/op 408.90 us/op 0.69
Full columns - reconstruct single blob out of 20 30.421 us/op 31.239 us/op 0.97
Half columns - reconstruct all 20 blobs 854.74 ms/op 875.58 ms/op 0.98
Half columns - reconstruct half of the blobs out of 20 429.31 ms/op 450.94 ms/op 0.95
Half columns - reconstruct single blob out of 20 47.571 ms/op 50.754 ms/op 0.94
Set add up to 64 items then delete first 2.0023 us/op 2.0730 us/op 0.97
OrderedSet add up to 64 items then delete first 2.9544 us/op 3.0756 us/op 0.96
Set add up to 64 items then delete last 2.2330 us/op 2.3839 us/op 0.94
OrderedSet add up to 64 items then delete last 3.2004 us/op 3.5351 us/op 0.91
Set add up to 64 items then delete middle 2.2562 us/op 2.3685 us/op 0.95
OrderedSet add up to 64 items then delete middle 4.7539 us/op 5.0293 us/op 0.95
Set add up to 128 items then delete first 4.7295 us/op 4.8239 us/op 0.98
OrderedSet add up to 128 items then delete first 6.9796 us/op 6.7901 us/op 1.03
Set add up to 128 items then delete last 4.5009 us/op 4.7002 us/op 0.96
OrderedSet add up to 128 items then delete last 6.5202 us/op 6.9485 us/op 0.94
Set add up to 128 items then delete middle 4.4163 us/op 4.5496 us/op 0.97
OrderedSet add up to 128 items then delete middle 12.734 us/op 13.293 us/op 0.96
Set add up to 256 items then delete first 9.8474 us/op 9.9490 us/op 0.99
OrderedSet add up to 256 items then delete first 14.811 us/op 14.392 us/op 1.03
Set add up to 256 items then delete last 9.3428 us/op 9.3767 us/op 1.00
OrderedSet add up to 256 items then delete last 13.487 us/op 14.364 us/op 0.94
Set add up to 256 items then delete middle 9.1705 us/op 9.3250 us/op 0.98
OrderedSet add up to 256 items then delete middle 39.306 us/op 40.920 us/op 0.96
pass gossip attestations to forkchoice per slot 3.0205 ms/op 2.5167 ms/op 1.20
forkChoice updateHead vc 100000 bc 64 eq 0 491.21 us/op 494.09 us/op 0.99
forkChoice updateHead vc 600000 bc 64 eq 0 2.9376 ms/op 2.9670 ms/op 0.99
forkChoice updateHead vc 1000000 bc 64 eq 0 4.8691 ms/op 4.9284 ms/op 0.99
forkChoice updateHead vc 600000 bc 320 eq 0 2.9384 ms/op 2.9607 ms/op 0.99
forkChoice updateHead vc 600000 bc 1200 eq 0 2.9616 ms/op 3.0068 ms/op 0.98
forkChoice updateHead vc 600000 bc 7200 eq 0 3.2262 ms/op 3.1519 ms/op 1.02
forkChoice updateHead vc 600000 bc 64 eq 1000 3.3485 ms/op 3.2503 ms/op 1.03
forkChoice updateHead vc 600000 bc 64 eq 10000 3.4810 ms/op 3.5030 ms/op 0.99
forkChoice updateHead vc 600000 bc 64 eq 300000 8.2449 ms/op 9.0240 ms/op 0.91
computeDeltas 1400000 validators 0% inactive 14.300 ms/op 14.506 ms/op 0.99
computeDeltas 1400000 validators 10% inactive 13.404 ms/op 13.489 ms/op 0.99
computeDeltas 1400000 validators 20% inactive 12.449 ms/op 12.621 ms/op 0.99
computeDeltas 1400000 validators 50% inactive 9.7434 ms/op 9.9240 ms/op 0.98
computeDeltas 2100000 validators 0% inactive 21.431 ms/op 21.710 ms/op 0.99
computeDeltas 2100000 validators 10% inactive 22.119 ms/op 20.242 ms/op 1.09
computeDeltas 2100000 validators 20% inactive 18.675 ms/op 18.876 ms/op 0.99
computeDeltas 2100000 validators 50% inactive 14.654 ms/op 14.782 ms/op 0.99
altair processAttestation - 250000 vs - 7PWei normalcase 1.8220 ms/op 1.8232 ms/op 1.00
altair processAttestation - 250000 vs - 7PWei worstcase 2.7281 ms/op 2.8194 ms/op 0.97
altair processAttestation - setStatus - 1/6 committees join 114.49 us/op 119.80 us/op 0.96
altair processAttestation - setStatus - 1/3 committees join 226.16 us/op 230.17 us/op 0.98
altair processAttestation - setStatus - 1/2 committees join 320.40 us/op 319.72 us/op 1.00
altair processAttestation - setStatus - 2/3 committees join 409.43 us/op 423.78 us/op 0.97
altair processAttestation - setStatus - 4/5 committees join 569.13 us/op 591.00 us/op 0.96
altair processAttestation - setStatus - 100% committees join 673.38 us/op 692.28 us/op 0.97
altair processBlock - 250000 vs - 7PWei normalcase 3.4676 ms/op 4.0947 ms/op 0.85
altair processBlock - 250000 vs - 7PWei normalcase hashState 17.816 ms/op 17.419 ms/op 1.02
altair processBlock - 250000 vs - 7PWei worstcase 26.979 ms/op 21.566 ms/op 1.25
altair processBlock - 250000 vs - 7PWei worstcase hashState 61.820 ms/op 66.609 ms/op 0.93
phase0 processBlock - 250000 vs - 7PWei normalcase 1.5622 ms/op 1.7320 ms/op 0.90
phase0 processBlock - 250000 vs - 7PWei worstcase 20.708 ms/op 19.263 ms/op 1.08
altair processEth1Data - 250000 vs - 7PWei normalcase 388.39 us/op 365.94 us/op 1.06
getExpectedWithdrawals 250000 eb:1,eth1:1,we:0,wn:0,smpl:15 10.535 us/op 7.6250 us/op 1.38
getExpectedWithdrawals 250000 eb:0.95,eth1:0.1,we:0.05,wn:0,smpl:219 55.051 us/op 35.369 us/op 1.56
getExpectedWithdrawals 250000 eb:0.95,eth1:0.3,we:0.05,wn:0,smpl:42 11.684 us/op 14.496 us/op 0.81
getExpectedWithdrawals 250000 eb:0.95,eth1:0.7,we:0.05,wn:0,smpl:18 5.9150 us/op 5.8080 us/op 1.02
getExpectedWithdrawals 250000 eb:0.1,eth1:0.1,we:0,wn:0,smpl:1020 137.72 us/op 146.79 us/op 0.94
getExpectedWithdrawals 250000 eb:0.03,eth1:0.03,we:0,wn:0,smpl:11777 2.4200 ms/op 1.8444 ms/op 1.31
getExpectedWithdrawals 250000 eb:0.01,eth1:0.01,we:0,wn:0,smpl:16384 2.3377 ms/op 2.4016 ms/op 0.97
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,smpl:16384 2.9375 ms/op 2.3700 ms/op 1.24
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,nocache,smpl:16384 4.6663 ms/op 4.6238 ms/op 1.01
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,smpl:16384 2.4176 ms/op 2.4558 ms/op 0.98
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,nocache,smpl:16384 4.6445 ms/op 4.6786 ms/op 0.99
Tree 40 250000 create 400.35 ms/op 375.00 ms/op 1.07
Tree 40 250000 get(125000) 126.67 ns/op 121.60 ns/op 1.04
Tree 40 250000 set(125000) 1.2354 us/op 1.2094 us/op 1.02
Tree 40 250000 toArray() 13.394 ms/op 13.167 ms/op 1.02
Tree 40 250000 iterate all - toArray() + loop 13.397 ms/op 13.173 ms/op 1.02
Tree 40 250000 iterate all - get(i) 42.012 ms/op 42.080 ms/op 1.00
Array 250000 create 2.5603 ms/op 2.5165 ms/op 1.02
Array 250000 clone - spread 823.12 us/op 816.41 us/op 1.01
Array 250000 get(125000) 0.37100 ns/op 0.35100 ns/op 1.06
Array 250000 set(125000) 0.34700 ns/op 0.34800 ns/op 1.00
Array 250000 iterate all - loop 61.814 us/op 61.362 us/op 1.01
phase0 afterProcessEpoch - 250000 vs - 7PWei 41.956 ms/op 41.273 ms/op 1.02
Array.fill - length 1000000 3.0963 ms/op 2.8889 ms/op 1.07
Array push - length 1000000 17.838 ms/op 10.845 ms/op 1.64
Array.get 0.21868 ns/op 0.21733 ns/op 1.01
Uint8Array.get 0.22513 ns/op 0.22522 ns/op 1.00
phase0 beforeProcessEpoch - 250000 vs - 7PWei 17.110 ms/op 13.723 ms/op 1.25
altair processEpoch - mainnet_e81889 276.74 ms/op 239.65 ms/op 1.15
mainnet_e81889 - altair beforeProcessEpoch 15.419 ms/op 16.430 ms/op 0.94
mainnet_e81889 - altair processJustificationAndFinalization 5.6760 us/op 5.5540 us/op 1.02
mainnet_e81889 - altair processInactivityUpdates 3.7000 ms/op 3.8922 ms/op 0.95
mainnet_e81889 - altair processRewardsAndPenalties 22.526 ms/op 26.956 ms/op 0.84
mainnet_e81889 - altair processRegistryUpdates 818.00 ns/op 737.00 ns/op 1.11
mainnet_e81889 - altair processSlashings 231.00 ns/op 193.00 ns/op 1.20
mainnet_e81889 - altair processEth1DataReset 192.00 ns/op 187.00 ns/op 1.03
mainnet_e81889 - altair processEffectiveBalanceUpdates 1.3846 ms/op 2.7397 ms/op 0.51
mainnet_e81889 - altair processSlashingsReset 794.00 ns/op 787.00 ns/op 1.01
mainnet_e81889 - altair processRandaoMixesReset 1.0130 us/op 1.0360 us/op 0.98
mainnet_e81889 - altair processHistoricalRootsUpdate 168.00 ns/op 154.00 ns/op 1.09
mainnet_e81889 - altair processParticipationFlagUpdates 552.00 ns/op 501.00 ns/op 1.10
mainnet_e81889 - altair processSyncCommitteeUpdates 126.00 ns/op 127.00 ns/op 0.99
mainnet_e81889 - altair afterProcessEpoch 43.328 ms/op 43.787 ms/op 0.99
capella processEpoch - mainnet_e217614 860.07 ms/op 748.73 ms/op 1.15
mainnet_e217614 - capella beforeProcessEpoch 67.216 ms/op 63.494 ms/op 1.06
mainnet_e217614 - capella processJustificationAndFinalization 5.4210 us/op 5.2490 us/op 1.03
mainnet_e217614 - capella processInactivityUpdates 18.007 ms/op 17.590 ms/op 1.02
mainnet_e217614 - capella processRewardsAndPenalties 104.31 ms/op 96.197 ms/op 1.08
mainnet_e217614 - capella processRegistryUpdates 5.8500 us/op 6.1600 us/op 0.95
mainnet_e217614 - capella processSlashings 258.00 ns/op 157.00 ns/op 1.64
mainnet_e217614 - capella processEth1DataReset 215.00 ns/op 157.00 ns/op 1.37
mainnet_e217614 - capella processEffectiveBalanceUpdates 13.669 ms/op 12.802 ms/op 1.07
mainnet_e217614 - capella processSlashingsReset 1.0250 us/op 778.00 ns/op 1.32
mainnet_e217614 - capella processRandaoMixesReset 1.0290 us/op 1.0580 us/op 0.97
mainnet_e217614 - capella processHistoricalRootsUpdate 275.00 ns/op 155.00 ns/op 1.77
mainnet_e217614 - capella processParticipationFlagUpdates 1.0070 us/op 494.00 ns/op 2.04
mainnet_e217614 - capella afterProcessEpoch 124.61 ms/op 114.56 ms/op 1.09
phase0 processEpoch - mainnet_e58758 244.01 ms/op 229.72 ms/op 1.06
mainnet_e58758 - phase0 beforeProcessEpoch 50.589 ms/op 54.378 ms/op 0.93
mainnet_e58758 - phase0 processJustificationAndFinalization 6.8600 us/op 8.2060 us/op 0.84
mainnet_e58758 - phase0 processRewardsAndPenalties 19.919 ms/op 19.898 ms/op 1.00
mainnet_e58758 - phase0 processRegistryUpdates 2.6990 us/op 3.3850 us/op 0.80
mainnet_e58758 - phase0 processSlashings 162.00 ns/op 159.00 ns/op 1.02
mainnet_e58758 - phase0 processEth1DataReset 192.00 ns/op 153.00 ns/op 1.25
mainnet_e58758 - phase0 processEffectiveBalanceUpdates 1.3556 ms/op 939.50 us/op 1.44
mainnet_e58758 - phase0 processSlashingsReset 871.00 ns/op 1.0360 us/op 0.84
mainnet_e58758 - phase0 processRandaoMixesReset 1.0550 us/op 1.0420 us/op 1.01
mainnet_e58758 - phase0 processHistoricalRootsUpdate 219.00 ns/op 269.00 ns/op 0.81
mainnet_e58758 - phase0 processParticipationRecordUpdates 1.0560 us/op 823.00 ns/op 1.28
mainnet_e58758 - phase0 afterProcessEpoch 34.471 ms/op 35.263 ms/op 0.98
phase0 processEffectiveBalanceUpdates - 250000 normalcase 1.2881 ms/op 1.9369 ms/op 0.67
phase0 processEffectiveBalanceUpdates - 250000 worstcase 0.5 2.1554 ms/op 1.9731 ms/op 1.09
altair processInactivityUpdates - 250000 normalcase 11.943 ms/op 14.021 ms/op 0.85
altair processInactivityUpdates - 250000 worstcase 12.181 ms/op 14.393 ms/op 0.85
phase0 processRegistryUpdates - 250000 normalcase 4.3690 us/op 6.4030 us/op 0.68
phase0 processRegistryUpdates - 250000 badcase_full_deposits 374.52 us/op 370.42 us/op 1.01
phase0 processRegistryUpdates - 250000 worstcase 0.5 69.556 ms/op 71.838 ms/op 0.97
altair processRewardsAndPenalties - 250000 normalcase 16.070 ms/op 21.448 ms/op 0.75
altair processRewardsAndPenalties - 250000 worstcase 15.341 ms/op 18.197 ms/op 0.84
phase0 getAttestationDeltas - 250000 normalcase 6.5719 ms/op 6.8033 ms/op 0.97
phase0 getAttestationDeltas - 250000 worstcase 6.5895 ms/op 6.7037 ms/op 0.98
phase0 processSlashings - 250000 worstcase 123.13 us/op 120.59 us/op 1.02
altair processSyncCommitteeUpdates - 250000 10.708 ms/op 10.943 ms/op 0.98
BeaconState.hashTreeRoot - No change 194.00 ns/op 188.00 ns/op 1.03
BeaconState.hashTreeRoot - 1 full validator 91.517 us/op 72.790 us/op 1.26
BeaconState.hashTreeRoot - 32 full validator 1.0732 ms/op 894.72 us/op 1.20
BeaconState.hashTreeRoot - 512 full validator 8.0976 ms/op 7.3514 ms/op 1.10
BeaconState.hashTreeRoot - 1 validator.effectiveBalance 109.33 us/op 86.065 us/op 1.27
BeaconState.hashTreeRoot - 32 validator.effectiveBalance 2.3531 ms/op 1.4045 ms/op 1.68
BeaconState.hashTreeRoot - 512 validator.effectiveBalance 23.039 ms/op 17.738 ms/op 1.30
BeaconState.hashTreeRoot - 1 balances 106.52 us/op 69.898 us/op 1.52
BeaconState.hashTreeRoot - 32 balances 1.3743 ms/op 1.0595 ms/op 1.30
BeaconState.hashTreeRoot - 512 balances 9.2704 ms/op 5.4288 ms/op 1.71
BeaconState.hashTreeRoot - 250000 balances 162.98 ms/op 115.75 ms/op 1.41
aggregationBits - 2048 els - zipIndexesInBitList 20.682 us/op 20.867 us/op 0.99
regular array get 100000 times 24.475 us/op 24.745 us/op 0.99
wrappedArray get 100000 times 24.474 us/op 24.114 us/op 1.01
arrayWithProxy get 100000 times 14.256 ms/op 14.674 ms/op 0.97
ssz.Root.equals 23.703 ns/op 22.553 ns/op 1.05
byteArrayEquals 23.006 ns/op 21.923 ns/op 1.05
Buffer.compare 9.9380 ns/op 9.4590 ns/op 1.05
processSlot - 1 slots 12.168 us/op 9.2250 us/op 1.32
processSlot - 32 slots 2.2629 ms/op 1.9288 ms/op 1.17
getEffectiveBalanceIncrementsZeroInactive - 250000 vs - 7PWei 2.9798 ms/op 3.3622 ms/op 0.89
getCommitteeAssignments - req 1 vs - 250000 vc 1.8369 ms/op 1.8671 ms/op 0.98
getCommitteeAssignments - req 100 vs - 250000 vc 3.6364 ms/op 3.6803 ms/op 0.99
getCommitteeAssignments - req 1000 vs - 250000 vc 3.8795 ms/op 4.0205 ms/op 0.96
findModifiedValidators - 10000 modified validators 366.36 ms/op 568.10 ms/op 0.64
findModifiedValidators - 1000 modified validators 400.41 ms/op 519.18 ms/op 0.77
findModifiedValidators - 100 modified validators 271.26 ms/op 266.13 ms/op 1.02
findModifiedValidators - 10 modified validators 183.00 ms/op 286.05 ms/op 0.64
findModifiedValidators - 1 modified validators 189.03 ms/op 148.38 ms/op 1.27
findModifiedValidators - no difference 185.42 ms/op 182.03 ms/op 1.02
migrate state 1500000 validators, 3400 modified, 2000 new 1.1575 s/op 1.1407 s/op 1.01
RootCache.getBlockRootAtSlot - 250000 vs - 7PWei 4.2200 ns/op 4.1400 ns/op 1.02
state getBlockRootAtSlot - 250000 vs - 7PWei 621.75 ns/op 612.56 ns/op 1.02
computeProposerIndex 100000 validators 1.5376 ms/op 1.5284 ms/op 1.01
getNextSyncCommitteeIndices 1000 validators 114.85 ms/op 118.45 ms/op 0.97
getNextSyncCommitteeIndices 10000 validators 114.84 ms/op 119.84 ms/op 0.96
getNextSyncCommitteeIndices 100000 validators 114.62 ms/op 118.95 ms/op 0.96
computeProposers - vc 250000 640.89 us/op 647.41 us/op 0.99
computeEpochShuffling - vc 250000 40.996 ms/op 42.103 ms/op 0.97
getNextSyncCommittee - vc 250000 10.313 ms/op 10.447 ms/op 0.99
nodejs block root to RootHex using toHex 128.26 ns/op 143.52 ns/op 0.89
nodejs block root to RootHex using toRootHex 81.622 ns/op 82.821 ns/op 0.99
nodejs fromHex(blob) 205.00 us/op 377.94 us/op 0.54
nodejs fromHexInto(blob) 696.08 us/op 715.80 us/op 0.97
nodejs block root to RootHex using the deprecated toHexString 525.01 ns/op 576.84 ns/op 0.91
browser block root to RootHex using toHex 281.76 ns/op 304.95 ns/op 0.92
browser block root to RootHex using toRootHex 152.42 ns/op 157.44 ns/op 0.97
browser fromHex(blob) 1.0805 ms/op 1.0709 ms/op 1.01
browser fromHexInto(blob) 686.91 us/op 753.60 us/op 0.91
browser block root to RootHex using the deprecated toHexString 360.38 ns/op 413.32 ns/op 0.87

by benchmarkbot/action

@nflaig nflaig changed the title chore: use map to lookup combined beacon committee selection for duty refactor: use map to lookup combined beacon committee selection for duty Dec 20, 2025
@wemeetagain
wemeetagain merged commit 075956b into unstable Dec 31, 2025
33 of 41 checks passed
@wemeetagain
wemeetagain deleted the nflaig/use-map branch December 31, 2025 15:11
@codecov

codecov Bot commented Dec 31, 2025

Copy link
Copy Markdown

Codecov Report

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

Additional details and impacted files
@@            Coverage Diff            @@
##           unstable    #8710   +/-   ##
=========================================
  Coverage     52.06%   52.06%           
=========================================
  Files           848      848           
  Lines         64787    64787           
  Branches       4771     4771           
=========================================
  Hits          33729    33729           
  Misses        30989    30989           
  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.

@wemeetagain

Copy link
Copy Markdown
Member

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