Skip to content

feat: add getStateBuilders endpoint#9593

Open
nflaig wants to merge 2 commits into
unstablefrom
nflaig/state-builders-api
Open

feat: add getStateBuilders endpoint#9593
nflaig wants to merge 2 commits into
unstablefrom
nflaig/state-builders-api

Conversation

@nflaig

@nflaig nflaig commented Jul 5, 2026

Copy link
Copy Markdown
Member

Motivation

Implement POST /eth/v1/beacon/states/{state_id}/builders added to the beacon-api spec in ethereum/beacon-APIs#614.

Description

  • add getStateBuilders route, filterable by builder ids (hex encoded public key or builder index) and statuses (pending, active, exited)
  • add getBuildersLength() to the beacon state view to enumerate the builder registry
  • returns 400 if the requested state is prior to gloas, ids that do not match a known builder are skipped without error as per spec
  • builder pubkey lookups are a linear scan over the registry, can consider a builder pubkey cache if this becomes a performance issue

@nflaig nflaig requested a review from a team as a code owner July 5, 2026 09:33

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e923627cb8

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/beacon-node/src/api/impl/beacon/state/utils.ts Outdated
Comment thread packages/beacon-node/src/api/impl/beacon/state/index.ts

@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 introduces the getStateBuilders endpoint (POST /eth/v1/beacon/states/{state_id}/builders) to retrieve and filter builders from a Gloas state by ID and status. It includes updates to state views, types, helper functions, and unit tests. The review feedback points out a potential out-of-bounds issue where negative builder indices are not rejected as invalid, and suggests moving the uniqueness validation for statuses to the beginning of the handler to prevent it from being bypassed when builderIds are provided.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread packages/beacon-node/src/api/impl/beacon/state/utils.ts Outdated
Comment thread packages/beacon-node/src/api/impl/beacon/state/index.ts
Comment thread packages/beacon-node/src/api/impl/beacon/state/index.ts
@github-actions

github-actions Bot commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

Performance Report

✔️ no performance regression detected

Full benchmark results
Benchmark suite Current: a7594b0 Previous: c0e6c9e Ratio
getPubkeys - index2pubkey - req 1000 vs - 250000 vc 844.22 us/op 846.97 us/op 1.00
getPubkeys - validatorsArr - req 1000 vs - 250000 vc 38.501 us/op 38.626 us/op 1.00
BLS verify - blst 701.26 us/op 747.82 us/op 0.94
BLS verifyMultipleSignatures 3 - blst 1.3519 ms/op 1.3542 ms/op 1.00
BLS verifyMultipleSignatures 8 - blst 2.1506 ms/op 2.1454 ms/op 1.00
BLS verifyMultipleSignatures 32 - blst 6.8976 ms/op 6.8110 ms/op 1.01
BLS verifyMultipleSignatures 64 - blst 13.791 ms/op 13.058 ms/op 1.06
BLS verifyMultipleSignatures 128 - blst 25.535 ms/op 25.399 ms/op 1.01
BLS deserializing 10000 signatures 638.81 ms/op 628.10 ms/op 1.02
BLS deserializing 100000 signatures 6.3227 s/op 6.2786 s/op 1.01
BLS verifyMultipleSignatures - same message - 3 - blst 752.61 us/op 805.63 us/op 0.93
BLS verifyMultipleSignatures - same message - 8 - blst 820.44 us/op 934.28 us/op 0.88
BLS verifyMultipleSignatures - same message - 32 - blst 1.5334 ms/op 1.4913 ms/op 1.03
BLS verifyMultipleSignatures - same message - 64 - blst 2.3470 ms/op 2.3520 ms/op 1.00
BLS verifyMultipleSignatures - same message - 128 - blst 4.0054 ms/op 4.0338 ms/op 0.99
BLS aggregatePubkeys 32 - blst 17.383 us/op 17.522 us/op 0.99
BLS aggregatePubkeys 128 - blst 62.393 us/op 62.783 us/op 0.99
getSlashingsAndExits - default max 46.573 us/op 47.566 us/op 0.98
getSlashingsAndExits - 2k 324.52 us/op 331.89 us/op 0.98
proposeBlockBody type=full, size=empty 682.57 us/op 599.71 us/op 1.14
isKnown best case - 1 super set check 169.00 ns/op 185.00 ns/op 0.91
isKnown normal case - 2 super set checks 154.00 ns/op 158.00 ns/op 0.97
isKnown worse case - 16 super set checks 166.00 ns/op 163.00 ns/op 1.02
validate api signedAggregateAndProof - struct 1.5108 ms/op 1.5099 ms/op 1.00
validate gossip signedAggregateAndProof - struct 1.5088 ms/op 1.5068 ms/op 1.00
batch validate gossip attestation - vc 640000 - chunk 32 107.75 us/op 105.82 us/op 1.02
batch validate gossip attestation - vc 640000 - chunk 64 93.877 us/op 92.122 us/op 1.02
batch validate gossip attestation - vc 640000 - chunk 128 86.974 us/op 85.142 us/op 1.02
batch validate gossip attestation - vc 640000 - chunk 256 82.601 us/op 81.515 us/op 1.01
bytes32 toHexString 287.00 ns/op 305.00 ns/op 0.94
bytes32 Buffer.toString(hex) 161.00 ns/op 163.00 ns/op 0.99
bytes32 Buffer.toString(hex) from Uint8Array 234.00 ns/op 237.00 ns/op 0.99
bytes32 Buffer.toString(hex) + 0x 162.00 ns/op 165.00 ns/op 0.98
Return object 10000 times 0.21250 ns/op 0.21020 ns/op 1.01
Throw Error 10000 times 3.3679 us/op 3.3020 us/op 1.02
toHex 95.248 ns/op 100.56 ns/op 0.95
Buffer.from 86.591 ns/op 91.512 ns/op 0.95
shared Buffer 61.136 ns/op 62.545 ns/op 0.98
fastMsgIdFn sha256 / 200 bytes 1.4850 us/op 1.4470 us/op 1.03
fastMsgIdFn h32 xxhash / 200 bytes 157.00 ns/op 151.00 ns/op 1.04
fastMsgIdFn h64 xxhash / 200 bytes 200.00 ns/op 202.00 ns/op 0.99
fastMsgIdFn sha256 / 1000 bytes 4.7590 us/op 4.6960 us/op 1.01
fastMsgIdFn h32 xxhash / 1000 bytes 252.00 ns/op 237.00 ns/op 1.06
fastMsgIdFn h64 xxhash / 1000 bytes 254.00 ns/op 251.00 ns/op 1.01
fastMsgIdFn sha256 / 10000 bytes 42.126 us/op 41.509 us/op 1.01
fastMsgIdFn h32 xxhash / 10000 bytes 1.2850 us/op 1.2650 us/op 1.02
fastMsgIdFn h64 xxhash / 10000 bytes 834.00 ns/op 828.00 ns/op 1.01
send data - 1000 256B messages 4.1283 ms/op 3.9928 ms/op 1.03
send data - 1000 512B messages 5.0115 ms/op 5.0047 ms/op 1.00
send data - 1000 1024B messages 5.0699 ms/op 5.3726 ms/op 0.94
send data - 1000 1200B messages 7.9440 ms/op 6.3819 ms/op 1.24
send data - 1000 2048B messages 15.891 ms/op 9.2762 ms/op 1.71
send data - 1000 4096B messages 60.204 ms/op 21.273 ms/op 2.83
send data - 1000 16384B messages 244.01 ms/op 257.40 ms/op 0.95
send data - 1000 65536B messages 1.0373 s/op 1.2016 s/op 0.86
enrSubnets - fastDeserialize 64 bits 735.00 ns/op 738.00 ns/op 1.00
enrSubnets - ssz BitVector 64 bits 267.00 ns/op 256.00 ns/op 1.04
enrSubnets - fastDeserialize 4 bits 98.000 ns/op 104.00 ns/op 0.94
enrSubnets - ssz BitVector 4 bits 266.00 ns/op 264.00 ns/op 1.01
prioritizePeers score -10:0 att 32-0.1 sync 2-0 205.67 us/op 204.73 us/op 1.00
prioritizePeers score 0:0 att 32-0.25 sync 2-0.25 232.30 us/op 234.48 us/op 0.99
prioritizePeers score 0:0 att 32-0.5 sync 2-0.5 335.15 us/op 338.41 us/op 0.99
prioritizePeers score 0:0 att 64-0.75 sync 4-0.75 599.93 us/op 607.34 us/op 0.99
prioritizePeers score 0:0 att 64-1 sync 4-1 708.73 us/op 700.85 us/op 1.01
array of 16000 items push then shift 1.2875 us/op 1.2879 us/op 1.00
LinkedList of 16000 items push then shift 7.0970 ns/op 6.7460 ns/op 1.05
array of 16000 items push then pop 67.104 ns/op 64.283 ns/op 1.04
LinkedList of 16000 items push then pop 5.9490 ns/op 5.8980 ns/op 1.01
array of 24000 items push then shift 1.9124 us/op 1.8975 us/op 1.01
LinkedList of 24000 items push then shift 6.7180 ns/op 6.4290 ns/op 1.04
array of 24000 items push then pop 91.767 ns/op 88.895 ns/op 1.03
LinkedList of 24000 items push then pop 5.9380 ns/op 5.9120 ns/op 1.00
intersect bitArray bitLen 8 4.7190 ns/op 4.7250 ns/op 1.00
intersect array and set length 8 29.101 ns/op 29.177 ns/op 1.00
intersect bitArray bitLen 128 23.947 ns/op 23.926 ns/op 1.00
intersect array and set length 128 490.79 ns/op 493.38 ns/op 0.99
bitArray.getTrueBitIndexes() bitLen 128 1.1120 us/op 1.0700 us/op 1.04
bitArray.getTrueBitIndexes() bitLen 248 1.7710 us/op 1.7340 us/op 1.02
bitArray.getTrueBitIndexes() bitLen 512 3.5740 us/op 3.5630 us/op 1.00
Full columns - reconstruct all 6 blobs 118.99 us/op 114.46 us/op 1.04
Full columns - reconstruct half of the blobs out of 6 102.11 us/op 93.973 us/op 1.09
Full columns - reconstruct single blob out of 6 31.683 us/op 34.070 us/op 0.93
Half columns - reconstruct all 6 blobs 376.68 ms/op 375.58 ms/op 1.00
Half columns - reconstruct half of the blobs out of 6 187.15 ms/op 188.85 ms/op 0.99
Half columns - reconstruct single blob out of 6 65.892 ms/op 65.789 ms/op 1.00
Set add up to 64 items then delete first 1.6851 us/op 1.6540 us/op 1.02
OrderedSet add up to 64 items then delete first 2.5403 us/op 2.5157 us/op 1.01
Set add up to 64 items then delete last 1.8813 us/op 1.8958 us/op 0.99
OrderedSet add up to 64 items then delete last 2.8924 us/op 2.7857 us/op 1.04
Set add up to 64 items then delete middle 1.9152 us/op 1.9069 us/op 1.00
OrderedSet add up to 64 items then delete middle 4.3921 us/op 4.2583 us/op 1.03
Set add up to 128 items then delete first 3.6859 us/op 3.7937 us/op 0.97
OrderedSet add up to 128 items then delete first 5.4202 us/op 5.7266 us/op 0.95
Set add up to 128 items then delete last 3.6939 us/op 3.6517 us/op 1.01
OrderedSet add up to 128 items then delete last 5.5977 us/op 5.3473 us/op 1.05
Set add up to 128 items then delete middle 3.6938 us/op 3.6653 us/op 1.01
OrderedSet add up to 128 items then delete middle 11.693 us/op 11.164 us/op 1.05
Set add up to 256 items then delete first 7.3015 us/op 7.4335 us/op 0.98
OrderedSet add up to 256 items then delete first 11.018 us/op 11.629 us/op 0.95
Set add up to 256 items then delete last 7.3382 us/op 7.2700 us/op 1.01
OrderedSet add up to 256 items then delete last 11.446 us/op 10.957 us/op 1.04
Set add up to 256 items then delete middle 7.3547 us/op 7.1590 us/op 1.03
OrderedSet add up to 256 items then delete middle 34.968 us/op 34.138 us/op 1.02
runFastConfirmationRules vc:100000 bc:96 eq:0 3.8060 us/op 4.0100 us/op 0.95
runFastConfirmationRules vc:600000 bc:96 eq:0 3.6890 us/op 3.6910 us/op 1.00
runFastConfirmationRules vc:1000000 bc:96 eq:0 3.7560 us/op 3.7370 us/op 1.01
runFastConfirmationRules vc:600000 bc:320 eq:0 9.7920 us/op 9.2370 us/op 1.06
runFastConfirmationRules vc:600000 bc:1200 eq:0 35.339 us/op 38.679 us/op 0.91
runFastConfirmationRules vc:600000 bc:96 eq:1000 3.3190 us/op 3.5120 us/op 0.95
runFastConfirmationRules vc:600000 bc:96 eq:10000 3.4170 us/op 3.7900 us/op 0.90
runFastConfirmationRules vc:600000 bc:96 eq:300000 3.0550 us/op 3.7050 us/op 0.82
pass gossip attestations to forkchoice per slot 2.5599 ms/op 2.5593 ms/op 1.00
forkChoice updateHead vc 100000 bc 64 eq 0 438.27 us/op 456.30 us/op 0.96
forkChoice updateHead vc 600000 bc 64 eq 0 2.5968 ms/op 2.6531 ms/op 0.98
forkChoice updateHead vc 1000000 bc 64 eq 0 4.3136 ms/op 4.4162 ms/op 0.98
forkChoice updateHead vc 600000 bc 320 eq 0 2.5660 ms/op 2.6755 ms/op 0.96
forkChoice updateHead vc 600000 bc 1200 eq 0 2.6348 ms/op 2.7764 ms/op 0.95
forkChoice updateHead vc 600000 bc 7200 eq 0 2.8837 ms/op 2.9957 ms/op 0.96
forkChoice updateHead vc 600000 bc 64 eq 1000 2.6866 ms/op 2.7941 ms/op 0.96
forkChoice updateHead vc 600000 bc 64 eq 10000 2.7566 ms/op 2.9143 ms/op 0.95
forkChoice updateHead vc 600000 bc 64 eq 300000 6.7689 ms/op 6.9162 ms/op 0.98
computeDeltas 1400000 validators 0% inactive 12.576 ms/op 13.169 ms/op 0.95
computeDeltas 1400000 validators 10% inactive 12.003 ms/op 12.382 ms/op 0.97
computeDeltas 1400000 validators 20% inactive 10.952 ms/op 11.337 ms/op 0.97
computeDeltas 1400000 validators 50% inactive 8.2655 ms/op 8.5044 ms/op 0.97
computeDeltas 2100000 validators 0% inactive 18.962 ms/op 19.974 ms/op 0.95
computeDeltas 2100000 validators 10% inactive 17.679 ms/op 18.937 ms/op 0.93
computeDeltas 2100000 validators 20% inactive 16.732 ms/op 17.168 ms/op 0.97
computeDeltas 2100000 validators 50% inactive 9.5120 ms/op 10.168 ms/op 0.94
altair processAttestation - 250000 vs - 7PWei normalcase 1.5952 ms/op 1.5899 ms/op 1.00
altair processAttestation - 250000 vs - 7PWei worstcase 2.3540 ms/op 2.3650 ms/op 1.00
altair processAttestation - setStatus - 1/6 committees join 97.056 us/op 100.34 us/op 0.97
altair processAttestation - setStatus - 1/3 committees join 193.51 us/op 198.69 us/op 0.97
altair processAttestation - setStatus - 1/2 committees join 273.06 us/op 281.57 us/op 0.97
altair processAttestation - setStatus - 2/3 committees join 355.12 us/op 364.58 us/op 0.97
altair processAttestation - setStatus - 4/5 committees join 493.43 us/op 500.39 us/op 0.99
altair processAttestation - setStatus - 100% committees join 573.00 us/op 585.53 us/op 0.98
altair processBlock - 250000 vs - 7PWei normalcase 2.7661 ms/op 2.7945 ms/op 0.99
altair processBlock - 250000 vs - 7PWei normalcase hashState 11.811 ms/op 11.766 ms/op 1.00
altair processBlock - 250000 vs - 7PWei worstcase 19.107 ms/op 18.622 ms/op 1.03
altair processBlock - 250000 vs - 7PWei worstcase hashState 38.828 ms/op 38.077 ms/op 1.02
phase0 processBlock - 250000 vs - 7PWei normalcase 1.2931 ms/op 1.2810 ms/op 1.01
phase0 processBlock - 250000 vs - 7PWei worstcase 16.339 ms/op 16.773 ms/op 0.97
altair processEth1Data - 250000 vs - 7PWei normalcase 291.23 us/op 303.62 us/op 0.96
getExpectedWithdrawals 250000 eb:1,eth1:1,we:0,wn:0,smpl:16 3.1940 us/op 3.6150 us/op 0.88
getExpectedWithdrawals 250000 eb:0.95,eth1:0.1,we:0.05,wn:0,smpl:220 20.342 us/op 35.575 us/op 0.57
getExpectedWithdrawals 250000 eb:0.95,eth1:0.3,we:0.05,wn:0,smpl:43 5.9950 us/op 9.1950 us/op 0.65
getExpectedWithdrawals 250000 eb:0.95,eth1:0.7,we:0.05,wn:0,smpl:19 4.1830 us/op 5.4530 us/op 0.77
getExpectedWithdrawals 250000 eb:0.1,eth1:0.1,we:0,wn:0,smpl:1021 96.189 us/op 102.25 us/op 0.94
getExpectedWithdrawals 250000 eb:0.03,eth1:0.03,we:0,wn:0,smpl:11778 1.3773 ms/op 1.3507 ms/op 1.02
getExpectedWithdrawals 250000 eb:0.01,eth1:0.01,we:0,wn:0,smpl:16384 1.7915 ms/op 1.7878 ms/op 1.00
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,smpl:16384 1.7976 ms/op 1.7847 ms/op 1.01
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,nocache,smpl:16384 3.5581 ms/op 3.6366 ms/op 0.98
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,smpl:16384 2.0252 ms/op 2.0255 ms/op 1.00
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,nocache,smpl:16384 3.8918 ms/op 3.9792 ms/op 0.98
Tree 40 250000 create 298.36 ms/op 301.83 ms/op 0.99
Tree 40 250000 get(125000) 94.004 ns/op 107.94 ns/op 0.87
Tree 40 250000 set(125000) 1.0292 us/op 1.0467 us/op 0.98
Tree 40 250000 toArray() 8.9152 ms/op 9.0319 ms/op 0.99
Tree 40 250000 iterate all - toArray() + loop 9.0674 ms/op 9.0362 ms/op 1.00
Tree 40 250000 iterate all - get(i) 32.820 ms/op 34.595 ms/op 0.95
Array 250000 create 2.0168 ms/op 1.9862 ms/op 1.02
Array 250000 clone - spread 651.47 us/op 641.68 us/op 1.02
Array 250000 get(125000) 0.29300 ns/op 0.28800 ns/op 1.02
Array 250000 set(125000) 0.29300 ns/op 0.33800 ns/op 0.87
Array 250000 iterate all - loop 56.530 us/op 56.227 us/op 1.01
phase0 afterProcessEpoch - 250000 vs - 7PWei 40.160 ms/op 38.903 ms/op 1.03
Array.fill - length 1000000 2.2090 ms/op 1.9618 ms/op 1.13
Array push - length 1000000 7.4951 ms/op 7.4751 ms/op 1.00
Array.get 0.20222 ns/op 0.20391 ns/op 0.99
Uint8Array.get 0.23637 ns/op 0.25872 ns/op 0.91
phase0 beforeProcessEpoch - 250000 vs - 7PWei 11.133 ms/op 14.046 ms/op 0.79
altair processEpoch - mainnet_e81889 228.20 ms/op 217.39 ms/op 1.05
mainnet_e81889 - altair beforeProcessEpoch 13.064 ms/op 13.314 ms/op 0.98
mainnet_e81889 - altair processJustificationAndFinalization 4.7070 us/op 4.7070 us/op 1.00
mainnet_e81889 - altair processInactivityUpdates 3.4430 ms/op 3.4936 ms/op 0.99
mainnet_e81889 - altair processRewardsAndPenalties 16.153 ms/op 16.317 ms/op 0.99
mainnet_e81889 - altair processRegistryUpdates 528.00 ns/op 518.00 ns/op 1.02
mainnet_e81889 - altair processSlashings 132.00 ns/op 136.00 ns/op 0.97
mainnet_e81889 - altair processEth1DataReset 130.00 ns/op 129.00 ns/op 1.01
mainnet_e81889 - altair processEffectiveBalanceUpdates 1.6402 ms/op 1.1618 ms/op 1.41
mainnet_e81889 - altair processSlashingsReset 658.00 ns/op 685.00 ns/op 0.96
mainnet_e81889 - altair processRandaoMixesReset 1.0030 us/op 1.0150 us/op 0.99
mainnet_e81889 - altair processHistoricalRootsUpdate 128.00 ns/op 135.00 ns/op 0.95
mainnet_e81889 - altair processParticipationFlagUpdates 421.00 ns/op 408.00 ns/op 1.03
mainnet_e81889 - altair processSyncCommitteeUpdates 109.00 ns/op 103.00 ns/op 1.06
mainnet_e81889 - altair afterProcessEpoch 40.789 ms/op 42.272 ms/op 0.96
capella processEpoch - mainnet_e217614 689.20 ms/op 720.34 ms/op 0.96
mainnet_e217614 - capella beforeProcessEpoch 52.705 ms/op 65.446 ms/op 0.81
mainnet_e217614 - capella processJustificationAndFinalization 5.0510 us/op 5.2600 us/op 0.96
mainnet_e217614 - capella processInactivityUpdates 11.196 ms/op 11.398 ms/op 0.98
mainnet_e217614 - capella processRewardsAndPenalties 84.196 ms/op 82.862 ms/op 1.02
mainnet_e217614 - capella processRegistryUpdates 4.3640 us/op 4.3960 us/op 0.99
mainnet_e217614 - capella processSlashings 135.00 ns/op 134.00 ns/op 1.01
mainnet_e217614 - capella processEth1DataReset 125.00 ns/op 130.00 ns/op 0.96
mainnet_e217614 - capella processEffectiveBalanceUpdates 5.0998 ms/op 5.2401 ms/op 0.97
mainnet_e217614 - capella processSlashingsReset 654.00 ns/op 672.00 ns/op 0.97
mainnet_e217614 - capella processRandaoMixesReset 1.0160 us/op 1.1130 us/op 0.91
mainnet_e217614 - capella processHistoricalRootsUpdate 128.00 ns/op 132.00 ns/op 0.97
mainnet_e217614 - capella processParticipationFlagUpdates 417.00 ns/op 421.00 ns/op 0.99
mainnet_e217614 - capella afterProcessEpoch 107.04 ms/op 107.62 ms/op 0.99
phase0 processEpoch - mainnet_e58758 223.37 ms/op 235.95 ms/op 0.95
mainnet_e58758 - phase0 beforeProcessEpoch 39.120 ms/op 47.284 ms/op 0.83
mainnet_e58758 - phase0 processJustificationAndFinalization 4.5660 us/op 4.8620 us/op 0.94
mainnet_e58758 - phase0 processRewardsAndPenalties 14.722 ms/op 14.356 ms/op 1.03
mainnet_e58758 - phase0 processRegistryUpdates 2.1650 us/op 2.2250 us/op 0.97
mainnet_e58758 - phase0 processSlashings 125.00 ns/op 133.00 ns/op 0.94
mainnet_e58758 - phase0 processEth1DataReset 124.00 ns/op 127.00 ns/op 0.98
mainnet_e58758 - phase0 processEffectiveBalanceUpdates 1.0053 ms/op 960.37 us/op 1.05
mainnet_e58758 - phase0 processSlashingsReset 782.00 ns/op 815.00 ns/op 0.96
mainnet_e58758 - phase0 processRandaoMixesReset 1.0020 us/op 1.0870 us/op 0.92
mainnet_e58758 - phase0 processHistoricalRootsUpdate 130.00 ns/op 147.00 ns/op 0.88
mainnet_e58758 - phase0 processParticipationRecordUpdates 969.00 ns/op 936.00 ns/op 1.04
mainnet_e58758 - phase0 afterProcessEpoch 32.851 ms/op 33.876 ms/op 0.97
phase0 processEffectiveBalanceUpdates - 250000 normalcase 999.86 us/op 1.0858 ms/op 0.92
phase0 processEffectiveBalanceUpdates - 250000 worstcase 0.5 1.6983 ms/op 1.6319 ms/op 1.04
altair processInactivityUpdates - 250000 normalcase 10.364 ms/op 10.318 ms/op 1.00
altair processInactivityUpdates - 250000 worstcase 10.338 ms/op 10.364 ms/op 1.00
phase0 processRegistryUpdates - 250000 normalcase 2.5030 us/op 2.2080 us/op 1.13
phase0 processRegistryUpdates - 250000 badcase_full_deposits 139.77 us/op 137.13 us/op 1.02
phase0 processRegistryUpdates - 250000 worstcase 0.5 46.116 ms/op 54.113 ms/op 0.85
altair processRewardsAndPenalties - 250000 normalcase 13.495 ms/op 12.837 ms/op 1.05
altair processRewardsAndPenalties - 250000 worstcase 13.134 ms/op 12.486 ms/op 1.05
phase0 getAttestationDeltas - 250000 normalcase 5.2760 ms/op 7.9034 ms/op 0.67
phase0 getAttestationDeltas - 250000 worstcase 5.3024 ms/op 5.4615 ms/op 0.97
phase0 processSlashings - 250000 worstcase 62.119 us/op 59.494 us/op 1.04
altair processSyncCommitteeUpdates - 250000 9.9551 ms/op 10.018 ms/op 0.99
BeaconState.hashTreeRoot - No change 171.00 ns/op 178.00 ns/op 0.96
BeaconState.hashTreeRoot - 1 full validator 56.005 us/op 78.158 us/op 0.72
BeaconState.hashTreeRoot - 32 full validator 608.31 us/op 899.14 us/op 0.68
BeaconState.hashTreeRoot - 512 full validator 5.9465 ms/op 6.3736 ms/op 0.93
BeaconState.hashTreeRoot - 1 validator.effectiveBalance 68.380 us/op 75.874 us/op 0.90
BeaconState.hashTreeRoot - 32 validator.effectiveBalance 984.48 us/op 1.4060 ms/op 0.70
BeaconState.hashTreeRoot - 512 validator.effectiveBalance 12.198 ms/op 14.509 ms/op 0.84
BeaconState.hashTreeRoot - 1 balances 54.743 us/op 57.684 us/op 0.95
BeaconState.hashTreeRoot - 32 balances 542.62 us/op 584.91 us/op 0.93
BeaconState.hashTreeRoot - 512 balances 4.5456 ms/op 5.0628 ms/op 0.90
BeaconState.hashTreeRoot - 250000 balances 97.903 ms/op 115.34 ms/op 0.85
aggregationBits - 2048 els - zipIndexesInBitList 18.555 us/op 19.190 us/op 0.97
regular array get 100000 times 22.629 us/op 23.027 us/op 0.98
wrappedArray get 100000 times 22.628 us/op 23.073 us/op 0.98
arrayWithProxy get 100000 times 10.665 ms/op 12.944 ms/op 0.82
ssz.Root.equals 21.428 ns/op 21.570 ns/op 0.99
byteArrayEquals 21.222 ns/op 21.361 ns/op 0.99
Buffer.compare 8.8450 ns/op 8.8710 ns/op 1.00
processSlot - 1 slots 7.9100 us/op 8.1250 us/op 0.97
processSlot - 32 slots 1.5171 ms/op 1.6850 ms/op 0.90
getEffectiveBalanceIncrementsZeroInactive - 250000 vs - 7PWei 2.9232 ms/op 3.2495 ms/op 0.90
getCommitteeAssignments - req 1 vs - 250000 vc 1.6569 ms/op 1.6670 ms/op 0.99
getCommitteeAssignments - req 100 vs - 250000 vc 3.3794 ms/op 3.4007 ms/op 0.99
getCommitteeAssignments - req 1000 vs - 250000 vc 3.6286 ms/op 3.6462 ms/op 1.00
findModifiedValidators - 10000 modified validators 633.06 ms/op 779.70 ms/op 0.81
findModifiedValidators - 1000 modified validators 528.99 ms/op 503.46 ms/op 1.05
findModifiedValidators - 100 modified validators 340.43 ms/op 355.46 ms/op 0.96
findModifiedValidators - 10 modified validators 230.81 ms/op 254.04 ms/op 0.91
findModifiedValidators - 1 modified validators 180.99 ms/op 136.38 ms/op 1.33
findModifiedValidators - no difference 180.90 ms/op 180.29 ms/op 1.00
migrate state 1500000 validators, 3400 modified, 2000 new 2.5675 s/op 2.6951 s/op 0.95
RootCache.getBlockRootAtSlot - 250000 vs - 7PWei 3.8000 ns/op 3.7800 ns/op 1.01
state getBlockRootAtSlot - 250000 vs - 7PWei 291.60 ns/op 442.75 ns/op 0.66
computeProposerIndex 100000 validators 1.3241 ms/op 1.3769 ms/op 0.96
getNextSyncCommitteeIndices 1000 validators 2.8587 ms/op 2.8728 ms/op 1.00
getNextSyncCommitteeIndices 10000 validators 25.206 ms/op 25.479 ms/op 0.99
getNextSyncCommitteeIndices 100000 validators 83.979 ms/op 88.329 ms/op 0.95
computeProposers - vc 250000 558.81 us/op 550.91 us/op 1.01
computeEpochShuffling - vc 250000 39.315 ms/op 39.710 ms/op 0.99
getNextSyncCommittee - vc 250000 9.6681 ms/op 9.3881 ms/op 1.03
nodejs block root to RootHex using toHex 96.602 ns/op 98.178 ns/op 0.98
nodejs block root to RootHex using toRootHex 62.810 ns/op 63.292 ns/op 0.99
nodejs fromHex(blob) 748.06 us/op 773.99 us/op 0.97
nodejs fromHexInto(blob) 632.83 us/op 633.10 us/op 1.00
nodejs block root to RootHex using the deprecated toHexString 483.04 ns/op 484.38 ns/op 1.00
nodejs byteArrayEquals 32 bytes (block root) 26.067 ns/op 25.927 ns/op 1.01
nodejs byteArrayEquals 48 bytes (pubkey) 37.760 ns/op 37.466 ns/op 1.01
nodejs byteArrayEquals 96 bytes (signature) 35.918 ns/op 37.794 ns/op 0.95
nodejs byteArrayEquals 1024 bytes 43.900 ns/op 45.977 ns/op 0.95
nodejs byteArrayEquals 131072 bytes (blob) 1.7480 us/op 1.7687 us/op 0.99
browser block root to RootHex using toHex 145.23 ns/op 145.50 ns/op 1.00
browser block root to RootHex using toRootHex 131.52 ns/op 132.05 ns/op 1.00
browser fromHex(blob) 1.5514 ms/op 1.5550 ms/op 1.00
browser fromHexInto(blob) 635.19 us/op 648.74 us/op 0.98
browser block root to RootHex using the deprecated toHexString 338.38 ns/op 341.51 ns/op 0.99
browser byteArrayEquals 32 bytes (block root) 28.414 ns/op 27.671 ns/op 1.03
browser byteArrayEquals 48 bytes (pubkey) 40.146 ns/op 38.988 ns/op 1.03
browser byteArrayEquals 96 bytes (signature) 74.741 ns/op 72.974 ns/op 1.02
browser byteArrayEquals 1024 bytes 763.30 ns/op 753.66 ns/op 1.01
browser byteArrayEquals 131072 bytes (blob) 96.215 us/op 94.290 us/op 1.02

by benchmarkbot/action

@nflaig nflaig left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@lodekeeper please review/approve if it looks good

@lodekeeper lodekeeper 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.

LGTM — reviewed the full diff. Clean new endpoint that mirrors getStateValidators end-to-end:

  • getStateBuilders follows the validators pattern exactly: pre-Gloas → 400, ids-path + full-scan path, assertUniqueItems on both ids and statuses, status filtering.
  • getStateBuilderIndex mirrors getStateValidatorIndex and guards the edges correctly — < 0 / non-safe-integer → 400, >= getBuildersLength() → 404 (future state), pre-Gloas throws. Linear pubkey scan is reasonable given there's no builder pubkey cache and the registry is small.
  • Good catch fixing the same negative-index gap in getStateValidatorIndex (d7c793a5d7) and adding the regression tests.
  • getBuilderStatus (exited → active → pending) reads clean and matches beacon-APIs #614.
  • getBuildersLength added to both state views with pre-Gloas guards, memoized on the native view.

Bot threads all resolved. 👍

lodekeeper

This comment was marked as duplicate.

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.

2 participants