Skip to content

refactor: defer fc store mutations after protoarray block import#9581

Merged
ensi321 merged 1 commit into
unstablefrom
nc/defer-onblock-store-mutations
Jul 3, 2026
Merged

refactor: defer fc store mutations after protoarray block import#9581
ensi321 merged 1 commit into
unstablefrom
nc/defer-onblock-store-mutations

Conversation

@ensi321

@ensi321 ensi321 commented Jul 3, 2026

Copy link
Copy Markdown
Member

ProtoArray.onBlock can potentially reject the block to be imported. So we should update our fork choice store only after the import is complete.

See #9565 (review) for more context

…Block

Per review on #9565. `onBlock` mutated `proposerBoostRoot` and the justified/
finalized checkpoints before `protoArray.onBlock()` inserted the block. If the
insertion threw, the store was left pointing at / justified on a block that was
never added.

Compute the proposer-boost decision into a temp, pass the candidate root to
`protoArray.onBlock()` for its best-child weighting, and commit the store
mutations (proposerBoostRoot + updateCheckpoints + updateUnrealizedCheckpoints)
only after the insertion succeeds — mirroring the spec's `on_block` ordering.
Behavior-preserving on the happy path: ProtoArray holds its own justified/
finalized epochs and never reads fcStore, so checkpoint-update ordering does not
affect insertion.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@ensi321 ensi321 requested a review from a team as a code owner July 3, 2026 07:37

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

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 refactors the fork-choice block processing logic to defer state mutations until after the block is successfully added to the proto-array. Specifically, the assignment of 'this.proposerBoostRoot' and the updates to checkpoints (via 'updateCheckpoints' and 'updateUnrealizedCheckpoints') are moved to execute only after 'this.protoArray.onBlock()' succeeds, using a temporary local variable for the initial call. There are no review comments, and I have no additional feedback to provide.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

@github-actions

github-actions Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Performance Report

✔️ no performance regression detected

Full benchmark results
Benchmark suite Current: dd54cea Previous: d7859e9 Ratio
getPubkeys - index2pubkey - req 1000 vs - 250000 vc 828.20 us/op 845.33 us/op 0.98
getPubkeys - validatorsArr - req 1000 vs - 250000 vc 39.221 us/op 38.952 us/op 1.01
BLS verify - blst 760.30 us/op 720.63 us/op 1.06
BLS verifyMultipleSignatures 3 - blst 1.3765 ms/op 1.3594 ms/op 1.01
BLS verifyMultipleSignatures 8 - blst 2.1888 ms/op 2.1666 ms/op 1.01
BLS verifyMultipleSignatures 32 - blst 6.8092 ms/op 6.8498 ms/op 0.99
BLS verifyMultipleSignatures 64 - blst 13.151 ms/op 13.033 ms/op 1.01
BLS verifyMultipleSignatures 128 - blst 25.714 ms/op 25.960 ms/op 0.99
BLS deserializing 10000 signatures 630.80 ms/op 631.44 ms/op 1.00
BLS deserializing 100000 signatures 6.3036 s/op 6.1837 s/op 1.02
BLS verifyMultipleSignatures - same message - 3 - blst 826.97 us/op 790.06 us/op 1.05
BLS verifyMultipleSignatures - same message - 8 - blst 829.29 us/op 930.16 us/op 0.89
BLS verifyMultipleSignatures - same message - 32 - blst 1.5395 ms/op 1.5654 ms/op 0.98
BLS verifyMultipleSignatures - same message - 64 - blst 2.4208 ms/op 2.4389 ms/op 0.99
BLS verifyMultipleSignatures - same message - 128 - blst 3.9518 ms/op 4.0401 ms/op 0.98
BLS aggregatePubkeys 32 - blst 17.609 us/op 17.558 us/op 1.00
BLS aggregatePubkeys 128 - blst 63.046 us/op 62.916 us/op 1.00
getSlashingsAndExits - default max 49.468 us/op 47.477 us/op 1.04
getSlashingsAndExits - 2k 321.30 us/op 334.70 us/op 0.96
proposeBlockBody type=full, size=empty 595.55 us/op 610.81 us/op 0.98
isKnown best case - 1 super set check 164.00 ns/op 183.00 ns/op 0.90
isKnown normal case - 2 super set checks 159.00 ns/op 165.00 ns/op 0.96
isKnown worse case - 16 super set checks 159.00 ns/op 161.00 ns/op 0.99
validate api signedAggregateAndProof - struct 1.5393 ms/op 1.5204 ms/op 1.01
validate gossip signedAggregateAndProof - struct 1.5350 ms/op 1.5256 ms/op 1.01
batch validate gossip attestation - vc 640000 - chunk 32 106.01 us/op 104.15 us/op 1.02
batch validate gossip attestation - vc 640000 - chunk 64 92.684 us/op 91.773 us/op 1.01
batch validate gossip attestation - vc 640000 - chunk 128 86.335 us/op 85.779 us/op 1.01
batch validate gossip attestation - vc 640000 - chunk 256 83.155 us/op 81.716 us/op 1.02
bytes32 toHexString 292.00 ns/op 290.00 ns/op 1.01
bytes32 Buffer.toString(hex) 159.00 ns/op 170.00 ns/op 0.94
bytes32 Buffer.toString(hex) from Uint8Array 227.00 ns/op 230.00 ns/op 0.99
bytes32 Buffer.toString(hex) + 0x 163.00 ns/op 174.00 ns/op 0.94
Return object 10000 times 0.21120 ns/op 0.21020 ns/op 1.00
Throw Error 10000 times 3.3496 us/op 3.7182 us/op 0.90
toHex 102.12 ns/op 99.910 ns/op 1.02
Buffer.from 92.622 ns/op 90.129 ns/op 1.03
shared Buffer 61.417 ns/op 60.994 ns/op 1.01
fastMsgIdFn sha256 / 200 bytes 1.4850 us/op 1.4890 us/op 1.00
fastMsgIdFn h32 xxhash / 200 bytes 151.00 ns/op 155.00 ns/op 0.97
fastMsgIdFn h64 xxhash / 200 bytes 192.00 ns/op 207.00 ns/op 0.93
fastMsgIdFn sha256 / 1000 bytes 4.8410 us/op 4.7910 us/op 1.01
fastMsgIdFn h32 xxhash / 1000 bytes 240.00 ns/op 243.00 ns/op 0.99
fastMsgIdFn h64 xxhash / 1000 bytes 242.00 ns/op 256.00 ns/op 0.95
fastMsgIdFn sha256 / 10000 bytes 43.302 us/op 41.428 us/op 1.05
fastMsgIdFn h32 xxhash / 10000 bytes 1.2680 us/op 1.2470 us/op 1.02
fastMsgIdFn h64 xxhash / 10000 bytes 823.00 ns/op 809.00 ns/op 1.02
send data - 1000 256B messages 4.2110 ms/op 4.0904 ms/op 1.03
send data - 1000 512B messages 4.8768 ms/op 5.0484 ms/op 0.97
send data - 1000 1024B messages 5.0727 ms/op 5.2576 ms/op 0.96
send data - 1000 1200B messages 6.1976 ms/op 5.9724 ms/op 1.04
send data - 1000 2048B messages 8.1552 ms/op 8.3968 ms/op 0.97
send data - 1000 4096B messages 71.563 ms/op 59.780 ms/op 1.20
send data - 1000 16384B messages 217.05 ms/op 377.34 ms/op 0.58
send data - 1000 65536B messages 1.1580 s/op 1.1810 s/op 0.98
enrSubnets - fastDeserialize 64 bits 738.00 ns/op 748.00 ns/op 0.99
enrSubnets - ssz BitVector 64 bits 264.00 ns/op 263.00 ns/op 1.00
enrSubnets - fastDeserialize 4 bits 104.00 ns/op 104.00 ns/op 1.00
enrSubnets - ssz BitVector 4 bits 263.00 ns/op 263.00 ns/op 1.00
prioritizePeers score -10:0 att 32-0.1 sync 2-0 214.82 us/op 207.48 us/op 1.04
prioritizePeers score 0:0 att 32-0.25 sync 2-0.25 241.33 us/op 250.84 us/op 0.96
prioritizePeers score 0:0 att 32-0.5 sync 2-0.5 350.64 us/op 369.11 us/op 0.95
prioritizePeers score 0:0 att 64-0.75 sync 4-0.75 613.59 us/op 682.46 us/op 0.90
prioritizePeers score 0:0 att 64-1 sync 4-1 713.48 us/op 720.42 us/op 0.99
array of 16000 items push then shift 1.2949 us/op 1.2867 us/op 1.01
LinkedList of 16000 items push then shift 6.7700 ns/op 6.6280 ns/op 1.02
array of 16000 items push then pop 65.474 ns/op 64.246 ns/op 1.02
LinkedList of 16000 items push then pop 6.0860 ns/op 5.9160 ns/op 1.03
array of 24000 items push then shift 1.9174 us/op 1.8875 us/op 1.02
LinkedList of 24000 items push then shift 6.3770 ns/op 6.2690 ns/op 1.02
array of 24000 items push then pop 93.243 ns/op 91.186 ns/op 1.02
LinkedList of 24000 items push then pop 6.0980 ns/op 5.9220 ns/op 1.03
intersect bitArray bitLen 8 4.7250 ns/op 4.6890 ns/op 1.01
intersect array and set length 8 30.071 ns/op 30.151 ns/op 1.00
intersect bitArray bitLen 128 23.949 ns/op 23.778 ns/op 1.01
intersect array and set length 128 509.00 ns/op 500.72 ns/op 1.02
bitArray.getTrueBitIndexes() bitLen 128 1.0710 us/op 1.0480 us/op 1.02
bitArray.getTrueBitIndexes() bitLen 248 1.7810 us/op 1.7260 us/op 1.03
bitArray.getTrueBitIndexes() bitLen 512 3.5330 us/op 3.5470 us/op 1.00
Full columns - reconstruct all 6 blobs 178.80 us/op 304.94 us/op 0.59
Full columns - reconstruct half of the blobs out of 6 91.776 us/op 63.782 us/op 1.44
Full columns - reconstruct single blob out of 6 34.466 us/op 33.289 us/op 1.04
Half columns - reconstruct all 6 blobs 386.15 ms/op 386.86 ms/op 1.00
Half columns - reconstruct half of the blobs out of 6 195.40 ms/op 194.48 ms/op 1.00
Half columns - reconstruct single blob out of 6 69.874 ms/op 69.581 ms/op 1.00
Set add up to 64 items then delete first 1.6636 us/op 1.5512 us/op 1.07
OrderedSet add up to 64 items then delete first 2.5400 us/op 2.3745 us/op 1.07
Set add up to 64 items then delete last 1.9164 us/op 1.7710 us/op 1.08
OrderedSet add up to 64 items then delete last 2.8244 us/op 2.7225 us/op 1.04
Set add up to 64 items then delete middle 1.9217 us/op 1.7802 us/op 1.08
OrderedSet add up to 64 items then delete middle 4.3248 us/op 4.1673 us/op 1.04
Set add up to 128 items then delete first 3.8626 us/op 3.4401 us/op 1.12
OrderedSet add up to 128 items then delete first 5.9240 us/op 5.1169 us/op 1.16
Set add up to 128 items then delete last 3.7555 us/op 3.4449 us/op 1.09
OrderedSet add up to 128 items then delete last 5.5725 us/op 5.3142 us/op 1.05
Set add up to 128 items then delete middle 3.7211 us/op 3.4511 us/op 1.08
OrderedSet add up to 128 items then delete middle 11.341 us/op 11.217 us/op 1.01
Set add up to 256 items then delete first 7.8026 us/op 6.7855 us/op 1.15
OrderedSet add up to 256 items then delete first 11.888 us/op 11.057 us/op 1.08
Set add up to 256 items then delete last 7.3756 us/op 6.9097 us/op 1.07
OrderedSet add up to 256 items then delete last 11.360 us/op 10.934 us/op 1.04
Set add up to 256 items then delete middle 7.5580 us/op 6.7991 us/op 1.11
OrderedSet add up to 256 items then delete middle 34.882 us/op 33.802 us/op 1.03
runFastConfirmationRules vc:100000 bc:96 eq:0 4.0300 us/op 3.1640 us/op 1.27
runFastConfirmationRules vc:600000 bc:96 eq:0 3.7460 us/op 3.4450 us/op 1.09
runFastConfirmationRules vc:1000000 bc:96 eq:0 3.9210 us/op 3.1310 us/op 1.25
runFastConfirmationRules vc:600000 bc:320 eq:0 10.089 us/op 9.5270 us/op 1.06
runFastConfirmationRules vc:600000 bc:1200 eq:0 31.145 us/op 35.747 us/op 0.87
runFastConfirmationRules vc:600000 bc:96 eq:1000 3.9810 us/op 3.2720 us/op 1.22
runFastConfirmationRules vc:600000 bc:96 eq:10000 3.7710 us/op 3.4210 us/op 1.10
runFastConfirmationRules vc:600000 bc:96 eq:300000 3.7390 us/op 3.4630 us/op 1.08
pass gossip attestations to forkchoice per slot 2.5358 ms/op 2.4765 ms/op 1.02
forkChoice updateHead vc 100000 bc 64 eq 0 480.56 us/op 386.13 us/op 1.24
forkChoice updateHead vc 600000 bc 64 eq 0 2.8931 ms/op 2.3088 ms/op 1.25
forkChoice updateHead vc 1000000 bc 64 eq 0 4.8363 ms/op 3.8450 ms/op 1.26
forkChoice updateHead vc 600000 bc 320 eq 0 2.9572 ms/op 2.3110 ms/op 1.28
forkChoice updateHead vc 600000 bc 1200 eq 0 2.9418 ms/op 2.3469 ms/op 1.25
forkChoice updateHead vc 600000 bc 7200 eq 0 3.2458 ms/op 2.6379 ms/op 1.23
forkChoice updateHead vc 600000 bc 64 eq 1000 2.9759 ms/op 2.3263 ms/op 1.28
forkChoice updateHead vc 600000 bc 64 eq 10000 3.0941 ms/op 2.4379 ms/op 1.27
forkChoice updateHead vc 600000 bc 64 eq 300000 7.3440 ms/op 6.4214 ms/op 1.14
computeDeltas 1400000 validators 0% inactive 13.677 ms/op 12.116 ms/op 1.13
computeDeltas 1400000 validators 10% inactive 12.810 ms/op 11.273 ms/op 1.14
computeDeltas 1400000 validators 20% inactive 11.850 ms/op 10.343 ms/op 1.15
computeDeltas 1400000 validators 50% inactive 9.1815 ms/op 8.0473 ms/op 1.14
computeDeltas 2100000 validators 0% inactive 20.282 ms/op 18.155 ms/op 1.12
computeDeltas 2100000 validators 10% inactive 18.263 ms/op 16.901 ms/op 1.08
computeDeltas 2100000 validators 20% inactive 16.750 ms/op 15.783 ms/op 1.06
computeDeltas 2100000 validators 50% inactive 13.475 ms/op 9.1238 ms/op 1.48
altair processAttestation - 250000 vs - 7PWei normalcase 1.7276 ms/op 1.6821 ms/op 1.03
altair processAttestation - 250000 vs - 7PWei worstcase 2.5802 ms/op 2.4137 ms/op 1.07
altair processAttestation - setStatus - 1/6 committees join 105.64 us/op 102.89 us/op 1.03
altair processAttestation - setStatus - 1/3 committees join 203.63 us/op 200.58 us/op 1.02
altair processAttestation - setStatus - 1/2 committees join 298.80 us/op 284.18 us/op 1.05
altair processAttestation - setStatus - 2/3 committees join 382.00 us/op 368.05 us/op 1.04
altair processAttestation - setStatus - 4/5 committees join 520.03 us/op 503.50 us/op 1.03
altair processAttestation - setStatus - 100% committees join 612.19 us/op 599.54 us/op 1.02
altair processBlock - 250000 vs - 7PWei normalcase 2.9034 ms/op 3.6858 ms/op 0.79
altair processBlock - 250000 vs - 7PWei normalcase hashState 14.382 ms/op 17.503 ms/op 0.82
altair processBlock - 250000 vs - 7PWei worstcase 19.702 ms/op 21.769 ms/op 0.91
altair processBlock - 250000 vs - 7PWei worstcase hashState 39.678 ms/op 44.841 ms/op 0.88
phase0 processBlock - 250000 vs - 7PWei normalcase 1.3072 ms/op 1.4163 ms/op 0.92
phase0 processBlock - 250000 vs - 7PWei worstcase 17.664 ms/op 16.565 ms/op 1.07
altair processEth1Data - 250000 vs - 7PWei normalcase 305.61 us/op 295.81 us/op 1.03
getExpectedWithdrawals 250000 eb:1,eth1:1,we:0,wn:0,smpl:16 3.3780 us/op 8.2320 us/op 0.41
getExpectedWithdrawals 250000 eb:0.95,eth1:0.1,we:0.05,wn:0,smpl:220 21.902 us/op 19.382 us/op 1.13
getExpectedWithdrawals 250000 eb:0.95,eth1:0.3,we:0.05,wn:0,smpl:43 6.5480 us/op 5.4200 us/op 1.21
getExpectedWithdrawals 250000 eb:0.95,eth1:0.7,we:0.05,wn:0,smpl:19 4.0010 us/op 3.5500 us/op 1.13
getExpectedWithdrawals 250000 eb:0.1,eth1:0.1,we:0,wn:0,smpl:1021 102.41 us/op 92.680 us/op 1.10
getExpectedWithdrawals 250000 eb:0.03,eth1:0.03,we:0,wn:0,smpl:11778 1.3818 ms/op 1.3393 ms/op 1.03
getExpectedWithdrawals 250000 eb:0.01,eth1:0.01,we:0,wn:0,smpl:16384 1.8431 ms/op 1.7181 ms/op 1.07
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,smpl:16384 1.8183 ms/op 1.7683 ms/op 1.03
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,nocache,smpl:16384 3.5740 ms/op 4.0438 ms/op 0.88
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,smpl:16384 2.0758 ms/op 2.0415 ms/op 1.02
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,nocache,smpl:16384 3.9493 ms/op 3.8727 ms/op 1.02
Tree 40 250000 create 322.94 ms/op 368.39 ms/op 0.88
Tree 40 250000 get(125000) 99.564 ns/op 102.27 ns/op 0.97
Tree 40 250000 set(125000) 1.0808 us/op 1.1048 us/op 0.98
Tree 40 250000 toArray() 9.4087 ms/op 9.3826 ms/op 1.00
Tree 40 250000 iterate all - toArray() + loop 9.5665 ms/op 9.3379 ms/op 1.02
Tree 40 250000 iterate all - get(i) 33.662 ms/op 33.637 ms/op 1.00
Array 250000 create 2.0755 ms/op 2.0383 ms/op 1.02
Array 250000 clone - spread 665.84 us/op 651.22 us/op 1.02
Array 250000 get(125000) 0.29400 ns/op 0.29300 ns/op 1.00
Array 250000 set(125000) 0.31100 ns/op 0.29700 ns/op 1.05
Array 250000 iterate all - loop 57.473 us/op 56.172 us/op 1.02
phase0 afterProcessEpoch - 250000 vs - 7PWei 40.121 ms/op 51.318 ms/op 0.78
Array.fill - length 1000000 2.2588 ms/op 2.0359 ms/op 1.11
Array push - length 1000000 7.5746 ms/op 8.4180 ms/op 0.90
Array.get 0.20596 ns/op 0.19643 ns/op 1.05
Uint8Array.get 0.24963 ns/op 0.23194 ns/op 1.08
phase0 beforeProcessEpoch - 250000 vs - 7PWei 12.717 ms/op 15.800 ms/op 0.80
altair processEpoch - mainnet_e81889 239.99 ms/op 302.17 ms/op 0.79
mainnet_e81889 - altair beforeProcessEpoch 13.646 ms/op 34.764 ms/op 0.39
mainnet_e81889 - altair processJustificationAndFinalization 4.7220 us/op 7.9360 us/op 0.60
mainnet_e81889 - altair processInactivityUpdates 3.6528 ms/op 4.1930 ms/op 0.87
mainnet_e81889 - altair processRewardsAndPenalties 17.537 ms/op 20.930 ms/op 0.84
mainnet_e81889 - altair processRegistryUpdates 515.00 ns/op 538.00 ns/op 0.96
mainnet_e81889 - altair processSlashings 140.00 ns/op 137.00 ns/op 1.02
mainnet_e81889 - altair processEth1DataReset 136.00 ns/op 135.00 ns/op 1.01
mainnet_e81889 - altair processEffectiveBalanceUpdates 1.6659 ms/op 1.5378 ms/op 1.08
mainnet_e81889 - altair processSlashingsReset 661.00 ns/op 685.00 ns/op 0.96
mainnet_e81889 - altair processRandaoMixesReset 976.00 ns/op 1.3440 us/op 0.73
mainnet_e81889 - altair processHistoricalRootsUpdate 136.00 ns/op 132.00 ns/op 1.03
mainnet_e81889 - altair processParticipationFlagUpdates 407.00 ns/op 443.00 ns/op 0.92
mainnet_e81889 - altair processSyncCommitteeUpdates 109.00 ns/op 124.00 ns/op 0.88
mainnet_e81889 - altair afterProcessEpoch 41.922 ms/op 40.926 ms/op 1.02
capella processEpoch - mainnet_e217614 711.89 ms/op 926.58 ms/op 0.77
mainnet_e217614 - capella beforeProcessEpoch 54.339 ms/op 80.053 ms/op 0.68
mainnet_e217614 - capella processJustificationAndFinalization 4.7510 us/op 6.9170 us/op 0.69
mainnet_e217614 - capella processInactivityUpdates 11.914 ms/op 15.226 ms/op 0.78
mainnet_e217614 - capella processRewardsAndPenalties 86.620 ms/op 97.747 ms/op 0.89
mainnet_e217614 - capella processRegistryUpdates 4.4560 us/op 4.3980 us/op 1.01
mainnet_e217614 - capella processSlashings 141.00 ns/op 128.00 ns/op 1.10
mainnet_e217614 - capella processEth1DataReset 135.00 ns/op 129.00 ns/op 1.05
mainnet_e217614 - capella processEffectiveBalanceUpdates 5.4137 ms/op 17.283 ms/op 0.31
mainnet_e217614 - capella processSlashingsReset 668.00 ns/op 667.00 ns/op 1.00
mainnet_e217614 - capella processRandaoMixesReset 986.00 ns/op 1.4400 us/op 0.68
mainnet_e217614 - capella processHistoricalRootsUpdate 136.00 ns/op 131.00 ns/op 1.04
mainnet_e217614 - capella processParticipationFlagUpdates 426.00 ns/op 424.00 ns/op 1.00
mainnet_e217614 - capella afterProcessEpoch 105.83 ms/op 107.26 ms/op 0.99
phase0 processEpoch - mainnet_e58758 251.52 ms/op 339.64 ms/op 0.74
mainnet_e58758 - phase0 beforeProcessEpoch 51.238 ms/op 61.147 ms/op 0.84
mainnet_e58758 - phase0 processJustificationAndFinalization 4.8470 us/op 5.7340 us/op 0.85
mainnet_e58758 - phase0 processRewardsAndPenalties 14.664 ms/op 16.044 ms/op 0.91
mainnet_e58758 - phase0 processRegistryUpdates 2.2580 us/op 2.2300 us/op 1.01
mainnet_e58758 - phase0 processSlashings 141.00 ns/op 138.00 ns/op 1.02
mainnet_e58758 - phase0 processEth1DataReset 137.00 ns/op 134.00 ns/op 1.02
mainnet_e58758 - phase0 processEffectiveBalanceUpdates 876.79 us/op 859.49 us/op 1.02
mainnet_e58758 - phase0 processSlashingsReset 796.00 ns/op 890.00 ns/op 0.89
mainnet_e58758 - phase0 processRandaoMixesReset 1.0220 us/op 1.3870 us/op 0.74
mainnet_e58758 - phase0 processHistoricalRootsUpdate 145.00 ns/op 132.00 ns/op 1.10
mainnet_e58758 - phase0 processParticipationRecordUpdates 925.00 ns/op 1.2840 us/op 0.72
mainnet_e58758 - phase0 afterProcessEpoch 32.977 ms/op 33.003 ms/op 1.00
phase0 processEffectiveBalanceUpdates - 250000 normalcase 1.0984 ms/op 964.61 us/op 1.14
phase0 processEffectiveBalanceUpdates - 250000 worstcase 0.5 1.2997 ms/op 1.6275 ms/op 0.80
altair processInactivityUpdates - 250000 normalcase 10.478 ms/op 12.664 ms/op 0.83
altair processInactivityUpdates - 250000 worstcase 10.476 ms/op 14.118 ms/op 0.74
phase0 processRegistryUpdates - 250000 normalcase 2.5350 us/op 2.1630 us/op 1.17
phase0 processRegistryUpdates - 250000 badcase_full_deposits 149.45 us/op 144.49 us/op 1.03
phase0 processRegistryUpdates - 250000 worstcase 0.5 53.715 ms/op 63.059 ms/op 0.85
altair processRewardsAndPenalties - 250000 normalcase 13.173 ms/op 16.073 ms/op 0.82
altair processRewardsAndPenalties - 250000 worstcase 12.962 ms/op 15.500 ms/op 0.84
phase0 getAttestationDeltas - 250000 normalcase 5.3702 ms/op 5.2790 ms/op 1.02
phase0 getAttestationDeltas - 250000 worstcase 5.4541 ms/op 5.3140 ms/op 1.03
phase0 processSlashings - 250000 worstcase 64.014 us/op 60.818 us/op 1.05
altair processSyncCommitteeUpdates - 250000 9.9152 ms/op 10.866 ms/op 0.91
BeaconState.hashTreeRoot - No change 176.00 ns/op 173.00 ns/op 1.02
BeaconState.hashTreeRoot - 1 full validator 55.925 us/op 79.366 us/op 0.70
BeaconState.hashTreeRoot - 32 full validator 619.07 us/op 1.1402 ms/op 0.54
BeaconState.hashTreeRoot - 512 full validator 6.0323 ms/op 7.5561 ms/op 0.80
BeaconState.hashTreeRoot - 1 validator.effectiveBalance 68.796 us/op 92.819 us/op 0.74
BeaconState.hashTreeRoot - 32 validator.effectiveBalance 1.0048 ms/op 1.4625 ms/op 0.69
BeaconState.hashTreeRoot - 512 validator.effectiveBalance 12.643 ms/op 17.855 ms/op 0.71
BeaconState.hashTreeRoot - 1 balances 54.803 us/op 89.555 us/op 0.61
BeaconState.hashTreeRoot - 32 balances 534.79 us/op 968.76 us/op 0.55
BeaconState.hashTreeRoot - 512 balances 4.5675 ms/op 5.1978 ms/op 0.88
BeaconState.hashTreeRoot - 250000 balances 98.193 ms/op 176.35 ms/op 0.56
aggregationBits - 2048 els - zipIndexesInBitList 20.690 us/op 19.943 us/op 1.04
regular array get 100000 times 22.639 us/op 22.957 us/op 0.99
wrappedArray get 100000 times 22.640 us/op 22.818 us/op 0.99
arrayWithProxy get 100000 times 10.650 ms/op 9.8524 ms/op 1.08
ssz.Root.equals 21.384 ns/op 21.274 ns/op 1.01
byteArrayEquals 21.189 ns/op 21.117 ns/op 1.00
Buffer.compare 9.4330 ns/op 9.2990 ns/op 1.01
processSlot - 1 slots 7.9670 us/op 10.100 us/op 0.79
processSlot - 32 slots 1.5248 ms/op 2.3953 ms/op 0.64
getEffectiveBalanceIncrementsZeroInactive - 250000 vs - 7PWei 3.2350 ms/op 4.9341 ms/op 0.66
getCommitteeAssignments - req 1 vs - 250000 vc 1.6804 ms/op 1.6584 ms/op 1.01
getCommitteeAssignments - req 100 vs - 250000 vc 3.4380 ms/op 3.4283 ms/op 1.00
getCommitteeAssignments - req 1000 vs - 250000 vc 3.6681 ms/op 3.6733 ms/op 1.00
findModifiedValidators - 10000 modified validators 646.53 ms/op 742.17 ms/op 0.87
findModifiedValidators - 1000 modified validators 387.02 ms/op 475.40 ms/op 0.81
findModifiedValidators - 100 modified validators 261.21 ms/op 280.02 ms/op 0.93
findModifiedValidators - 10 modified validators 226.67 ms/op 275.49 ms/op 0.82
findModifiedValidators - 1 modified validators 159.04 ms/op 155.06 ms/op 1.03
findModifiedValidators - no difference 162.45 ms/op 199.38 ms/op 0.81
migrate state 1500000 validators, 3400 modified, 2000 new 2.6508 s/op 3.5277 s/op 0.75
RootCache.getBlockRootAtSlot - 250000 vs - 7PWei 3.8600 ns/op 3.6900 ns/op 1.05
state getBlockRootAtSlot - 250000 vs - 7PWei 282.50 ns/op 464.73 ns/op 0.61
computeProposerIndex 100000 validators 1.3385 ms/op 1.3053 ms/op 1.03
getNextSyncCommitteeIndices 1000 validators 2.8879 ms/op 2.8309 ms/op 1.02
getNextSyncCommitteeIndices 10000 validators 25.744 ms/op 25.070 ms/op 1.03
getNextSyncCommitteeIndices 100000 validators 84.885 ms/op 84.007 ms/op 1.01
computeProposers - vc 250000 551.99 us/op 536.92 us/op 1.03
computeEpochShuffling - vc 250000 39.808 ms/op 39.357 ms/op 1.01
getNextSyncCommittee - vc 250000 9.4087 ms/op 9.4068 ms/op 1.00
nodejs block root to RootHex using toHex 104.06 ns/op 100.11 ns/op 1.04
nodejs block root to RootHex using toRootHex 65.956 ns/op 64.928 ns/op 1.02
nodejs fromHex(blob) 728.28 us/op 828.83 us/op 0.88
nodejs fromHexInto(blob) 666.57 us/op 646.91 us/op 1.03
nodejs block root to RootHex using the deprecated toHexString 505.64 ns/op 491.07 ns/op 1.03
nodejs byteArrayEquals 32 bytes (block root) 25.914 ns/op 25.500 ns/op 1.02
nodejs byteArrayEquals 48 bytes (pubkey) 37.380 ns/op 36.793 ns/op 1.02
nodejs byteArrayEquals 96 bytes (signature) 40.731 ns/op 40.476 ns/op 1.01
nodejs byteArrayEquals 1024 bytes 43.825 ns/op 44.510 ns/op 0.98
nodejs byteArrayEquals 131072 bytes (blob) 1.7562 us/op 1.7323 us/op 1.01
browser block root to RootHex using toHex 147.62 ns/op 143.96 ns/op 1.03
browser block root to RootHex using toRootHex 131.87 ns/op 130.13 ns/op 1.01
browser fromHex(blob) 1.5895 ms/op 1.6999 ms/op 0.94
browser fromHexInto(blob) 683.14 us/op 654.50 us/op 1.04
browser block root to RootHex using the deprecated toHexString 335.77 ns/op 343.53 ns/op 0.98
browser byteArrayEquals 32 bytes (block root) 28.046 ns/op 27.512 ns/op 1.02
browser byteArrayEquals 48 bytes (pubkey) 39.426 ns/op 38.786 ns/op 1.02
browser byteArrayEquals 96 bytes (signature) 72.752 ns/op 72.595 ns/op 1.00
browser byteArrayEquals 1024 bytes 741.83 ns/op 738.76 ns/op 1.00
browser byteArrayEquals 131072 bytes (blob) 93.534 us/op 93.162 us/op 1.00

by benchmarkbot/action

@ensi321 ensi321 merged commit 0c3761f into unstable Jul 3, 2026
18 of 19 checks passed
@ensi321 ensi321 deleted the nc/defer-onblock-store-mutations branch July 3, 2026 23:19
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