Skip to content

feat: use zig backed lodestar-z shuffle - #9829

Open
nazarhussain wants to merge 1 commit into
unstablefrom
nh/zig-shuffle-integration
Open

feat: use zig backed lodestar-z shuffle#9829
nazarhussain wants to merge 1 commit into
unstablefrom
nh/zig-shuffle-integration

Conversation

@nazarhussain

@nazarhussain nazarhussain commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

Motivation

Migrate shuffling to the zig-based implementation from ChainSafe/lodestar-z#559, removing the rust-based @chainsafe/swap-or-not-shuffle dependency.

Description

  • Remove @chainsafe/swap-or-not-shuffle from state-transition and beacon-node (@chainsafe/lodestar-z@^1.0.0 is already a dependency on unstable)
  • Switch unshuffleList/computeProposerIndex/computeSyncCommitteeIndices call sites to bindings.shuffle — same signatures, no logic changes
  • Remove unused computeEpochShufflingAsync — lodestar-z ships sync-only shuffle bindings (async left for a future zapi release per the lodestar-z PR) and it had no production callers

Verified with build, check-types, lint, state-transition unit tests, and a shuffle smoke test.

🤖 AI-assisted (Claude Code)

@nazarhussain
nazarhussain requested a review from a team as a code owner August 15, 2026 06:33
@nazarhussain nazarhussain changed the title feat: replace @chainsafe/swap-or-not-shuffle with zig-based lodestar-z shuffle feat: use zig backedlodestar-z shuffle Aug 15, 2026

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

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8c3cfb0d97

ℹ️ About Codex in GitHub

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

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

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

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

Comment thread pnpm-workspace.yaml Outdated
nodeLinker: isolated

catalog:
"@chainsafe/lodestar-z": "github:ChainSafe/lodestar-z#nh/swap-or-not-shuffle-parity"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Pin the published shuffle dependency to a commit

When @lodestar/state-transition is packed or published, pnpm replaces its catalog: dependency with this catalog value, so downstream users receive the mutable nh/swap-or-not-shuffle-parity branch rather than the commit recorded in this repository's lockfile. A later branch update could therefore change consensus-critical native shuffling code without a Lodestar change or lockfile review. Use the resolved commit hash or a released package version in the catalog.

Useful? React with 👍 / 👎.

@github-actions

github-actions Bot commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

⚠️ 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: bb048a3 Previous: aa8303e Ratio
Array.fill - length 1000000 20.670 ms/op 4.2355 ms/op 4.88
Full benchmark results
Benchmark suite Current: bb048a3 Previous: aa8303e Ratio
getPubkeys - native cache - req 1000 vs - 250000 vc 422.80 us/op 572.80 us/op 0.74
getPubkeys - validatorsArr - req 1000 vs - 250000 vc 44.385 us/op 39.188 us/op 1.13
BLS verify - blst 909.32 us/op 887.74 us/op 1.02
BLS verifyMultipleSignatures 3 - blst 1.3929 ms/op 1.3494 ms/op 1.03
BLS verifyMultipleSignatures 8 - blst 2.3285 ms/op 2.2600 ms/op 1.03
BLS verifyMultipleSignatures 32 - blst 7.6718 ms/op 7.4684 ms/op 1.03
BLS verifyMultipleSignatures 64 - blst 14.725 ms/op 14.426 ms/op 1.02
BLS verifyMultipleSignatures 128 - blst 27.696 ms/op 26.866 ms/op 1.03
BLS deserializing 10000 signatures 654.23 ms/op 652.05 ms/op 1.00
BLS deserializing 100000 signatures 6.5163 s/op 6.4914 s/op 1.00
BLS verifyMultipleSignatures - same message - 3 - blst 969.76 us/op 965.65 us/op 1.00
BLS verifyMultipleSignatures - same message - 8 - blst 1.1059 ms/op 1.0975 ms/op 1.01
BLS verifyMultipleSignatures - same message - 32 - blst 1.7338 ms/op 1.7308 ms/op 1.00
BLS verifyMultipleSignatures - same message - 64 - blst 2.5667 ms/op 2.5491 ms/op 1.01
BLS verifyMultipleSignatures - same message - 128 - blst 4.2456 ms/op 4.2478 ms/op 1.00
BLS aggregatePubkeys 32 - blst 19.751 us/op 19.570 us/op 1.01
BLS aggregatePubkeys 128 - blst 71.643 us/op 71.143 us/op 1.01
getSlashingsAndExits - default max 40.958 us/op 42.694 us/op 0.96
getSlashingsAndExits - 2k 329.32 us/op 349.90 us/op 0.94
proposeBlockBody type=full, size=empty 798.75 us/op 723.28 us/op 1.10
isKnown best case - 1 super set check 186.00 ns/op 172.00 ns/op 1.08
isKnown normal case - 2 super set checks 171.00 ns/op 165.00 ns/op 1.04
isKnown worse case - 16 super set checks 167.00 ns/op 164.00 ns/op 1.02
validate api signedAggregateAndProof - struct 1.5453 ms/op 1.5122 ms/op 1.02
validate gossip signedAggregateAndProof - struct 1.5438 ms/op 1.5039 ms/op 1.03
batch validate gossip attestation - vc 640000 - chunk 32 125.03 us/op 128.27 us/op 0.97
batch validate gossip attestation - vc 640000 - chunk 64 104.87 us/op 107.55 us/op 0.98
batch validate gossip attestation - vc 640000 - chunk 128 96.153 us/op 98.262 us/op 0.98
batch validate gossip attestation - vc 640000 - chunk 256 95.278 us/op 99.107 us/op 0.96
bytes32 toHexString 290.00 ns/op 293.00 ns/op 0.99
bytes32 Buffer.toString(hex) 168.00 ns/op 175.00 ns/op 0.96
bytes32 Buffer.toString(hex) from Uint8Array 245.00 ns/op 237.00 ns/op 1.03
bytes32 Buffer.toString(hex) + 0x 176.00 ns/op 182.00 ns/op 0.97
Return object 10000 times 0.21640 ns/op 0.22010 ns/op 0.98
Throw Error 10000 times 3.4210 us/op 3.4364 us/op 1.00
toHex 114.44 ns/op 100.58 ns/op 1.14
Buffer.from 94.211 ns/op 87.352 ns/op 1.08
shared Buffer 63.305 ns/op 57.418 ns/op 1.10
fastMsgIdFn sha256 / 200 bytes 1.5030 us/op 1.4940 us/op 1.01
fastMsgIdFn h32 xxhash / 200 bytes 156.00 ns/op 153.00 ns/op 1.02
fastMsgIdFn h64 xxhash / 200 bytes 217.00 ns/op 207.00 ns/op 1.05
fastMsgIdFn sha256 / 1000 bytes 4.8500 us/op 4.7410 us/op 1.02
fastMsgIdFn h32 xxhash / 1000 bytes 251.00 ns/op 243.00 ns/op 1.03
fastMsgIdFn h64 xxhash / 1000 bytes 267.00 ns/op 257.00 ns/op 1.04
fastMsgIdFn sha256 / 10000 bytes 43.162 us/op 42.242 us/op 1.02
fastMsgIdFn h32 xxhash / 10000 bytes 1.3080 us/op 1.2850 us/op 1.02
fastMsgIdFn h64 xxhash / 10000 bytes 851.00 ns/op 837.00 ns/op 1.02
send data - 1000 256B messages 3.8939 ms/op 4.5835 ms/op 0.85
send data - 1000 512B messages 4.7234 ms/op 5.6716 ms/op 0.83
send data - 1000 1024B messages 5.3812 ms/op 6.0179 ms/op 0.89
send data - 1000 1200B messages 7.1291 ms/op 7.3609 ms/op 0.97
send data - 1000 2048B messages 18.370 ms/op 10.980 ms/op 1.67
send data - 1000 4096B messages 120.20 ms/op 93.731 ms/op 1.28
send data - 1000 16384B messages 379.63 ms/op 432.22 ms/op 0.88
send data - 1000 65536B messages 1.6794 s/op 2.4683 s/op 0.68
enrSubnets - fastDeserialize 64 bits 770.00 ns/op 757.00 ns/op 1.02
enrSubnets - ssz BitVector 64 bits 267.00 ns/op 269.00 ns/op 0.99
enrSubnets - fastDeserialize 4 bits 108.00 ns/op 102.00 ns/op 1.06
enrSubnets - ssz BitVector 4 bits 264.00 ns/op 277.00 ns/op 0.95
prioritizePeers score -10:0 att 32-0.1 sync 2-0 211.20 us/op 212.27 us/op 0.99
prioritizePeers score 0:0 att 32-0.25 sync 2-0.25 238.89 us/op 242.89 us/op 0.98
prioritizePeers score 0:0 att 32-0.5 sync 2-0.5 350.25 us/op 354.20 us/op 0.99
prioritizePeers score 0:0 att 64-0.75 sync 4-0.75 618.28 us/op 627.30 us/op 0.99
prioritizePeers score 0:0 att 64-1 sync 4-1 710.41 us/op 736.80 us/op 0.96
array of 16000 items push then shift 1.3437 us/op 1.2984 us/op 1.03
LinkedList of 16000 items push then shift 7.7830 ns/op 9.2390 ns/op 0.84
array of 16000 items push then pop 78.488 ns/op 86.625 ns/op 0.91
LinkedList of 16000 items push then pop 6.1250 ns/op 6.8360 ns/op 0.90
array of 24000 items push then shift 1.9819 us/op 1.9283 us/op 1.03
LinkedList of 24000 items push then shift 6.9970 ns/op 8.0870 ns/op 0.87
array of 24000 items push then pop 112.28 ns/op 126.40 ns/op 0.89
LinkedList of 24000 items push then pop 6.1030 ns/op 7.1970 ns/op 0.85
intersect bitArray bitLen 8 3.9880 ns/op 3.9440 ns/op 1.01
intersect array and set length 8 30.019 ns/op 30.380 ns/op 0.99
intersect bitArray bitLen 128 23.876 ns/op 23.633 ns/op 1.01
intersect array and set length 128 507.04 ns/op 497.19 ns/op 1.02
bitArray.getTrueBitIndexes() bitLen 128 923.00 ns/op 949.00 ns/op 0.97
bitArray.getTrueBitIndexes() bitLen 248 1.6930 us/op 1.7210 us/op 0.98
bitArray.getTrueBitIndexes() bitLen 512 3.5700 us/op 3.6580 us/op 0.98
Full columns - reconstruct all 6 blobs 165.06 us/op 168.97 us/op 0.98
Full columns - reconstruct half of the blobs out of 6 69.208 us/op 109.15 us/op 0.63
Full columns - reconstruct single blob out of 6 34.440 us/op 38.839 us/op 0.89
Half columns - reconstruct all 6 blobs 394.70 ms/op 424.52 ms/op 0.93
Half columns - reconstruct half of the blobs out of 6 195.05 ms/op 215.68 ms/op 0.90
Half columns - reconstruct single blob out of 6 68.537 ms/op 76.819 ms/op 0.89
Set add up to 64 items then delete first 1.6851 us/op 2.3294 us/op 0.72
OrderedSet add up to 64 items then delete first 2.5658 us/op 3.7056 us/op 0.69
Set add up to 64 items then delete last 1.9047 us/op 2.5518 us/op 0.75
OrderedSet add up to 64 items then delete last 2.9419 us/op 3.5132 us/op 0.84
Set add up to 64 items then delete middle 1.9333 us/op 2.2222 us/op 0.87
OrderedSet add up to 64 items then delete middle 4.5247 us/op 5.0141 us/op 0.90
Set add up to 128 items then delete first 3.7554 us/op 4.5090 us/op 0.83
OrderedSet add up to 128 items then delete first 5.6123 us/op 6.9981 us/op 0.80
Set add up to 128 items then delete last 3.7158 us/op 4.3887 us/op 0.85
OrderedSet add up to 128 items then delete last 5.7485 us/op 6.3261 us/op 0.91
Set add up to 128 items then delete middle 3.7270 us/op 4.4196 us/op 0.84
OrderedSet add up to 128 items then delete middle 12.028 us/op 14.361 us/op 0.84
Set add up to 256 items then delete first 7.4764 us/op 9.9164 us/op 0.75
OrderedSet add up to 256 items then delete first 11.620 us/op 14.075 us/op 0.83
Set add up to 256 items then delete last 7.4093 us/op 7.9337 us/op 0.93
OrderedSet add up to 256 items then delete last 11.805 us/op 11.729 us/op 1.01
Set add up to 256 items then delete middle 7.5638 us/op 9.5845 us/op 0.79
OrderedSet add up to 256 items then delete middle 36.834 us/op 41.405 us/op 0.89
runFastConfirmationRules vc:100000 bc:96 eq:0 4.7537 ms/op 7.4583 ms/op 0.64
runFastConfirmationRules vc:600000 bc:96 eq:0 35.419 ms/op 39.985 ms/op 0.89
runFastConfirmationRules vc:1000000 bc:96 eq:0 63.406 ms/op 74.992 ms/op 0.85
runFastConfirmationRules vc:600000 bc:320 eq:0 35.779 ms/op 37.939 ms/op 0.94
runFastConfirmationRules vc:100000 bc:96 eq:1000 1.1593 s/op 1.2242 s/op 0.95
pass gossip attestations to forkchoice per slot 2.6509 ms/op 3.2598 ms/op 0.81
forkChoice updateHead vc 100000 bc 64 eq 0 444.32 us/op 413.14 us/op 1.08
forkChoice updateHead vc 600000 bc 64 eq 0 2.6303 ms/op 2.4780 ms/op 1.06
forkChoice updateHead vc 1000000 bc 64 eq 0 4.3357 ms/op 4.1273 ms/op 1.05
forkChoice updateHead vc 600000 bc 320 eq 0 2.5946 ms/op 2.4846 ms/op 1.04
forkChoice updateHead vc 600000 bc 1200 eq 0 2.6571 ms/op 2.5287 ms/op 1.05
forkChoice updateHead vc 600000 bc 7200 eq 0 3.1543 ms/op 3.6817 ms/op 0.86
forkChoice updateHead vc 600000 bc 64 eq 1000 2.6748 ms/op 2.4842 ms/op 1.08
forkChoice updateHead vc 600000 bc 64 eq 10000 2.7504 ms/op 2.5265 ms/op 1.09
forkChoice updateHead vc 600000 bc 64 eq 300000 7.2173 ms/op 7.1171 ms/op 1.01
computeDeltas 1400000 validators 0% inactive 12.524 ms/op 12.411 ms/op 1.01
computeDeltas 1400000 validators 10% inactive 12.005 ms/op 11.576 ms/op 1.04
computeDeltas 1400000 validators 20% inactive 11.570 ms/op 11.054 ms/op 1.05
computeDeltas 1400000 validators 50% inactive 9.1162 ms/op 8.8712 ms/op 1.03
computeDeltas 2100000 validators 0% inactive 19.361 ms/op 18.568 ms/op 1.04
computeDeltas 2100000 validators 10% inactive 18.045 ms/op 17.890 ms/op 1.01
computeDeltas 2100000 validators 20% inactive 16.941 ms/op 16.443 ms/op 1.03
computeDeltas 2100000 validators 50% inactive 11.247 ms/op 10.780 ms/op 1.04
altair processAttestation - 250000 vs - 7PWei normalcase 1.6964 ms/op 2.6693 ms/op 0.64
altair processAttestation - 250000 vs - 7PWei worstcase 2.4751 ms/op 3.4333 ms/op 0.72
altair processAttestation - setStatus - 1/6 committees join 99.200 us/op 105.55 us/op 0.94
altair processAttestation - setStatus - 1/3 committees join 196.08 us/op 203.47 us/op 0.96
altair processAttestation - setStatus - 1/2 committees join 295.00 us/op 292.85 us/op 1.01
altair processAttestation - setStatus - 2/3 committees join 372.02 us/op 371.06 us/op 1.00
altair processAttestation - setStatus - 4/5 committees join 523.07 us/op 572.44 us/op 0.91
altair processAttestation - setStatus - 100% committees join 623.80 us/op 663.07 us/op 0.94
altair processBlock - 250000 vs - 7PWei normalcase 3.6754 ms/op 5.6285 ms/op 0.65
altair processBlock - 250000 vs - 7PWei normalcase hashState 20.835 ms/op 28.847 ms/op 0.72
altair processBlock - 250000 vs - 7PWei worstcase 24.087 ms/op 27.833 ms/op 0.87
altair processBlock - 250000 vs - 7PWei worstcase hashState 50.446 ms/op 65.196 ms/op 0.77
phase0 processBlock - 250000 vs - 7PWei normalcase 1.3851 ms/op 1.5033 ms/op 0.92
phase0 processBlock - 250000 vs - 7PWei worstcase 20.370 ms/op 21.949 ms/op 0.93
altair processEth1Data - 250000 vs - 7PWei normalcase 297.46 us/op 301.93 us/op 0.99
getExpectedWithdrawals 250000 eb:1,eth1:1,we:0,wn:0,smpl:16 5.5980 us/op 3.3340 us/op 1.68
getExpectedWithdrawals 250000 eb:0.95,eth1:0.1,we:0.05,wn:0,smpl:220 20.836 us/op 20.660 us/op 1.01
getExpectedWithdrawals 250000 eb:0.95,eth1:0.3,we:0.05,wn:0,smpl:43 5.8570 us/op 6.0830 us/op 0.96
getExpectedWithdrawals 250000 eb:0.95,eth1:0.7,we:0.05,wn:0,smpl:19 3.6640 us/op 4.7190 us/op 0.78
getExpectedWithdrawals 250000 eb:0.1,eth1:0.1,we:0,wn:0,smpl:1021 92.465 us/op 93.808 us/op 0.99
getExpectedWithdrawals 250000 eb:0.03,eth1:0.03,we:0,wn:0,smpl:11778 1.4996 ms/op 1.4677 ms/op 1.02
getExpectedWithdrawals 250000 eb:0.01,eth1:0.01,we:0,wn:0,smpl:16384 1.9164 ms/op 2.0721 ms/op 0.92
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,smpl:16384 1.9187 ms/op 1.8836 ms/op 1.02
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,nocache,smpl:16384 3.9260 ms/op 3.7169 ms/op 1.06
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,smpl:16384 2.1719 ms/op 2.0954 ms/op 1.04
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,nocache,smpl:16384 4.2423 ms/op 3.9089 ms/op 1.09
Tree 40 250000 create 389.83 ms/op 354.70 ms/op 1.10
Tree 40 250000 get(125000) 98.860 ns/op 99.926 ns/op 0.99
Tree 40 250000 set(125000) 1.0978 us/op 1.0556 us/op 1.04
Tree 40 250000 toArray() 17.605 ms/op 11.074 ms/op 1.59
Tree 40 250000 iterate all - toArray() + loop 19.348 ms/op 10.133 ms/op 1.91
Tree 40 250000 iterate all - get(i) 44.519 ms/op 40.852 ms/op 1.09
Array 250000 create 2.7073 ms/op 2.6936 ms/op 1.01
Array 250000 clone - spread 832.06 us/op 827.19 us/op 1.01
Array 250000 get(125000) 0.31300 ns/op 0.30500 ns/op 1.03
Array 250000 set(125000) 0.31400 ns/op 0.30500 ns/op 1.03
Array 250000 iterate all - loop 59.751 us/op 59.482 us/op 1.00
phase0 afterProcessEpoch - 250000 vs - 7PWei 48.094 ms/op 40.817 ms/op 1.18
Array.fill - length 1000000 20.670 ms/op 4.2355 ms/op 4.88
Array push - length 1000000 13.706 ms/op 51.354 ms/op 0.27
Array.get 0.21547 ns/op 0.21112 ns/op 1.02
Uint8Array.get 0.25836 ns/op 0.24329 ns/op 1.06
phase0 beforeProcessEpoch - 250000 vs - 7PWei 20.544 ms/op 19.215 ms/op 1.07
altair processEpoch - mainnet_e81889 234.05 ms/op 296.23 ms/op 0.79
mainnet_e81889 - altair beforeProcessEpoch 54.203 ms/op 42.553 ms/op 1.27
mainnet_e81889 - altair processJustificationAndFinalization 4.4300 us/op 6.2510 us/op 0.71
mainnet_e81889 - altair processInactivityUpdates 3.7518 ms/op 7.4968 ms/op 0.50
mainnet_e81889 - altair processRewardsAndPenalties 18.761 ms/op 19.961 ms/op 0.94
mainnet_e81889 - altair processRegistryUpdates 586.00 ns/op 598.00 ns/op 0.98
mainnet_e81889 - altair processSlashings 147.00 ns/op 156.00 ns/op 0.94
mainnet_e81889 - altair processEth1DataReset 145.00 ns/op 149.00 ns/op 0.97
mainnet_e81889 - altair processEffectiveBalanceUpdates 1.2216 ms/op 8.2046 ms/op 0.15
mainnet_e81889 - altair processSlashingsReset 800.00 ns/op 739.00 ns/op 1.08
mainnet_e81889 - altair processRandaoMixesReset 941.00 ns/op 1.1400 us/op 0.83
mainnet_e81889 - altair processHistoricalRootsUpdate 148.00 ns/op 157.00 ns/op 0.94
mainnet_e81889 - altair processParticipationFlagUpdates 526.00 ns/op 485.00 ns/op 1.08
mainnet_e81889 - altair processSyncCommitteeUpdates 116.00 ns/op 131.00 ns/op 0.89
mainnet_e81889 - altair afterProcessEpoch 51.192 ms/op 42.490 ms/op 1.20
capella processEpoch - mainnet_e217614 692.29 ms/op 863.27 ms/op 0.80
mainnet_e217614 - capella beforeProcessEpoch 86.185 ms/op 58.641 ms/op 1.47
mainnet_e217614 - capella processJustificationAndFinalization 4.9950 us/op 5.1790 us/op 0.96
mainnet_e217614 - capella processInactivityUpdates 12.153 ms/op 13.541 ms/op 0.90
mainnet_e217614 - capella processRewardsAndPenalties 94.064 ms/op 101.37 ms/op 0.93
mainnet_e217614 - capella processRegistryUpdates 4.7260 us/op 4.7660 us/op 0.99
mainnet_e217614 - capella processSlashings 147.00 ns/op 155.00 ns/op 0.95
mainnet_e217614 - capella processEth1DataReset 144.00 ns/op 152.00 ns/op 0.95
mainnet_e217614 - capella processEffectiveBalanceUpdates 8.6711 ms/op 20.504 ms/op 0.42
mainnet_e217614 - capella processSlashingsReset 742.00 ns/op 719.00 ns/op 1.03
mainnet_e217614 - capella processRandaoMixesReset 987.00 ns/op 1.1140 us/op 0.89
mainnet_e217614 - capella processHistoricalRootsUpdate 147.00 ns/op 156.00 ns/op 0.94
mainnet_e217614 - capella processParticipationFlagUpdates 465.00 ns/op 478.00 ns/op 0.97
mainnet_e217614 - capella afterProcessEpoch 134.81 ms/op 112.22 ms/op 1.20
phase0 processEpoch - mainnet_e58758 208.82 ms/op 268.78 ms/op 0.78
mainnet_e58758 - phase0 beforeProcessEpoch 43.033 ms/op 54.934 ms/op 0.78
mainnet_e58758 - phase0 processJustificationAndFinalization 4.6400 us/op 5.4690 us/op 0.85
mainnet_e58758 - phase0 processRewardsAndPenalties 16.880 ms/op 17.072 ms/op 0.99
mainnet_e58758 - phase0 processRegistryUpdates 2.3760 us/op 2.4360 us/op 0.98
mainnet_e58758 - phase0 processSlashings 148.00 ns/op 157.00 ns/op 0.94
mainnet_e58758 - phase0 processEth1DataReset 145.00 ns/op 155.00 ns/op 0.94
mainnet_e58758 - phase0 processEffectiveBalanceUpdates 854.24 us/op 962.56 us/op 0.89
mainnet_e58758 - phase0 processSlashingsReset 1.6830 us/op 959.00 ns/op 1.75
mainnet_e58758 - phase0 processRandaoMixesReset 1.0410 us/op 1.0780 us/op 0.97
mainnet_e58758 - phase0 processHistoricalRootsUpdate 146.00 ns/op 156.00 ns/op 0.94
mainnet_e58758 - phase0 processParticipationRecordUpdates 970.00 ns/op 1.0550 us/op 0.92
mainnet_e58758 - phase0 afterProcessEpoch 40.587 ms/op 36.326 ms/op 1.12
phase0 processEffectiveBalanceUpdates - 250000 normalcase 1.2882 ms/op 1.4024 ms/op 0.92
phase0 processEffectiveBalanceUpdates - 250000 worstcase 0.5 1.7186 ms/op 1.6846 ms/op 1.02
altair processInactivityUpdates - 250000 normalcase 11.794 ms/op 11.225 ms/op 1.05
altair processInactivityUpdates - 250000 worstcase 11.277 ms/op 11.243 ms/op 1.00
phase0 processRegistryUpdates - 250000 normalcase 2.2900 us/op 2.3940 us/op 0.96
phase0 processRegistryUpdates - 250000 badcase_full_deposits 144.00 us/op 151.00 us/op 0.95
phase0 processRegistryUpdates - 250000 worstcase 0.5 68.168 ms/op 67.679 ms/op 1.01
altair processRewardsAndPenalties - 250000 normalcase 15.726 ms/op 15.757 ms/op 1.00
altair processRewardsAndPenalties - 250000 worstcase 15.684 ms/op 15.603 ms/op 1.01
phase0 getAttestationDeltas - 250000 normalcase 5.7990 ms/op 5.9537 ms/op 0.97
phase0 getAttestationDeltas - 250000 worstcase 5.9456 ms/op 9.0427 ms/op 0.66
phase0 processSlashings - 250000 worstcase 63.047 us/op 67.470 us/op 0.93
altair processSyncCommitteeUpdates - 250000 13.951 ms/op 14.224 ms/op 0.98
BeaconState.hashTreeRoot - No change 179.00 ns/op 189.00 ns/op 0.95
BeaconState.hashTreeRoot - 1 full validator 61.028 us/op 100.06 us/op 0.61
BeaconState.hashTreeRoot - 32 full validator 671.72 us/op 1.1916 ms/op 0.56
BeaconState.hashTreeRoot - 512 full validator 6.3403 ms/op 13.326 ms/op 0.48
BeaconState.hashTreeRoot - 1 validator.effectiveBalance 74.216 us/op 132.64 us/op 0.56
BeaconState.hashTreeRoot - 32 validator.effectiveBalance 1.0845 ms/op 2.0825 ms/op 0.52
BeaconState.hashTreeRoot - 512 validator.effectiveBalance 13.170 ms/op 17.900 ms/op 0.74
BeaconState.hashTreeRoot - 1 balances 58.050 us/op 111.06 us/op 0.52
BeaconState.hashTreeRoot - 32 balances 562.12 us/op 1.0864 ms/op 0.52
BeaconState.hashTreeRoot - 512 balances 4.8361 ms/op 7.9486 ms/op 0.61
BeaconState.hashTreeRoot - 250000 balances 115.46 ms/op 215.07 ms/op 0.54
aggregationBits - 2048 els - zipIndexesInBitList 19.815 us/op 20.722 us/op 0.96
regular array get 100000 times 23.559 us/op 23.243 us/op 1.01
wrappedArray get 100000 times 23.538 us/op 23.307 us/op 1.01
arrayWithProxy get 100000 times 10.243 ms/op 10.117 ms/op 1.01
ssz.Root.equals 22.163 ns/op 21.830 ns/op 1.02
byteArrayEquals 21.953 ns/op 21.632 ns/op 1.01
Buffer.compare 9.1490 ns/op 14.256 ns/op 0.64
processSlot - 1 slots 8.6340 us/op 12.072 us/op 0.72
processSlot - 32 slots 1.7782 ms/op 3.3730 ms/op 0.53
getEffectiveBalanceIncrementsZeroInactive - 250000 vs - 7PWei 2.7486 ms/op 8.6024 ms/op 0.32
getCommitteeAssignments - req 1 vs - 250000 vc 1.9859 ms/op 1.7395 ms/op 1.14
getCommitteeAssignments - req 100 vs - 250000 vc 3.5640 ms/op 3.5427 ms/op 1.01
getCommitteeAssignments - req 1000 vs - 250000 vc 3.8314 ms/op 3.8751 ms/op 0.99
findModifiedValidators - 10000 modified validators 871.65 ms/op 927.66 ms/op 0.94
findModifiedValidators - 1000 modified validators 802.30 ms/op 790.41 ms/op 1.02
findModifiedValidators - 100 modified validators 356.45 ms/op 492.40 ms/op 0.72
findModifiedValidators - 10 modified validators 317.85 ms/op 361.16 ms/op 0.88
findModifiedValidators - 1 modified validators 224.57 ms/op 318.73 ms/op 0.70
findModifiedValidators - no difference 206.16 ms/op 272.00 ms/op 0.76
migrate state 1500000 validators, 3400 modified, 2000 new 2.9399 s/op 3.7385 s/op 0.79
RootCache.getBlockRootAtSlot - 250000 vs - 7PWei 3.5800 ns/op 3.5200 ns/op 1.02
state getBlockRootAtSlot - 250000 vs - 7PWei 295.27 ns/op 497.83 ns/op 0.59
computeProposerIndex 100000 validators 2.7951 ms/op 1.4316 ms/op 1.95
getNextSyncCommitteeIndices 1000 validators 1.4944 ms/op 3.0372 ms/op 0.49
getNextSyncCommitteeIndices 10000 validators 14.055 ms/op 27.408 ms/op 0.51
getNextSyncCommitteeIndices 100000 validators 55.184 ms/op 94.449 ms/op 0.58
computeProposers - vc 250000 1.3073 ms/op 598.04 us/op 2.19
computeEpochShuffling - vc 250000 48.871 ms/op 41.155 ms/op 1.19
getNextSyncCommittee - vc 250000 13.371 ms/op 9.8714 ms/op 1.35
nodejs block root to RootHex using toHex 104.77 ns/op 101.66 ns/op 1.03
nodejs block root to RootHex using toRootHex 65.793 ns/op 65.559 ns/op 1.00
nodejs fromHex(blob) 998.28 us/op 1.0148 ms/op 0.98
nodejs fromHexInto(blob) 657.41 us/op 659.08 us/op 1.00
nodejs block root to RootHex using the deprecated toHexString 615.84 ns/op 618.61 ns/op 1.00
nodejs byteArrayEquals 32 bytes (block root) 26.869 ns/op 27.365 ns/op 0.98
nodejs byteArrayEquals 48 bytes (pubkey) 38.716 ns/op 39.307 ns/op 0.98
nodejs byteArrayEquals 96 bytes (signature) 37.519 ns/op 37.596 ns/op 1.00
nodejs byteArrayEquals 1024 bytes 46.032 ns/op 44.924 ns/op 1.02
nodejs byteArrayEquals 131072 bytes (blob) 1.7989 us/op 1.8467 us/op 0.97
browser block root to RootHex using toHex 149.38 ns/op 150.56 ns/op 0.99
browser block root to RootHex using toRootHex 135.33 ns/op 135.56 ns/op 1.00
browser fromHex(blob) 1.7592 ms/op 2.0623 ms/op 0.85
browser fromHexInto(blob) 647.08 us/op 655.39 us/op 0.99
browser block root to RootHex using the deprecated toHexString 410.23 ns/op 430.52 ns/op 0.95
browser byteArrayEquals 32 bytes (block root) 28.716 ns/op 28.935 ns/op 0.99
browser byteArrayEquals 48 bytes (pubkey) 40.805 ns/op 40.598 ns/op 1.01
browser byteArrayEquals 96 bytes (signature) 76.372 ns/op 75.896 ns/op 1.01
browser byteArrayEquals 1024 bytes 773.54 ns/op 771.38 ns/op 1.00
browser byteArrayEquals 131072 bytes (blob) 98.391 us/op 96.966 us/op 1.01

by benchmarkbot/action

@twoeths twoeths left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

need to wait for a @chainsafe/lodestar-z release

nazarhussain added a commit to ChainSafe/lodestar-z that referenced this pull request Aug 19, 2026
Review feedback: the async variants are unused (ChainSafe/lodestar#9829
calls unshuffleList, computeProposerIndex and computeSyncCommitteeIndices),
so drop asyncShuffleList/asyncUnshuffleList and the async_task helper --
the zapi AsyncTask work waits for a future release. Also unbind the other
unused package exports (forward shuffleList, ComputeShuffledIndex, the
Electra wrappers, SHUFFLE_ROUNDS_* and ByteCount); the Zig module still
implements them, so re-binding later is a few lines.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@nazarhussain nazarhussain changed the title feat: use zig backedlodestar-z shuffle feat: use zig backed lodestar-z shuffle Aug 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

2 participants