Skip to content

feat: add beacon_blocks_by_head reqresp#9331

Open
wemeetagain wants to merge 3 commits intounstablefrom
cayman/beacon-blocks-by-head
Open

feat: add beacon_blocks_by_head reqresp#9331
wemeetagain wants to merge 3 commits intounstablefrom
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 Report

✔️ no performance regression detected

Full benchmark results
Benchmark suite Current: 7d25f70 Previous: 05a33e5 Ratio
getPubkeys - index2pubkey - req 1000 vs - 250000 vc 968.74 us/op 904.70 us/op 1.07
getPubkeys - validatorsArr - req 1000 vs - 250000 vc 39.471 us/op 39.028 us/op 1.01
BLS verify - blst 715.67 us/op 720.24 us/op 0.99
BLS verifyMultipleSignatures 3 - blst 1.3378 ms/op 1.3487 ms/op 0.99
BLS verifyMultipleSignatures 8 - blst 2.0980 ms/op 2.1262 ms/op 0.99
BLS verifyMultipleSignatures 32 - blst 6.6275 ms/op 6.8431 ms/op 0.97
BLS verifyMultipleSignatures 64 - blst 13.191 ms/op 12.979 ms/op 1.02
BLS verifyMultipleSignatures 128 - blst 25.419 ms/op 25.311 ms/op 1.00
BLS deserializing 10000 signatures 628.63 ms/op 648.90 ms/op 0.97
BLS deserializing 100000 signatures 6.4355 s/op 6.3685 s/op 1.01
BLS verifyMultipleSignatures - same message - 3 - blst 802.63 us/op 777.94 us/op 1.03
BLS verifyMultipleSignatures - same message - 8 - blst 920.24 us/op 857.53 us/op 1.07
BLS verifyMultipleSignatures - same message - 32 - blst 1.5457 ms/op 1.4090 ms/op 1.10
BLS verifyMultipleSignatures - same message - 64 - blst 2.3940 ms/op 2.2227 ms/op 1.08
BLS verifyMultipleSignatures - same message - 128 - blst 4.0603 ms/op 3.8800 ms/op 1.05
BLS aggregatePubkeys 32 - blst 17.692 us/op 17.295 us/op 1.02
BLS aggregatePubkeys 128 - blst 62.940 us/op 61.042 us/op 1.03
getSlashingsAndExits - default max 46.462 us/op 49.363 us/op 0.94
getSlashingsAndExits - 2k 347.01 us/op 332.33 us/op 1.04
proposeBlockBody type=full, size=empty 684.44 us/op 761.69 us/op 0.90
isKnown best case - 1 super set check 164.00 ns/op 164.00 ns/op 1.00
isKnown normal case - 2 super set checks 167.00 ns/op 164.00 ns/op 1.02
isKnown worse case - 16 super set checks 164.00 ns/op 169.00 ns/op 0.97
validate api signedAggregateAndProof - struct 1.5040 ms/op 1.4527 ms/op 1.04
validate gossip signedAggregateAndProof - struct 1.5045 ms/op 1.4494 ms/op 1.04
batch validate gossip attestation - vc 640000 - chunk 32 106.89 us/op 104.32 us/op 1.02
batch validate gossip attestation - vc 640000 - chunk 64 95.595 us/op 93.057 us/op 1.03
batch validate gossip attestation - vc 640000 - chunk 128 88.347 us/op 87.871 us/op 1.01
batch validate gossip attestation - vc 640000 - chunk 256 85.057 us/op 82.485 us/op 1.03
bytes32 toHexString 301.00 ns/op 292.00 ns/op 1.03
bytes32 Buffer.toString(hex) 183.00 ns/op 181.00 ns/op 1.01
bytes32 Buffer.toString(hex) from Uint8Array 250.00 ns/op 245.00 ns/op 1.02
bytes32 Buffer.toString(hex) + 0x 184.00 ns/op 183.00 ns/op 1.01
Return object 10000 times 0.21820 ns/op 0.20980 ns/op 1.04
Throw Error 10000 times 3.5112 us/op 3.3434 us/op 1.05
toHex 111.10 ns/op 89.388 ns/op 1.24
Buffer.from 90.026 ns/op 83.046 ns/op 1.08
shared Buffer 61.622 ns/op 55.086 ns/op 1.12
fastMsgIdFn sha256 / 200 bytes 1.5010 us/op 1.4500 us/op 1.04
fastMsgIdFn h32 xxhash / 200 bytes 163.00 ns/op 155.00 ns/op 1.05
fastMsgIdFn h64 xxhash / 200 bytes 217.00 ns/op 215.00 ns/op 1.01
fastMsgIdFn sha256 / 1000 bytes 4.7830 us/op 4.6440 us/op 1.03
fastMsgIdFn h32 xxhash / 1000 bytes 254.00 ns/op 245.00 ns/op 1.04
fastMsgIdFn h64 xxhash / 1000 bytes 266.00 ns/op 257.00 ns/op 1.04
fastMsgIdFn sha256 / 10000 bytes 42.501 us/op 40.668 us/op 1.05
fastMsgIdFn h32 xxhash / 10000 bytes 1.3030 us/op 1.2460 us/op 1.05
fastMsgIdFn h64 xxhash / 10000 bytes 866.00 ns/op 819.00 ns/op 1.06
send data - 1000 256B messages 4.0757 ms/op 4.3435 ms/op 0.94
send data - 1000 512B messages 4.2197 ms/op 4.2938 ms/op 0.98
send data - 1000 1024B messages 4.3960 ms/op 4.8334 ms/op 0.91
send data - 1000 1200B messages 4.6879 ms/op 4.9218 ms/op 0.95
send data - 1000 2048B messages 4.8139 ms/op 4.9475 ms/op 0.97
send data - 1000 4096B messages 5.5591 ms/op 5.7720 ms/op 0.96
send data - 1000 16384B messages 21.518 ms/op 44.268 ms/op 0.49
send data - 1000 65536B messages 170.37 ms/op 153.77 ms/op 1.11
enrSubnets - fastDeserialize 64 bits 777.00 ns/op 731.00 ns/op 1.06
enrSubnets - ssz BitVector 64 bits 273.00 ns/op 261.00 ns/op 1.05
enrSubnets - fastDeserialize 4 bits 106.00 ns/op 100.00 ns/op 1.06
enrSubnets - ssz BitVector 4 bits 277.00 ns/op 267.00 ns/op 1.04
prioritizePeers score -10:0 att 32-0.1 sync 2-0 211.80 us/op 205.32 us/op 1.03
prioritizePeers score 0:0 att 32-0.25 sync 2-0.25 235.56 us/op 232.21 us/op 1.01
prioritizePeers score 0:0 att 32-0.5 sync 2-0.5 345.02 us/op 337.54 us/op 1.02
prioritizePeers score 0:0 att 64-0.75 sync 4-0.75 628.62 us/op 613.12 us/op 1.03
prioritizePeers score 0:0 att 64-1 sync 4-1 721.55 us/op 722.67 us/op 1.00
array of 16000 items push then shift 1.2834 us/op 1.2404 us/op 1.03
LinkedList of 16000 items push then shift 7.5450 ns/op 7.4600 ns/op 1.01
array of 16000 items push then pop 67.985 ns/op 66.752 ns/op 1.02
LinkedList of 16000 items push then pop 6.0880 ns/op 5.8920 ns/op 1.03
array of 24000 items push then shift 1.8839 us/op 1.8157 us/op 1.04
LinkedList of 24000 items push then shift 7.0390 ns/op 7.1970 ns/op 0.98
array of 24000 items push then pop 93.052 ns/op 93.558 ns/op 0.99
LinkedList of 24000 items push then pop 6.0640 ns/op 5.9090 ns/op 1.03
intersect bitArray bitLen 8 4.7920 ns/op 4.6960 ns/op 1.02
intersect array and set length 8 29.461 ns/op 28.677 ns/op 1.03
intersect bitArray bitLen 128 24.337 ns/op 23.728 ns/op 1.03
intersect array and set length 128 513.73 ns/op 489.17 ns/op 1.05
bitArray.getTrueBitIndexes() bitLen 128 1.0960 us/op 1.0250 us/op 1.07
bitArray.getTrueBitIndexes() bitLen 248 1.8180 us/op 1.7080 us/op 1.06
bitArray.getTrueBitIndexes() bitLen 512 3.6410 us/op 3.5100 us/op 1.04
Full columns - reconstruct all 6 blobs 110.59 us/op 177.25 us/op 0.62
Full columns - reconstruct half of the blobs out of 6 94.799 us/op 95.995 us/op 0.99
Full columns - reconstruct single blob out of 6 43.036 us/op 31.819 us/op 1.35
Half columns - reconstruct all 6 blobs 395.49 ms/op 373.96 ms/op 1.06
Half columns - reconstruct half of the blobs out of 6 196.58 ms/op 187.83 ms/op 1.05
Half columns - reconstruct single blob out of 6 74.834 ms/op 66.795 ms/op 1.12
Full columns - reconstruct all 10 blobs 200.05 us/op 303.58 us/op 0.66
Full columns - reconstruct half of the blobs out of 10 116.54 us/op 134.19 us/op 0.87
Full columns - reconstruct single blob out of 10 33.565 us/op 31.710 us/op 1.06
Half columns - reconstruct all 10 blobs 651.57 ms/op 633.03 ms/op 1.03
Half columns - reconstruct half of the blobs out of 10 327.23 ms/op 320.77 ms/op 1.02
Half columns - reconstruct single blob out of 10 69.922 ms/op 70.855 ms/op 0.99
Full columns - reconstruct all 20 blobs 612.86 us/op 627.78 us/op 0.98
Full columns - reconstruct half of the blobs out of 20 265.32 us/op 159.75 us/op 1.66
Full columns - reconstruct single blob out of 20 32.041 us/op 31.175 us/op 1.03
Half columns - reconstruct all 20 blobs 1.3159 s/op 1.2593 s/op 1.04
Half columns - reconstruct half of the blobs out of 20 670.82 ms/op 630.66 ms/op 1.06
Half columns - reconstruct single blob out of 20 68.958 ms/op 68.999 ms/op 1.00
Set add up to 64 items then delete first 2.0663 us/op 2.5039 us/op 0.83
OrderedSet add up to 64 items then delete first 3.3135 us/op 3.3046 us/op 1.00
Set add up to 64 items then delete last 2.0817 us/op 2.3471 us/op 0.89
OrderedSet add up to 64 items then delete last 3.1926 us/op 3.2511 us/op 0.98
Set add up to 64 items then delete middle 2.0481 us/op 2.1806 us/op 0.94
OrderedSet add up to 64 items then delete middle 4.7732 us/op 4.8803 us/op 0.98
Set add up to 128 items then delete first 4.0425 us/op 4.5757 us/op 0.88
OrderedSet add up to 128 items then delete first 6.2086 us/op 6.5551 us/op 0.95
Set add up to 128 items then delete last 3.7039 us/op 3.9549 us/op 0.94
OrderedSet add up to 128 items then delete last 5.5697 us/op 5.8741 us/op 0.95
Set add up to 128 items then delete middle 3.6894 us/op 3.8179 us/op 0.97
OrderedSet add up to 128 items then delete middle 11.205 us/op 12.151 us/op 0.92
Set add up to 256 items then delete first 7.4314 us/op 7.8851 us/op 0.94
OrderedSet add up to 256 items then delete first 12.474 us/op 12.480 us/op 1.00
Set add up to 256 items then delete last 8.1387 us/op 8.0010 us/op 1.02
OrderedSet add up to 256 items then delete last 12.191 us/op 12.508 us/op 0.97
Set add up to 256 items then delete middle 8.0130 us/op 8.5939 us/op 0.93
OrderedSet add up to 256 items then delete middle 39.466 us/op 38.750 us/op 1.02
pass gossip attestations to forkchoice per slot 2.6629 ms/op 2.5865 ms/op 1.03
forkChoice updateHead vc 100000 bc 64 eq 0 411.63 us/op 391.25 us/op 1.05
forkChoice updateHead vc 600000 bc 64 eq 0 2.4089 ms/op 2.3492 ms/op 1.03
forkChoice updateHead vc 1000000 bc 64 eq 0 3.8413 ms/op 3.9252 ms/op 0.98
forkChoice updateHead vc 600000 bc 320 eq 0 2.4209 ms/op 2.3783 ms/op 1.02
forkChoice updateHead vc 600000 bc 1200 eq 0 2.4038 ms/op 2.4377 ms/op 0.99
forkChoice updateHead vc 600000 bc 7200 eq 0 2.6230 ms/op 3.2331 ms/op 0.81
forkChoice updateHead vc 600000 bc 64 eq 1000 2.8058 ms/op 2.8843 ms/op 0.97
forkChoice updateHead vc 600000 bc 64 eq 10000 2.8780 ms/op 2.9875 ms/op 0.96
forkChoice updateHead vc 600000 bc 64 eq 300000 7.2836 ms/op 6.7785 ms/op 1.07
computeDeltas 1400000 validators 0% inactive 12.657 ms/op 12.578 ms/op 1.01
computeDeltas 1400000 validators 10% inactive 11.790 ms/op 11.633 ms/op 1.01
computeDeltas 1400000 validators 20% inactive 10.759 ms/op 10.520 ms/op 1.02
computeDeltas 1400000 validators 50% inactive 8.3666 ms/op 8.2044 ms/op 1.02
computeDeltas 2100000 validators 0% inactive 19.209 ms/op 18.848 ms/op 1.02
computeDeltas 2100000 validators 10% inactive 17.995 ms/op 17.668 ms/op 1.02
computeDeltas 2100000 validators 20% inactive 16.357 ms/op 15.772 ms/op 1.04
computeDeltas 2100000 validators 50% inactive 12.631 ms/op 9.2615 ms/op 1.36
altair processAttestation - 250000 vs - 7PWei normalcase 2.3630 ms/op 2.2499 ms/op 1.05
altair processAttestation - 250000 vs - 7PWei worstcase 3.4910 ms/op 3.2331 ms/op 1.08
altair processAttestation - setStatus - 1/6 committees join 103.90 us/op 99.438 us/op 1.04
altair processAttestation - setStatus - 1/3 committees join 205.15 us/op 200.78 us/op 1.02
altair processAttestation - setStatus - 1/2 committees join 275.51 us/op 290.07 us/op 0.95
altair processAttestation - setStatus - 2/3 committees join 353.55 us/op 374.23 us/op 0.94
altair processAttestation - setStatus - 4/5 committees join 505.44 us/op 516.22 us/op 0.98
altair processAttestation - setStatus - 100% committees join 613.50 us/op 602.56 us/op 1.02
altair processBlock - 250000 vs - 7PWei normalcase 4.2563 ms/op 4.4783 ms/op 0.95
altair processBlock - 250000 vs - 7PWei normalcase hashState 20.021 ms/op 21.483 ms/op 0.93
altair processBlock - 250000 vs - 7PWei worstcase 23.827 ms/op 22.284 ms/op 1.07
altair processBlock - 250000 vs - 7PWei worstcase hashState 46.355 ms/op 43.836 ms/op 1.06
phase0 processBlock - 250000 vs - 7PWei normalcase 1.3869 ms/op 1.4445 ms/op 0.96
phase0 processBlock - 250000 vs - 7PWei worstcase 19.026 ms/op 16.739 ms/op 1.14
altair processEth1Data - 250000 vs - 7PWei normalcase 332.91 us/op 293.04 us/op 1.14
getExpectedWithdrawals 250000 eb:1,eth1:1,we:0,wn:0,smpl:16 3.1980 us/op 3.3520 us/op 0.95
getExpectedWithdrawals 250000 eb:0.95,eth1:0.1,we:0.05,wn:0,smpl:220 20.851 us/op 21.288 us/op 0.98
getExpectedWithdrawals 250000 eb:0.95,eth1:0.3,we:0.05,wn:0,smpl:43 6.0370 us/op 5.9470 us/op 1.02
getExpectedWithdrawals 250000 eb:0.95,eth1:0.7,we:0.05,wn:0,smpl:19 4.2490 us/op 3.6490 us/op 1.16
getExpectedWithdrawals 250000 eb:0.1,eth1:0.1,we:0,wn:0,smpl:1021 92.685 us/op 93.463 us/op 0.99
getExpectedWithdrawals 250000 eb:0.03,eth1:0.03,we:0,wn:0,smpl:11778 1.3914 ms/op 1.3760 ms/op 1.01
getExpectedWithdrawals 250000 eb:0.01,eth1:0.01,we:0,wn:0,smpl:16384 1.8850 ms/op 1.7840 ms/op 1.06
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,smpl:16384 1.8025 ms/op 1.7826 ms/op 1.01
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,nocache,smpl:16384 4.0421 ms/op 4.3358 ms/op 0.93
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,smpl:16384 2.0829 ms/op 2.0428 ms/op 1.02
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,nocache,smpl:16384 4.0988 ms/op 4.2046 ms/op 0.97
Tree 40 250000 create 317.17 ms/op 376.36 ms/op 0.84
Tree 40 250000 get(125000) 89.891 ns/op 91.704 ns/op 0.98
Tree 40 250000 set(125000) 948.71 ns/op 989.83 ns/op 0.96
Tree 40 250000 toArray() 11.386 ms/op 16.056 ms/op 0.71
Tree 40 250000 iterate all - toArray() + loop 12.292 ms/op 16.099 ms/op 0.76
Tree 40 250000 iterate all - get(i) 36.454 ms/op 39.484 ms/op 0.92
Array 250000 create 2.0808 ms/op 2.3136 ms/op 0.90
Array 250000 clone - spread 671.27 us/op 705.69 us/op 0.95
Array 250000 get(125000) 0.29000 ns/op 0.29900 ns/op 0.97
Array 250000 set(125000) 0.29400 ns/op 0.30600 ns/op 0.96
Array 250000 iterate all - loop 57.440 us/op 57.554 us/op 1.00
phase0 afterProcessEpoch - 250000 vs - 7PWei 39.911 ms/op 50.103 ms/op 0.80
Array.fill - length 1000000 2.7331 ms/op 2.1151 ms/op 1.29
Array push - length 1000000 9.7436 ms/op 10.010 ms/op 0.97
Array.get 0.21482 ns/op 0.20659 ns/op 1.04
Uint8Array.get 0.24288 ns/op 0.23208 ns/op 1.05
phase0 beforeProcessEpoch - 250000 vs - 7PWei 14.149 ms/op 14.914 ms/op 0.95
altair processEpoch - mainnet_e81889 291.86 ms/op 298.93 ms/op 0.98
mainnet_e81889 - altair beforeProcessEpoch 17.589 ms/op 17.439 ms/op 1.01
mainnet_e81889 - altair processJustificationAndFinalization 6.3360 us/op 6.5810 us/op 0.96
mainnet_e81889 - altair processInactivityUpdates 3.9926 ms/op 5.5989 ms/op 0.71
mainnet_e81889 - altair processRewardsAndPenalties 20.806 ms/op 20.579 ms/op 1.01
mainnet_e81889 - altair processRegistryUpdates 597.00 ns/op 546.00 ns/op 1.09
mainnet_e81889 - altair processSlashings 179.00 ns/op 151.00 ns/op 1.19
mainnet_e81889 - altair processEth1DataReset 132.00 ns/op 136.00 ns/op 0.97
mainnet_e81889 - altair processEffectiveBalanceUpdates 3.8621 ms/op 1.5363 ms/op 2.51
mainnet_e81889 - altair processSlashingsReset 860.00 ns/op 703.00 ns/op 1.22
mainnet_e81889 - altair processRandaoMixesReset 1.2960 us/op 1.3520 us/op 0.96
mainnet_e81889 - altair processHistoricalRootsUpdate 135.00 ns/op 137.00 ns/op 0.99
mainnet_e81889 - altair processParticipationFlagUpdates 440.00 ns/op 429.00 ns/op 1.03
mainnet_e81889 - altair processSyncCommitteeUpdates 106.00 ns/op 124.00 ns/op 0.85
mainnet_e81889 - altair afterProcessEpoch 43.025 ms/op 42.068 ms/op 1.02
capella processEpoch - mainnet_e217614 814.41 ms/op 864.32 ms/op 0.94
mainnet_e217614 - capella beforeProcessEpoch 59.567 ms/op 68.895 ms/op 0.86
mainnet_e217614 - capella processJustificationAndFinalization 5.4630 us/op 6.5200 us/op 0.84
mainnet_e217614 - capella processInactivityUpdates 16.396 ms/op 19.022 ms/op 0.86
mainnet_e217614 - capella processRewardsAndPenalties 89.842 ms/op 95.920 ms/op 0.94
mainnet_e217614 - capella processRegistryUpdates 4.2400 us/op 4.5910 us/op 0.92
mainnet_e217614 - capella processSlashings 122.00 ns/op 135.00 ns/op 0.90
mainnet_e217614 - capella processEth1DataReset 122.00 ns/op 129.00 ns/op 0.95
mainnet_e217614 - capella processEffectiveBalanceUpdates 12.521 ms/op 15.470 ms/op 0.81
mainnet_e217614 - capella processSlashingsReset 658.00 ns/op 706.00 ns/op 0.93
mainnet_e217614 - capella processRandaoMixesReset 1.1050 us/op 1.3110 us/op 0.84
mainnet_e217614 - capella processHistoricalRootsUpdate 115.00 ns/op 139.00 ns/op 0.83
mainnet_e217614 - capella processParticipationFlagUpdates 410.00 ns/op 444.00 ns/op 0.92
mainnet_e217614 - capella afterProcessEpoch 107.09 ms/op 111.99 ms/op 0.96
phase0 processEpoch - mainnet_e58758 302.42 ms/op 338.31 ms/op 0.89
mainnet_e58758 - phase0 beforeProcessEpoch 61.572 ms/op 68.216 ms/op 0.90
mainnet_e58758 - phase0 processJustificationAndFinalization 5.9330 us/op 6.4250 us/op 0.92
mainnet_e58758 - phase0 processRewardsAndPenalties 16.412 ms/op 16.972 ms/op 0.97
mainnet_e58758 - phase0 processRegistryUpdates 2.1720 us/op 2.2530 us/op 0.96
mainnet_e58758 - phase0 processSlashings 127.00 ns/op 134.00 ns/op 0.95
mainnet_e58758 - phase0 processEth1DataReset 124.00 ns/op 133.00 ns/op 0.93
mainnet_e58758 - phase0 processEffectiveBalanceUpdates 1.3087 ms/op 956.88 us/op 1.37
mainnet_e58758 - phase0 processSlashingsReset 860.00 ns/op 895.00 ns/op 0.96
mainnet_e58758 - phase0 processRandaoMixesReset 1.2240 us/op 1.3280 us/op 0.92
mainnet_e58758 - phase0 processHistoricalRootsUpdate 128.00 ns/op 134.00 ns/op 0.96
mainnet_e58758 - phase0 processParticipationRecordUpdates 973.00 ns/op 1.1800 us/op 0.82
mainnet_e58758 - phase0 afterProcessEpoch 32.381 ms/op 33.406 ms/op 0.97
phase0 processEffectiveBalanceUpdates - 250000 normalcase 962.07 us/op 1.0021 ms/op 0.96
phase0 processEffectiveBalanceUpdates - 250000 worstcase 0.5 1.2128 ms/op 1.5538 ms/op 0.78
altair processInactivityUpdates - 250000 normalcase 10.757 ms/op 13.922 ms/op 0.77
altair processInactivityUpdates - 250000 worstcase 10.903 ms/op 14.570 ms/op 0.75
phase0 processRegistryUpdates - 250000 normalcase 2.4090 us/op 2.4340 us/op 0.99
phase0 processRegistryUpdates - 250000 badcase_full_deposits 155.08 us/op 158.96 us/op 0.98
phase0 processRegistryUpdates - 250000 worstcase 0.5 63.514 ms/op 69.039 ms/op 0.92
altair processRewardsAndPenalties - 250000 normalcase 16.087 ms/op 17.491 ms/op 0.92
altair processRewardsAndPenalties - 250000 worstcase 15.415 ms/op 17.301 ms/op 0.89
phase0 getAttestationDeltas - 250000 normalcase 5.1260 ms/op 5.7333 ms/op 0.89
phase0 getAttestationDeltas - 250000 worstcase 5.1757 ms/op 5.6647 ms/op 0.91
phase0 processSlashings - 250000 worstcase 59.537 us/op 66.118 us/op 0.90
altair processSyncCommitteeUpdates - 250000 11.005 ms/op 13.270 ms/op 0.83
BeaconState.hashTreeRoot - No change 198.00 ns/op 211.00 ns/op 0.94
BeaconState.hashTreeRoot - 1 full validator 79.218 us/op 89.371 us/op 0.89
BeaconState.hashTreeRoot - 32 full validator 870.07 us/op 1.1152 ms/op 0.78
BeaconState.hashTreeRoot - 512 full validator 9.3258 ms/op 10.217 ms/op 0.91
BeaconState.hashTreeRoot - 1 validator.effectiveBalance 124.75 us/op 127.91 us/op 0.98
BeaconState.hashTreeRoot - 32 validator.effectiveBalance 1.6479 ms/op 1.7270 ms/op 0.95
BeaconState.hashTreeRoot - 512 validator.effectiveBalance 22.648 ms/op 22.160 ms/op 1.02
BeaconState.hashTreeRoot - 1 balances 90.794 us/op 96.508 us/op 0.94
BeaconState.hashTreeRoot - 32 balances 759.07 us/op 909.05 us/op 0.84
BeaconState.hashTreeRoot - 512 balances 8.0663 ms/op 7.8369 ms/op 1.03
BeaconState.hashTreeRoot - 250000 balances 174.68 ms/op 170.70 ms/op 1.02
aggregationBits - 2048 els - zipIndexesInBitList 23.957 us/op 21.369 us/op 1.12
regular array get 100000 times 24.231 us/op 24.833 us/op 0.98
wrappedArray get 100000 times 24.143 us/op 24.638 us/op 0.98
arrayWithProxy get 100000 times 10.085 ms/op 10.428 ms/op 0.97
ssz.Root.equals 22.354 ns/op 22.789 ns/op 0.98
byteArrayEquals 22.137 ns/op 22.533 ns/op 0.98
Buffer.compare 9.1310 ns/op 9.4770 ns/op 0.96
processSlot - 1 slots 9.7710 us/op 12.013 us/op 0.81
processSlot - 32 slots 2.3081 ms/op 2.4207 ms/op 0.95
getEffectiveBalanceIncrementsZeroInactive - 250000 vs - 7PWei 4.7043 ms/op 4.4479 ms/op 1.06
getCommitteeAssignments - req 1 vs - 250000 vc 1.6887 ms/op 1.6553 ms/op 1.02
getCommitteeAssignments - req 100 vs - 250000 vc 3.4796 ms/op 3.4408 ms/op 1.01
getCommitteeAssignments - req 1000 vs - 250000 vc 3.7454 ms/op 3.7254 ms/op 1.01
findModifiedValidators - 10000 modified validators 760.42 ms/op 693.90 ms/op 1.10
findModifiedValidators - 1000 modified validators 448.77 ms/op 531.85 ms/op 0.84
findModifiedValidators - 100 modified validators 281.78 ms/op 340.27 ms/op 0.83
findModifiedValidators - 10 modified validators 238.06 ms/op 248.76 ms/op 0.96
findModifiedValidators - 1 modified validators 158.97 ms/op 153.94 ms/op 1.03
findModifiedValidators - no difference 156.02 ms/op 161.90 ms/op 0.96
migrate state 1500000 validators, 3400 modified, 2000 new 3.2569 s/op 3.1810 s/op 1.02
RootCache.getBlockRootAtSlot - 250000 vs - 7PWei 3.7700 ns/op 3.5800 ns/op 1.05
state getBlockRootAtSlot - 250000 vs - 7PWei 405.60 ns/op 405.96 ns/op 1.00
computeProposerIndex 100000 validators 1.3837 ms/op 1.3282 ms/op 1.04
getNextSyncCommitteeIndices 1000 validators 2.9284 ms/op 2.8475 ms/op 1.03
getNextSyncCommitteeIndices 10000 validators 26.387 ms/op 24.625 ms/op 1.07
getNextSyncCommitteeIndices 100000 validators 85.985 ms/op 87.852 ms/op 0.98
computeProposers - vc 250000 644.91 us/op 542.75 us/op 1.19
computeEpochShuffling - vc 250000 42.795 ms/op 38.612 ms/op 1.11
getNextSyncCommittee - vc 250000 10.152 ms/op 9.6138 ms/op 1.06
nodejs block root to RootHex using toHex 99.827 ns/op 91.860 ns/op 1.09
nodejs block root to RootHex using toRootHex 64.640 ns/op 55.939 ns/op 1.16
nodejs fromHex(blob) 753.97 us/op 778.68 us/op 0.97
nodejs fromHexInto(blob) 638.49 us/op 619.59 us/op 1.03
nodejs block root to RootHex using the deprecated toHexString 486.15 ns/op 474.52 ns/op 1.02
nodejs byteArrayEquals 32 bytes (block root) 26.182 ns/op 25.337 ns/op 1.03
nodejs byteArrayEquals 48 bytes (pubkey) 38.127 ns/op 36.831 ns/op 1.04
nodejs byteArrayEquals 96 bytes (signature) 34.674 ns/op 33.469 ns/op 1.04
nodejs byteArrayEquals 1024 bytes 41.776 ns/op 39.798 ns/op 1.05
nodejs byteArrayEquals 131072 bytes (blob) 1.7975 us/op 1.7215 us/op 1.04
browser block root to RootHex using toHex 146.95 ns/op 141.53 ns/op 1.04
browser block root to RootHex using toRootHex 133.05 ns/op 128.63 ns/op 1.03
browser fromHex(blob) 1.5005 ms/op 1.5016 ms/op 1.00
browser fromHexInto(blob) 653.09 us/op 619.49 us/op 1.05
browser block root to RootHex using the deprecated toHexString 347.17 ns/op 467.51 ns/op 0.74
browser byteArrayEquals 32 bytes (block root) 28.670 ns/op 27.724 ns/op 1.03
browser byteArrayEquals 48 bytes (pubkey) 41.419 ns/op 39.017 ns/op 1.06
browser byteArrayEquals 96 bytes (signature) 77.012 ns/op 72.756 ns/op 1.06
browser byteArrayEquals 1024 bytes 767.53 ns/op 743.50 ns/op 1.03
browser byteArrayEquals 131072 bytes (blob) 97.126 us/op 94.658 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
Copy link
Copy Markdown
Contributor

twoeths commented May 8, 2026

some unit tests are failing..

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