Skip to content

feat: add ptc state endpoint - #10190

Merged
nflaig merged 6 commits into
unstablefrom
nflaig/ptc-state-endpoint
Oct 7, 2026
Merged

nflaig merged 6 commits into
unstablefrom
nflaig/ptc-state-endpoint

Conversation

@nflaig

@nflaig nflaig commented Sep 26, 2026 •

Copy link
Copy Markdown
Member

Motivation

Implement ethereum/beacon-APIs#657 and SSZ support from ethereum/beacon-APIs#661 so consumers can retrieve the PTC for a slot without fetching the full state.

Description

  • add the endpoint to the API client and beacon node with JSON and SSZ responses
  • preserve committee order and duplicates, default to the state's slot and validate the fork and PTC window
  • cover the endpoint with client/server tests and focused handler tests

@nflaig
nflaig marked this pull request as ready for review September 26, 2026 14:48
@nflaig
nflaig requested a review from a team as a code owner September 26, 2026 14:48
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 26, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-07T17:10:05.873592Z 0f552e5 Draft marked ready
🔒 Security Review ✅ Completed 2026-10-07T17:09:57.241340Z 0f552e5 Draft marked ready
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions

github-actions Bot commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

Performance Report

✔️ no performance regression detected

Full benchmark results
Benchmark suite Current: 151d778 Previous: fda8006 Ratio
getPubkeys - native cache - req 1000 vs - 250000 vc 431.12 us/op 521.13 us/op 0.83
getPubkeys - validatorsArr - req 1000 vs - 250000 vc 32.222 us/op 37.877 us/op 0.85
BLS verify - blst 729.54 us/op 732.86 us/op 1.00
BLS verifyMultipleSignatures 3 - blst 1.0680 ms/op 1.1022 ms/op 0.97
BLS verifyMultipleSignatures 8 - blst 1.7874 ms/op 1.8246 ms/op 0.98
BLS verifyMultipleSignatures 32 - blst 5.5811 ms/op 5.7841 ms/op 0.96
BLS verifyMultipleSignatures 64 - blst 10.406 ms/op 10.793 ms/op 0.96
BLS verifyMultipleSignatures 128 - blst 20.121 ms/op 21.048 ms/op 0.96
BLS deserializing 10000 signatures 476.68 ms/op 503.12 ms/op 0.95
BLS deserializing 100000 signatures 4.8136 s/op 5.1754 s/op 0.93
BLS verifyMultipleSignatures - same message - 3 - blst 771.67 us/op 790.51 us/op 0.98
BLS verifyMultipleSignatures - same message - 8 - blst 857.41 us/op 925.35 us/op 0.93
BLS verifyMultipleSignatures - same message - 32 - blst 1.3227 ms/op 1.3968 ms/op 0.95
BLS verifyMultipleSignatures - same message - 64 - blst 1.9475 ms/op 1.9899 ms/op 0.98
BLS verifyMultipleSignatures - same message - 128 - blst 3.1693 ms/op 3.2711 ms/op 0.97
BLS aggregatePubkeys 32 - blst 14.220 us/op 14.598 us/op 0.97
BLS aggregatePubkeys 128 - blst 51.859 us/op 52.586 us/op 0.99
getSlashingsAndExits - default max 46.970 us/op 40.755 us/op 1.15
getSlashingsAndExits - 2k 335.39 us/op 589.25 us/op 0.57
proposeBlockBody type=full, size=empty 708.89 us/op 487.00 us/op 1.46
isKnown best case - 1 super set check 123.00 ns/op 141.00 ns/op 0.87
isKnown normal case - 2 super set checks 120.00 ns/op 136.00 ns/op 0.88
isKnown worse case - 16 super set checks 121.00 ns/op 136.00 ns/op 0.89
validate api signedAggregateAndProof - struct 1.2163 ms/op 1.2374 ms/op 0.98
validate gossip signedAggregateAndProof - struct 1.2153 ms/op 1.2288 ms/op 0.99
batch validate gossip attestation - vc 640000 - chunk 32 101.80 us/op 106.38 us/op 0.96
batch validate gossip attestation - vc 640000 - chunk 64 87.836 us/op 93.748 us/op 0.94
batch validate gossip attestation - vc 640000 - chunk 128 78.883 us/op 82.410 us/op 0.96
batch validate gossip attestation - vc 640000 - chunk 256 81.167 us/op 83.866 us/op 0.97
bytes32 toHexString 223.00 ns/op 222.00 ns/op 1.00
bytes32 Buffer.toString(hex) 130.00 ns/op 116.00 ns/op 1.12
bytes32 Buffer.toString(hex) from Uint8Array 190.00 ns/op 190.00 ns/op 1.00
bytes32 Buffer.toString(hex) + 0x 127.00 ns/op 117.00 ns/op 1.09
Return object 10000 times 0.19910 ns/op 0.20050 ns/op 0.99
Throw Error 10000 times 2.9447 us/op 2.8115 us/op 1.05
toHex 70.514 ns/op 71.136 ns/op 0.99
Buffer.from 65.386 ns/op 64.635 ns/op 1.01
shared Buffer 44.434 ns/op 42.477 ns/op 1.05
fastMsgIdFn sha256 / 200 bytes 1.2000 us/op 1.1990 us/op 1.00
fastMsgIdFn h32 xxhash / 200 bytes 110.00 ns/op 117.00 ns/op 0.94
fastMsgIdFn h64 xxhash / 200 bytes 157.00 ns/op 154.00 ns/op 1.02
fastMsgIdFn sha256 / 1000 bytes 3.7850 us/op 3.8230 us/op 0.99
fastMsgIdFn h32 xxhash / 1000 bytes 173.00 ns/op 182.00 ns/op 0.95
fastMsgIdFn h64 xxhash / 1000 bytes 203.00 ns/op 199.00 ns/op 1.02
fastMsgIdFn sha256 / 10000 bytes 33.075 us/op 33.399 us/op 0.99
fastMsgIdFn h32 xxhash / 10000 bytes 945.00 ns/op 936.00 ns/op 1.01
fastMsgIdFn h64 xxhash / 10000 bytes 609.00 ns/op 576.00 ns/op 1.06
send data - 1000 256B messages 4.7845 ms/op 4.6420 ms/op 1.03
send data - 1000 512B messages 5.6793 ms/op 5.5033 ms/op 1.03
send data - 1000 1024B messages 5.4265 ms/op 5.8308 ms/op 0.93
send data - 1000 1200B messages 6.3911 ms/op 6.7103 ms/op 0.95
send data - 1000 2048B messages 11.654 ms/op 12.144 ms/op 0.96
send data - 1000 4096B messages 40.769 ms/op 89.651 ms/op 0.45
send data - 1000 16384B messages 175.46 ms/op 307.59 ms/op 0.57
send data - 1000 65536B messages 756.65 ms/op 1.5024 s/op 0.50
enrSubnets - fastDeserialize 64 bits 656.00 ns/op 761.00 ns/op 0.86
enrSubnets - ssz BitVector 64 bits 246.00 ns/op 218.00 ns/op 1.13
enrSubnets - fastDeserialize 4 bits 80.000 ns/op 70.000 ns/op 1.14
enrSubnets - ssz BitVector 4 bits 248.00 ns/op 221.00 ns/op 1.12
prioritizePeers score -10:0 att 32-0.1 sync 2-0 177.55 us/op 188.09 us/op 0.94
prioritizePeers score 0:0 att 32-0.25 sync 2-0.25 196.28 us/op 213.68 us/op 0.92
prioritizePeers score 0:0 att 32-0.5 sync 2-0.5 294.11 us/op 304.54 us/op 0.97
prioritizePeers score 0:0 att 64-0.75 sync 4-0.75 517.19 us/op 534.60 us/op 0.97
prioritizePeers score 0:0 att 64-1 sync 4-1 608.28 us/op 657.91 us/op 0.92
archive index / 1 slot / archive root index lookup 43.269 us/op 43.082 us/op 1.00
archive index / 1 slot / archive block lookup, decode and hash 2.5945 ms/op 2.6555 ms/op 0.98
archive index / 1 slots / 1 columns / legacy 51.236 us/op 48.319 us/op 1.06
archive index / 1 slots / 1 columns / flat files 277.34 us/op 275.70 us/op 1.01
archive index / 1 slots / 8 columns / legacy 101.22 us/op 117.14 us/op 0.86
archive index / 1 slots / 8 columns / flat files 662.07 us/op 348.25 us/op 1.90
archive index / 1 slots / 128 columns / legacy 12.410 ms/op 9.5809 ms/op 1.30
archive index / 1 slots / 128 columns / flat files 5.3624 ms/op 5.8186 ms/op 0.92
archive index / 8 slots / 1 columns / legacy 148.88 us/op 148.87 us/op 1.00
archive index / 8 slots / 1 columns / flat files 2.2185 ms/op 2.1213 ms/op 1.05
archive index / 8 slots / 8 columns / legacy 758.13 us/op 672.65 us/op 1.13
archive index / 8 slots / 8 columns / flat files 4.9308 ms/op 4.8997 ms/op 1.01
archive index / 8 slots / 128 columns / legacy 92.494 ms/op 92.742 ms/op 1.00
archive index / 8 slots / 128 columns / flat files 274.95 ms/op 263.32 ms/op 1.04
head state / 1 slot / archive root index lookup 39.615 us/op 44.514 us/op 0.89
head state / 1 slot / archive block lookup, decode and hash 2.5281 ms/op 2.7298 ms/op 0.93
head state / 1 slots / 1 columns / legacy 46.643 us/op 48.060 us/op 0.97
head state / 1 slots / 1 columns / flat files 237.55 us/op 230.40 us/op 1.03
head state / 1 slots / 8 columns / legacy 93.108 us/op 90.335 us/op 1.03
head state / 1 slots / 8 columns / flat files 280.61 us/op 301.19 us/op 0.93
head state / 1 slots / 128 columns / legacy 7.5727 ms/op 8.8876 ms/op 0.85
head state / 1 slots / 128 columns / flat files 6.0906 ms/op 7.8740 ms/op 0.77
head state / 8 slots / 1 columns / legacy 258.85 us/op 135.41 us/op 1.91
head state / 8 slots / 1 columns / flat files 1.6997 ms/op 1.6655 ms/op 1.02
head state / 8 slots / 8 columns / legacy 719.09 us/op 1.0753 ms/op 0.67
head state / 8 slots / 8 columns / flat files 6.0450 ms/op 2.9505 ms/op 2.05
head state / 8 slots / 128 columns / legacy 101.99 ms/op 121.80 ms/op 0.84
head state / 8 slots / 128 columns / flat files 274.15 ms/op 310.00 ms/op 0.88
array of 16000 items push then shift 792.50 ns/op 805.40 ns/op 0.98
LinkedList of 16000 items push then shift 5.0620 ns/op 6.1160 ns/op 0.83
array of 16000 items push then pop 50.727 ns/op 57.479 ns/op 0.88
LinkedList of 16000 items push then pop 4.6780 ns/op 5.2890 ns/op 0.88
array of 24000 items push then shift 1.1801 us/op 1.1920 us/op 0.99
LinkedList of 24000 items push then shift 5.3860 ns/op 6.1390 ns/op 0.88
array of 24000 items push then pop 71.967 ns/op 81.750 ns/op 0.88
LinkedList of 24000 items push then pop 5.0030 ns/op 5.5230 ns/op 0.91
intersect bitArray bitLen 8 2.5710 ns/op 2.5420 ns/op 1.01
intersect array and set length 8 22.945 ns/op 23.625 ns/op 0.97
intersect bitArray bitLen 128 17.519 ns/op 17.232 ns/op 1.02
intersect array and set length 128 392.32 ns/op 395.38 ns/op 0.99
bitArray.getTrueBitIndexes() bitLen 128 889.00 ns/op 881.00 ns/op 1.01
bitArray.getTrueBitIndexes() bitLen 248 1.5590 us/op 1.5360 us/op 1.01
bitArray.getTrueBitIndexes() bitLen 512 3.3440 us/op 3.4510 us/op 0.97
Full columns - reconstruct all 6 blobs 206.05 us/op 142.17 us/op 1.45
Full columns - reconstruct half of the blobs out of 6 65.892 us/op 95.212 us/op 0.69
Full columns - reconstruct single blob out of 6 31.799 us/op 30.596 us/op 1.04
Half columns - reconstruct all 6 blobs 313.31 ms/op 306.98 ms/op 1.02
Half columns - reconstruct half of the blobs out of 6 160.78 ms/op 154.25 ms/op 1.04
Half columns - reconstruct single blob out of 6 56.627 ms/op 55.899 ms/op 1.01
Set add up to 64 items then delete first 1.3852 us/op 1.3637 us/op 1.02
OrderedSet add up to 64 items then delete first 2.0651 us/op 2.0690 us/op 1.00
Set add up to 64 items then delete last 1.6718 us/op 1.6637 us/op 1.00
OrderedSet add up to 64 items then delete last 2.6193 us/op 2.7985 us/op 0.94
Set add up to 64 items then delete middle 1.6460 us/op 1.6591 us/op 0.99
OrderedSet add up to 64 items then delete middle 3.3088 us/op 3.4133 us/op 0.97
Set add up to 128 items then delete first 3.8384 us/op 3.8004 us/op 1.01
OrderedSet add up to 128 items then delete first 5.7144 us/op 5.7472 us/op 0.99
Set add up to 128 items then delete last 3.6629 us/op 3.7184 us/op 0.99
OrderedSet add up to 128 items then delete last 5.2850 us/op 5.2709 us/op 1.00
Set add up to 128 items then delete middle 3.7278 us/op 3.8747 us/op 0.96
OrderedSet add up to 128 items then delete middle 9.3103 us/op 10.082 us/op 0.92
Set add up to 256 items then delete first 7.6146 us/op 7.6126 us/op 1.00
OrderedSet add up to 256 items then delete first 11.841 us/op 12.085 us/op 0.98
Set add up to 256 items then delete last 7.2085 us/op 7.9089 us/op 0.91
OrderedSet add up to 256 items then delete last 11.171 us/op 11.505 us/op 0.97
Set add up to 256 items then delete middle 7.4815 us/op 7.6349 us/op 0.98
OrderedSet add up to 256 items then delete middle 30.472 us/op 29.787 us/op 1.02
runFastConfirmationRules vc:100000 bc:96 eq:0 3.7942 ms/op 3.7396 ms/op 1.01
runFastConfirmationRules vc:600000 bc:96 eq:0 30.770 ms/op 30.639 ms/op 1.00
runFastConfirmationRules vc:1000000 bc:96 eq:0 51.006 ms/op 49.371 ms/op 1.03
runFastConfirmationRules vc:600000 bc:320 eq:0 29.770 ms/op 29.872 ms/op 1.00
runFastConfirmationRules vc:100000 bc:96 eq:1000 1.0964 s/op 1.0705 s/op 1.02
pass gossip attestations to forkchoice per slot 3.6773 ms/op 3.7077 ms/op 0.99
forkChoice updateHead vc 100000 bc 64 eq 0 324.67 us/op 320.51 us/op 1.01
forkChoice updateHead vc 600000 bc 64 eq 0 1.9636 ms/op 1.9256 ms/op 1.02
forkChoice updateHead vc 1000000 bc 64 eq 0 3.2966 ms/op 3.2119 ms/op 1.03
forkChoice updateHead vc 600000 bc 320 eq 0 1.9811 ms/op 1.9351 ms/op 1.02
forkChoice updateHead vc 600000 bc 1200 eq 0 1.9508 ms/op 1.9596 ms/op 1.00
forkChoice updateHead vc 600000 bc 7200 eq 0 2.8311 ms/op 3.0299 ms/op 0.93
forkChoice updateHead vc 600000 bc 64 eq 1000 1.9446 ms/op 1.9127 ms/op 1.02
forkChoice updateHead vc 600000 bc 64 eq 10000 2.0668 ms/op 1.9873 ms/op 1.04
forkChoice updateHead vc 600000 bc 64 eq 300000 5.5910 ms/op 5.3358 ms/op 1.05
forkChoice updateHead vc 600000 bc 64 eq 0 gloas boosted 2.4930 ms/op 2.3497 ms/op 1.06
computeDeltas 1400000 validators 0% inactive 8.8403 ms/op 8.9447 ms/op 0.99
computeDeltas 1400000 validators 10% inactive 8.3087 ms/op 8.2970 ms/op 1.00
computeDeltas 1400000 validators 20% inactive 7.8532 ms/op 7.8598 ms/op 1.00
computeDeltas 1400000 validators 50% inactive 6.6613 ms/op 6.5502 ms/op 1.02
computeDeltas 2100000 validators 0% inactive 13.667 ms/op 13.126 ms/op 1.04
computeDeltas 2100000 validators 10% inactive 11.123 ms/op 10.866 ms/op 1.02
computeDeltas 2100000 validators 20% inactive 10.661 ms/op 10.164 ms/op 1.05
computeDeltas 2100000 validators 50% inactive 8.5775 ms/op 8.3237 ms/op 1.03
altair processAttestation - 250000 vs - 7PWei normalcase 9.9945 ms/op 9.6895 ms/op 1.03
altair processAttestation - 250000 vs - 7PWei worstcase 13.256 ms/op 13.790 ms/op 0.96
altair processAttestation - setStatus - 1/6 committees join 76.154 us/op 74.147 us/op 1.03
altair processAttestation - setStatus - 1/3 committees join 152.76 us/op 148.06 us/op 1.03
altair processAttestation - setStatus - 1/2 committees join 219.00 us/op 210.07 us/op 1.04
altair processAttestation - setStatus - 2/3 committees join 280.37 us/op 296.46 us/op 0.95
altair processAttestation - setStatus - 4/5 committees join 399.07 us/op 393.56 us/op 1.01
altair processAttestation - setStatus - 100% committees join 479.22 us/op 461.74 us/op 1.04
altair processBlock - 250000 vs - 7PWei normalcase 12.925 ms/op 12.879 ms/op 1.00
altair processBlock - 250000 vs - 7PWei normalcase hashState 38.857 ms/op 30.849 ms/op 1.26
altair processBlock - 250000 vs - 7PWei worstcase 38.368 ms/op 33.291 ms/op 1.15
altair processBlock - 250000 vs - 7PWei worstcase hashState 76.252 ms/op 63.430 ms/op 1.20
phase0 processBlock - 250000 vs - 7PWei normalcase 5.2624 ms/op 4.0634 ms/op 1.30
phase0 processBlock - 250000 vs - 7PWei worstcase 49.192 ms/op 36.441 ms/op 1.35
altair processEth1Data - 250000 vs - 7PWei normalcase 244.63 us/op 226.62 us/op 1.08
getExpectedWithdrawals 250000 eb:1,eth1:1,we:0,wn:0,smpl:16 5.9750 us/op 5.8630 us/op 1.02
getExpectedWithdrawals 250000 eb:0.95,eth1:0.1,we:0.05,wn:0,smpl:220 20.809 us/op 21.103 us/op 0.99
getExpectedWithdrawals 250000 eb:0.95,eth1:0.3,we:0.05,wn:0,smpl:43 8.8690 us/op 8.6650 us/op 1.02
getExpectedWithdrawals 250000 eb:0.95,eth1:0.7,we:0.05,wn:0,smpl:19 6.8610 us/op 6.5570 us/op 1.05
getExpectedWithdrawals 250000 eb:0.1,eth1:0.1,we:0,wn:0,smpl:1021 84.491 us/op 84.116 us/op 1.00
getExpectedWithdrawals 250000 eb:0.03,eth1:0.03,we:0,wn:0,smpl:11778 1.1010 ms/op 1.1299 ms/op 0.97
getExpectedWithdrawals 250000 eb:0.01,eth1:0.01,we:0,wn:0,smpl:16384 1.4574 ms/op 1.4787 ms/op 0.99
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,smpl:16384 1.4574 ms/op 1.4883 ms/op 0.98
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,nocache,smpl:16384 2.7277 ms/op 3.1730 ms/op 0.86
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,smpl:16384 1.6445 ms/op 1.6856 ms/op 0.98
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,nocache,smpl:16384 2.9453 ms/op 3.5253 ms/op 0.84
Tree 40 250000 create 261.03 ms/op 270.02 ms/op 0.97
Tree 40 250000 get(125000) 70.680 ns/op 71.349 ns/op 0.99
Tree 40 250000 set(125000) 785.47 ns/op 776.32 ns/op 1.01
Tree 40 250000 toArray() 17.089 ms/op 17.348 ms/op 0.99
Tree 40 250000 iterate all - toArray() + loop 18.506 ms/op 17.121 ms/op 1.08
Tree 40 250000 iterate all - get(i) 37.130 ms/op 34.186 ms/op 1.09
Array 250000 create 1.5345 ms/op 1.5071 ms/op 1.02
Array 250000 clone - spread 379.78 us/op 368.06 us/op 1.03
Array 250000 get(125000) 0.26500 ns/op 0.26500 ns/op 1.00
Array 250000 set(125000) 0.27300 ns/op 0.26700 ns/op 1.02
Array 250000 iterate all - loop 48.150 us/op 47.470 us/op 1.01
phase0 afterProcessEpoch - 250000 vs - 7PWei 17.561 ms/op 17.402 ms/op 1.01
Array.fill - length 1000000 4.4362 ms/op 2.4534 ms/op 1.81
Array push - length 1000000 11.244 ms/op 9.8585 ms/op 1.14
Array.get 0.19683 ns/op 0.18990 ns/op 1.04
Uint8Array.get 0.20826 ns/op 0.21190 ns/op 0.98
phase0 beforeProcessEpoch - 250000 vs - 7PWei 17.592 ms/op 16.236 ms/op 1.08
altair processEpoch - mainnet_e81889 236.56 ms/op 212.21 ms/op 1.11
mainnet_e81889 - altair beforeProcessEpoch 18.365 ms/op 16.370 ms/op 1.12
mainnet_e81889 - altair processJustificationAndFinalization 5.0840 us/op 4.1580 us/op 1.22
mainnet_e81889 - altair processInactivityUpdates 6.2178 ms/op 2.7571 ms/op 2.26
mainnet_e81889 - altair processRewardsAndPenalties 16.250 ms/op 14.754 ms/op 1.10
mainnet_e81889 - altair processRegistryUpdates 432.00 ns/op 430.00 ns/op 1.00
mainnet_e81889 - altair processSlashings 110.00 ns/op 110.00 ns/op 1.00
mainnet_e81889 - altair processEth1DataReset 106.00 ns/op 107.00 ns/op 0.99
mainnet_e81889 - altair processEffectiveBalanceUpdates 2.3000 ms/op 905.35 us/op 2.54
mainnet_e81889 - altair processSlashingsReset 558.00 ns/op 582.00 ns/op 0.96
mainnet_e81889 - altair processRandaoMixesReset 856.00 ns/op 802.00 ns/op 1.07
mainnet_e81889 - altair processHistoricalRootsUpdate 110.00 ns/op 110.00 ns/op 1.00
mainnet_e81889 - altair processParticipationFlagUpdates 339.00 ns/op 326.00 ns/op 1.04
mainnet_e81889 - altair processSyncCommitteeUpdates 86.000 ns/op 87.000 ns/op 0.99
mainnet_e81889 - altair afterProcessEpoch 18.567 ms/op 18.327 ms/op 1.01
capella processEpoch - mainnet_e217614 697.93 ms/op 631.21 ms/op 1.11
mainnet_e217614 - capella beforeProcessEpoch 58.936 ms/op 56.523 ms/op 1.04
mainnet_e217614 - capella processJustificationAndFinalization 5.4670 us/op 4.2080 us/op 1.30
mainnet_e217614 - capella processInactivityUpdates 15.293 ms/op 13.465 ms/op 1.14
mainnet_e217614 - capella processRewardsAndPenalties 95.050 ms/op 80.186 ms/op 1.19
mainnet_e217614 - capella processRegistryUpdates 3.5120 us/op 3.4730 us/op 1.01
mainnet_e217614 - capella processSlashings 110.00 ns/op 110.00 ns/op 1.00
mainnet_e217614 - capella processEth1DataReset 106.00 ns/op 107.00 ns/op 0.99
mainnet_e217614 - capella processEffectiveBalanceUpdates 13.125 ms/op 9.4864 ms/op 1.38
mainnet_e217614 - capella processSlashingsReset 556.00 ns/op 584.00 ns/op 0.95
mainnet_e217614 - capella processRandaoMixesReset 946.00 ns/op 776.00 ns/op 1.22
mainnet_e217614 - capella processHistoricalSummariesUpdate 110.00 ns/op 112.00 ns/op 0.98
mainnet_e217614 - capella processParticipationFlagUpdates 357.00 ns/op 339.00 ns/op 1.05
mainnet_e217614 - capella afterProcessEpoch 48.171 ms/op 47.306 ms/op 1.02
phase0 processEpoch - mainnet_e58758 254.67 ms/op 179.50 ms/op 1.42
mainnet_e58758 - phase0 beforeProcessEpoch 64.764 ms/op 43.669 ms/op 1.48
mainnet_e58758 - phase0 processJustificationAndFinalization 5.4750 us/op 3.6690 us/op 1.49
mainnet_e58758 - phase0 processRewardsAndPenalties 15.297 ms/op 12.732 ms/op 1.20
mainnet_e58758 - phase0 processRegistryUpdates 1.7860 us/op 1.7470 us/op 1.02
mainnet_e58758 - phase0 processSlashings 110.00 ns/op 110.00 ns/op 1.00
mainnet_e58758 - phase0 processEth1DataReset 107.00 ns/op 110.00 ns/op 0.97
mainnet_e58758 - phase0 processEffectiveBalanceUpdates 570.79 us/op 563.02 us/op 1.01
mainnet_e58758 - phase0 processSlashingsReset 735.00 ns/op 666.00 ns/op 1.10
mainnet_e58758 - phase0 processRandaoMixesReset 975.00 ns/op 776.00 ns/op 1.26
mainnet_e58758 - phase0 processHistoricalRootsUpdate 110.00 ns/op 110.00 ns/op 1.00
mainnet_e58758 - phase0 processParticipationRecordUpdates 999.00 ns/op 848.00 ns/op 1.18
mainnet_e58758 - phase0 afterProcessEpoch 22.067 ms/op 14.706 ms/op 1.50
phase0 processEffectiveBalanceUpdates - 250000 normalcase 703.36 us/op 690.30 us/op 1.02
phase0 processEffectiveBalanceUpdates - 250000 worstcase 0.5 839.26 us/op 821.95 us/op 1.02
gloas processInactivityUpdates - 250000 inactivity leak all eligible missed target 10.423 ms/op 9.2324 ms/op 1.13
phase0 processRegistryUpdates - 250000 normalcase 6.8600 us/op 6.5220 us/op 1.05
phase0 processRegistryUpdates - 250000 badcase_full_deposits 124.09 us/op 121.09 us/op 1.02
phase0 processRegistryUpdates - 250000 worstcase 0.5 71.283 ms/op 57.043 ms/op 1.25
altair processRewardsAndPenalties - 250000 normalcase 14.416 ms/op 11.613 ms/op 1.24
altair processRewardsAndPenalties - 250000 worstcase 13.369 ms/op 11.572 ms/op 1.16
phase0 getAttestationDeltas - 250000 normalcase 4.2596 ms/op 3.4888 ms/op 1.22
phase0 getAttestationDeltas - 250000 worstcase 7.1606 ms/op 3.4910 ms/op 2.05
phase0 processSlashings - 250000 worstcase 50.454 us/op 44.104 us/op 1.14
altair processSyncCommitteeUpdates - 250000 13.224 ms/op 10.448 ms/op 1.27
BeaconState.hashTreeRoot - No change 137.00 ns/op 136.00 ns/op 1.01
BeaconState.hashTreeRoot - 1 full validator 75.725 us/op 69.834 us/op 1.08
BeaconState.hashTreeRoot - 32 full validator 791.37 us/op 775.35 us/op 1.02
BeaconState.hashTreeRoot - 512 full validator 9.4453 ms/op 7.4577 ms/op 1.27
BeaconState.hashTreeRoot - 1 validator.effectiveBalance 96.988 us/op 94.720 us/op 1.02
BeaconState.hashTreeRoot - 32 validator.effectiveBalance 1.3802 ms/op 1.3430 ms/op 1.03
BeaconState.hashTreeRoot - 512 validator.effectiveBalance 22.930 ms/op 16.649 ms/op 1.38
BeaconState.hashTreeRoot - 1 balances 76.038 us/op 75.287 us/op 1.01
BeaconState.hashTreeRoot - 32 balances 750.01 us/op 687.86 us/op 1.09
BeaconState.hashTreeRoot - 512 balances 7.5909 ms/op 5.7188 ms/op 1.33
BeaconState.hashTreeRoot - 250000 balances 141.44 ms/op 120.18 ms/op 1.18
aggregationBits - 2048 els - zipIndexesInBitList 16.784 us/op 15.099 us/op 1.11
regular array get 100000 times 19.522 us/op 19.104 us/op 1.02
wrappedArray get 100000 times 19.818 us/op 19.227 us/op 1.03
arrayWithProxy get 100000 times 7.6370 ms/op 7.4225 ms/op 1.03
ssz.Root.equals 15.591 ns/op 15.612 ns/op 1.00
byteArrayEquals 15.351 ns/op 15.341 ns/op 1.00
Buffer.compare 6.5290 ns/op 6.4870 ns/op 1.01
processSlot - 1 slots 10.943 us/op 9.2010 us/op 1.19
processSlot - 32 slots 2.0497 ms/op 1.8996 ms/op 1.08
getEffectiveBalanceIncrementsZeroInactive - 250000 vs - 7PWei 5.5948 ms/op 3.5658 ms/op 1.57
getCommitteeAssignments - req 1 vs - 250000 vc 1.4794 ms/op 1.4870 ms/op 0.99
getCommitteeAssignments - req 100 vs - 250000 vc 3.5510 ms/op 3.3981 ms/op 1.05
getCommitteeAssignments - req 1000 vs - 250000 vc 3.7776 ms/op 3.6230 ms/op 1.04
findModifiedValidators - 10000 modified validators 591.90 ms/op 508.63 ms/op 1.16
findModifiedValidators - 1000 modified validators 539.45 ms/op 419.29 ms/op 1.29
findModifiedValidators - 100 modified validators 244.88 ms/op 280.53 ms/op 0.87
findModifiedValidators - 10 modified validators 252.56 ms/op 227.16 ms/op 1.11
findModifiedValidators - 1 modified validators 224.33 ms/op 159.16 ms/op 1.41
findModifiedValidators - no difference 167.76 ms/op 158.15 ms/op 1.06
migrate state 1500000 validators, 3400 modified, 2000 new 3.2344 s/op 3.5695 s/op 0.91
RootCache.getBlockRootAtSlot - 250000 vs - 7PWei 2.6000 ns/op 2.6000 ns/op 1.00
state getBlockRootAtSlot - 250000 vs - 7PWei 386.83 ns/op 370.08 ns/op 1.05
computeProposerIndex 100000 validators 2.5303 ms/op 2.4529 ms/op 1.03
getNextSyncCommitteeIndices 1000 validators 1.3455 ms/op 1.3346 ms/op 1.01
getNextSyncCommitteeIndices 10000 validators 13.785 ms/op 13.225 ms/op 1.04
getNextSyncCommitteeIndices 100000 validators 56.769 ms/op 51.735 ms/op 1.10
computeProposers - vc 250000 1.1573 ms/op 1.1298 ms/op 1.02
computeEpochShuffling - vc 250000 17.835 ms/op 17.691 ms/op 1.01
getNextSyncCommittee - vc 250000 12.771 ms/op 10.554 ms/op 1.21
nodejs block root to RootHex using toHex 74.117 ns/op 73.772 ns/op 1.00
nodejs block root to RootHex using toRootHex 47.197 ns/op 45.919 ns/op 1.03
nodejs fromHex(blob) 770.78 us/op 794.61 us/op 0.97
nodejs fromHexInto(blob) 452.56 us/op 458.37 us/op 0.99
nodejs block root to RootHex using the deprecated toHexString 566.29 ns/op 575.50 ns/op 0.98
nodejs byteArrayEquals 32 bytes (block root) 17.878 ns/op 18.162 ns/op 0.98
nodejs byteArrayEquals 48 bytes (pubkey) 25.712 ns/op 26.004 ns/op 0.99
nodejs byteArrayEquals 96 bytes (signature) 26.605 ns/op 27.431 ns/op 0.97
nodejs byteArrayEquals 1024 bytes 31.357 ns/op 33.363 ns/op 0.94
nodejs byteArrayEquals 131072 bytes (blob) 1.1246 us/op 1.0862 us/op 1.04
browser block root to RootHex using toHex 111.22 ns/op 111.19 ns/op 1.00
browser block root to RootHex using toRootHex 103.63 ns/op 104.07 ns/op 1.00
browser fromHex(blob) 1.3472 ms/op 1.4209 ms/op 0.95
browser fromHexInto(blob) 459.07 us/op 462.69 us/op 0.99
browser block root to RootHex using the deprecated toHexString 570.60 ns/op 574.23 ns/op 0.99
browser byteArrayEquals 32 bytes (block root) 18.697 ns/op 18.775 ns/op 1.00
browser byteArrayEquals 48 bytes (pubkey) 26.881 ns/op 26.815 ns/op 1.00
browser byteArrayEquals 96 bytes (signature) 50.480 ns/op 50.401 ns/op 1.00
browser byteArrayEquals 1024 bytes 516.64 ns/op 523.11 ns/op 0.99
browser byteArrayEquals 131072 bytes (blob) 65.422 us/op 65.172 us/op 1.00

by benchmarkbot/action

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

nflaig commented Sep 28, 2026

Copy link
Copy Markdown
Member Author

keeping as draft until spec is finalized

@nflaig
nflaig marked this pull request as draft September 28, 2026 12:06
@nflaig
nflaig marked this pull request as ready for review October 7, 2026 17:06
@nflaig
nflaig merged commit ba0411b into unstable Oct 7, 2026
22 checks passed
@nflaig
nflaig deleted the nflaig/ptc-state-endpoint branch October 7, 2026 17:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants