Skip to content

fix: gate builder bid lookup on shouldBuildOnFull in produceBlockV4 - #9442

Merged
nflaig merged 2 commits into
unstablefrom
nc/builder-bid-reorg-gate
Jun 2, 2026
Merged

fix: gate builder bid lookup on shouldBuildOnFull in produceBlockV4#9442
nflaig merged 2 commits into
unstablefrom
nc/builder-bid-reorg-gate

Conversation

@ensi321

@ensi321 ensi321 commented Jun 1, 2026

Copy link
Copy Markdown
Member

When the PTC majority votes the parent's payload was unavailable or
untimely, shouldBuildOnFull returns false and the self-build path in
produceBlockBody correctly reorgs to EMPTY. The builder bid path
bypassed this check: produceBlockV4 unconditionally queried the bid
pool with parentBlock.executionPayloadBlockHash (the FULL hash when
FULL remains canonical head by weight), then preferred any fulfilled
builder result over the engine result. Net effect: the validator would
publish a builder block extending the late/unavailable FULL payload
instead of executing the spec-mandated reorg.

Compute shouldBuildOnFull before the pool lookup and, when reorging,
query the pool with the EMPTY variant's executionPayloadBlockHash
(grandparent EL hash) so only EMPTY-reorg-targeting bids can match.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@ensi321
ensi321 requested a review from a team as a code owner June 1, 2026 23:19

@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 updates the validator API to conditionally select the parent block hash for builder bids based on whether the node is building on a full block. However, querying the fork choice for the empty variant of the parent block is likely to return null during block production. It is recommended to directly use the parent block's parent block hash instead, which is more efficient and avoids this potential bug.

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.

Comment thread packages/beacon-node/src/api/impl/validator/index.ts Outdated
…ckHash

Use parentBlock.parentBlockHash directly instead of looking up the
EMPTY variant in the protoArray. For any variant of a gloas parent
block, both fields hold the same value (the bid's parent_block_hash),
because forkChoice.onBlock sets executionPayloadBlockHash = parentBlockHash
= bid.parentBlockHash for the PENDING/EMPTY variants, and only the FULL
variant overrides executionPayloadBlockHash to the delivered payload hash.

Pre-gloas parents (at the fork transition) have parentBlockHash = null,
which getBestBid already handles by returning null. The explicit null
guard is therefore unnecessary.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@github-actions

github-actions Bot commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

Performance Report

🚀🚀 Significant benchmark improvement detected

Benchmark suite Current: 78cdd40 Previous: 86fc005 Ratio
Full columns - reconstruct all 20 blobs 451.37 us/op 1.5965 ms/op 0.28
Full benchmark results
Benchmark suite Current: 78cdd40 Previous: 86fc005 Ratio
getPubkeys - index2pubkey - req 1000 vs - 250000 vc 1.0571 ms/op 882.97 us/op 1.20
getPubkeys - validatorsArr - req 1000 vs - 250000 vc 44.897 us/op 37.518 us/op 1.20
BLS verify - blst 739.16 us/op 725.96 us/op 1.02
BLS verifyMultipleSignatures 3 - blst 1.3732 ms/op 1.3111 ms/op 1.05
BLS verifyMultipleSignatures 8 - blst 2.1832 ms/op 2.0750 ms/op 1.05
BLS verifyMultipleSignatures 32 - blst 6.8097 ms/op 6.4218 ms/op 1.06
BLS verifyMultipleSignatures 64 - blst 13.318 ms/op 12.441 ms/op 1.07
BLS verifyMultipleSignatures 128 - blst 25.680 ms/op 24.207 ms/op 1.06
BLS deserializing 10000 signatures 635.33 ms/op 618.87 ms/op 1.03
BLS deserializing 100000 signatures 6.4329 s/op 6.2186 s/op 1.03
BLS verifyMultipleSignatures - same message - 3 - blst 782.17 us/op 708.40 us/op 1.10
BLS verifyMultipleSignatures - same message - 8 - blst 916.16 us/op 894.08 us/op 1.02
BLS verifyMultipleSignatures - same message - 32 - blst 1.4536 ms/op 1.5043 ms/op 0.97
BLS verifyMultipleSignatures - same message - 64 - blst 2.3122 ms/op 2.3882 ms/op 0.97
BLS verifyMultipleSignatures - same message - 128 - blst 3.9923 ms/op 4.0176 ms/op 0.99
BLS aggregatePubkeys 32 - blst 17.848 us/op 17.635 us/op 1.01
BLS aggregatePubkeys 128 - blst 63.896 us/op 62.432 us/op 1.02
getSlashingsAndExits - default max 54.150 us/op 44.699 us/op 1.21
getSlashingsAndExits - 2k 382.08 us/op 330.30 us/op 1.16
proposeBlockBody type=full, size=empty 726.63 us/op 569.46 us/op 1.28
isKnown best case - 1 super set check 177.00 ns/op 163.00 ns/op 1.09
isKnown normal case - 2 super set checks 181.00 ns/op 162.00 ns/op 1.12
isKnown worse case - 16 super set checks 175.00 ns/op 158.00 ns/op 1.11
validate api signedAggregateAndProof - struct 1.5305 ms/op 1.4571 ms/op 1.05
validate gossip signedAggregateAndProof - struct 1.5335 ms/op 1.4486 ms/op 1.06
batch validate gossip attestation - vc 640000 - chunk 32 104.74 us/op 106.94 us/op 0.98
batch validate gossip attestation - vc 640000 - chunk 64 95.101 us/op 91.116 us/op 1.04
batch validate gossip attestation - vc 640000 - chunk 128 87.964 us/op 84.741 us/op 1.04
batch validate gossip attestation - vc 640000 - chunk 256 84.253 us/op 83.243 us/op 1.01
bytes32 toHexString 304.00 ns/op 279.00 ns/op 1.09
bytes32 Buffer.toString(hex) 181.00 ns/op 159.00 ns/op 1.14
bytes32 Buffer.toString(hex) from Uint8Array 240.00 ns/op 231.00 ns/op 1.04
bytes32 Buffer.toString(hex) + 0x 179.00 ns/op 153.00 ns/op 1.17
Return object 10000 times 0.21380 ns/op 0.20750 ns/op 1.03
Throw Error 10000 times 3.3349 us/op 3.3031 us/op 1.01
toHex 93.558 ns/op 85.828 ns/op 1.09
Buffer.from 87.173 ns/op 76.528 ns/op 1.14
shared Buffer 58.817 ns/op 50.019 ns/op 1.18
fastMsgIdFn sha256 / 200 bytes 1.4740 us/op 1.4550 us/op 1.01
fastMsgIdFn h32 xxhash / 200 bytes 166.00 ns/op 163.00 ns/op 1.02
fastMsgIdFn h64 xxhash / 200 bytes 208.00 ns/op 214.00 ns/op 0.97
fastMsgIdFn sha256 / 1000 bytes 4.7260 us/op 4.6380 us/op 1.02
fastMsgIdFn h32 xxhash / 1000 bytes 255.00 ns/op 247.00 ns/op 1.03
fastMsgIdFn h64 xxhash / 1000 bytes 260.00 ns/op 262.00 ns/op 0.99
fastMsgIdFn sha256 / 10000 bytes 41.933 us/op 40.660 us/op 1.03
fastMsgIdFn h32 xxhash / 10000 bytes 1.2660 us/op 1.2520 us/op 1.01
fastMsgIdFn h64 xxhash / 10000 bytes 825.00 ns/op 819.00 ns/op 1.01
send data - 1000 256B messages 4.0452 ms/op 4.2340 ms/op 0.96
send data - 1000 512B messages 4.1431 ms/op 4.3021 ms/op 0.96
send data - 1000 1024B messages 4.2513 ms/op 4.7742 ms/op 0.89
send data - 1000 1200B messages 4.6464 ms/op 4.4187 ms/op 1.05
send data - 1000 2048B messages 4.9376 ms/op 4.5431 ms/op 1.09
send data - 1000 4096B messages 5.3733 ms/op 5.6197 ms/op 0.96
send data - 1000 16384B messages 40.840 ms/op 19.497 ms/op 2.09
send data - 1000 65536B messages 281.59 ms/op 139.35 ms/op 2.02
enrSubnets - fastDeserialize 64 bits 784.00 ns/op 747.00 ns/op 1.05
enrSubnets - ssz BitVector 64 bits 267.00 ns/op 260.00 ns/op 1.03
enrSubnets - fastDeserialize 4 bits 112.00 ns/op 103.00 ns/op 1.09
enrSubnets - ssz BitVector 4 bits 275.00 ns/op 261.00 ns/op 1.05
prioritizePeers score -10:0 att 32-0.1 sync 2-0 212.70 us/op 200.86 us/op 1.06
prioritizePeers score 0:0 att 32-0.25 sync 2-0.25 595.03 us/op 229.43 us/op 2.59
prioritizePeers score 0:0 att 32-0.5 sync 2-0.5 367.75 us/op 328.39 us/op 1.12
prioritizePeers score 0:0 att 64-0.75 sync 4-0.75 627.11 us/op 592.72 us/op 1.06
prioritizePeers score 0:0 att 64-1 sync 4-1 727.62 us/op 674.27 us/op 1.08
array of 16000 items push then shift 1.3142 us/op 1.2297 us/op 1.07
LinkedList of 16000 items push then shift 6.9240 ns/op 7.3420 ns/op 0.94
array of 16000 items push then pop 67.790 ns/op 65.032 ns/op 1.04
LinkedList of 16000 items push then pop 6.0120 ns/op 5.8520 ns/op 1.03
array of 24000 items push then shift 1.9290 us/op 1.8122 us/op 1.06
LinkedList of 24000 items push then shift 6.4710 ns/op 6.9140 ns/op 0.94
array of 24000 items push then pop 95.144 ns/op 91.107 ns/op 1.04
LinkedList of 24000 items push then pop 6.1090 ns/op 5.8430 ns/op 1.05
intersect bitArray bitLen 8 4.7860 ns/op 4.6150 ns/op 1.04
intersect array and set length 8 30.232 ns/op 28.552 ns/op 1.06
intersect bitArray bitLen 128 24.119 ns/op 23.789 ns/op 1.01
intersect array and set length 128 511.14 ns/op 513.30 ns/op 1.00
bitArray.getTrueBitIndexes() bitLen 128 1.0540 us/op 1.0460 us/op 1.01
bitArray.getTrueBitIndexes() bitLen 248 1.8000 us/op 1.7770 us/op 1.01
bitArray.getTrueBitIndexes() bitLen 512 3.5550 us/op 3.6830 us/op 0.97
Full columns - reconstruct all 6 blobs 146.98 us/op 161.66 us/op 0.91
Full columns - reconstruct half of the blobs out of 6 100.07 us/op 99.502 us/op 1.01
Full columns - reconstruct single blob out of 6 35.488 us/op 53.671 us/op 0.66
Half columns - reconstruct all 6 blobs 387.09 ms/op 378.05 ms/op 1.02
Half columns - reconstruct half of the blobs out of 6 193.64 ms/op 189.07 ms/op 1.02
Half columns - reconstruct single blob out of 6 67.274 ms/op 67.945 ms/op 0.99
Full columns - reconstruct all 10 blobs 286.56 us/op 273.09 us/op 1.05
Full columns - reconstruct half of the blobs out of 10 147.92 us/op 150.79 us/op 0.98
Full columns - reconstruct single blob out of 10 35.286 us/op 28.710 us/op 1.23
Half columns - reconstruct all 10 blobs 625.85 ms/op 624.62 ms/op 1.00
Half columns - reconstruct half of the blobs out of 10 313.42 ms/op 315.32 ms/op 0.99
Half columns - reconstruct single blob out of 10 66.456 ms/op 66.587 ms/op 1.00
Full columns - reconstruct all 20 blobs 451.37 us/op 1.5965 ms/op 0.28
Full columns - reconstruct half of the blobs out of 20 290.59 us/op 171.42 us/op 1.70
Full columns - reconstruct single blob out of 20 51.102 us/op 45.834 us/op 1.11
Half columns - reconstruct all 20 blobs 1.2518 s/op 1.2521 s/op 1.00
Half columns - reconstruct half of the blobs out of 20 625.37 ms/op 625.21 ms/op 1.00
Half columns - reconstruct single blob out of 20 66.649 ms/op 67.935 ms/op 0.98
Set add up to 64 items then delete first 2.7560 us/op 2.4649 us/op 1.12
OrderedSet add up to 64 items then delete first 3.5296 us/op 3.3013 us/op 1.07
Set add up to 64 items then delete last 2.4607 us/op 2.3360 us/op 1.05
OrderedSet add up to 64 items then delete last 3.3787 us/op 3.2067 us/op 1.05
Set add up to 64 items then delete middle 2.2116 us/op 2.0974 us/op 1.05
OrderedSet add up to 64 items then delete middle 4.8179 us/op 4.6889 us/op 1.03
Set add up to 128 items then delete first 4.4668 us/op 4.2285 us/op 1.06
OrderedSet add up to 128 items then delete first 6.7399 us/op 6.4468 us/op 1.05
Set add up to 128 items then delete last 4.3086 us/op 3.9056 us/op 1.10
OrderedSet add up to 128 items then delete last 5.9598 us/op 5.8373 us/op 1.02
Set add up to 128 items then delete middle 4.0576 us/op 3.9536 us/op 1.03
OrderedSet add up to 128 items then delete middle 11.719 us/op 12.409 us/op 0.94
Set add up to 256 items then delete first 8.3208 us/op 7.9907 us/op 1.04
OrderedSet add up to 256 items then delete first 12.568 us/op 12.694 us/op 0.99
Set add up to 256 items then delete last 7.9083 us/op 7.8888 us/op 1.00
OrderedSet add up to 256 items then delete last 11.911 us/op 11.606 us/op 1.03
Set add up to 256 items then delete middle 7.9016 us/op 7.6014 us/op 1.04
OrderedSet add up to 256 items then delete middle 34.830 us/op 36.686 us/op 0.95
pass gossip attestations to forkchoice per slot 2.5355 ms/op 2.5537 ms/op 0.99
forkChoice updateHead vc 100000 bc 64 eq 0 464.08 us/op 390.24 us/op 1.19
forkChoice updateHead vc 600000 bc 64 eq 0 2.8183 ms/op 2.2958 ms/op 1.23
forkChoice updateHead vc 1000000 bc 64 eq 0 4.6581 ms/op 3.8873 ms/op 1.20
forkChoice updateHead vc 600000 bc 320 eq 0 2.7989 ms/op 2.3476 ms/op 1.19
forkChoice updateHead vc 600000 bc 1200 eq 0 2.7753 ms/op 2.3681 ms/op 1.17
forkChoice updateHead vc 600000 bc 7200 eq 0 3.0949 ms/op 2.8846 ms/op 1.07
forkChoice updateHead vc 600000 bc 64 eq 1000 3.3848 ms/op 2.9095 ms/op 1.16
forkChoice updateHead vc 600000 bc 64 eq 10000 3.7056 ms/op 2.9935 ms/op 1.24
forkChoice updateHead vc 600000 bc 64 eq 300000 7.5792 ms/op 6.8137 ms/op 1.11
computeDeltas 1400000 validators 0% inactive 13.873 ms/op 12.473 ms/op 1.11
computeDeltas 1400000 validators 10% inactive 12.801 ms/op 11.688 ms/op 1.10
computeDeltas 1400000 validators 20% inactive 11.875 ms/op 10.548 ms/op 1.13
computeDeltas 1400000 validators 50% inactive 9.3003 ms/op 8.1210 ms/op 1.15
computeDeltas 2100000 validators 0% inactive 20.388 ms/op 18.562 ms/op 1.10
computeDeltas 2100000 validators 10% inactive 19.161 ms/op 17.489 ms/op 1.10
computeDeltas 2100000 validators 20% inactive 17.813 ms/op 16.861 ms/op 1.06
computeDeltas 2100000 validators 50% inactive 13.840 ms/op 9.3326 ms/op 1.48
altair processAttestation - 250000 vs - 7PWei normalcase 1.7082 ms/op 1.9212 ms/op 0.89
altair processAttestation - 250000 vs - 7PWei worstcase 2.4177 ms/op 2.7443 ms/op 0.88
altair processAttestation - setStatus - 1/6 committees join 104.52 us/op 99.831 us/op 1.05
altair processAttestation - setStatus - 1/3 committees join 207.03 us/op 197.72 us/op 1.05
altair processAttestation - setStatus - 1/2 committees join 291.18 us/op 292.60 us/op 1.00
altair processAttestation - setStatus - 2/3 committees join 378.59 us/op 373.81 us/op 1.01
altair processAttestation - setStatus - 4/5 committees join 515.79 us/op 536.43 us/op 0.96
altair processAttestation - setStatus - 100% committees join 608.95 us/op 589.37 us/op 1.03
altair processBlock - 250000 vs - 7PWei normalcase 2.8590 ms/op 4.3282 ms/op 0.66
altair processBlock - 250000 vs - 7PWei normalcase hashState 13.973 ms/op 17.290 ms/op 0.81
altair processBlock - 250000 vs - 7PWei worstcase 19.235 ms/op 21.711 ms/op 0.89
altair processBlock - 250000 vs - 7PWei worstcase hashState 38.348 ms/op 42.775 ms/op 0.90
phase0 processBlock - 250000 vs - 7PWei normalcase 1.3132 ms/op 1.3505 ms/op 0.97
phase0 processBlock - 250000 vs - 7PWei worstcase 17.630 ms/op 16.776 ms/op 1.05
altair processEth1Data - 250000 vs - 7PWei normalcase 303.74 us/op 281.19 us/op 1.08
getExpectedWithdrawals 250000 eb:1,eth1:1,we:0,wn:0,smpl:16 3.2890 us/op 3.9120 us/op 0.84
getExpectedWithdrawals 250000 eb:0.95,eth1:0.1,we:0.05,wn:0,smpl:220 23.487 us/op 20.774 us/op 1.13
getExpectedWithdrawals 250000 eb:0.95,eth1:0.3,we:0.05,wn:0,smpl:43 6.8850 us/op 5.3830 us/op 1.28
getExpectedWithdrawals 250000 eb:0.95,eth1:0.7,we:0.05,wn:0,smpl:19 5.0960 us/op 3.4710 us/op 1.47
getExpectedWithdrawals 250000 eb:0.1,eth1:0.1,we:0,wn:0,smpl:1021 122.19 us/op 86.846 us/op 1.41
getExpectedWithdrawals 250000 eb:0.03,eth1:0.03,we:0,wn:0,smpl:11778 1.6654 ms/op 1.3386 ms/op 1.24
getExpectedWithdrawals 250000 eb:0.01,eth1:0.01,we:0,wn:0,smpl:16384 2.2263 ms/op 1.7368 ms/op 1.28
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,smpl:16384 2.2012 ms/op 1.7711 ms/op 1.24
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,nocache,smpl:16384 3.6116 ms/op 3.8693 ms/op 0.93
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,smpl:16384 2.5091 ms/op 2.0236 ms/op 1.24
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,nocache,smpl:16384 3.9021 ms/op 3.9127 ms/op 1.00
Tree 40 250000 create 318.29 ms/op 350.36 ms/op 0.91
Tree 40 250000 get(125000) 101.81 ns/op 90.573 ns/op 1.12
Tree 40 250000 set(125000) 1.0835 us/op 966.78 ns/op 1.12
Tree 40 250000 toArray() 9.4176 ms/op 15.827 ms/op 0.60
Tree 40 250000 iterate all - toArray() + loop 9.6238 ms/op 15.905 ms/op 0.61
Tree 40 250000 iterate all - get(i) 35.563 ms/op 39.041 ms/op 0.91
Array 250000 create 2.0327 ms/op 2.3018 ms/op 0.88
Array 250000 clone - spread 647.29 us/op 717.45 us/op 0.90
Array 250000 get(125000) 0.29300 ns/op 0.29200 ns/op 1.00
Array 250000 set(125000) 0.29800 ns/op 0.30100 ns/op 0.99
Array 250000 iterate all - loop 56.571 us/op 56.382 us/op 1.00
phase0 afterProcessEpoch - 250000 vs - 7PWei 39.764 ms/op 50.825 ms/op 0.78
Array.fill - length 1000000 2.4485 ms/op 2.1202 ms/op 1.15
Array push - length 1000000 7.7803 ms/op 9.5252 ms/op 0.82
Array.get 0.20418 ns/op 0.20504 ns/op 1.00
Uint8Array.get 0.24821 ns/op 0.24509 ns/op 1.01
phase0 beforeProcessEpoch - 250000 vs - 7PWei 12.932 ms/op 14.623 ms/op 0.88
altair processEpoch - mainnet_e81889 243.40 ms/op 286.68 ms/op 0.85
mainnet_e81889 - altair beforeProcessEpoch 19.096 ms/op 16.380 ms/op 1.17
mainnet_e81889 - altair processJustificationAndFinalization 5.3250 us/op 6.5070 us/op 0.82
mainnet_e81889 - altair processInactivityUpdates 3.6025 ms/op 6.3821 ms/op 0.56
mainnet_e81889 - altair processRewardsAndPenalties 18.141 ms/op 20.480 ms/op 0.89
mainnet_e81889 - altair processRegistryUpdates 538.00 ns/op 523.00 ns/op 1.03
mainnet_e81889 - altair processSlashings 136.00 ns/op 134.00 ns/op 1.01
mainnet_e81889 - altair processEth1DataReset 135.00 ns/op 127.00 ns/op 1.06
mainnet_e81889 - altair processEffectiveBalanceUpdates 1.4301 ms/op 5.9907 ms/op 0.24
mainnet_e81889 - altair processSlashingsReset 689.00 ns/op 687.00 ns/op 1.00
mainnet_e81889 - altair processRandaoMixesReset 1.0880 us/op 1.3140 us/op 0.83
mainnet_e81889 - altair processHistoricalRootsUpdate 132.00 ns/op 127.00 ns/op 1.04
mainnet_e81889 - altair processParticipationFlagUpdates 445.00 ns/op 420.00 ns/op 1.06
mainnet_e81889 - altair processSyncCommitteeUpdates 113.00 ns/op 108.00 ns/op 1.05
mainnet_e81889 - altair afterProcessEpoch 42.356 ms/op 41.701 ms/op 1.02
capella processEpoch - mainnet_e217614 768.08 ms/op 831.61 ms/op 0.92
mainnet_e217614 - capella beforeProcessEpoch 56.011 ms/op 60.131 ms/op 0.93
mainnet_e217614 - capella processJustificationAndFinalization 5.5100 us/op 6.4890 us/op 0.85
mainnet_e217614 - capella processInactivityUpdates 14.156 ms/op 16.282 ms/op 0.87
mainnet_e217614 - capella processRewardsAndPenalties 89.718 ms/op 95.947 ms/op 0.94
mainnet_e217614 - capella processRegistryUpdates 4.5330 us/op 4.4340 us/op 1.02
mainnet_e217614 - capella processSlashings 133.00 ns/op 154.00 ns/op 0.86
mainnet_e217614 - capella processEth1DataReset 130.00 ns/op 142.00 ns/op 0.92
mainnet_e217614 - capella processEffectiveBalanceUpdates 6.3829 ms/op 16.878 ms/op 0.38
mainnet_e217614 - capella processSlashingsReset 682.00 ns/op 700.00 ns/op 0.97
mainnet_e217614 - capella processRandaoMixesReset 1.1370 us/op 1.3370 us/op 0.85
mainnet_e217614 - capella processHistoricalRootsUpdate 136.00 ns/op 146.00 ns/op 0.93
mainnet_e217614 - capella processParticipationFlagUpdates 457.00 ns/op 425.00 ns/op 1.08
mainnet_e217614 - capella afterProcessEpoch 110.33 ms/op 108.98 ms/op 1.01
phase0 processEpoch - mainnet_e58758 276.78 ms/op 323.23 ms/op 0.86
mainnet_e58758 - phase0 beforeProcessEpoch 51.562 ms/op 69.514 ms/op 0.74
mainnet_e58758 - phase0 processJustificationAndFinalization 5.4730 us/op 6.5360 us/op 0.84
mainnet_e58758 - phase0 processRewardsAndPenalties 16.583 ms/op 16.385 ms/op 1.01
mainnet_e58758 - phase0 processRegistryUpdates 2.2830 us/op 2.2550 us/op 1.01
mainnet_e58758 - phase0 processSlashings 134.00 ns/op 134.00 ns/op 1.00
mainnet_e58758 - phase0 processEth1DataReset 141.00 ns/op 132.00 ns/op 1.07
mainnet_e58758 - phase0 processEffectiveBalanceUpdates 865.72 us/op 1.3434 ms/op 0.64
mainnet_e58758 - phase0 processSlashingsReset 869.00 ns/op 863.00 ns/op 1.01
mainnet_e58758 - phase0 processRandaoMixesReset 1.2300 us/op 1.2770 us/op 0.96
mainnet_e58758 - phase0 processHistoricalRootsUpdate 136.00 ns/op 136.00 ns/op 1.00
mainnet_e58758 - phase0 processParticipationRecordUpdates 1.0200 us/op 1.2350 us/op 0.83
mainnet_e58758 - phase0 afterProcessEpoch 33.786 ms/op 33.608 ms/op 1.01
phase0 processEffectiveBalanceUpdates - 250000 normalcase 1.0984 ms/op 995.22 us/op 1.10
phase0 processEffectiveBalanceUpdates - 250000 worstcase 0.5 1.2321 ms/op 1.5417 ms/op 0.80
altair processInactivityUpdates - 250000 normalcase 10.607 ms/op 11.076 ms/op 0.96
altair processInactivityUpdates - 250000 worstcase 11.071 ms/op 10.764 ms/op 1.03
phase0 processRegistryUpdates - 250000 normalcase 2.4360 us/op 2.9670 us/op 0.82
phase0 processRegistryUpdates - 250000 badcase_full_deposits 148.58 us/op 139.90 us/op 1.06
phase0 processRegistryUpdates - 250000 worstcase 0.5 57.850 ms/op 61.126 ms/op 0.95
altair processRewardsAndPenalties - 250000 normalcase 14.132 ms/op 15.789 ms/op 0.90
altair processRewardsAndPenalties - 250000 worstcase 16.600 ms/op 15.695 ms/op 1.06
phase0 getAttestationDeltas - 250000 normalcase 5.5985 ms/op 7.5083 ms/op 0.75
phase0 getAttestationDeltas - 250000 worstcase 5.4429 ms/op 5.5303 ms/op 0.98
phase0 processSlashings - 250000 worstcase 62.445 us/op 58.724 us/op 1.06
altair processSyncCommitteeUpdates - 250000 10.400 ms/op 12.436 ms/op 0.84
BeaconState.hashTreeRoot - No change 176.00 ns/op 162.00 ns/op 1.09
BeaconState.hashTreeRoot - 1 full validator 63.012 us/op 91.445 us/op 0.69
BeaconState.hashTreeRoot - 32 full validator 819.59 us/op 930.75 us/op 0.88
BeaconState.hashTreeRoot - 512 full validator 6.8310 ms/op 9.2349 ms/op 0.74
BeaconState.hashTreeRoot - 1 validator.effectiveBalance 85.656 us/op 107.20 us/op 0.80
BeaconState.hashTreeRoot - 32 validator.effectiveBalance 1.5226 ms/op 1.5056 ms/op 1.01
BeaconState.hashTreeRoot - 512 validator.effectiveBalance 13.943 ms/op 20.944 ms/op 0.67
BeaconState.hashTreeRoot - 1 balances 60.469 us/op 87.713 us/op 0.69
BeaconState.hashTreeRoot - 32 balances 704.56 us/op 788.26 us/op 0.89
BeaconState.hashTreeRoot - 512 balances 4.7464 ms/op 6.7922 ms/op 0.70
BeaconState.hashTreeRoot - 250000 balances 113.94 ms/op 142.75 ms/op 0.80
aggregationBits - 2048 els - zipIndexesInBitList 20.297 us/op 19.403 us/op 1.05
regular array get 100000 times 23.328 us/op 22.818 us/op 1.02
wrappedArray get 100000 times 23.292 us/op 22.950 us/op 1.01
arrayWithProxy get 100000 times 10.583 ms/op 14.853 ms/op 0.71
ssz.Root.equals 21.607 ns/op 21.291 ns/op 1.01
byteArrayEquals 21.418 ns/op 21.182 ns/op 1.01
Buffer.compare 9.0940 ns/op 8.7410 ns/op 1.04
processSlot - 1 slots 8.1320 us/op 10.540 us/op 0.77
processSlot - 32 slots 1.6855 ms/op 2.2321 ms/op 0.76
getEffectiveBalanceIncrementsZeroInactive - 250000 vs - 7PWei 3.7321 ms/op 3.8801 ms/op 0.96
getCommitteeAssignments - req 1 vs - 250000 vc 1.6787 ms/op 1.6543 ms/op 1.01
getCommitteeAssignments - req 100 vs - 250000 vc 3.4404 ms/op 3.3829 ms/op 1.02
getCommitteeAssignments - req 1000 vs - 250000 vc 3.6943 ms/op 3.6035 ms/op 1.03
findModifiedValidators - 10000 modified validators 629.85 ms/op 554.65 ms/op 1.14
findModifiedValidators - 1000 modified validators 404.75 ms/op 491.08 ms/op 0.82
findModifiedValidators - 100 modified validators 279.71 ms/op 322.00 ms/op 0.87
findModifiedValidators - 10 modified validators 200.70 ms/op 207.26 ms/op 0.97
findModifiedValidators - 1 modified validators 158.23 ms/op 141.69 ms/op 1.12
findModifiedValidators - no difference 161.36 ms/op 140.73 ms/op 1.15
migrate state 1500000 validators, 3400 modified, 2000 new 2.7186 s/op 2.9963 s/op 0.91
RootCache.getBlockRootAtSlot - 250000 vs - 7PWei 3.8200 ns/op 3.8500 ns/op 0.99
state getBlockRootAtSlot - 250000 vs - 7PWei 282.42 ns/op 390.10 ns/op 0.72
computeProposerIndex 100000 validators 1.3302 ms/op 1.3381 ms/op 0.99
getNextSyncCommitteeIndices 1000 validators 2.8567 ms/op 2.8932 ms/op 0.99
getNextSyncCommitteeIndices 10000 validators 25.196 ms/op 25.226 ms/op 1.00
getNextSyncCommitteeIndices 100000 validators 88.961 ms/op 88.357 ms/op 1.01
computeProposers - vc 250000 564.98 us/op 553.85 us/op 1.02
computeEpochShuffling - vc 250000 40.411 ms/op 40.164 ms/op 1.01
getNextSyncCommittee - vc 250000 9.5875 ms/op 9.8150 ms/op 0.98
nodejs block root to RootHex using toHex 96.040 ns/op 96.685 ns/op 0.99
nodejs block root to RootHex using toRootHex 57.743 ns/op 52.270 ns/op 1.10
nodejs fromHex(blob) 770.31 us/op 717.21 us/op 1.07
nodejs fromHexInto(blob) 663.58 us/op 627.22 us/op 1.06
nodejs block root to RootHex using the deprecated toHexString 535.99 ns/op 471.37 ns/op 1.14
nodejs byteArrayEquals 32 bytes (block root) 26.326 ns/op 26.173 ns/op 1.01
nodejs byteArrayEquals 48 bytes (pubkey) 37.886 ns/op 37.937 ns/op 1.00
nodejs byteArrayEquals 96 bytes (signature) 38.211 ns/op 35.574 ns/op 1.07
nodejs byteArrayEquals 1024 bytes 44.481 ns/op 41.882 ns/op 1.06
nodejs byteArrayEquals 131072 bytes (blob) 1.7859 us/op 1.7834 us/op 1.00
browser block root to RootHex using toHex 147.60 ns/op 144.84 ns/op 1.02
browser block root to RootHex using toRootHex 131.85 ns/op 131.76 ns/op 1.00
browser fromHex(blob) 1.5770 ms/op 1.4930 ms/op 1.06
browser fromHexInto(blob) 664.49 us/op 623.53 us/op 1.07
browser block root to RootHex using the deprecated toHexString 370.56 ns/op 326.64 ns/op 1.13
browser byteArrayEquals 32 bytes (block root) 28.245 ns/op 28.100 ns/op 1.01
browser byteArrayEquals 48 bytes (pubkey) 40.114 ns/op 39.536 ns/op 1.01
browser byteArrayEquals 96 bytes (signature) 75.092 ns/op 74.514 ns/op 1.01
browser byteArrayEquals 1024 bytes 760.37 ns/op 750.10 ns/op 1.01
browser byteArrayEquals 131072 bytes (blob) 96.525 us/op 94.114 us/op 1.03

by benchmarkbot/action

@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, I am fine with merging that as is, functionally, it should achieve what we want

parentBlock.executionPayloadBlockHash,
parentBlockRootHex
);
const isBuildingOnFull = chain.forkChoice.shouldBuildOnFull(parentBlock, slot);

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.

have you looked into deduplicating the shouldBuildOnFull call? now we call it twice, this might require more refactoring though, but ideally we just wanna call it once

parentBlockRootHex
);
const isBuildingOnFull = chain.forkChoice.shouldBuildOnFull(parentBlock, slot);
const bidParentBlockHash = isBuildingOnFull ? parentBlock.executionPayloadBlockHash : parentBlock.parentBlockHash;

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 find our naming here confusing, why do we use parentBlockHash per spec, but also executionPayloadBlockHash instead of blockHash?

we can choose either, but would be good if we can be consistent, or is there a good reason for this?

@nflaig

nflaig commented Jun 2, 2026

Copy link
Copy Markdown
Member

going to merge this, we can look into further refactoring separately

@nflaig
nflaig merged commit d0a9d4a into unstable Jun 2, 2026
18 of 20 checks passed
@nflaig
nflaig deleted the nc/builder-bid-reorg-gate branch June 2, 2026 08:57
@wemeetagain

Copy link
Copy Markdown
Member

🎉 This PR is included in v1.44.0 🎉

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.

3 participants