Skip to content

fix: ensure block in forkchoice before validate by_root payload#9479

Merged
nflaig merged 1 commit into
unstablefrom
te/fix_UnknownBlockSync_BlockRootUnknown
Jun 9, 2026
Merged

fix: ensure block in forkchoice before validate by_root payload#9479
nflaig merged 1 commit into
unstablefrom
te/fix_UnknownBlockSync_BlockRootUnknown

Conversation

@twoeths

@twoeths twoeths commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Motivation

  • UnknownBlockSync failed validateGossipExecutionPayloadEnvelope() because block was not in forkchoce
  • there was a gap where PayloadEnvelopeInput existed but block was not imported to forkchoice yet

Description

  • check block was in forkchoice instead

Closes #9478

AI Assistance Disclosure

  • created with the help of Claude

@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 defers execution payload envelope validation until the corresponding block is imported into the fork choice. Previously, a non-null payloadInput (which can be seeded from the block body during download) was assumed to mean the block was already imported, leading to potential validation failures (such as BLOCK_ROOT_UNKNOWN). The changes ensure that the fork choice is checked first, deferring validation and pulling the block if it is not yet imported. A new unit test has been added to verify this behavior. There are no review comments, so I have no 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 Jun 8, 2026

Copy link
Copy Markdown
Contributor

Performance Report

✔️ no performance regression detected

Full benchmark results
Benchmark suite Current: f56bdbb Previous: 1b4e24f Ratio
getPubkeys - index2pubkey - req 1000 vs - 250000 vc 1.0097 ms/op 988.76 us/op 1.02
getPubkeys - validatorsArr - req 1000 vs - 250000 vc 40.159 us/op 39.138 us/op 1.03
BLS verify - blst 725.36 us/op 688.04 us/op 1.05
BLS verifyMultipleSignatures 3 - blst 1.3149 ms/op 1.3085 ms/op 1.00
BLS verifyMultipleSignatures 8 - blst 2.0889 ms/op 2.0762 ms/op 1.01
BLS verifyMultipleSignatures 32 - blst 6.5395 ms/op 6.5047 ms/op 1.01
BLS verifyMultipleSignatures 64 - blst 12.727 ms/op 13.052 ms/op 0.98
BLS verifyMultipleSignatures 128 - blst 24.808 ms/op 24.786 ms/op 1.00
BLS deserializing 10000 signatures 627.67 ms/op 630.34 ms/op 1.00
BLS deserializing 100000 signatures 6.1833 s/op 6.4215 s/op 0.96
BLS verifyMultipleSignatures - same message - 3 - blst 672.63 us/op 783.87 us/op 0.86
BLS verifyMultipleSignatures - same message - 8 - blst 864.98 us/op 922.20 us/op 0.94
BLS verifyMultipleSignatures - same message - 32 - blst 1.4681 ms/op 1.5287 ms/op 0.96
BLS verifyMultipleSignatures - same message - 64 - blst 2.2588 ms/op 2.4143 ms/op 0.94
BLS verifyMultipleSignatures - same message - 128 - blst 3.8773 ms/op 4.0582 ms/op 0.96
BLS aggregatePubkeys 32 - blst 17.149 us/op 17.559 us/op 0.98
BLS aggregatePubkeys 128 - blst 60.871 us/op 62.796 us/op 0.97
getSlashingsAndExits - default max 48.806 us/op 49.057 us/op 0.99
getSlashingsAndExits - 2k 343.25 us/op 360.39 us/op 0.95
proposeBlockBody type=full, size=empty 582.48 us/op 751.16 us/op 0.78
isKnown best case - 1 super set check 164.00 ns/op 164.00 ns/op 1.00
isKnown normal case - 2 super set checks 156.00 ns/op 168.00 ns/op 0.93
isKnown worse case - 16 super set checks 154.00 ns/op 163.00 ns/op 0.94
validate api signedAggregateAndProof - struct 1.4558 ms/op 1.4979 ms/op 0.97
validate gossip signedAggregateAndProof - struct 1.4385 ms/op 1.4930 ms/op 0.96
batch validate gossip attestation - vc 640000 - chunk 32 104.96 us/op 107.02 us/op 0.98
batch validate gossip attestation - vc 640000 - chunk 64 91.719 us/op 95.349 us/op 0.96
batch validate gossip attestation - vc 640000 - chunk 128 85.265 us/op 89.891 us/op 0.95
batch validate gossip attestation - vc 640000 - chunk 256 81.052 us/op 86.626 us/op 0.94
bytes32 toHexString 281.00 ns/op 281.00 ns/op 1.00
bytes32 Buffer.toString(hex) 159.00 ns/op 172.00 ns/op 0.92
bytes32 Buffer.toString(hex) from Uint8Array 228.00 ns/op 228.00 ns/op 1.00
bytes32 Buffer.toString(hex) + 0x 166.00 ns/op 171.00 ns/op 0.97
Return object 10000 times 0.20570 ns/op 0.20690 ns/op 0.99
Throw Error 10000 times 3.1852 us/op 3.3719 us/op 0.94
toHex 85.638 ns/op 102.82 ns/op 0.83
Buffer.from 77.051 ns/op 82.960 ns/op 0.93
shared Buffer 50.464 ns/op 53.036 ns/op 0.95
fastMsgIdFn sha256 / 200 bytes 1.4340 us/op 1.4370 us/op 1.00
fastMsgIdFn h32 xxhash / 200 bytes 150.00 ns/op 154.00 ns/op 0.97
fastMsgIdFn h64 xxhash / 200 bytes 194.00 ns/op 208.00 ns/op 0.93
fastMsgIdFn sha256 / 1000 bytes 4.5760 us/op 4.7650 us/op 0.96
fastMsgIdFn h32 xxhash / 1000 bytes 234.00 ns/op 244.00 ns/op 0.96
fastMsgIdFn h64 xxhash / 1000 bytes 244.00 ns/op 252.00 ns/op 0.97
fastMsgIdFn sha256 / 10000 bytes 40.588 us/op 42.154 us/op 0.96
fastMsgIdFn h32 xxhash / 10000 bytes 1.2160 us/op 1.2830 us/op 0.95
fastMsgIdFn h64 xxhash / 10000 bytes 788.00 ns/op 833.00 ns/op 0.95
send data - 1000 256B messages 4.1730 ms/op 4.4244 ms/op 0.94
send data - 1000 512B messages 4.2347 ms/op 4.7525 ms/op 0.89
send data - 1000 1024B messages 4.2740 ms/op 4.8657 ms/op 0.88
send data - 1000 1200B messages 4.3558 ms/op 5.6167 ms/op 0.78
send data - 1000 2048B messages 4.7897 ms/op 5.2398 ms/op 0.91
send data - 1000 4096B messages 5.7728 ms/op 6.0282 ms/op 0.96
send data - 1000 16384B messages 25.732 ms/op 19.870 ms/op 1.30
send data - 1000 65536B messages 253.77 ms/op 242.17 ms/op 1.05
enrSubnets - fastDeserialize 64 bits 735.00 ns/op 757.00 ns/op 0.97
enrSubnets - ssz BitVector 64 bits 268.00 ns/op 267.00 ns/op 1.00
enrSubnets - fastDeserialize 4 bits 97.000 ns/op 105.00 ns/op 0.92
enrSubnets - ssz BitVector 4 bits 277.00 ns/op 264.00 ns/op 1.05
prioritizePeers score -10:0 att 32-0.1 sync 2-0 210.97 us/op 203.87 us/op 1.03
prioritizePeers score 0:0 att 32-0.25 sync 2-0.25 233.89 us/op 250.07 us/op 0.94
prioritizePeers score 0:0 att 32-0.5 sync 2-0.5 332.47 us/op 355.20 us/op 0.94
prioritizePeers score 0:0 att 64-0.75 sync 4-0.75 603.39 us/op 599.00 us/op 1.01
prioritizePeers score 0:0 att 64-1 sync 4-1 675.72 us/op 699.27 us/op 0.97
array of 16000 items push then shift 1.1957 us/op 1.2752 us/op 0.94
LinkedList of 16000 items push then shift 7.4090 ns/op 7.5800 ns/op 0.98
array of 16000 items push then pop 65.503 ns/op 83.936 ns/op 0.78
LinkedList of 16000 items push then pop 5.9370 ns/op 6.0090 ns/op 0.99
array of 24000 items push then shift 1.7767 us/op 1.8732 us/op 0.95
LinkedList of 24000 items push then shift 7.4300 ns/op 7.4180 ns/op 1.00
array of 24000 items push then pop 94.311 ns/op 118.12 ns/op 0.80
LinkedList of 24000 items push then pop 6.0590 ns/op 6.0330 ns/op 1.00
intersect bitArray bitLen 8 4.5740 ns/op 4.7100 ns/op 0.97
intersect array and set length 8 28.494 ns/op 28.963 ns/op 0.98
intersect bitArray bitLen 128 24.151 ns/op 23.530 ns/op 1.03
intersect array and set length 128 475.08 ns/op 494.53 ns/op 0.96
bitArray.getTrueBitIndexes() bitLen 128 1.0210 us/op 1.1010 us/op 0.93
bitArray.getTrueBitIndexes() bitLen 248 1.7830 us/op 1.8850 us/op 0.95
bitArray.getTrueBitIndexes() bitLen 512 3.5650 us/op 3.9340 us/op 0.91
Full columns - reconstruct all 6 blobs 158.60 us/op 186.33 us/op 0.85
Full columns - reconstruct half of the blobs out of 6 88.714 us/op 72.291 us/op 1.23
Full columns - reconstruct single blob out of 6 32.395 us/op 33.180 us/op 0.98
Half columns - reconstruct all 6 blobs 379.96 ms/op 386.39 ms/op 0.98
Half columns - reconstruct half of the blobs out of 6 196.21 ms/op 193.58 ms/op 1.01
Half columns - reconstruct single blob out of 6 67.871 ms/op 69.578 ms/op 0.98
Full columns - reconstruct all 10 blobs 202.83 us/op 211.34 us/op 0.96
Full columns - reconstruct half of the blobs out of 10 99.051 us/op 136.22 us/op 0.73
Full columns - reconstruct single blob out of 10 42.696 us/op 30.442 us/op 1.40
Half columns - reconstruct all 10 blobs 633.52 ms/op 641.52 ms/op 0.99
Half columns - reconstruct half of the blobs out of 10 317.11 ms/op 317.74 ms/op 1.00
Half columns - reconstruct single blob out of 10 70.203 ms/op 67.983 ms/op 1.03
Full columns - reconstruct all 20 blobs 1.7883 ms/op 750.74 us/op 2.38
Full columns - reconstruct half of the blobs out of 20 284.01 us/op 301.40 us/op 0.94
Full columns - reconstruct single blob out of 20 30.953 us/op 32.762 us/op 0.94
Half columns - reconstruct all 20 blobs 1.2769 s/op 1.2683 s/op 1.01
Half columns - reconstruct half of the blobs out of 20 634.13 ms/op 627.77 ms/op 1.01
Half columns - reconstruct single blob out of 20 69.046 ms/op 66.171 ms/op 1.04
Set add up to 64 items then delete first 2.5131 us/op 2.4775 us/op 1.01
OrderedSet add up to 64 items then delete first 3.3721 us/op 3.2388 us/op 1.04
Set add up to 64 items then delete last 2.2787 us/op 2.2615 us/op 1.01
OrderedSet add up to 64 items then delete last 3.1800 us/op 3.1570 us/op 1.01
Set add up to 64 items then delete middle 2.0404 us/op 2.0040 us/op 1.02
OrderedSet add up to 64 items then delete middle 4.7904 us/op 4.5113 us/op 1.06
Set add up to 128 items then delete first 4.0821 us/op 4.0021 us/op 1.02
OrderedSet add up to 128 items then delete first 6.2958 us/op 6.2108 us/op 1.01
Set add up to 128 items then delete last 3.7651 us/op 3.7064 us/op 1.02
OrderedSet add up to 128 items then delete last 5.6705 us/op 5.6675 us/op 1.00
Set add up to 128 items then delete middle 3.8527 us/op 3.6997 us/op 1.04
OrderedSet add up to 128 items then delete middle 12.261 us/op 12.060 us/op 1.02
Set add up to 256 items then delete first 7.8623 us/op 7.6812 us/op 1.02
OrderedSet add up to 256 items then delete first 11.697 us/op 11.893 us/op 0.98
Set add up to 256 items then delete last 8.0395 us/op 7.2240 us/op 1.11
OrderedSet add up to 256 items then delete last 11.455 us/op 11.070 us/op 1.03
Set add up to 256 items then delete middle 7.7356 us/op 7.4248 us/op 1.04
OrderedSet add up to 256 items then delete middle 36.977 us/op 35.745 us/op 1.03
runFastConfirmationRules vc:100000 bc:96 eq:0 3.5980 us/op 3.0920 us/op 1.16
runFastConfirmationRules vc:600000 bc:96 eq:0 16.718 us/op 6.6860 us/op 2.50
runFastConfirmationRules vc:1000000 bc:96 eq:0 21.012 us/op 8.4600 us/op 2.48
runFastConfirmationRules vc:600000 bc:320 eq:0 17.171 us/op 8.9220 us/op 1.92
runFastConfirmationRules vc:600000 bc:1200 eq:0 45.558 us/op 30.208 us/op 1.51
runFastConfirmationRules vc:600000 bc:96 eq:1000 9.6680 us/op 17.746 us/op 0.54
runFastConfirmationRules vc:600000 bc:96 eq:10000 9.6460 us/op 16.482 us/op 0.59
runFastConfirmationRules vc:600000 bc:96 eq:300000 25.114 us/op 29.170 us/op 0.86
pass gossip attestations to forkchoice per slot 2.5560 ms/op 2.6122 ms/op 0.98
forkChoice updateHead vc 100000 bc 64 eq 0 403.91 us/op 403.07 us/op 1.00
forkChoice updateHead vc 600000 bc 64 eq 0 2.3989 ms/op 2.3794 ms/op 1.01
forkChoice updateHead vc 1000000 bc 64 eq 0 3.9890 ms/op 3.9552 ms/op 1.01
forkChoice updateHead vc 600000 bc 320 eq 0 2.3999 ms/op 2.4137 ms/op 0.99
forkChoice updateHead vc 600000 bc 1200 eq 0 2.4356 ms/op 2.3948 ms/op 1.02
forkChoice updateHead vc 600000 bc 7200 eq 0 3.6441 ms/op 2.6341 ms/op 1.38
forkChoice updateHead vc 600000 bc 64 eq 1000 2.4195 ms/op 2.4279 ms/op 1.00
forkChoice updateHead vc 600000 bc 64 eq 10000 2.5502 ms/op 2.4985 ms/op 1.02
forkChoice updateHead vc 600000 bc 64 eq 300000 6.7497 ms/op 7.1026 ms/op 0.95
computeDeltas 1400000 validators 0% inactive 12.450 ms/op 12.476 ms/op 1.00
computeDeltas 1400000 validators 10% inactive 11.996 ms/op 11.498 ms/op 1.04
computeDeltas 1400000 validators 20% inactive 10.563 ms/op 10.515 ms/op 1.00
computeDeltas 1400000 validators 50% inactive 8.0841 ms/op 8.0821 ms/op 1.00
computeDeltas 2100000 validators 0% inactive 18.590 ms/op 18.781 ms/op 0.99
computeDeltas 2100000 validators 10% inactive 17.242 ms/op 17.335 ms/op 0.99
computeDeltas 2100000 validators 20% inactive 15.778 ms/op 16.021 ms/op 0.98
computeDeltas 2100000 validators 50% inactive 9.1589 ms/op 9.2575 ms/op 0.99
altair processAttestation - 250000 vs - 7PWei normalcase 2.0489 ms/op 2.2293 ms/op 0.92
altair processAttestation - 250000 vs - 7PWei worstcase 3.1010 ms/op 3.4459 ms/op 0.90
altair processAttestation - setStatus - 1/6 committees join 95.345 us/op 107.57 us/op 0.89
altair processAttestation - setStatus - 1/3 committees join 200.49 us/op 218.44 us/op 0.92
altair processAttestation - setStatus - 1/2 committees join 293.02 us/op 299.97 us/op 0.98
altair processAttestation - setStatus - 2/3 committees join 372.56 us/op 367.64 us/op 1.01
altair processAttestation - setStatus - 4/5 committees join 514.71 us/op 517.15 us/op 1.00
altair processAttestation - setStatus - 100% committees join 605.92 us/op 606.46 us/op 1.00
altair processBlock - 250000 vs - 7PWei normalcase 4.3104 ms/op 4.4590 ms/op 0.97
altair processBlock - 250000 vs - 7PWei normalcase hashState 18.724 ms/op 15.011 ms/op 1.25
altair processBlock - 250000 vs - 7PWei worstcase 24.108 ms/op 23.461 ms/op 1.03
altair processBlock - 250000 vs - 7PWei worstcase hashState 48.686 ms/op 45.000 ms/op 1.08
phase0 processBlock - 250000 vs - 7PWei normalcase 1.5703 ms/op 1.4933 ms/op 1.05
phase0 processBlock - 250000 vs - 7PWei worstcase 19.114 ms/op 19.249 ms/op 0.99
altair processEth1Data - 250000 vs - 7PWei normalcase 288.03 us/op 280.78 us/op 1.03
getExpectedWithdrawals 250000 eb:1,eth1:1,we:0,wn:0,smpl:16 4.2600 us/op 7.5700 us/op 0.56
getExpectedWithdrawals 250000 eb:0.95,eth1:0.1,we:0.05,wn:0,smpl:220 21.351 us/op 22.827 us/op 0.94
getExpectedWithdrawals 250000 eb:0.95,eth1:0.3,we:0.05,wn:0,smpl:43 5.8700 us/op 6.1700 us/op 0.95
getExpectedWithdrawals 250000 eb:0.95,eth1:0.7,we:0.05,wn:0,smpl:19 4.1100 us/op 3.8620 us/op 1.06
getExpectedWithdrawals 250000 eb:0.1,eth1:0.1,we:0,wn:0,smpl:1021 93.339 us/op 102.64 us/op 0.91
getExpectedWithdrawals 250000 eb:0.03,eth1:0.03,we:0,wn:0,smpl:11778 1.4654 ms/op 1.6019 ms/op 0.91
getExpectedWithdrawals 250000 eb:0.01,eth1:0.01,we:0,wn:0,smpl:16384 1.8325 ms/op 2.2202 ms/op 0.83
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,smpl:16384 1.8258 ms/op 2.1957 ms/op 0.83
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,nocache,smpl:16384 5.4166 ms/op 4.2915 ms/op 1.26
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,smpl:16384 2.2688 ms/op 2.1896 ms/op 1.04
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,nocache,smpl:16384 5.9476 ms/op 4.4456 ms/op 1.34
Tree 40 250000 create 381.78 ms/op 343.84 ms/op 1.11
Tree 40 250000 get(125000) 93.816 ns/op 91.925 ns/op 1.02
Tree 40 250000 set(125000) 1.0244 us/op 985.83 ns/op 1.04
Tree 40 250000 toArray() 20.105 ms/op 16.150 ms/op 1.24
Tree 40 250000 iterate all - toArray() + loop 19.749 ms/op 16.271 ms/op 1.21
Tree 40 250000 iterate all - get(i) 43.291 ms/op 41.110 ms/op 1.05
Array 250000 create 2.4043 ms/op 2.5173 ms/op 0.96
Array 250000 clone - spread 721.40 us/op 770.02 us/op 0.94
Array 250000 get(125000) 0.29700 ns/op 0.29200 ns/op 1.02
Array 250000 set(125000) 0.30100 ns/op 0.29000 ns/op 1.04
Array 250000 iterate all - loop 58.130 us/op 56.883 us/op 1.02
phase0 afterProcessEpoch - 250000 vs - 7PWei 52.641 ms/op 39.938 ms/op 1.32
Array.fill - length 1000000 2.5169 ms/op 2.2299 ms/op 1.13
Array push - length 1000000 10.522 ms/op 9.6633 ms/op 1.09
Array.get 0.20775 ns/op 0.20129 ns/op 1.03
Uint8Array.get 0.23119 ns/op 0.24358 ns/op 0.95
phase0 beforeProcessEpoch - 250000 vs - 7PWei 21.848 ms/op 16.092 ms/op 1.36
altair processEpoch - mainnet_e81889 340.69 ms/op 268.23 ms/op 1.27
mainnet_e81889 - altair beforeProcessEpoch 27.741 ms/op 15.577 ms/op 1.78
mainnet_e81889 - altair processJustificationAndFinalization 10.638 us/op 6.1650 us/op 1.73
mainnet_e81889 - altair processInactivityUpdates 10.284 ms/op 4.1791 ms/op 2.46
mainnet_e81889 - altair processRewardsAndPenalties 23.710 ms/op 21.996 ms/op 1.08
mainnet_e81889 - altair processRegistryUpdates 596.00 ns/op 550.00 ns/op 1.08
mainnet_e81889 - altair processSlashings 163.00 ns/op 132.00 ns/op 1.23
mainnet_e81889 - altair processEth1DataReset 134.00 ns/op 127.00 ns/op 1.06
mainnet_e81889 - altair processEffectiveBalanceUpdates 7.7295 ms/op 5.1433 ms/op 1.50
mainnet_e81889 - altair processSlashingsReset 865.00 ns/op 715.00 ns/op 1.21
mainnet_e81889 - altair processRandaoMixesReset 2.2350 us/op 1.3200 us/op 1.69
mainnet_e81889 - altair processHistoricalRootsUpdate 324.00 ns/op 131.00 ns/op 2.47
mainnet_e81889 - altair processParticipationFlagUpdates 1.0770 us/op 445.00 ns/op 2.42
mainnet_e81889 - altair processSyncCommitteeUpdates 271.00 ns/op 106.00 ns/op 2.56
mainnet_e81889 - altair afterProcessEpoch 42.888 ms/op 42.791 ms/op 1.00
capella processEpoch - mainnet_e217614 856.62 ms/op 845.41 ms/op 1.01
mainnet_e217614 - capella beforeProcessEpoch 58.018 ms/op 64.262 ms/op 0.90
mainnet_e217614 - capella processJustificationAndFinalization 6.5240 us/op 6.5840 us/op 0.99
mainnet_e217614 - capella processInactivityUpdates 20.408 ms/op 14.666 ms/op 1.39
mainnet_e217614 - capella processRewardsAndPenalties 97.729 ms/op 97.836 ms/op 1.00
mainnet_e217614 - capella processRegistryUpdates 4.3940 us/op 4.3830 us/op 1.00
mainnet_e217614 - capella processSlashings 130.00 ns/op 131.00 ns/op 0.99
mainnet_e217614 - capella processEth1DataReset 127.00 ns/op 125.00 ns/op 1.02
mainnet_e217614 - capella processEffectiveBalanceUpdates 17.852 ms/op 15.848 ms/op 1.13
mainnet_e217614 - capella processSlashingsReset 684.00 ns/op 681.00 ns/op 1.00
mainnet_e217614 - capella processRandaoMixesReset 1.3750 us/op 1.2870 us/op 1.07
mainnet_e217614 - capella processHistoricalRootsUpdate 128.00 ns/op 126.00 ns/op 1.02
mainnet_e217614 - capella processParticipationFlagUpdates 435.00 ns/op 428.00 ns/op 1.02
mainnet_e217614 - capella afterProcessEpoch 108.08 ms/op 104.68 ms/op 1.03
phase0 processEpoch - mainnet_e58758 365.13 ms/op 317.61 ms/op 1.15
mainnet_e58758 - phase0 beforeProcessEpoch 104.05 ms/op 67.721 ms/op 1.54
mainnet_e58758 - phase0 processJustificationAndFinalization 7.0380 us/op 6.2570 us/op 1.12
mainnet_e58758 - phase0 processRewardsAndPenalties 17.901 ms/op 16.651 ms/op 1.08
mainnet_e58758 - phase0 processRegistryUpdates 2.2660 us/op 2.2070 us/op 1.03
mainnet_e58758 - phase0 processSlashings 131.00 ns/op 126.00 ns/op 1.04
mainnet_e58758 - phase0 processEth1DataReset 125.00 ns/op 118.00 ns/op 1.06
mainnet_e58758 - phase0 processEffectiveBalanceUpdates 810.51 us/op 798.39 us/op 1.02
mainnet_e58758 - phase0 processSlashingsReset 1.0290 us/op 883.00 ns/op 1.17
mainnet_e58758 - phase0 processRandaoMixesReset 1.4240 us/op 1.2280 us/op 1.16
mainnet_e58758 - phase0 processHistoricalRootsUpdate 131.00 ns/op 271.00 ns/op 0.48
mainnet_e58758 - phase0 processParticipationRecordUpdates 1.2510 us/op 1.1280 us/op 1.11
mainnet_e58758 - phase0 afterProcessEpoch 32.305 ms/op 33.373 ms/op 0.97
phase0 processEffectiveBalanceUpdates - 250000 normalcase 994.40 us/op 993.01 us/op 1.00
phase0 processEffectiveBalanceUpdates - 250000 worstcase 0.5 1.5267 ms/op 2.5899 ms/op 0.59
altair processInactivityUpdates - 250000 normalcase 12.983 ms/op 11.214 ms/op 1.16
altair processInactivityUpdates - 250000 worstcase 14.281 ms/op 11.221 ms/op 1.27
phase0 processRegistryUpdates - 250000 normalcase 3.0370 us/op 2.0700 us/op 1.47
phase0 processRegistryUpdates - 250000 badcase_full_deposits 139.78 us/op 133.54 us/op 1.05
phase0 processRegistryUpdates - 250000 worstcase 0.5 60.831 ms/op 63.457 ms/op 0.96
altair processRewardsAndPenalties - 250000 normalcase 15.975 ms/op 18.054 ms/op 0.88
altair processRewardsAndPenalties - 250000 worstcase 15.756 ms/op 17.424 ms/op 0.90
phase0 getAttestationDeltas - 250000 normalcase 5.2416 ms/op 5.5324 ms/op 0.95
phase0 getAttestationDeltas - 250000 worstcase 5.2802 ms/op 8.3151 ms/op 0.64
phase0 processSlashings - 250000 worstcase 59.693 us/op 57.729 us/op 1.03
altair processSyncCommitteeUpdates - 250000 11.680 ms/op 9.9257 ms/op 1.18
BeaconState.hashTreeRoot - No change 156.00 ns/op 163.00 ns/op 0.96
BeaconState.hashTreeRoot - 1 full validator 72.405 us/op 66.482 us/op 1.09
BeaconState.hashTreeRoot - 32 full validator 880.10 us/op 796.06 us/op 1.11
BeaconState.hashTreeRoot - 512 full validator 9.1740 ms/op 6.6112 ms/op 1.39
BeaconState.hashTreeRoot - 1 validator.effectiveBalance 108.17 us/op 82.747 us/op 1.31
BeaconState.hashTreeRoot - 32 validator.effectiveBalance 1.4090 ms/op 1.3758 ms/op 1.02
BeaconState.hashTreeRoot - 512 validator.effectiveBalance 21.998 ms/op 14.042 ms/op 1.57
BeaconState.hashTreeRoot - 1 balances 84.314 us/op 58.763 us/op 1.43
BeaconState.hashTreeRoot - 32 balances 720.13 us/op 683.52 us/op 1.05
BeaconState.hashTreeRoot - 512 balances 6.4081 ms/op 4.9060 ms/op 1.31
BeaconState.hashTreeRoot - 250000 balances 134.46 ms/op 112.24 ms/op 1.20
aggregationBits - 2048 els - zipIndexesInBitList 18.940 us/op 18.892 us/op 1.00
regular array get 100000 times 22.035 us/op 22.394 us/op 0.98
wrappedArray get 100000 times 21.870 us/op 22.308 us/op 0.98
arrayWithProxy get 100000 times 17.145 ms/op 11.001 ms/op 1.56
ssz.Root.equals 21.089 ns/op 20.895 ns/op 1.01
byteArrayEquals 21.175 ns/op 20.601 ns/op 1.03
Buffer.compare 8.7650 ns/op 8.9070 ns/op 0.98
processSlot - 1 slots 11.458 us/op 8.0440 us/op 1.42
processSlot - 32 slots 2.1362 ms/op 1.9527 ms/op 1.09
getEffectiveBalanceIncrementsZeroInactive - 250000 vs - 7PWei 4.7076 ms/op 4.7865 ms/op 0.98
getCommitteeAssignments - req 1 vs - 250000 vc 1.6050 ms/op 1.6075 ms/op 1.00
getCommitteeAssignments - req 100 vs - 250000 vc 3.3033 ms/op 3.2694 ms/op 1.01
getCommitteeAssignments - req 1000 vs - 250000 vc 3.5443 ms/op 3.5948 ms/op 0.99
findModifiedValidators - 10000 modified validators 890.87 ms/op 596.91 ms/op 1.49
findModifiedValidators - 1000 modified validators 514.70 ms/op 461.64 ms/op 1.11
findModifiedValidators - 100 modified validators 341.41 ms/op 282.36 ms/op 1.21
findModifiedValidators - 10 modified validators 255.72 ms/op 232.44 ms/op 1.10
findModifiedValidators - 1 modified validators 178.91 ms/op 142.95 ms/op 1.25
findModifiedValidators - no difference 174.60 ms/op 171.20 ms/op 1.02
migrate state 1500000 validators, 3400 modified, 2000 new 3.0308 s/op 2.8356 s/op 1.07
RootCache.getBlockRootAtSlot - 250000 vs - 7PWei 3.6300 ns/op 3.6300 ns/op 1.00
state getBlockRootAtSlot - 250000 vs - 7PWei 408.40 ns/op 313.56 ns/op 1.30
computeProposerIndex 100000 validators 1.3302 ms/op 1.2922 ms/op 1.03
getNextSyncCommitteeIndices 1000 validators 2.8177 ms/op 2.8352 ms/op 0.99
getNextSyncCommitteeIndices 10000 validators 24.553 ms/op 24.835 ms/op 0.99
getNextSyncCommitteeIndices 100000 validators 84.531 ms/op 87.838 ms/op 0.96
computeProposers - vc 250000 534.44 us/op 551.76 us/op 0.97
computeEpochShuffling - vc 250000 39.317 ms/op 38.621 ms/op 1.02
getNextSyncCommittee - vc 250000 9.5760 ms/op 9.3516 ms/op 1.02
nodejs block root to RootHex using toHex 88.599 ns/op 93.919 ns/op 0.94
nodejs block root to RootHex using toRootHex 52.234 ns/op 52.301 ns/op 1.00
nodejs fromHex(blob) 795.92 us/op 733.14 us/op 1.09
nodejs fromHexInto(blob) 620.64 us/op 611.37 us/op 1.02
nodejs block root to RootHex using the deprecated toHexString 468.99 ns/op 381.23 ns/op 1.23
nodejs byteArrayEquals 32 bytes (block root) 25.358 ns/op 25.257 ns/op 1.00
nodejs byteArrayEquals 48 bytes (pubkey) 36.531 ns/op 36.448 ns/op 1.00
nodejs byteArrayEquals 96 bytes (signature) 32.740 ns/op 32.533 ns/op 1.01
nodejs byteArrayEquals 1024 bytes 40.263 ns/op 40.164 ns/op 1.00
nodejs byteArrayEquals 131072 bytes (blob) 1.7168 us/op 1.7098 us/op 1.00
browser block root to RootHex using toHex 140.72 ns/op 138.60 ns/op 1.02
browser block root to RootHex using toRootHex 127.69 ns/op 125.84 ns/op 1.01
browser fromHex(blob) 1.6854 ms/op 1.4564 ms/op 1.16
browser fromHexInto(blob) 623.84 us/op 612.33 us/op 1.02
browser block root to RootHex using the deprecated toHexString 470.76 ns/op 504.34 ns/op 0.93
browser byteArrayEquals 32 bytes (block root) 27.815 ns/op 27.618 ns/op 1.01
browser byteArrayEquals 48 bytes (pubkey) 39.297 ns/op 38.578 ns/op 1.02
browser byteArrayEquals 96 bytes (signature) 73.213 ns/op 72.317 ns/op 1.01
browser byteArrayEquals 1024 bytes 746.03 ns/op 745.18 ns/op 1.00
browser byteArrayEquals 131072 bytes (blob) 95.343 us/op 94.796 us/op 1.01

by benchmarkbot/action

@twoeths twoeths marked this pull request as ready for review June 8, 2026 14:34
@twoeths twoeths requested a review from a team as a code owner June 8, 2026 14:34
@codecov

codecov Bot commented Jun 8, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 52.59%. Comparing base (a879adb) to head (dd5a209).
⚠️ Report is 1 commits behind head on unstable.

Additional details and impacted files
@@            Coverage Diff            @@
##           unstable    #9479   +/-   ##
=========================================
  Coverage     52.59%   52.59%           
=========================================
  Files           848      848           
  Lines         60890    60890           
  Branches       4485     4485           
=========================================
  Hits          32023    32023           
  Misses        28805    28805           
  Partials         62       62           
🚀 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.

@nflaig nflaig 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.

LGTM, already had this code running on the devnet for over a day, no issues there

@nflaig nflaig merged commit 407d8c5 into unstable Jun 9, 2026
19 of 21 checks passed
@nflaig nflaig deleted the te/fix_UnknownBlockSync_BlockRootUnknown branch June 9, 2026 10:00
nflaig pushed a commit that referenced this pull request Jun 9, 2026
…emit (#9492)

## Summary

The base-branch update brought in #9479's new test ("defers envelope
validation until the block is in fork choice when payload input is
seeded from the block body") which uses the same `let emitter!:
ChainEventEmitter` + destructuring-assignment + sibling closure capture
pattern that #9491 already mitigated in the original failing test below.
Same `TS2769` fires at the new test's emit site:

```
test/unit/sync/unknownBlock.test.ts(1027,20): error TS2769: No overload matches this call.
  Argument of type 'ChainEvent.unknownEnvelopeBlockRoot' is not assignable to parameter of type 'unique symbol'.
```

Also, #9479's emit predates this PR's addition of `slot: Slot` to the
`ChainEvent.unknownEnvelopeBlockRoot` event signature, so the emit data
is missing the required `slot` field after the merge.

## Fix

Same minimal cast workaround as #9491 plus the required `slot: 0` field:

```diff
-      emitter.emit(ChainEvent.unknownEnvelopeBlockRoot, {
+      // tsgo overload-resolution miss when emit is reached through a closure that captures emitter
+      // first; cast re-anchors the StrictEventEmitter overload for ChainEvent keys (see #9491).
+      (emitter as ChainEventEmitter).emit(ChainEvent.unknownEnvelopeBlockRoot, {
         rootHex: blockRootHex,
+        slot: 0,
         peer,
         source: BlockInputSource.gossip,
       });
```

Single-site change. The 5 other
`emitter.emit(ChainEvent.unknownEnvelopeBlockRoot, ...)` sites in the
file remain unchanged because they aren't reached through a sibling
closure capture; the cast at the sibling test's emit (introduced in
#9491, currently at line 1126) also remains as-is and continues to
typecheck cleanly with the expanded `EventType` union from #9439.

## Test plan

- [ ] CI: `Type Checks (24)` passes (no TS2769 on
`unknownBlock.test.ts`).
- [ ] CI: the new `defers envelope validation until the block is in fork
choice when payload input is seeded from the block body` test still
passes — emit semantics unchanged.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: lodekeeper <lodekeeper@users.noreply.github.com>
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.

glamsterdam-devnet-5: Error downloading payload due to code=EXECUTION_PAYLOAD_ENVELOPE_ERROR_BLOCK_ROOT_UNKNOWN

3 participants