Skip to content

fix: recompute head after pulling up checkpoints - #9864

Merged
wemeetagain merged 3 commits into
unstablefrom
te/recompute_head_epoch_boundary
Aug 24, 2026
Merged

fix: recompute head after pulling up checkpoints#9864
wemeetagain merged 3 commits into
unstablefrom
te/recompute_head_epoch_boundary

Conversation

@twoeths

@twoeths twoeths commented Aug 20, 2026

Copy link
Copy Markdown
Member

Motivation

Description

  • after we pull up checkpoints at epoch boundary, recompute head

AI Assistance Disclosure

  • created with the help of Claude

@github-actions

github-actions Bot commented Aug 20, 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: aaeadc7 Previous: 157b2b2 Ratio
Full columns - reconstruct all 6 blobs 37.143 ms/op 144.00 us/op 257.93
getExpectedWithdrawals 250000 eb:1,eth1:1,we:0,wn:0,smpl:16 9.8770 us/op 2.9960 us/op 3.30
getExpectedWithdrawals 250000 eb:0.95,eth1:0.3,we:0.05,wn:0,smpl:43 20.205 us/op 5.3040 us/op 3.81
phase0 processEffectiveBalanceUpdates - 250000 worstcase 0.5 6.0420 ms/op 1.5619 ms/op 3.87
Full benchmark results
Benchmark suite Current: aaeadc7 Previous: 157b2b2 Ratio
getPubkeys - native cache - req 1000 vs - 250000 vc 546.92 us/op 562.25 us/op 0.97
getPubkeys - validatorsArr - req 1000 vs - 250000 vc 41.664 us/op 42.759 us/op 0.97
BLS verify - blst 883.05 us/op 894.35 us/op 0.99
BLS verifyMultipleSignatures 3 - blst 1.3243 ms/op 1.3461 ms/op 0.98
BLS verifyMultipleSignatures 8 - blst 2.2333 ms/op 2.2314 ms/op 1.00
BLS verifyMultipleSignatures 32 - blst 7.2510 ms/op 7.3208 ms/op 0.99
BLS verifyMultipleSignatures 64 - blst 14.011 ms/op 14.117 ms/op 0.99
BLS verifyMultipleSignatures 128 - blst 26.484 ms/op 26.830 ms/op 0.99
BLS deserializing 10000 signatures 635.56 ms/op 655.79 ms/op 0.97
BLS deserializing 100000 signatures 6.5454 s/op 6.6039 s/op 0.99
BLS verifyMultipleSignatures - same message - 3 - blst 967.55 us/op 962.88 us/op 1.00
BLS verifyMultipleSignatures - same message - 8 - blst 1.1008 ms/op 1.0856 ms/op 1.01
BLS verifyMultipleSignatures - same message - 32 - blst 1.7470 ms/op 1.6708 ms/op 1.05
BLS verifyMultipleSignatures - same message - 64 - blst 2.5776 ms/op 2.4928 ms/op 1.03
BLS verifyMultipleSignatures - same message - 128 - blst 4.2746 ms/op 4.1080 ms/op 1.04
BLS aggregatePubkeys 32 - blst 20.070 us/op 19.263 us/op 1.04
BLS aggregatePubkeys 128 - blst 72.522 us/op 69.206 us/op 1.05
getSlashingsAndExits - default max 56.097 us/op 42.883 us/op 1.31
getSlashingsAndExits - 2k 537.46 us/op 362.11 us/op 1.48
proposeBlockBody type=full, size=empty 775.42 us/op 1.2665 ms/op 0.61
isKnown best case - 1 super set check 207.00 ns/op 157.00 ns/op 1.32
isKnown normal case - 2 super set checks 182.00 ns/op 155.00 ns/op 1.17
isKnown worse case - 16 super set checks 184.00 ns/op 154.00 ns/op 1.19
validate api signedAggregateAndProof - struct 1.5709 ms/op 1.4193 ms/op 1.11
validate gossip signedAggregateAndProof - struct 1.5530 ms/op 1.4121 ms/op 1.10
batch validate gossip attestation - vc 640000 - chunk 32 135.02 us/op 121.96 us/op 1.11
batch validate gossip attestation - vc 640000 - chunk 64 118.52 us/op 104.96 us/op 1.13
batch validate gossip attestation - vc 640000 - chunk 128 105.05 us/op 95.323 us/op 1.10
batch validate gossip attestation - vc 640000 - chunk 256 105.05 us/op 98.099 us/op 1.07
bytes32 toHexString 307.00 ns/op 274.00 ns/op 1.12
bytes32 Buffer.toString(hex) 180.00 ns/op 173.00 ns/op 1.04
bytes32 Buffer.toString(hex) from Uint8Array 244.00 ns/op 240.00 ns/op 1.02
bytes32 Buffer.toString(hex) + 0x 180.00 ns/op 166.00 ns/op 1.08
Return object 10000 times 0.22200 ns/op 0.20460 ns/op 1.09
Throw Error 10000 times 3.4050 us/op 3.1554 us/op 1.08
toHex 100.34 ns/op 91.167 ns/op 1.10
Buffer.from 90.101 ns/op 85.467 ns/op 1.05
shared Buffer 62.072 ns/op 55.373 ns/op 1.12
fastMsgIdFn sha256 / 200 bytes 1.5080 us/op 1.4190 us/op 1.06
fastMsgIdFn h32 xxhash / 200 bytes 163.00 ns/op 157.00 ns/op 1.04
fastMsgIdFn h64 xxhash / 200 bytes 214.00 ns/op 203.00 ns/op 1.05
fastMsgIdFn sha256 / 1000 bytes 4.8490 us/op 4.5820 us/op 1.06
fastMsgIdFn h32 xxhash / 1000 bytes 254.00 ns/op 239.00 ns/op 1.06
fastMsgIdFn h64 xxhash / 1000 bytes 264.00 ns/op 250.00 ns/op 1.06
fastMsgIdFn sha256 / 10000 bytes 42.776 us/op 40.288 us/op 1.06
fastMsgIdFn h32 xxhash / 10000 bytes 1.3090 us/op 1.2210 us/op 1.07
fastMsgIdFn h64 xxhash / 10000 bytes 845.00 ns/op 787.00 ns/op 1.07
send data - 1000 256B messages 5.4865 ms/op 4.3253 ms/op 1.27
send data - 1000 512B messages 6.4664 ms/op 5.3751 ms/op 1.20
send data - 1000 1024B messages 6.3580 ms/op 5.7403 ms/op 1.11
send data - 1000 1200B messages 13.236 ms/op 7.8422 ms/op 1.69
send data - 1000 2048B messages 25.393 ms/op 16.383 ms/op 1.55
send data - 1000 4096B messages 175.03 ms/op 115.69 ms/op 1.51
send data - 1000 16384B messages 691.71 ms/op 419.65 ms/op 1.65
send data - 1000 65536B messages 2.4719 s/op 1.4189 s/op 1.74
enrSubnets - fastDeserialize 64 bits 899.00 ns/op 708.00 ns/op 1.27
enrSubnets - ssz BitVector 64 bits 272.00 ns/op 261.00 ns/op 1.04
enrSubnets - fastDeserialize 4 bits 108.00 ns/op 98.000 ns/op 1.10
enrSubnets - ssz BitVector 4 bits 276.00 ns/op 262.00 ns/op 1.05
prioritizePeers score -10:0 att 32-0.1 sync 2-0 296.19 us/op 196.77 us/op 1.51
prioritizePeers score 0:0 att 32-0.25 sync 2-0.25 312.69 us/op 224.90 us/op 1.39
prioritizePeers score 0:0 att 32-0.5 sync 2-0.5 413.28 us/op 323.51 us/op 1.28
prioritizePeers score 0:0 att 64-0.75 sync 4-0.75 737.96 us/op 573.74 us/op 1.29
prioritizePeers score 0:0 att 64-1 sync 4-1 843.11 us/op 675.42 us/op 1.25
array of 16000 items push then shift 1.3099 us/op 1.2395 us/op 1.06
LinkedList of 16000 items push then shift 9.8410 ns/op 7.6000 ns/op 1.29
array of 16000 items push then pop 101.87 ns/op 84.667 ns/op 1.20
LinkedList of 16000 items push then pop 7.6980 ns/op 5.8890 ns/op 1.31
array of 24000 items push then shift 1.9608 us/op 1.8292 us/op 1.07
LinkedList of 24000 items push then shift 10.412 ns/op 7.5050 ns/op 1.39
array of 24000 items push then pop 148.69 ns/op 120.78 ns/op 1.23
LinkedList of 24000 items push then pop 7.2870 ns/op 5.9330 ns/op 1.23
intersect bitArray bitLen 8 3.9780 ns/op 3.7500 ns/op 1.06
intersect array and set length 8 30.736 ns/op 28.621 ns/op 1.07
intersect bitArray bitLen 128 23.879 ns/op 22.575 ns/op 1.06
intersect array and set length 128 658.36 ns/op 478.89 ns/op 1.37
bitArray.getTrueBitIndexes() bitLen 128 1.4980 us/op 903.00 ns/op 1.66
bitArray.getTrueBitIndexes() bitLen 248 2.3450 us/op 1.6240 us/op 1.44
bitArray.getTrueBitIndexes() bitLen 512 4.9490 us/op 3.4480 us/op 1.44
Full columns - reconstruct all 6 blobs 37.143 ms/op 144.00 us/op 257.93
Full columns - reconstruct half of the blobs out of 6 197.71 us/op 77.942 us/op 2.54
Full columns - reconstruct single blob out of 6 49.653 us/op 32.102 us/op 1.55
Half columns - reconstruct all 6 blobs 418.94 ms/op 380.88 ms/op 1.10
Half columns - reconstruct half of the blobs out of 6 211.58 ms/op 192.76 ms/op 1.10
Half columns - reconstruct single blob out of 6 74.293 ms/op 67.910 ms/op 1.09
Set add up to 64 items then delete first 2.5013 us/op 1.5744 us/op 1.59
OrderedSet add up to 64 items then delete first 3.8636 us/op 2.3988 us/op 1.61
Set add up to 64 items then delete last 2.6912 us/op 1.7594 us/op 1.53
OrderedSet add up to 64 items then delete last 4.1854 us/op 2.7475 us/op 1.52
Set add up to 64 items then delete middle 2.8903 us/op 1.7920 us/op 1.61
OrderedSet add up to 64 items then delete middle 6.5877 us/op 4.2901 us/op 1.54
Set add up to 128 items then delete first 5.5639 us/op 3.4809 us/op 1.60
OrderedSet add up to 128 items then delete first 7.9814 us/op 5.3000 us/op 1.51
Set add up to 128 items then delete last 6.7045 us/op 3.4546 us/op 1.94
OrderedSet add up to 128 items then delete last 9.2868 us/op 5.3589 us/op 1.73
Set add up to 128 items then delete middle 5.7930 us/op 3.4339 us/op 1.69
OrderedSet add up to 128 items then delete middle 16.660 us/op 11.196 us/op 1.49
Set add up to 256 items then delete first 12.311 us/op 6.8146 us/op 1.81
OrderedSet add up to 256 items then delete first 19.458 us/op 11.188 us/op 1.74
Set add up to 256 items then delete last 8.5344 us/op 7.0411 us/op 1.21
OrderedSet add up to 256 items then delete last 16.623 us/op 11.496 us/op 1.45
Set add up to 256 items then delete middle 10.793 us/op 6.7751 us/op 1.59
OrderedSet add up to 256 items then delete middle 44.722 us/op 34.276 us/op 1.30
runFastConfirmationRules vc:100000 bc:96 eq:0 9.9855 ms/op 4.2351 ms/op 2.36
runFastConfirmationRules vc:600000 bc:96 eq:0 48.211 ms/op 34.572 ms/op 1.39
runFastConfirmationRules vc:1000000 bc:96 eq:0 68.430 ms/op 58.332 ms/op 1.17
runFastConfirmationRules vc:600000 bc:320 eq:0 39.074 ms/op 34.874 ms/op 1.12
runFastConfirmationRules vc:100000 bc:96 eq:1000 1.2856 s/op 1.1437 s/op 1.12
pass gossip attestations to forkchoice per slot 3.0729 ms/op 2.4596 ms/op 1.25
forkChoice updateHead vc 100000 bc 64 eq 0 403.41 us/op 386.38 us/op 1.04
forkChoice updateHead vc 600000 bc 64 eq 0 2.4589 ms/op 2.2905 ms/op 1.07
forkChoice updateHead vc 1000000 bc 64 eq 0 4.0537 ms/op 3.8379 ms/op 1.06
forkChoice updateHead vc 600000 bc 320 eq 0 2.4648 ms/op 2.3258 ms/op 1.06
forkChoice updateHead vc 600000 bc 1200 eq 0 2.5245 ms/op 2.3784 ms/op 1.06
forkChoice updateHead vc 600000 bc 7200 eq 0 3.8664 ms/op 4.0370 ms/op 0.96
forkChoice updateHead vc 600000 bc 64 eq 1000 2.5542 ms/op 2.3511 ms/op 1.09
forkChoice updateHead vc 600000 bc 64 eq 10000 2.6937 ms/op 2.4297 ms/op 1.11
forkChoice updateHead vc 600000 bc 64 eq 300000 8.0634 ms/op 6.8926 ms/op 1.17
computeDeltas 1400000 validators 0% inactive 12.701 ms/op 11.623 ms/op 1.09
computeDeltas 1400000 validators 10% inactive 11.904 ms/op 11.005 ms/op 1.08
computeDeltas 1400000 validators 20% inactive 11.303 ms/op 10.370 ms/op 1.09
computeDeltas 1400000 validators 50% inactive 9.3258 ms/op 8.4529 ms/op 1.10
computeDeltas 2100000 validators 0% inactive 18.887 ms/op 17.327 ms/op 1.09
computeDeltas 2100000 validators 10% inactive 18.208 ms/op 16.352 ms/op 1.11
computeDeltas 2100000 validators 20% inactive 17.198 ms/op 15.459 ms/op 1.11
computeDeltas 2100000 validators 50% inactive 14.359 ms/op 10.385 ms/op 1.38
altair processAttestation - 250000 vs - 7PWei normalcase 3.1369 ms/op 1.7839 ms/op 1.76
altair processAttestation - 250000 vs - 7PWei worstcase 4.7542 ms/op 2.8272 ms/op 1.68
altair processAttestation - setStatus - 1/6 committees join 117.64 us/op 96.897 us/op 1.21
altair processAttestation - setStatus - 1/3 committees join 233.84 us/op 182.09 us/op 1.28
altair processAttestation - setStatus - 1/2 committees join 317.21 us/op 267.89 us/op 1.18
altair processAttestation - setStatus - 2/3 committees join 394.79 us/op 352.41 us/op 1.12
altair processAttestation - setStatus - 4/5 committees join 619.26 us/op 512.91 us/op 1.21
altair processAttestation - setStatus - 100% committees join 686.81 us/op 601.47 us/op 1.14
altair processBlock - 250000 vs - 7PWei normalcase 7.7993 ms/op 5.3542 ms/op 1.46
altair processBlock - 250000 vs - 7PWei normalcase hashState 34.598 ms/op 22.635 ms/op 1.53
altair processBlock - 250000 vs - 7PWei worstcase 32.363 ms/op 26.068 ms/op 1.24
altair processBlock - 250000 vs - 7PWei worstcase hashState 73.792 ms/op 59.014 ms/op 1.25
phase0 processBlock - 250000 vs - 7PWei normalcase 2.3535 ms/op 1.3350 ms/op 1.76
phase0 processBlock - 250000 vs - 7PWei worstcase 26.780 ms/op 19.919 ms/op 1.34
altair processEth1Data - 250000 vs - 7PWei normalcase 329.66 us/op 273.69 us/op 1.20
getExpectedWithdrawals 250000 eb:1,eth1:1,we:0,wn:0,smpl:16 9.8770 us/op 2.9960 us/op 3.30
getExpectedWithdrawals 250000 eb:0.95,eth1:0.1,we:0.05,wn:0,smpl:220 37.674 us/op 18.839 us/op 2.00
getExpectedWithdrawals 250000 eb:0.95,eth1:0.3,we:0.05,wn:0,smpl:43 20.205 us/op 5.3040 us/op 3.81
getExpectedWithdrawals 250000 eb:0.95,eth1:0.7,we:0.05,wn:0,smpl:19 7.5590 us/op 3.3740 us/op 2.24
getExpectedWithdrawals 250000 eb:0.1,eth1:0.1,we:0,wn:0,smpl:1021 101.78 us/op 85.402 us/op 1.19
getExpectedWithdrawals 250000 eb:0.03,eth1:0.03,we:0,wn:0,smpl:11778 1.6529 ms/op 1.3936 ms/op 1.19
getExpectedWithdrawals 250000 eb:0.01,eth1:0.01,we:0,wn:0,smpl:16384 2.5030 ms/op 1.7992 ms/op 1.39
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,smpl:16384 2.0833 ms/op 1.7732 ms/op 1.17
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,nocache,smpl:16384 8.8766 ms/op 3.6798 ms/op 2.41
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,smpl:16384 2.5980 ms/op 2.0200 ms/op 1.29
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,nocache,smpl:16384 9.0206 ms/op 3.8981 ms/op 2.31
Tree 40 250000 create 441.32 ms/op 338.82 ms/op 1.30
Tree 40 250000 get(125000) 96.648 ns/op 87.418 ns/op 1.11
Tree 40 250000 set(125000) 1.1451 us/op 953.62 ns/op 1.20
Tree 40 250000 toArray() 24.970 ms/op 16.003 ms/op 1.56
Tree 40 250000 iterate all - toArray() + loop 24.202 ms/op 17.176 ms/op 1.41
Tree 40 250000 iterate all - get(i) 47.626 ms/op 40.671 ms/op 1.17
Array 250000 create 3.1993 ms/op 2.5609 ms/op 1.25
Array 250000 clone - spread 987.54 us/op 791.11 us/op 1.25
Array 250000 get(125000) 0.30500 ns/op 0.29000 ns/op 1.05
Array 250000 set(125000) 0.30800 ns/op 0.29300 ns/op 1.05
Array 250000 iterate all - loop 60.355 us/op 56.413 us/op 1.07
phase0 afterProcessEpoch - 250000 vs - 7PWei 40.790 ms/op 49.939 ms/op 0.82
Array.fill - length 1000000 9.0363 ms/op 6.5549 ms/op 1.38
Array push - length 1000000 20.324 ms/op 16.669 ms/op 1.22
Array.get 0.22144 ns/op 0.20278 ns/op 1.09
Uint8Array.get 0.26416 ns/op 0.25742 ns/op 1.03
phase0 beforeProcessEpoch - 250000 vs - 7PWei 27.059 ms/op 19.466 ms/op 1.39
altair processEpoch - mainnet_e81889 286.28 ms/op 237.51 ms/op 1.21
mainnet_e81889 - altair beforeProcessEpoch 41.641 ms/op 52.169 ms/op 0.80
mainnet_e81889 - altair processJustificationAndFinalization 4.9720 us/op 5.0440 us/op 0.99
mainnet_e81889 - altair processInactivityUpdates 9.6114 ms/op 6.3374 ms/op 1.52
mainnet_e81889 - altair processRewardsAndPenalties 26.454 ms/op 18.917 ms/op 1.40
mainnet_e81889 - altair processRegistryUpdates 868.00 ns/op 557.00 ns/op 1.56
mainnet_e81889 - altair processSlashings 238.00 ns/op 144.00 ns/op 1.65
mainnet_e81889 - altair processEth1DataReset 274.00 ns/op 144.00 ns/op 1.90
mainnet_e81889 - altair processEffectiveBalanceUpdates 9.2105 ms/op 5.6247 ms/op 1.64
mainnet_e81889 - altair processSlashingsReset 1.0760 us/op 687.00 ns/op 1.57
mainnet_e81889 - altair processRandaoMixesReset 1.5070 us/op 972.00 ns/op 1.55
mainnet_e81889 - altair processHistoricalRootsUpdate 213.00 ns/op 140.00 ns/op 1.52
mainnet_e81889 - altair processParticipationFlagUpdates 1.0100 us/op 459.00 ns/op 2.20
mainnet_e81889 - altair processSyncCommitteeUpdates 225.00 ns/op 115.00 ns/op 1.96
mainnet_e81889 - altair afterProcessEpoch 42.905 ms/op 41.717 ms/op 1.03
capella processEpoch - mainnet_e217614 948.42 ms/op 755.67 ms/op 1.26
mainnet_e217614 - capella beforeProcessEpoch 218.36 ms/op 75.583 ms/op 2.89
mainnet_e217614 - capella processJustificationAndFinalization 12.049 us/op 5.2140 us/op 2.31
mainnet_e217614 - capella processInactivityUpdates 22.686 ms/op 17.014 ms/op 1.33
mainnet_e217614 - capella processRewardsAndPenalties 132.68 ms/op 91.897 ms/op 1.44
mainnet_e217614 - capella processRegistryUpdates 12.794 us/op 4.4210 us/op 2.89
mainnet_e217614 - capella processSlashings 304.00 ns/op 142.00 ns/op 2.14
mainnet_e217614 - capella processEth1DataReset 196.00 ns/op 139.00 ns/op 1.41
mainnet_e217614 - capella processEffectiveBalanceUpdates 26.930 ms/op 17.443 ms/op 1.54
mainnet_e217614 - capella processSlashingsReset 823.00 ns/op 673.00 ns/op 1.22
mainnet_e217614 - capella processRandaoMixesReset 1.4580 us/op 1.0120 us/op 1.44
mainnet_e217614 - capella processHistoricalRootsUpdate 160.00 ns/op 142.00 ns/op 1.13
mainnet_e217614 - capella processParticipationFlagUpdates 589.00 ns/op 448.00 ns/op 1.31
mainnet_e217614 - capella afterProcessEpoch 114.00 ms/op 107.18 ms/op 1.06
phase0 processEpoch - mainnet_e58758 340.10 ms/op 218.19 ms/op 1.56
mainnet_e58758 - phase0 beforeProcessEpoch 78.370 ms/op 54.909 ms/op 1.43
mainnet_e58758 - phase0 processJustificationAndFinalization 8.2590 us/op 5.2360 us/op 1.58
mainnet_e58758 - phase0 processRewardsAndPenalties 19.275 ms/op 16.498 ms/op 1.17
mainnet_e58758 - phase0 processRegistryUpdates 2.5010 us/op 2.2290 us/op 1.12
mainnet_e58758 - phase0 processSlashings 168.00 ns/op 143.00 ns/op 1.17
mainnet_e58758 - phase0 processEth1DataReset 174.00 ns/op 140.00 ns/op 1.24
mainnet_e58758 - phase0 processEffectiveBalanceUpdates 854.35 us/op 794.31 us/op 1.08
mainnet_e58758 - phase0 processSlashingsReset 1.0980 us/op 886.00 ns/op 1.24
mainnet_e58758 - phase0 processRandaoMixesReset 1.1630 us/op 992.00 ns/op 1.17
mainnet_e58758 - phase0 processHistoricalRootsUpdate 146.00 ns/op 282.00 ns/op 0.52
mainnet_e58758 - phase0 processParticipationRecordUpdates 1.3730 us/op 1.0720 us/op 1.28
mainnet_e58758 - phase0 afterProcessEpoch 35.431 ms/op 33.340 ms/op 1.06
phase0 processEffectiveBalanceUpdates - 250000 normalcase 1.3176 ms/op 961.50 us/op 1.37
phase0 processEffectiveBalanceUpdates - 250000 worstcase 0.5 6.0420 ms/op 1.5619 ms/op 3.87
altair processInactivityUpdates - 250000 normalcase 17.639 ms/op 13.596 ms/op 1.30
altair processInactivityUpdates - 250000 worstcase 14.524 ms/op 14.113 ms/op 1.03
phase0 processRegistryUpdates - 250000 normalcase 2.4970 us/op 2.3660 us/op 1.06
phase0 processRegistryUpdates - 250000 badcase_full_deposits 151.48 us/op 138.33 us/op 1.10
phase0 processRegistryUpdates - 250000 worstcase 0.5 84.822 ms/op 64.285 ms/op 1.32
altair processRewardsAndPenalties - 250000 normalcase 17.440 ms/op 15.691 ms/op 1.11
altair processRewardsAndPenalties - 250000 worstcase 16.910 ms/op 15.289 ms/op 1.11
phase0 getAttestationDeltas - 250000 normalcase 5.8345 ms/op 5.4807 ms/op 1.06
phase0 getAttestationDeltas - 250000 worstcase 5.7739 ms/op 5.4185 ms/op 1.07
phase0 processSlashings - 250000 worstcase 63.331 us/op 57.937 us/op 1.09
altair processSyncCommitteeUpdates - 250000 12.288 ms/op 11.576 ms/op 1.06
BeaconState.hashTreeRoot - No change 179.00 ns/op 176.00 ns/op 1.02
BeaconState.hashTreeRoot - 1 full validator 86.925 us/op 75.497 us/op 1.15
BeaconState.hashTreeRoot - 32 full validator 879.67 us/op 869.95 us/op 1.01
BeaconState.hashTreeRoot - 512 full validator 9.9004 ms/op 8.4373 ms/op 1.17
BeaconState.hashTreeRoot - 1 validator.effectiveBalance 114.24 us/op 100.42 us/op 1.14
BeaconState.hashTreeRoot - 32 validator.effectiveBalance 1.4779 ms/op 1.4645 ms/op 1.01
BeaconState.hashTreeRoot - 512 validator.effectiveBalance 23.682 ms/op 19.239 ms/op 1.23
BeaconState.hashTreeRoot - 1 balances 80.784 us/op 83.473 us/op 0.97
BeaconState.hashTreeRoot - 32 balances 838.53 us/op 738.55 us/op 1.14
BeaconState.hashTreeRoot - 512 balances 7.4708 ms/op 6.3989 ms/op 1.17
BeaconState.hashTreeRoot - 250000 balances 119.77 ms/op 115.17 ms/op 1.04
aggregationBits - 2048 els - zipIndexesInBitList 25.258 us/op 19.463 us/op 1.30
regular array get 100000 times 23.409 us/op 22.241 us/op 1.05
wrappedArray get 100000 times 23.481 us/op 22.313 us/op 1.05
arrayWithProxy get 100000 times 9.7179 ms/op 9.1263 ms/op 1.06
ssz.Root.equals 21.931 ns/op 20.634 ns/op 1.06
byteArrayEquals 21.473 ns/op 20.510 ns/op 1.05
Buffer.compare 8.9020 ns/op 8.4480 ns/op 1.05
processSlot - 1 slots 11.309 us/op 10.327 us/op 1.10
processSlot - 32 slots 2.3322 ms/op 2.1155 ms/op 1.10
getEffectiveBalanceIncrementsZeroInactive - 250000 vs - 7PWei 6.1754 ms/op 5.5348 ms/op 1.12
getCommitteeAssignments - req 1 vs - 250000 vc 1.6715 ms/op 2.2573 ms/op 0.74
getCommitteeAssignments - req 100 vs - 250000 vc 3.5039 ms/op 3.3350 ms/op 1.05
getCommitteeAssignments - req 1000 vs - 250000 vc 3.6977 ms/op 3.5799 ms/op 1.03
findModifiedValidators - 10000 modified validators 768.20 ms/op 787.63 ms/op 0.98
findModifiedValidators - 1000 modified validators 626.96 ms/op 458.53 ms/op 1.37
findModifiedValidators - 100 modified validators 401.47 ms/op 382.95 ms/op 1.05
findModifiedValidators - 10 modified validators 325.38 ms/op 326.18 ms/op 1.00
findModifiedValidators - 1 modified validators 275.62 ms/op 209.25 ms/op 1.32
findModifiedValidators - no difference 278.05 ms/op 250.61 ms/op 1.11
migrate state 1500000 validators, 3400 modified, 2000 new 3.1657 s/op 3.1105 s/op 1.02
RootCache.getBlockRootAtSlot - 250000 vs - 7PWei 3.3800 ns/op 3.2800 ns/op 1.03
state getBlockRootAtSlot - 250000 vs - 7PWei 438.55 ns/op 415.39 ns/op 1.06
computeProposerIndex 100000 validators 1.3466 ms/op 1.3566 ms/op 0.99
getNextSyncCommitteeIndices 1000 validators 2.8257 ms/op 2.8085 ms/op 1.01
getNextSyncCommitteeIndices 10000 validators 25.844 ms/op 25.556 ms/op 1.01
getNextSyncCommitteeIndices 100000 validators 90.062 ms/op 87.324 ms/op 1.03
computeProposers - vc 250000 540.80 us/op 554.43 us/op 0.98
computeEpochShuffling - vc 250000 38.850 ms/op 39.490 ms/op 0.98
getNextSyncCommittee - vc 250000 10.417 ms/op 9.2887 ms/op 1.12
nodejs block root to RootHex using toHex 95.058 ns/op 97.012 ns/op 0.98
nodejs block root to RootHex using toRootHex 61.590 ns/op 63.034 ns/op 0.98
nodejs fromHex(blob) 944.84 us/op 850.06 us/op 1.11
nodejs fromHexInto(blob) 624.05 us/op 599.61 us/op 1.04
nodejs block root to RootHex using the deprecated toHexString 651.82 ns/op 567.94 ns/op 1.15
nodejs byteArrayEquals 32 bytes (block root) 25.228 ns/op 24.834 ns/op 1.02
nodejs byteArrayEquals 48 bytes (pubkey) 36.458 ns/op 35.583 ns/op 1.02
nodejs byteArrayEquals 96 bytes (signature) 33.409 ns/op 32.454 ns/op 1.03
nodejs byteArrayEquals 1024 bytes 40.305 ns/op 39.939 ns/op 1.01
nodejs byteArrayEquals 131072 bytes (blob) 1.7315 us/op 1.7072 us/op 1.01
browser block root to RootHex using toHex 143.67 ns/op 141.38 ns/op 1.02
browser block root to RootHex using toRootHex 128.80 ns/op 126.02 ns/op 1.02
browser fromHex(blob) 1.8379 ms/op 1.6467 ms/op 1.12
browser fromHexInto(blob) 618.18 us/op 605.10 us/op 1.02
browser block root to RootHex using the deprecated toHexString 474.81 ns/op 433.24 ns/op 1.10
browser byteArrayEquals 32 bytes (block root) 28.150 ns/op 26.687 ns/op 1.05
browser byteArrayEquals 48 bytes (pubkey) 39.651 ns/op 37.762 ns/op 1.05
browser byteArrayEquals 96 bytes (signature) 74.796 ns/op 70.612 ns/op 1.06
browser byteArrayEquals 1024 bytes 759.54 ns/op 726.66 ns/op 1.05
browser byteArrayEquals 131072 bytes (blob) 94.001 us/op 91.331 us/op 1.03

by benchmarkbot/action

@twoeths
twoeths marked this pull request as ready for review August 20, 2026 07:02
@twoeths
twoeths requested a review from a team as a code owner August 20, 2026 07:02
@codecov

codecov Bot commented Aug 20, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 52.59%. Comparing base (e91bc3e) to head (dd9cb93).

Additional details and impacted files
@@            Coverage Diff            @@
##           unstable    #9864   +/-   ##
=========================================
  Coverage     52.59%   52.59%           
=========================================
  Files           848      848           
  Lines         59942    59940    -2     
  Branches       4410     4410           
=========================================
  Hits          31525    31525           
+ Misses        28358    28356    -2     
  Partials         59       59           
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@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: dd9cb93b9d

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines +2077 to +2078
if (didUpdateCheckpoints) {
this.updateHead();

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Avoid recomputing the head twice at epoch boundaries

When fast confirmation is enabled and not paused, an epoch-boundary checkpoint update calls the expensive updateHead() here, but updateTime() then immediately drains the attestation queue and invokes runFastConfirmation(), which calls updateHead() again. The first result cannot be observed between these synchronous operations and is already outdated once queued votes are applied, so this adds a redundant full proto-array score and head calculation to the slot-start critical path. Delay this recomputation until after the queue is processed or share it with the fast-confirmation calculation.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

thanks, fixed in the latest commit
moved the updateHead() to the last step, it's more precise because we applied previous slot attestations at that time

Comment thread packages/fork-choice/src/forkChoice/forkChoice.ts
## Summary
- document the boolean return values of `updateCheckpoints()` and
`onTick()`
- remove the now-redundant inline return-value explanation

## Verification
- `pnpm exec biome check
packages/fork-choice/src/forkChoice/forkChoice.ts`
@wemeetagain
wemeetagain merged commit bd761ec into unstable Aug 24, 2026
19 of 20 checks passed
@wemeetagain
wemeetagain deleted the te/recompute_head_epoch_boundary branch August 24, 2026 16:31
@github-project-automation github-project-automation Bot moved this from In Progress to Done in Lodestar Team Coordination Aug 24, 2026
Comment on lines +1094 to +1096
if (didUpdateCheckpoints && !didRecomputeHead) {
this.updateHead();
}

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.

this still does it unconditionally at every epoch boundary? I wonder if we should incorporate #9853 or similar in addition, unless there is another case besides dependent root and proposer boost in which we wanna re-compute head

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.

I think #9853 still has its value to use justified checkpoint when it's safe to use it.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

this still does it unconditionally at every epoch boundary?

yes, I don't think there's an issue with it

I think #9853 still has its value to use justified checkpoint when it's safe to use it.

I'd only do it if we find a scenario for it

ensi321 added a commit that referenced this pull request Aug 26, 2026
The alpha.14 comptests were regenerated, so the seed-embedding case names
changed again. Full re-run and re-triage of the gloas suite:

- #9821 (exact Gwei weights) fixed the proposer boost weight quantization
  divergence (#9694); that skip bucket is removed.
- #9864 (recompute head after pulling up checkpoints) fixed the stale
  cached head read in the proposer boost dependent-root gate (#9666);
  both remaining pins are removed.
- 127 cases remain skipped for consensus-specs#5496 (childless
  payload-status variants bypass the filter_block_tree FFG check),
  regenerated names. This is the only remaining failure bucket.

Suite result with #9233 merged locally: 1345 passed, 0 failed.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018Vw1BUX36pwcv52fGr3n1C
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

5 participants