Skip to content

feat: add beacon_blocks_by_head reqresp#9331

Merged
nflaig merged 4 commits into
unstablefrom
cayman/beacon-blocks-by-head
May 13, 2026
Merged

feat: add beacon_blocks_by_head reqresp#9331
nflaig merged 4 commits into
unstablefrom
cayman/beacon-blocks-by-head

Conversation

@wemeetagain
Copy link
Copy Markdown
Member

Motivation

Description

  • Add beacon_blocks_by_head serving and requesting code (requesting is currently unused)

AI Assistance Disclosure

  • codex assistance

@wemeetagain wemeetagain requested a review from a team as a code owner May 6, 2026 11:56
Copy link
Copy Markdown
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 implements the BeaconBlocksByHead request-response protocol, which allows peers to request a sequence of blocks starting from a specific root and traversing backwards through parent roots. The changes include the definition of the new protocol, implementation of the onBeaconBlocksByHead handler with validation and rate limiting, and the addition of corresponding network interface methods. Unit tests have been added to verify the handler's behavior across fork boundaries and its adherence to request limits. I have no feedback to provide.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 6, 2026

⚠️ Performance Alert ⚠️

Possible performance regression was detected for some benchmarks.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold.

Benchmark suite Current: c801ea4 Previous: ac258a8 Ratio
Full columns - reconstruct half of the blobs out of 6 207.27 us/op 64.003 us/op 3.24
Full benchmark results
Benchmark suite Current: c801ea4 Previous: ac258a8 Ratio
getPubkeys - index2pubkey - req 1000 vs - 250000 vc 830.13 us/op 989.27 us/op 0.84
getPubkeys - validatorsArr - req 1000 vs - 250000 vc 39.235 us/op 38.902 us/op 1.01
BLS verify - blst 752.79 us/op 705.13 us/op 1.07
BLS verifyMultipleSignatures 3 - blst 1.3706 ms/op 1.3622 ms/op 1.01
BLS verifyMultipleSignatures 8 - blst 2.1876 ms/op 2.1688 ms/op 1.01
BLS verifyMultipleSignatures 32 - blst 6.9446 ms/op 6.9327 ms/op 1.00
BLS verifyMultipleSignatures 64 - blst 13.509 ms/op 13.430 ms/op 1.01
BLS verifyMultipleSignatures 128 - blst 26.030 ms/op 25.720 ms/op 1.01
BLS deserializing 10000 signatures 637.07 ms/op 632.46 ms/op 1.01
BLS deserializing 100000 signatures 6.3587 s/op 6.3690 s/op 1.00
BLS verifyMultipleSignatures - same message - 3 - blst 783.83 us/op 813.85 us/op 0.96
BLS verifyMultipleSignatures - same message - 8 - blst 942.38 us/op 911.48 us/op 1.03
BLS verifyMultipleSignatures - same message - 32 - blst 1.5761 ms/op 1.4784 ms/op 1.07
BLS verifyMultipleSignatures - same message - 64 - blst 2.3983 ms/op 2.3778 ms/op 1.01
BLS verifyMultipleSignatures - same message - 128 - blst 4.0305 ms/op 4.0371 ms/op 1.00
BLS aggregatePubkeys 32 - blst 17.636 us/op 17.687 us/op 1.00
BLS aggregatePubkeys 128 - blst 63.092 us/op 62.782 us/op 1.00
getSlashingsAndExits - default max 51.680 us/op 48.838 us/op 1.06
getSlashingsAndExits - 2k 323.00 us/op 356.19 us/op 0.91
proposeBlockBody type=full, size=empty 711.36 us/op 698.02 us/op 1.02
isKnown best case - 1 super set check 166.00 ns/op 182.00 ns/op 0.91
isKnown normal case - 2 super set checks 168.00 ns/op 177.00 ns/op 0.95
isKnown worse case - 16 super set checks 168.00 ns/op 176.00 ns/op 0.95
validate api signedAggregateAndProof - struct 1.5315 ms/op 1.5218 ms/op 1.01
validate gossip signedAggregateAndProof - struct 1.5340 ms/op 1.5204 ms/op 1.01
batch validate gossip attestation - vc 640000 - chunk 32 107.69 us/op 106.09 us/op 1.02
batch validate gossip attestation - vc 640000 - chunk 64 93.602 us/op 92.374 us/op 1.01
batch validate gossip attestation - vc 640000 - chunk 128 86.771 us/op 85.369 us/op 1.02
batch validate gossip attestation - vc 640000 - chunk 256 82.273 us/op 82.388 us/op 1.00
bytes32 toHexString 287.00 ns/op 289.00 ns/op 0.99
bytes32 Buffer.toString(hex) 179.00 ns/op 172.00 ns/op 1.04
bytes32 Buffer.toString(hex) from Uint8Array 246.00 ns/op 243.00 ns/op 1.01
bytes32 Buffer.toString(hex) + 0x 180.00 ns/op 175.00 ns/op 1.03
Return object 10000 times 0.21180 ns/op 0.21300 ns/op 0.99
Throw Error 10000 times 3.3300 us/op 3.2903 us/op 1.01
toHex 96.979 ns/op 96.609 ns/op 1.00
Buffer.from 88.469 ns/op 89.296 ns/op 0.99
shared Buffer 61.721 ns/op 67.389 ns/op 0.92
fastMsgIdFn sha256 / 200 bytes 1.4760 us/op 1.4850 us/op 0.99
fastMsgIdFn h32 xxhash / 200 bytes 161.00 ns/op 153.00 ns/op 1.05
fastMsgIdFn h64 xxhash / 200 bytes 211.00 ns/op 211.00 ns/op 1.00
fastMsgIdFn sha256 / 1000 bytes 4.7780 us/op 4.7750 us/op 1.00
fastMsgIdFn h32 xxhash / 1000 bytes 247.00 ns/op 243.00 ns/op 1.02
fastMsgIdFn h64 xxhash / 1000 bytes 257.00 ns/op 255.00 ns/op 1.01
fastMsgIdFn sha256 / 10000 bytes 42.200 us/op 42.099 us/op 1.00
fastMsgIdFn h32 xxhash / 10000 bytes 1.2890 us/op 1.2500 us/op 1.03
fastMsgIdFn h64 xxhash / 10000 bytes 851.00 ns/op 812.00 ns/op 1.05
send data - 1000 256B messages 4.0749 ms/op 3.9427 ms/op 1.03
send data - 1000 512B messages 4.3294 ms/op 4.0664 ms/op 1.06
send data - 1000 1024B messages 4.6326 ms/op 4.2134 ms/op 1.10
send data - 1000 1200B messages 4.5503 ms/op 4.4180 ms/op 1.03
send data - 1000 2048B messages 4.7477 ms/op 4.6620 ms/op 1.02
send data - 1000 4096B messages 5.4149 ms/op 5.3628 ms/op 1.01
send data - 1000 16384B messages 21.038 ms/op 28.114 ms/op 0.75
send data - 1000 65536B messages 227.69 ms/op 148.30 ms/op 1.54
enrSubnets - fastDeserialize 64 bits 736.00 ns/op 748.00 ns/op 0.98
enrSubnets - ssz BitVector 64 bits 271.00 ns/op 264.00 ns/op 1.03
enrSubnets - fastDeserialize 4 bits 112.00 ns/op 102.00 ns/op 1.10
enrSubnets - ssz BitVector 4 bits 275.00 ns/op 274.00 ns/op 1.00
prioritizePeers score -10:0 att 32-0.1 sync 2-0 203.85 us/op 205.19 us/op 0.99
prioritizePeers score 0:0 att 32-0.25 sync 2-0.25 246.15 us/op 239.73 us/op 1.03
prioritizePeers score 0:0 att 32-0.5 sync 2-0.5 348.37 us/op 350.91 us/op 0.99
prioritizePeers score 0:0 att 64-0.75 sync 4-0.75 605.13 us/op 602.09 us/op 1.01
prioritizePeers score 0:0 att 64-1 sync 4-1 702.06 us/op 699.70 us/op 1.00
array of 16000 items push then shift 1.3233 us/op 1.3126 us/op 1.01
LinkedList of 16000 items push then shift 7.5780 ns/op 6.9400 ns/op 1.09
array of 16000 items push then pop 68.857 ns/op 70.542 ns/op 0.98
LinkedList of 16000 items push then pop 6.0470 ns/op 5.9700 ns/op 1.01
array of 24000 items push then shift 1.9608 us/op 1.9327 us/op 1.01
LinkedList of 24000 items push then shift 6.7980 ns/op 6.8130 ns/op 1.00
array of 24000 items push then pop 95.488 ns/op 99.665 ns/op 0.96
LinkedList of 24000 items push then pop 6.0520 ns/op 5.9800 ns/op 1.01
intersect bitArray bitLen 8 4.7980 ns/op 4.7980 ns/op 1.00
intersect array and set length 8 29.635 ns/op 29.526 ns/op 1.00
intersect bitArray bitLen 128 24.821 ns/op 24.186 ns/op 1.03
intersect array and set length 128 500.13 ns/op 496.31 ns/op 1.01
bitArray.getTrueBitIndexes() bitLen 128 1.0380 us/op 1.0310 us/op 1.01
bitArray.getTrueBitIndexes() bitLen 248 1.7580 us/op 1.7810 us/op 0.99
bitArray.getTrueBitIndexes() bitLen 512 3.5500 us/op 3.6150 us/op 0.98
Full columns - reconstruct all 6 blobs 110.49 us/op 233.86 us/op 0.47
Full columns - reconstruct half of the blobs out of 6 207.27 us/op 64.003 us/op 3.24
Full columns - reconstruct single blob out of 6 35.547 us/op 34.381 us/op 1.03
Half columns - reconstruct all 6 blobs 383.75 ms/op 377.63 ms/op 1.02
Half columns - reconstruct half of the blobs out of 6 191.68 ms/op 190.35 ms/op 1.01
Half columns - reconstruct single blob out of 6 67.474 ms/op 67.278 ms/op 1.00
Full columns - reconstruct all 10 blobs 182.84 us/op 353.79 us/op 0.52
Full columns - reconstruct half of the blobs out of 10 291.15 us/op 158.73 us/op 1.83
Full columns - reconstruct single blob out of 10 33.247 us/op 36.533 us/op 0.91
Half columns - reconstruct all 10 blobs 630.39 ms/op 629.29 ms/op 1.00
Half columns - reconstruct half of the blobs out of 10 316.04 ms/op 316.04 ms/op 1.00
Half columns - reconstruct single blob out of 10 68.068 ms/op 66.215 ms/op 1.03
Full columns - reconstruct all 20 blobs 1.5148 ms/op 589.29 us/op 2.57
Full columns - reconstruct half of the blobs out of 20 270.78 us/op 244.31 us/op 1.11
Full columns - reconstruct single blob out of 20 30.528 us/op 35.320 us/op 0.86
Half columns - reconstruct all 20 blobs 1.2581 s/op 1.2438 s/op 1.01
Half columns - reconstruct half of the blobs out of 20 629.41 ms/op 625.23 ms/op 1.01
Half columns - reconstruct single blob out of 20 66.841 ms/op 66.304 ms/op 1.01
Set add up to 64 items then delete first 2.4048 us/op 2.6367 us/op 0.91
OrderedSet add up to 64 items then delete first 3.3412 us/op 3.3838 us/op 0.99
Set add up to 64 items then delete last 2.3765 us/op 2.3985 us/op 0.99
OrderedSet add up to 64 items then delete last 3.2776 us/op 3.2888 us/op 1.00
Set add up to 64 items then delete middle 2.1480 us/op 2.1400 us/op 1.00
OrderedSet add up to 64 items then delete middle 4.7572 us/op 4.7796 us/op 1.00
Set add up to 128 items then delete first 4.2494 us/op 4.3176 us/op 0.98
OrderedSet add up to 128 items then delete first 6.5668 us/op 6.5676 us/op 1.00
Set add up to 128 items then delete last 3.9374 us/op 3.9266 us/op 1.00
OrderedSet add up to 128 items then delete last 5.7862 us/op 5.7980 us/op 1.00
Set add up to 128 items then delete middle 3.9526 us/op 3.9302 us/op 1.01
OrderedSet add up to 128 items then delete middle 11.671 us/op 11.645 us/op 1.00
Set add up to 256 items then delete first 7.9295 us/op 7.9139 us/op 1.00
OrderedSet add up to 256 items then delete first 12.161 us/op 12.166 us/op 1.00
Set add up to 256 items then delete last 7.6871 us/op 7.7266 us/op 0.99
OrderedSet add up to 256 items then delete last 11.495 us/op 11.541 us/op 1.00
Set add up to 256 items then delete middle 7.7561 us/op 7.6624 us/op 1.01
OrderedSet add up to 256 items then delete middle 34.852 us/op 34.843 us/op 1.00
pass gossip attestations to forkchoice per slot 2.5418 ms/op 2.5559 ms/op 0.99
forkChoice updateHead vc 100000 bc 64 eq 0 426.69 us/op 432.74 us/op 0.99
forkChoice updateHead vc 600000 bc 64 eq 0 2.5108 ms/op 2.5661 ms/op 0.98
forkChoice updateHead vc 1000000 bc 64 eq 0 4.2126 ms/op 4.2646 ms/op 0.99
forkChoice updateHead vc 600000 bc 320 eq 0 2.5485 ms/op 2.5749 ms/op 0.99
forkChoice updateHead vc 600000 bc 1200 eq 0 2.5885 ms/op 2.6302 ms/op 0.98
forkChoice updateHead vc 600000 bc 7200 eq 0 2.8691 ms/op 2.8800 ms/op 1.00
forkChoice updateHead vc 600000 bc 64 eq 1000 4.9853 ms/op 3.0876 ms/op 1.61
forkChoice updateHead vc 600000 bc 64 eq 10000 3.1874 ms/op 3.2105 ms/op 0.99
forkChoice updateHead vc 600000 bc 64 eq 300000 7.5263 ms/op 7.0606 ms/op 1.07
computeDeltas 1400000 validators 0% inactive 12.933 ms/op 12.970 ms/op 1.00
computeDeltas 1400000 validators 10% inactive 12.104 ms/op 12.087 ms/op 1.00
computeDeltas 1400000 validators 20% inactive 11.095 ms/op 11.121 ms/op 1.00
computeDeltas 1400000 validators 50% inactive 8.4683 ms/op 8.5238 ms/op 0.99
computeDeltas 2100000 validators 0% inactive 19.468 ms/op 19.427 ms/op 1.00
computeDeltas 2100000 validators 10% inactive 17.925 ms/op 18.610 ms/op 0.96
computeDeltas 2100000 validators 20% inactive 16.771 ms/op 16.728 ms/op 1.00
computeDeltas 2100000 validators 50% inactive 9.9114 ms/op 10.085 ms/op 0.98
altair processAttestation - 250000 vs - 7PWei normalcase 1.7374 ms/op 1.6786 ms/op 1.04
altair processAttestation - 250000 vs - 7PWei worstcase 2.5336 ms/op 2.4394 ms/op 1.04
altair processAttestation - setStatus - 1/6 committees join 103.86 us/op 102.57 us/op 1.01
altair processAttestation - setStatus - 1/3 committees join 200.85 us/op 203.44 us/op 0.99
altair processAttestation - setStatus - 1/2 committees join 286.07 us/op 286.62 us/op 1.00
altair processAttestation - setStatus - 2/3 committees join 375.12 us/op 376.40 us/op 1.00
altair processAttestation - setStatus - 4/5 committees join 514.80 us/op 507.85 us/op 1.01
altair processAttestation - setStatus - 100% committees join 609.50 us/op 597.73 us/op 1.02
altair processBlock - 250000 vs - 7PWei normalcase 2.9137 ms/op 2.8493 ms/op 1.02
altair processBlock - 250000 vs - 7PWei normalcase hashState 11.634 ms/op 11.751 ms/op 0.99
altair processBlock - 250000 vs - 7PWei worstcase 19.514 ms/op 19.808 ms/op 0.99
altair processBlock - 250000 vs - 7PWei worstcase hashState 40.249 ms/op 38.842 ms/op 1.04
phase0 processBlock - 250000 vs - 7PWei normalcase 1.2536 ms/op 1.3518 ms/op 0.93
phase0 processBlock - 250000 vs - 7PWei worstcase 17.337 ms/op 17.122 ms/op 1.01
altair processEth1Data - 250000 vs - 7PWei normalcase 300.69 us/op 292.61 us/op 1.03
getExpectedWithdrawals 250000 eb:1,eth1:1,we:0,wn:0,smpl:16 8.2080 us/op 3.3870 us/op 2.42
getExpectedWithdrawals 250000 eb:0.95,eth1:0.1,we:0.05,wn:0,smpl:220 22.930 us/op 21.789 us/op 1.05
getExpectedWithdrawals 250000 eb:0.95,eth1:0.3,we:0.05,wn:0,smpl:43 6.8010 us/op 6.0480 us/op 1.12
getExpectedWithdrawals 250000 eb:0.95,eth1:0.7,we:0.05,wn:0,smpl:19 3.7280 us/op 3.9410 us/op 0.95
getExpectedWithdrawals 250000 eb:0.1,eth1:0.1,we:0,wn:0,smpl:1021 94.538 us/op 94.376 us/op 1.00
getExpectedWithdrawals 250000 eb:0.03,eth1:0.03,we:0,wn:0,smpl:11778 1.3777 ms/op 1.4035 ms/op 0.98
getExpectedWithdrawals 250000 eb:0.01,eth1:0.01,we:0,wn:0,smpl:16384 1.8186 ms/op 1.8452 ms/op 0.99
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,smpl:16384 1.7911 ms/op 1.8246 ms/op 0.98
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,nocache,smpl:16384 3.6543 ms/op 3.6831 ms/op 0.99
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,smpl:16384 2.0842 ms/op 2.0390 ms/op 1.02
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,nocache,smpl:16384 4.0106 ms/op 3.9192 ms/op 1.02
Tree 40 250000 create 311.82 ms/op 303.70 ms/op 1.03
Tree 40 250000 get(125000) 97.055 ns/op 95.759 ns/op 1.01
Tree 40 250000 set(125000) 1.0281 us/op 1.0309 us/op 1.00
Tree 40 250000 toArray() 9.0840 ms/op 9.1330 ms/op 0.99
Tree 40 250000 iterate all - toArray() + loop 9.2492 ms/op 9.1765 ms/op 1.01
Tree 40 250000 iterate all - get(i) 34.270 ms/op 34.929 ms/op 0.98
Array 250000 create 2.0856 ms/op 2.0345 ms/op 1.03
Array 250000 clone - spread 659.77 us/op 649.00 us/op 1.02
Array 250000 get(125000) 0.29500 ns/op 0.30300 ns/op 0.97
Array 250000 set(125000) 0.30200 ns/op 0.30800 ns/op 0.98
Array 250000 iterate all - loop 57.606 us/op 57.630 us/op 1.00
phase0 afterProcessEpoch - 250000 vs - 7PWei 40.456 ms/op 59.260 ms/op 0.68
Array.fill - length 1000000 2.4087 ms/op 2.2317 ms/op 1.08
Array push - length 1000000 7.6059 ms/op 7.5691 ms/op 1.00
Array.get 0.20565 ns/op 0.20689 ns/op 0.99
Uint8Array.get 0.24636 ns/op 0.25590 ns/op 0.96
phase0 beforeProcessEpoch - 250000 vs - 7PWei 12.090 ms/op 12.466 ms/op 0.97
altair processEpoch - mainnet_e81889 232.40 ms/op 282.01 ms/op 0.82
mainnet_e81889 - altair beforeProcessEpoch 20.129 ms/op 19.501 ms/op 1.03
mainnet_e81889 - altair processJustificationAndFinalization 4.7440 us/op 6.4570 us/op 0.73
mainnet_e81889 - altair processInactivityUpdates 3.5049 ms/op 3.5273 ms/op 0.99
mainnet_e81889 - altair processRewardsAndPenalties 16.732 ms/op 21.621 ms/op 0.77
mainnet_e81889 - altair processRegistryUpdates 534.00 ns/op 576.00 ns/op 0.93
mainnet_e81889 - altair processSlashings 137.00 ns/op 135.00 ns/op 1.01
mainnet_e81889 - altair processEth1DataReset 131.00 ns/op 133.00 ns/op 0.98
mainnet_e81889 - altair processEffectiveBalanceUpdates 1.6409 ms/op 1.6346 ms/op 1.00
mainnet_e81889 - altair processSlashingsReset 715.00 ns/op 737.00 ns/op 0.97
mainnet_e81889 - altair processRandaoMixesReset 998.00 ns/op 1.3350 us/op 0.75
mainnet_e81889 - altair processHistoricalRootsUpdate 135.00 ns/op 136.00 ns/op 0.99
mainnet_e81889 - altair processParticipationFlagUpdates 420.00 ns/op 450.00 ns/op 0.93
mainnet_e81889 - altair processSyncCommitteeUpdates 109.00 ns/op 111.00 ns/op 0.98
mainnet_e81889 - altair afterProcessEpoch 40.476 ms/op 42.858 ms/op 0.94
capella processEpoch - mainnet_e217614 703.08 ms/op 874.52 ms/op 0.80
mainnet_e217614 - capella beforeProcessEpoch 56.353 ms/op 63.424 ms/op 0.89
mainnet_e217614 - capella processJustificationAndFinalization 4.8210 us/op 6.9880 us/op 0.69
mainnet_e217614 - capella processInactivityUpdates 11.286 ms/op 16.632 ms/op 0.68
mainnet_e217614 - capella processRewardsAndPenalties 83.673 ms/op 99.859 ms/op 0.84
mainnet_e217614 - capella processRegistryUpdates 4.5130 us/op 4.7400 us/op 0.95
mainnet_e217614 - capella processSlashings 136.00 ns/op 136.00 ns/op 1.00
mainnet_e217614 - capella processEth1DataReset 134.00 ns/op 134.00 ns/op 1.00
mainnet_e217614 - capella processEffectiveBalanceUpdates 5.1654 ms/op 18.473 ms/op 0.28
mainnet_e217614 - capella processSlashingsReset 699.00 ns/op 701.00 ns/op 1.00
mainnet_e217614 - capella processRandaoMixesReset 1.0860 us/op 1.2900 us/op 0.84
mainnet_e217614 - capella processHistoricalRootsUpdate 140.00 ns/op 136.00 ns/op 1.03
mainnet_e217614 - capella processParticipationFlagUpdates 427.00 ns/op 454.00 ns/op 0.94
mainnet_e217614 - capella afterProcessEpoch 109.66 ms/op 117.32 ms/op 0.93
phase0 processEpoch - mainnet_e58758 255.70 ms/op 336.49 ms/op 0.76
mainnet_e58758 - phase0 beforeProcessEpoch 51.733 ms/op 73.325 ms/op 0.71
mainnet_e58758 - phase0 processJustificationAndFinalization 5.0490 us/op 6.7970 us/op 0.74
mainnet_e58758 - phase0 processRewardsAndPenalties 14.819 ms/op 17.735 ms/op 0.84
mainnet_e58758 - phase0 processRegistryUpdates 2.2600 us/op 2.3630 us/op 0.96
mainnet_e58758 - phase0 processSlashings 137.00 ns/op 206.00 ns/op 0.67
mainnet_e58758 - phase0 processEth1DataReset 132.00 ns/op 153.00 ns/op 0.86
mainnet_e58758 - phase0 processEffectiveBalanceUpdates 833.47 us/op 1.2674 ms/op 0.66
mainnet_e58758 - phase0 processSlashingsReset 821.00 ns/op 998.00 ns/op 0.82
mainnet_e58758 - phase0 processRandaoMixesReset 1.0730 us/op 1.3960 us/op 0.77
mainnet_e58758 - phase0 processHistoricalRootsUpdate 139.00 ns/op 139.00 ns/op 1.00
mainnet_e58758 - phase0 processParticipationRecordUpdates 964.00 ns/op 1.2820 us/op 0.75
mainnet_e58758 - phase0 afterProcessEpoch 33.553 ms/op 36.372 ms/op 0.92
phase0 processEffectiveBalanceUpdates - 250000 normalcase 1.0187 ms/op 1.1527 ms/op 0.88
phase0 processEffectiveBalanceUpdates - 250000 worstcase 0.5 1.5972 ms/op 1.6483 ms/op 0.97
altair processInactivityUpdates - 250000 normalcase 10.537 ms/op 11.739 ms/op 0.90
altair processInactivityUpdates - 250000 worstcase 10.641 ms/op 11.729 ms/op 0.91
phase0 processRegistryUpdates - 250000 normalcase 2.1720 us/op 2.2620 us/op 0.96
phase0 processRegistryUpdates - 250000 badcase_full_deposits 143.44 us/op 146.07 us/op 0.98
phase0 processRegistryUpdates - 250000 worstcase 0.5 48.291 ms/op 62.891 ms/op 0.77
altair processRewardsAndPenalties - 250000 normalcase 12.872 ms/op 17.489 ms/op 0.74
altair processRewardsAndPenalties - 250000 worstcase 12.386 ms/op 16.967 ms/op 0.73
phase0 getAttestationDeltas - 250000 normalcase 5.3371 ms/op 5.6363 ms/op 0.95
phase0 getAttestationDeltas - 250000 worstcase 5.3770 ms/op 5.6784 ms/op 0.95
phase0 processSlashings - 250000 worstcase 59.210 us/op 63.639 us/op 0.93
altair processSyncCommitteeUpdates - 250000 10.320 ms/op 11.477 ms/op 0.90
BeaconState.hashTreeRoot - No change 165.00 ns/op 172.00 ns/op 0.96
BeaconState.hashTreeRoot - 1 full validator 56.456 us/op 64.996 us/op 0.87
BeaconState.hashTreeRoot - 32 full validator 634.69 us/op 727.53 us/op 0.87
BeaconState.hashTreeRoot - 512 full validator 5.9531 ms/op 7.2703 ms/op 0.82
BeaconState.hashTreeRoot - 1 validator.effectiveBalance 68.849 us/op 81.608 us/op 0.84
BeaconState.hashTreeRoot - 32 validator.effectiveBalance 1.0321 ms/op 1.3528 ms/op 0.76
BeaconState.hashTreeRoot - 512 validator.effectiveBalance 12.656 ms/op 14.786 ms/op 0.86
BeaconState.hashTreeRoot - 1 balances 54.242 us/op 63.498 us/op 0.85
BeaconState.hashTreeRoot - 32 balances 547.37 us/op 613.56 us/op 0.89
BeaconState.hashTreeRoot - 512 balances 4.6105 ms/op 5.3474 ms/op 0.86
BeaconState.hashTreeRoot - 250000 balances 104.27 ms/op 168.12 ms/op 0.62
aggregationBits - 2048 els - zipIndexesInBitList 19.919 us/op 19.631 us/op 1.01
regular array get 100000 times 23.119 us/op 23.097 us/op 1.00
wrappedArray get 100000 times 23.058 us/op 23.063 us/op 1.00
arrayWithProxy get 100000 times 9.8257 ms/op 10.219 ms/op 0.96
ssz.Root.equals 21.808 ns/op 21.797 ns/op 1.00
byteArrayEquals 21.611 ns/op 21.584 ns/op 1.00
Buffer.compare 8.9860 ns/op 9.0030 ns/op 1.00
processSlot - 1 slots 8.0650 us/op 9.0620 us/op 0.89
processSlot - 32 slots 1.5607 ms/op 1.5762 ms/op 0.99
getEffectiveBalanceIncrementsZeroInactive - 250000 vs - 7PWei 2.8831 ms/op 2.4663 ms/op 1.17
getCommitteeAssignments - req 1 vs - 250000 vc 1.7087 ms/op 1.6978 ms/op 1.01
getCommitteeAssignments - req 100 vs - 250000 vc 3.4986 ms/op 3.4443 ms/op 1.02
getCommitteeAssignments - req 1000 vs - 250000 vc 3.7769 ms/op 3.6928 ms/op 1.02
findModifiedValidators - 10000 modified validators 827.15 ms/op 723.13 ms/op 1.14
findModifiedValidators - 1000 modified validators 516.63 ms/op 405.36 ms/op 1.27
findModifiedValidators - 100 modified validators 312.39 ms/op 324.93 ms/op 0.96
findModifiedValidators - 10 modified validators 160.37 ms/op 222.89 ms/op 0.72
findModifiedValidators - 1 modified validators 171.37 ms/op 167.91 ms/op 1.02
findModifiedValidators - no difference 179.74 ms/op 162.01 ms/op 1.11
migrate state 1500000 validators, 3400 modified, 2000 new 2.9814 s/op 2.6101 s/op 1.14
RootCache.getBlockRootAtSlot - 250000 vs - 7PWei 3.5500 ns/op 3.6700 ns/op 0.97
state getBlockRootAtSlot - 250000 vs - 7PWei 265.51 ns/op 280.74 ns/op 0.95
computeProposerIndex 100000 validators 1.3513 ms/op 1.3090 ms/op 1.03
getNextSyncCommitteeIndices 1000 validators 2.9381 ms/op 2.8666 ms/op 1.02
getNextSyncCommitteeIndices 10000 validators 25.839 ms/op 25.019 ms/op 1.03
getNextSyncCommitteeIndices 100000 validators 89.042 ms/op 86.905 ms/op 1.02
computeProposers - vc 250000 557.57 us/op 543.76 us/op 1.03
computeEpochShuffling - vc 250000 40.790 ms/op 38.075 ms/op 1.07
getNextSyncCommittee - vc 250000 9.6233 ms/op 9.4012 ms/op 1.02
nodejs block root to RootHex using toHex 97.206 ns/op 100.65 ns/op 0.97
nodejs block root to RootHex using toRootHex 60.366 ns/op 62.567 ns/op 0.96
nodejs fromHex(blob) 749.67 us/op 730.57 us/op 1.03
nodejs fromHexInto(blob) 649.19 us/op 637.87 us/op 1.02
nodejs block root to RootHex using the deprecated toHexString 481.83 ns/op 513.80 ns/op 0.94
nodejs byteArrayEquals 32 bytes (block root) 26.837 ns/op 25.931 ns/op 1.03
nodejs byteArrayEquals 48 bytes (pubkey) 38.561 ns/op 37.359 ns/op 1.03
nodejs byteArrayEquals 96 bytes (signature) 35.955 ns/op 38.026 ns/op 0.95
nodejs byteArrayEquals 1024 bytes 44.404 ns/op 45.413 ns/op 0.98
nodejs byteArrayEquals 131072 bytes (blob) 1.8106 us/op 1.7504 us/op 1.03
browser block root to RootHex using toHex 149.29 ns/op 144.93 ns/op 1.03
browser block root to RootHex using toRootHex 134.15 ns/op 130.69 ns/op 1.03
browser fromHex(blob) 1.6323 ms/op 1.4869 ms/op 1.10
browser fromHexInto(blob) 642.67 us/op 637.03 us/op 1.01
browser block root to RootHex using the deprecated toHexString 334.74 ns/op 354.70 ns/op 0.94
browser byteArrayEquals 32 bytes (block root) 28.640 ns/op 28.079 ns/op 1.02
browser byteArrayEquals 48 bytes (pubkey) 40.368 ns/op 39.621 ns/op 1.02
browser byteArrayEquals 96 bytes (signature) 75.619 ns/op 74.130 ns/op 1.02
browser byteArrayEquals 1024 bytes 774.06 ns/op 754.82 ns/op 1.03
browser byteArrayEquals 131072 bytes (blob) 98.115 us/op 95.304 us/op 1.03

by benchmarkbot/action

Copy link
Copy Markdown
Contributor

@twoeths twoeths left a comment

Choose a reason for hiding this comment

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

looks good to me, I dropped some minor comments

Comment thread packages/beacon-node/src/network/reqresp/handlers/beaconBlocksByHead.ts Outdated
Comment thread packages/beacon-node/src/util/types.ts Outdated
twoeths
twoeths previously approved these changes May 8, 2026
@twoeths
Copy link
Copy Markdown
Contributor

twoeths commented May 8, 2026

some unit tests are failing..

Copy link
Copy Markdown
Member

@nflaig nflaig left a comment

Choose a reason for hiding this comment

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

LGTM

@nflaig nflaig merged commit be5f70c into unstable May 13, 2026
22 of 25 checks passed
@nflaig nflaig deleted the cayman/beacon-blocks-by-head branch May 13, 2026 09:24
@wemeetagain
Copy link
Copy Markdown
Member Author

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