Skip to content

fix: tighten light-client zeroed-header checks to match spec#9419

Draft
ensi321 wants to merge 1 commit into
unstablefrom
nc/lc-zeroed-header-spec-parity
Draft

fix: tighten light-client zeroed-header checks to match spec#9419
ensi321 wants to merge 1 commit into
unstablefrom
nc/lc-zeroed-header-spec-parity

Conversation

@ensi321
Copy link
Copy Markdown
Contributor

@ensi321 ensi321 commented May 28, 2026

Summary

  • isZeroedHeader (packages/state-transition/src/lightClient/spec/utils.ts:108) only checked bodyRoot; spec (altair/light-client/sync-protocol.md process_light_client_update) requires whole-struct equality against LightClientHeader(). Same loosening present in isZeroedSyncCommittee. Switched both to full SSZ-struct equality.
  • Added isFinalityUpdate(update) guard at the store.finalizedHeader write site in processLightClientUpdate as defense-in-depth.
  • Removed now-unused ZERO_PUBKEY export.

Background

A reporter flagged that the loose isZeroedHeader check allows a non-finality LightClientUpdate to carry an attacker-controlled finalizedHeader (arbitrary slot/proposerIndex/parentRoot/stateRoot, only bodyRoot=0) past validateLightClientUpdate. processLightClientUpdate.ts:47-51 then overwrites store.finalizedHeader with it, since the conditional was gated only on the 2/3 sync-committee threshold and a higher slot — not on isFinalityUpdate(update). A MITM or malicious beacon-API endpoint could thus point a connected light client at any attacker-chosen state root.

AI Assistance Disclosure

Drafted with Claude (claude-opus-4-7).

🤖 Generated with Claude Code

…atch spec

`isZeroedHeader` only compared `bodyRoot`, and `isZeroedSyncCommittee` only
compared `pubkeys[0]`. The consensus-specs reference
(`altair/light-client/sync-protocol.md` `process_light_client_update`)
requires whole-struct equality against `LightClientHeader()` and
`SyncCommittee()` respectively. The loose checks let a non-finality
`LightClientUpdate` carry an attacker-controlled `finalizedHeader`
(arbitrary slot/proposerIndex/parentRoot/stateRoot, only `bodyRoot=0`)
past validation, and `processLightClientUpdate` would then overwrite
`store.finalizedHeader` with it.

Switch both helpers to full SSZ-struct equality, matching the spec.

Also add an `isFinalityUpdate(update)` guard on the
`store.finalizedHeader` write site in `processLightClientUpdate` as
defense-in-depth, so a non-finality update can never reach the
overwrite branch regardless of any future regression in the zero checks.

In-tree impact is limited: the light-client consumer was extracted to
an external repo in #9346, and the in-repo callers of this code are the
spec-test runner and downstream importers of
`@lodestar/state-transition/light-client`. The published package surface
still exposes the bug to any consumer that runs `validateLightClientUpdate`
/ `LightclientSpec` against untrusted updates.

AI Assistance Disclosure: drafted with Claude (claude-opus-4-7).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@ensi321 ensi321 changed the title fix(state-transition): tighten light-client zeroed-header checks to match spec fix: tighten light-client zeroed-header checks to match spec May 28, 2026
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 improves the security and spec-compliance of the light client update processing. It adds a defense-in-depth check isFinalityUpdate(update) when updating the finalized header. Additionally, it strengthens isZeroedHeader and isZeroedSyncCommittee by performing full equality checks against zeroed structures instead of partial checks, preventing potential exploits where arbitrary data could be smuggled. There are no review comments, so I have no feedback to provide.

@github-actions
Copy link
Copy Markdown
Contributor

Performance Report

✔️ no performance regression detected

Full benchmark results
Benchmark suite Current: b01b907 Previous: 055b83c Ratio
getPubkeys - index2pubkey - req 1000 vs - 250000 vc 848.58 us/op 1.2316 ms/op 0.69
getPubkeys - validatorsArr - req 1000 vs - 250000 vc 38.695 us/op 39.964 us/op 0.97
BLS verify - blst 714.39 us/op 631.51 us/op 1.13
BLS verifyMultipleSignatures 3 - blst 1.3494 ms/op 1.3022 ms/op 1.04
BLS verifyMultipleSignatures 8 - blst 2.1409 ms/op 2.0754 ms/op 1.03
BLS verifyMultipleSignatures 32 - blst 6.7489 ms/op 6.4593 ms/op 1.04
BLS verifyMultipleSignatures 64 - blst 13.204 ms/op 12.760 ms/op 1.03
BLS verifyMultipleSignatures 128 - blst 25.463 ms/op 25.005 ms/op 1.02
BLS deserializing 10000 signatures 646.30 ms/op 622.44 ms/op 1.04
BLS deserializing 100000 signatures 6.3923 s/op 6.2463 s/op 1.02
BLS verifyMultipleSignatures - same message - 3 - blst 698.86 us/op 769.41 us/op 0.91
BLS verifyMultipleSignatures - same message - 8 - blst 890.20 us/op 817.55 us/op 1.09
BLS verifyMultipleSignatures - same message - 32 - blst 1.4908 ms/op 1.4765 ms/op 1.01
BLS verifyMultipleSignatures - same message - 64 - blst 2.3469 ms/op 2.2342 ms/op 1.05
BLS verifyMultipleSignatures - same message - 128 - blst 3.9527 ms/op 3.9335 ms/op 1.00
BLS aggregatePubkeys 32 - blst 17.779 us/op 17.595 us/op 1.01
BLS aggregatePubkeys 128 - blst 63.876 us/op 62.686 us/op 1.02
getSlashingsAndExits - default max 49.025 us/op 50.722 us/op 0.97
getSlashingsAndExits - 2k 338.80 us/op 413.55 us/op 0.82
proposeBlockBody type=full, size=empty 1.2255 ms/op 1.3840 ms/op 0.89
isKnown best case - 1 super set check 190.00 ns/op 183.00 ns/op 1.04
isKnown normal case - 2 super set checks 174.00 ns/op 176.00 ns/op 0.99
isKnown worse case - 16 super set checks 175.00 ns/op 181.00 ns/op 0.97
validate api signedAggregateAndProof - struct 1.5055 ms/op 1.4431 ms/op 1.04
validate gossip signedAggregateAndProof - struct 1.5074 ms/op 1.4392 ms/op 1.05
batch validate gossip attestation - vc 640000 - chunk 32 105.83 us/op 102.42 us/op 1.03
batch validate gossip attestation - vc 640000 - chunk 64 91.839 us/op 90.380 us/op 1.02
batch validate gossip attestation - vc 640000 - chunk 128 86.393 us/op 84.996 us/op 1.02
batch validate gossip attestation - vc 640000 - chunk 256 83.648 us/op 81.971 us/op 1.02
bytes32 toHexString 294.00 ns/op 293.00 ns/op 1.00
bytes32 Buffer.toString(hex) 164.00 ns/op 182.00 ns/op 0.90
bytes32 Buffer.toString(hex) from Uint8Array 232.00 ns/op 242.00 ns/op 0.96
bytes32 Buffer.toString(hex) + 0x 165.00 ns/op 186.00 ns/op 0.89
Return object 10000 times 0.21240 ns/op 0.21120 ns/op 1.01
Throw Error 10000 times 3.3549 us/op 3.1587 us/op 1.06
toHex 95.197 ns/op 85.446 ns/op 1.11
Buffer.from 86.029 ns/op 78.804 ns/op 1.09
shared Buffer 62.010 ns/op 49.846 ns/op 1.24
fastMsgIdFn sha256 / 200 bytes 1.5020 us/op 1.4250 us/op 1.05
fastMsgIdFn h32 xxhash / 200 bytes 166.00 ns/op 172.00 ns/op 0.97
fastMsgIdFn h64 xxhash / 200 bytes 213.00 ns/op 213.00 ns/op 1.00
fastMsgIdFn sha256 / 1000 bytes 4.7580 us/op 4.5640 us/op 1.04
fastMsgIdFn h32 xxhash / 1000 bytes 254.00 ns/op 257.00 ns/op 0.99
fastMsgIdFn h64 xxhash / 1000 bytes 260.00 ns/op 258.00 ns/op 1.01
fastMsgIdFn sha256 / 10000 bytes 42.041 us/op 40.351 us/op 1.04
fastMsgIdFn h32 xxhash / 10000 bytes 1.2730 us/op 1.2580 us/op 1.01
fastMsgIdFn h64 xxhash / 10000 bytes 836.00 ns/op 813.00 ns/op 1.03
send data - 1000 256B messages 4.4021 ms/op 4.2977 ms/op 1.02
send data - 1000 512B messages 4.1430 ms/op 4.5096 ms/op 0.92
send data - 1000 1024B messages 4.2260 ms/op 4.5447 ms/op 0.93
send data - 1000 1200B messages 4.3799 ms/op 4.9802 ms/op 0.88
send data - 1000 2048B messages 4.5776 ms/op 5.0919 ms/op 0.90
send data - 1000 4096B messages 5.3827 ms/op 6.2954 ms/op 0.86
send data - 1000 16384B messages 37.277 ms/op 36.593 ms/op 1.02
send data - 1000 65536B messages 262.54 ms/op 133.56 ms/op 1.97
enrSubnets - fastDeserialize 64 bits 724.00 ns/op 722.00 ns/op 1.00
enrSubnets - ssz BitVector 64 bits 263.00 ns/op 280.00 ns/op 0.94
enrSubnets - fastDeserialize 4 bits 99.000 ns/op 125.00 ns/op 0.79
enrSubnets - ssz BitVector 4 bits 269.00 ns/op 277.00 ns/op 0.97
prioritizePeers score -10:0 att 32-0.1 sync 2-0 204.92 us/op 199.66 us/op 1.03
prioritizePeers score 0:0 att 32-0.25 sync 2-0.25 231.70 us/op 239.16 us/op 0.97
prioritizePeers score 0:0 att 32-0.5 sync 2-0.5 337.14 us/op 338.31 us/op 1.00
prioritizePeers score 0:0 att 64-0.75 sync 4-0.75 603.33 us/op 592.93 us/op 1.02
prioritizePeers score 0:0 att 64-1 sync 4-1 690.32 us/op 688.19 us/op 1.00
array of 16000 items push then shift 1.2925 us/op 1.2257 us/op 1.05
LinkedList of 16000 items push then shift 6.9410 ns/op 7.2080 ns/op 0.96
array of 16000 items push then pop 65.627 ns/op 67.899 ns/op 0.97
LinkedList of 16000 items push then pop 5.9230 ns/op 5.7240 ns/op 1.03
array of 24000 items push then shift 1.9113 us/op 1.7490 us/op 1.09
LinkedList of 24000 items push then shift 6.5790 ns/op 7.0570 ns/op 0.93
array of 24000 items push then pop 93.750 ns/op 92.525 ns/op 1.01
LinkedList of 24000 items push then pop 5.9300 ns/op 5.7870 ns/op 1.02
intersect bitArray bitLen 8 4.7490 ns/op 4.5530 ns/op 1.04
intersect array and set length 8 29.219 ns/op 27.913 ns/op 1.05
intersect bitArray bitLen 128 23.936 ns/op 22.821 ns/op 1.05
intersect array and set length 128 496.18 ns/op 468.07 ns/op 1.06
bitArray.getTrueBitIndexes() bitLen 128 1.0690 us/op 950.00 ns/op 1.13
bitArray.getTrueBitIndexes() bitLen 248 1.7540 us/op 1.7010 us/op 1.03
bitArray.getTrueBitIndexes() bitLen 512 3.5280 us/op 3.4940 us/op 1.01
Full columns - reconstruct all 6 blobs 180.69 us/op 153.75 us/op 1.18
Full columns - reconstruct half of the blobs out of 6 106.29 us/op 92.647 us/op 1.15
Full columns - reconstruct single blob out of 6 32.308 us/op 45.862 us/op 0.70
Half columns - reconstruct all 6 blobs 371.43 ms/op 374.10 ms/op 0.99
Half columns - reconstruct half of the blobs out of 6 185.94 ms/op 186.64 ms/op 1.00
Half columns - reconstruct single blob out of 6 65.588 ms/op 67.360 ms/op 0.97
Full columns - reconstruct all 10 blobs 243.86 us/op 413.21 us/op 0.59
Full columns - reconstruct half of the blobs out of 10 86.624 us/op 145.45 us/op 0.60
Full columns - reconstruct single blob out of 10 34.593 us/op 44.638 us/op 0.77
Half columns - reconstruct all 10 blobs 619.64 ms/op 611.04 ms/op 1.01
Half columns - reconstruct half of the blobs out of 10 313.13 ms/op 308.57 ms/op 1.01
Half columns - reconstruct single blob out of 10 65.485 ms/op 65.880 ms/op 0.99
Full columns - reconstruct all 20 blobs 1.3401 ms/op 1.2830 ms/op 1.04
Full columns - reconstruct half of the blobs out of 20 291.45 us/op 399.63 us/op 0.73
Full columns - reconstruct single blob out of 20 31.735 us/op 46.565 us/op 0.68
Half columns - reconstruct all 20 blobs 1.2374 s/op 1.2174 s/op 1.02
Half columns - reconstruct half of the blobs out of 20 621.85 ms/op 620.07 ms/op 1.00
Half columns - reconstruct single blob out of 20 66.372 ms/op 67.167 ms/op 0.99
Set add up to 64 items then delete first 2.5767 us/op 2.0953 us/op 1.23
OrderedSet add up to 64 items then delete first 3.7715 us/op 3.3650 us/op 1.12
Set add up to 64 items then delete last 2.3708 us/op 2.0812 us/op 1.14
OrderedSet add up to 64 items then delete last 3.3946 us/op 3.2339 us/op 1.05
Set add up to 64 items then delete middle 2.1522 us/op 2.0834 us/op 1.03
OrderedSet add up to 64 items then delete middle 4.8872 us/op 4.6924 us/op 1.04
Set add up to 128 items then delete first 4.1862 us/op 4.1235 us/op 1.02
OrderedSet add up to 128 items then delete first 6.2571 us/op 6.2335 us/op 1.00
Set add up to 128 items then delete last 3.9318 us/op 3.7311 us/op 1.05
OrderedSet add up to 128 items then delete last 5.9928 us/op 5.7445 us/op 1.04
Set add up to 128 items then delete middle 3.9118 us/op 3.7094 us/op 1.05
OrderedSet add up to 128 items then delete middle 11.880 us/op 11.264 us/op 1.05
Set add up to 256 items then delete first 7.7701 us/op 7.7145 us/op 1.01
OrderedSet add up to 256 items then delete first 11.526 us/op 12.072 us/op 0.95
Set add up to 256 items then delete last 7.7845 us/op 7.5534 us/op 1.03
OrderedSet add up to 256 items then delete last 11.865 us/op 11.639 us/op 1.02
Set add up to 256 items then delete middle 7.7340 us/op 7.5265 us/op 1.03
OrderedSet add up to 256 items then delete middle 35.155 us/op 35.472 us/op 0.99
pass gossip attestations to forkchoice per slot 2.5905 ms/op 2.5360 ms/op 1.02
forkChoice updateHead vc 100000 bc 64 eq 0 428.35 us/op 381.97 us/op 1.12
forkChoice updateHead vc 600000 bc 64 eq 0 2.4396 ms/op 2.3104 ms/op 1.06
forkChoice updateHead vc 1000000 bc 64 eq 0 4.0392 ms/op 3.8110 ms/op 1.06
forkChoice updateHead vc 600000 bc 320 eq 0 2.4376 ms/op 2.3005 ms/op 1.06
forkChoice updateHead vc 600000 bc 1200 eq 0 2.5120 ms/op 2.3596 ms/op 1.06
forkChoice updateHead vc 600000 bc 7200 eq 0 2.8332 ms/op 3.0623 ms/op 0.93
forkChoice updateHead vc 600000 bc 64 eq 1000 3.0564 ms/op 2.8193 ms/op 1.08
forkChoice updateHead vc 600000 bc 64 eq 10000 3.1306 ms/op 2.9238 ms/op 1.07
forkChoice updateHead vc 600000 bc 64 eq 300000 7.1673 ms/op 7.0660 ms/op 1.01
computeDeltas 1400000 validators 0% inactive 12.733 ms/op 12.144 ms/op 1.05
computeDeltas 1400000 validators 10% inactive 11.962 ms/op 11.500 ms/op 1.04
computeDeltas 1400000 validators 20% inactive 10.935 ms/op 10.374 ms/op 1.05
computeDeltas 1400000 validators 50% inactive 8.3704 ms/op 8.0421 ms/op 1.04
computeDeltas 2100000 validators 0% inactive 19.057 ms/op 18.344 ms/op 1.04
computeDeltas 2100000 validators 10% inactive 17.923 ms/op 17.380 ms/op 1.03
computeDeltas 2100000 validators 20% inactive 16.428 ms/op 15.741 ms/op 1.04
computeDeltas 2100000 validators 50% inactive 9.7106 ms/op 12.084 ms/op 0.80
altair processAttestation - 250000 vs - 7PWei normalcase 1.6924 ms/op 2.4130 ms/op 0.70
altair processAttestation - 250000 vs - 7PWei worstcase 2.3729 ms/op 3.1243 ms/op 0.76
altair processAttestation - setStatus - 1/6 committees join 99.346 us/op 102.60 us/op 0.97
altair processAttestation - setStatus - 1/3 committees join 199.74 us/op 194.05 us/op 1.03
altair processAttestation - setStatus - 1/2 committees join 291.80 us/op 283.11 us/op 1.03
altair processAttestation - setStatus - 2/3 committees join 365.37 us/op 372.26 us/op 0.98
altair processAttestation - setStatus - 4/5 committees join 508.05 us/op 518.13 us/op 0.98
altair processAttestation - setStatus - 100% committees join 600.65 us/op 608.20 us/op 0.99
altair processBlock - 250000 vs - 7PWei normalcase 2.9402 ms/op 4.6656 ms/op 0.63
altair processBlock - 250000 vs - 7PWei normalcase hashState 14.331 ms/op 17.304 ms/op 0.83
altair processBlock - 250000 vs - 7PWei worstcase 20.185 ms/op 23.217 ms/op 0.87
altair processBlock - 250000 vs - 7PWei worstcase hashState 40.259 ms/op 44.666 ms/op 0.90
phase0 processBlock - 250000 vs - 7PWei normalcase 1.3615 ms/op 1.4480 ms/op 0.94
phase0 processBlock - 250000 vs - 7PWei worstcase 17.473 ms/op 18.563 ms/op 0.94
altair processEth1Data - 250000 vs - 7PWei normalcase 312.66 us/op 295.68 us/op 1.06
getExpectedWithdrawals 250000 eb:1,eth1:1,we:0,wn:0,smpl:16 8.0520 us/op 4.8060 us/op 1.68
getExpectedWithdrawals 250000 eb:0.95,eth1:0.1,we:0.05,wn:0,smpl:220 20.841 us/op 22.411 us/op 0.93
getExpectedWithdrawals 250000 eb:0.95,eth1:0.3,we:0.05,wn:0,smpl:43 6.6580 us/op 6.5290 us/op 1.02
getExpectedWithdrawals 250000 eb:0.95,eth1:0.7,we:0.05,wn:0,smpl:19 4.0340 us/op 3.5970 us/op 1.12
getExpectedWithdrawals 250000 eb:0.1,eth1:0.1,we:0,wn:0,smpl:1021 91.986 us/op 95.605 us/op 0.96
getExpectedWithdrawals 250000 eb:0.03,eth1:0.03,we:0,wn:0,smpl:11778 1.4022 ms/op 1.3912 ms/op 1.01
getExpectedWithdrawals 250000 eb:0.01,eth1:0.01,we:0,wn:0,smpl:16384 1.8470 ms/op 1.8882 ms/op 0.98
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,smpl:16384 1.8333 ms/op 2.0611 ms/op 0.89
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,nocache,smpl:16384 3.7986 ms/op 4.6547 ms/op 0.82
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,smpl:16384 2.1171 ms/op 2.4420 ms/op 0.87
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,nocache,smpl:16384 4.1842 ms/op 5.5234 ms/op 0.76
Tree 40 250000 create 309.07 ms/op 373.08 ms/op 0.83
Tree 40 250000 get(125000) 95.238 ns/op 93.936 ns/op 1.01
Tree 40 250000 set(125000) 1.0246 us/op 1.2366 us/op 0.83
Tree 40 250000 toArray() 9.1567 ms/op 22.739 ms/op 0.40
Tree 40 250000 iterate all - toArray() + loop 9.2256 ms/op 21.597 ms/op 0.43
Tree 40 250000 iterate all - get(i) 34.191 ms/op 43.778 ms/op 0.78
Array 250000 create 2.1114 ms/op 2.3962 ms/op 0.88
Array 250000 clone - spread 681.40 us/op 748.31 us/op 0.91
Array 250000 get(125000) 0.30100 ns/op 0.30300 ns/op 0.99
Array 250000 set(125000) 0.30200 ns/op 0.30300 ns/op 1.00
Array 250000 iterate all - loop 58.659 us/op 58.726 us/op 1.00
phase0 afterProcessEpoch - 250000 vs - 7PWei 60.219 ms/op 39.730 ms/op 1.52
Array.fill - length 1000000 2.2066 ms/op 2.2044 ms/op 1.00
Array push - length 1000000 8.4022 ms/op 10.594 ms/op 0.79
Array.get 0.20929 ns/op 0.21668 ns/op 0.97
Uint8Array.get 0.24064 ns/op 0.24626 ns/op 0.98
phase0 beforeProcessEpoch - 250000 vs - 7PWei 14.123 ms/op 22.677 ms/op 0.62
altair processEpoch - mainnet_e81889 239.92 ms/op 326.33 ms/op 0.74
mainnet_e81889 - altair beforeProcessEpoch 15.544 ms/op 46.306 ms/op 0.34
mainnet_e81889 - altair processJustificationAndFinalization 4.9030 us/op 7.4960 us/op 0.65
mainnet_e81889 - altair processInactivityUpdates 3.4953 ms/op 8.0634 ms/op 0.43
mainnet_e81889 - altair processRewardsAndPenalties 16.670 ms/op 22.556 ms/op 0.74
mainnet_e81889 - altair processRegistryUpdates 528.00 ns/op 609.00 ns/op 0.87
mainnet_e81889 - altair processSlashings 138.00 ns/op 137.00 ns/op 1.01
mainnet_e81889 - altair processEth1DataReset 137.00 ns/op 138.00 ns/op 0.99
mainnet_e81889 - altair processEffectiveBalanceUpdates 1.7022 ms/op 7.6145 ms/op 0.22
mainnet_e81889 - altair processSlashingsReset 698.00 ns/op 769.00 ns/op 0.91
mainnet_e81889 - altair processRandaoMixesReset 1.0720 us/op 1.6310 us/op 0.66
mainnet_e81889 - altair processHistoricalRootsUpdate 139.00 ns/op 139.00 ns/op 1.00
mainnet_e81889 - altair processParticipationFlagUpdates 435.00 ns/op 522.00 ns/op 0.83
mainnet_e81889 - altair processSyncCommitteeUpdates 116.00 ns/op 114.00 ns/op 1.02
mainnet_e81889 - altair afterProcessEpoch 42.044 ms/op 42.930 ms/op 0.98
capella processEpoch - mainnet_e217614 732.39 ms/op 883.70 ms/op 0.83
mainnet_e217614 - capella beforeProcessEpoch 62.228 ms/op 62.156 ms/op 1.00
mainnet_e217614 - capella processJustificationAndFinalization 5.5610 us/op 6.7050 us/op 0.83
mainnet_e217614 - capella processInactivityUpdates 11.623 ms/op 15.007 ms/op 0.77
mainnet_e217614 - capella processRewardsAndPenalties 83.992 ms/op 92.188 ms/op 0.91
mainnet_e217614 - capella processRegistryUpdates 4.5730 us/op 4.6520 us/op 0.98
mainnet_e217614 - capella processSlashings 140.00 ns/op 134.00 ns/op 1.04
mainnet_e217614 - capella processEth1DataReset 137.00 ns/op 133.00 ns/op 1.03
mainnet_e217614 - capella processEffectiveBalanceUpdates 5.6312 ms/op 19.639 ms/op 0.29
mainnet_e217614 - capella processSlashingsReset 697.00 ns/op 707.00 ns/op 0.99
mainnet_e217614 - capella processRandaoMixesReset 1.0890 us/op 1.4100 us/op 0.77
mainnet_e217614 - capella processHistoricalRootsUpdate 139.00 ns/op 137.00 ns/op 1.01
mainnet_e217614 - capella processParticipationFlagUpdates 438.00 ns/op 450.00 ns/op 0.97
mainnet_e217614 - capella afterProcessEpoch 111.13 ms/op 111.52 ms/op 1.00
phase0 processEpoch - mainnet_e58758 261.24 ms/op 333.50 ms/op 0.78
mainnet_e58758 - phase0 beforeProcessEpoch 51.849 ms/op 90.479 ms/op 0.57
mainnet_e58758 - phase0 processJustificationAndFinalization 5.6020 us/op 7.0690 us/op 0.79
mainnet_e58758 - phase0 processRewardsAndPenalties 14.670 ms/op 17.449 ms/op 0.84
mainnet_e58758 - phase0 processRegistryUpdates 2.3390 us/op 2.3870 us/op 0.98
mainnet_e58758 - phase0 processSlashings 139.00 ns/op 135.00 ns/op 1.03
mainnet_e58758 - phase0 processEth1DataReset 140.00 ns/op 132.00 ns/op 1.06
mainnet_e58758 - phase0 processEffectiveBalanceUpdates 848.55 us/op 1.1528 ms/op 0.74
mainnet_e58758 - phase0 processSlashingsReset 829.00 ns/op 983.00 ns/op 0.84
mainnet_e58758 - phase0 processRandaoMixesReset 1.1690 us/op 1.4670 us/op 0.80
mainnet_e58758 - phase0 processHistoricalRootsUpdate 139.00 ns/op 136.00 ns/op 1.02
mainnet_e58758 - phase0 processParticipationRecordUpdates 1.0410 us/op 1.3610 us/op 0.76
mainnet_e58758 - phase0 afterProcessEpoch 34.548 ms/op 34.387 ms/op 1.00
phase0 processEffectiveBalanceUpdates - 250000 normalcase 1.0247 ms/op 1.0286 ms/op 1.00
phase0 processEffectiveBalanceUpdates - 250000 worstcase 0.5 1.5892 ms/op 1.5968 ms/op 1.00
altair processInactivityUpdates - 250000 normalcase 10.797 ms/op 13.512 ms/op 0.80
altair processInactivityUpdates - 250000 worstcase 10.736 ms/op 13.022 ms/op 0.82
phase0 processRegistryUpdates - 250000 normalcase 2.3830 us/op 2.5010 us/op 0.95
phase0 processRegistryUpdates - 250000 badcase_full_deposits 149.61 us/op 146.24 us/op 1.02
phase0 processRegistryUpdates - 250000 worstcase 0.5 64.104 ms/op 76.903 ms/op 0.83
altair processRewardsAndPenalties - 250000 normalcase 13.115 ms/op 16.425 ms/op 0.80
altair processRewardsAndPenalties - 250000 worstcase 12.817 ms/op 15.571 ms/op 0.82
phase0 getAttestationDeltas - 250000 normalcase 7.6687 ms/op 5.5228 ms/op 1.39
phase0 getAttestationDeltas - 250000 worstcase 5.6360 ms/op 5.7200 ms/op 0.99
phase0 processSlashings - 250000 worstcase 59.988 us/op 66.197 us/op 0.91
altair processSyncCommitteeUpdates - 250000 10.377 ms/op 12.932 ms/op 0.80
BeaconState.hashTreeRoot - No change 180.00 ns/op 173.00 ns/op 1.04
BeaconState.hashTreeRoot - 1 full validator 66.107 us/op 85.562 us/op 0.77
BeaconState.hashTreeRoot - 32 full validator 697.49 us/op 1.0037 ms/op 0.69
BeaconState.hashTreeRoot - 512 full validator 7.4080 ms/op 9.5720 ms/op 0.77
BeaconState.hashTreeRoot - 1 validator.effectiveBalance 80.808 us/op 118.92 us/op 0.68
BeaconState.hashTreeRoot - 32 validator.effectiveBalance 1.1118 ms/op 1.6583 ms/op 0.67
BeaconState.hashTreeRoot - 512 validator.effectiveBalance 14.958 ms/op 23.333 ms/op 0.64
BeaconState.hashTreeRoot - 1 balances 64.494 us/op 91.758 us/op 0.70
BeaconState.hashTreeRoot - 32 balances 613.46 us/op 819.91 us/op 0.75
BeaconState.hashTreeRoot - 512 balances 5.7315 ms/op 6.7511 ms/op 0.85
BeaconState.hashTreeRoot - 250000 balances 120.18 ms/op 150.60 ms/op 0.80
aggregationBits - 2048 els - zipIndexesInBitList 19.613 us/op 21.243 us/op 0.92
regular array get 100000 times 23.573 us/op 22.619 us/op 1.04
wrappedArray get 100000 times 23.611 us/op 22.987 us/op 1.03
arrayWithProxy get 100000 times 19.016 ms/op 9.7791 ms/op 1.94
ssz.Root.equals 79.852 ns/op 21.420 ns/op 3.73
byteArrayEquals 21.968 ns/op 21.603 ns/op 1.02
Buffer.compare 9.1000 ns/op 9.0280 ns/op 1.01
processSlot - 1 slots 8.8810 us/op 11.127 us/op 0.80
processSlot - 32 slots 1.6298 ms/op 2.3437 ms/op 0.70
getEffectiveBalanceIncrementsZeroInactive - 250000 vs - 7PWei 3.4815 ms/op 4.4363 ms/op 0.78
getCommitteeAssignments - req 1 vs - 250000 vc 2.0182 ms/op 1.7161 ms/op 1.18
getCommitteeAssignments - req 100 vs - 250000 vc 3.7927 ms/op 3.4914 ms/op 1.09
getCommitteeAssignments - req 1000 vs - 250000 vc 4.0653 ms/op 3.7370 ms/op 1.09
findModifiedValidators - 10000 modified validators 599.56 ms/op 748.86 ms/op 0.80
findModifiedValidators - 1000 modified validators 409.60 ms/op 478.97 ms/op 0.86
findModifiedValidators - 100 modified validators 295.23 ms/op 303.68 ms/op 0.97
findModifiedValidators - 10 modified validators 270.77 ms/op 248.91 ms/op 1.09
findModifiedValidators - 1 modified validators 158.39 ms/op 183.92 ms/op 0.86
findModifiedValidators - no difference 161.23 ms/op 195.00 ms/op 0.83
migrate state 1500000 validators, 3400 modified, 2000 new 2.5950 s/op 3.0888 s/op 0.84
RootCache.getBlockRootAtSlot - 250000 vs - 7PWei 3.8000 ns/op 3.7700 ns/op 1.01
state getBlockRootAtSlot - 250000 vs - 7PWei 259.28 ns/op 419.79 ns/op 0.62
computeProposerIndex 100000 validators 1.3030 ms/op 1.3722 ms/op 0.95
getNextSyncCommitteeIndices 1000 validators 2.8176 ms/op 2.9130 ms/op 0.97
getNextSyncCommitteeIndices 10000 validators 24.848 ms/op 25.668 ms/op 0.97
getNextSyncCommitteeIndices 100000 validators 83.218 ms/op 85.798 ms/op 0.97
computeProposers - vc 250000 540.88 us/op 564.89 us/op 0.96
computeEpochShuffling - vc 250000 38.594 ms/op 39.305 ms/op 0.98
getNextSyncCommittee - vc 250000 9.3085 ms/op 9.7199 ms/op 0.96
nodejs block root to RootHex using toHex 92.691 ns/op 93.099 ns/op 1.00
nodejs block root to RootHex using toRootHex 56.350 ns/op 51.670 ns/op 1.09
nodejs fromHex(blob) 794.45 us/op 746.07 us/op 1.06
nodejs fromHexInto(blob) 628.79 us/op 620.50 us/op 1.01
nodejs block root to RootHex using the deprecated toHexString 500.73 ns/op 561.70 ns/op 0.89
nodejs byteArrayEquals 32 bytes (block root) 25.518 ns/op 26.084 ns/op 0.98
nodejs byteArrayEquals 48 bytes (pubkey) 36.929 ns/op 37.520 ns/op 0.98
nodejs byteArrayEquals 96 bytes (signature) 36.971 ns/op 34.023 ns/op 1.09
nodejs byteArrayEquals 1024 bytes 44.938 ns/op 41.083 ns/op 1.09
nodejs byteArrayEquals 131072 bytes (blob) 1.7231 us/op 1.7400 us/op 0.99
browser block root to RootHex using toHex 142.93 ns/op 142.55 ns/op 1.00
browser block root to RootHex using toRootHex 128.79 ns/op 130.72 ns/op 0.99
browser fromHex(blob) 1.5095 ms/op 1.5133 ms/op 1.00
browser fromHexInto(blob) 639.97 us/op 619.50 us/op 1.03
browser block root to RootHex using the deprecated toHexString 506.46 ns/op 363.12 ns/op 1.39
browser byteArrayEquals 32 bytes (block root) 27.638 ns/op 27.304 ns/op 1.01
browser byteArrayEquals 48 bytes (pubkey) 38.986 ns/op 38.586 ns/op 1.01
browser byteArrayEquals 96 bytes (signature) 73.041 ns/op 72.406 ns/op 1.01
browser byteArrayEquals 1024 bytes 742.76 ns/op 738.88 ns/op 1.01
browser byteArrayEquals 131072 bytes (blob) 93.953 us/op 92.051 us/op 1.02

by benchmarkbot/action

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.

1 participant