这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@nflaig
Copy link
Member

@nflaig nflaig commented Sep 10, 2025

Motivation

We currently print proposer boost reorg related logs Strong block detected ... during sync but it's not relevant there as shouldOverrideForkChoiceUpdate will never return true if block.slot < currentSlot.

There is also an edge we currently don't handle since we only run proposer reorg checks if block is received through gossip but in theory (although unlikely in practice) we can also receive the block via req/resp (close to 0% on mainnet).

Description

  • only run proposer boost reorg check if block.slot >= currentSlot
  • do not emit logs if no checks are run, eg. during sync there is no reason to emit logs
  • remove isGossipBlock flag to also check if receive block via req/resp, this also means we run the checks if receive block from api meaning we a previous proposer, we could additional check if we are previous proposer cache if we wanna handle that case explicitly

@nflaig nflaig marked this pull request as ready for review September 10, 2025 11:25
@nflaig nflaig requested a review from a team as a code owner September 10, 2025 11:25
@codecov
Copy link

codecov bot commented Sep 10, 2025

Codecov Report

❌ Patch coverage is 0% with 19 lines in your changes missing coverage. Please review.
✅ Project coverage is 54.09%. Comparing base (4a37a4b) to head (af85244).
⚠️ Report is 12 commits behind head on unstable.

Additional details and impacted files
@@            Coverage Diff            @@
##           unstable    #8363   +/-   ##
=========================================
  Coverage     54.09%   54.09%           
=========================================
  Files           850      850           
  Lines         64193    64194    +1     
  Branches       4855     4853    -2     
=========================================
+ Hits          34723    34725    +2     
+ Misses        29393    29392    -1     
  Partials         77       77           
🚀 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.

@github-actions
Copy link
Contributor

github-actions bot commented Sep 10, 2025

Performance Report

🚀🚀 Significant benchmark improvement detected

Benchmark suite Current: 4198b05 Previous: 1ec12b4 Ratio
getPubkeys - validatorsArr - req 1000 vs - 250000 vc 30.546 us/op 117.18 us/op 0.26
BLS aggregatePubkeys 32 - blst 17.804 us/op 55.723 us/op 0.32
notSeenSlots=1 numMissedVotes=1 numBadVotes=10 41.038 ms/op 139.43 ms/op 0.29
prioritizePeers score 0:0 att 32-0.25 sync 2-0.25 234.15 us/op 718.68 us/op 0.33
Uint8Array.set - without subarray 995.00 ns/op 3.0130 us/op 0.33
OrderedSet add up to 64 items then delete last 3.1512 us/op 10.274 us/op 0.31
Set add up to 64 items then delete middle 2.0776 us/op 6.9060 us/op 0.30
pass gossip attestations to forkchoice per slot 2.4631 ms/op 10.558 ms/op 0.23
forkChoice updateHead vc 100000 bc 64 eq 0 361.46 us/op 1.5493 ms/op 0.23
forkChoice updateHead vc 600000 bc 64 eq 0 2.3675 ms/op 13.300 ms/op 0.18
forkChoice updateHead vc 1000000 bc 64 eq 0 4.0159 ms/op 15.514 ms/op 0.26
forkChoice updateHead vc 600000 bc 320 eq 0 2.3198 ms/op 8.2033 ms/op 0.28
forkChoice updateHead vc 600000 bc 1200 eq 0 2.4110 ms/op 10.842 ms/op 0.22
forkChoice updateHead vc 600000 bc 7200 eq 0 2.6289 ms/op 14.507 ms/op 0.18
forkChoice updateHead vc 600000 bc 64 eq 1000 9.3799 ms/op 40.192 ms/op 0.23
forkChoice updateHead vc 600000 bc 64 eq 10000 9.4447 ms/op 32.113 ms/op 0.29
forkChoice updateHead vc 600000 bc 64 eq 300000 12.146 ms/op 55.674 ms/op 0.22
computeDeltas 500000 validators 300 proto nodes 3.1915 ms/op 13.974 ms/op 0.23
altair processAttestation - setStatus - 2/3 committees join 387.39 us/op 1.2272 ms/op 0.32
phase0 processBlock - 250000 vs - 7PWei normalcase 1.2406 ms/op 4.5019 ms/op 0.28
byteArrayEquals 16384 - diff last byte 19.568 us/op 60.030 us/op 0.33
Buffer.compare 123687377 - random bytes 17.720 ns/op 59.290 ns/op 0.30
regular array get 100000 times 29.722 us/op 94.402 us/op 0.31
processSlot - 1 slots 8.6680 us/op 35.701 us/op 0.24
findModifiedValidators - 1 modified validators 144.72 ms/op 437.80 ms/op 0.33
findModifiedValidators - no difference 133.07 ms/op 452.50 ms/op 0.29
state getBlockRootAtSlot - 250000 vs - 7PWei 426.66 ns/op 1.4217 us/op 0.30
computeProposerIndex 100000 validators 1.3396 ms/op 5.3863 ms/op 0.25
naiveGetNextSyncCommitteeIndices 1000 validators 6.5450 s/op 26.900 s/op 0.24
getNextSyncCommitteeIndices 1000 validators 98.903 ms/op 370.15 ms/op 0.27
naiveGetNextSyncCommitteeIndices 10000 validators 7.4566 s/op 30.301 s/op 0.25
getNextSyncCommitteeIndices 10000 validators 103.81 ms/op 549.81 ms/op 0.19
naiveGetNextSyncCommitteeIndices 100000 validators 7.5817 s/op 29.969 s/op 0.25
getNextSyncCommitteeIndices 100000 validators 103.30 ms/op 528.62 ms/op 0.20
naive computeShuffledIndex 100000 validators 20.225 s/op 81.869 s/op 0.25
cached computeShuffledIndex 100000 validators 466.19 ms/op 2.2012 s/op 0.21
cached computeShuffledIndex 2000000 validators 29.010 s/op 129.78 s/op 0.22
computeProposers - vc 250000 526.99 us/op 3.0237 ms/op 0.17
computeEpochShuffling - vc 250000 36.543 ms/op 188.05 ms/op 0.19
getNextSyncCommittee - vc 250000 8.9122 ms/op 48.187 ms/op 0.18
computeSigningRoot for AttestationData 15.174 us/op 96.990 us/op 0.16
hash AttestationData serialized data then Buffer.toString(base64) 1.1849 us/op 5.6607 us/op 0.21
toHexString serialized data 948.85 ns/op 6.1453 us/op 0.15
Buffer.toString(base64) 105.57 ns/op 596.85 ns/op 0.18
nodejs block root to RootHex using toHex 108.92 ns/op 550.96 ns/op 0.20
nodejs block root to RootHex using toRootHex 77.463 ns/op 381.36 ns/op 0.20
nodejs fromhex(blob) 85.844 ms/op 398.95 ms/op 0.22
browser block root to RootHex using the deprecated toHexString 189.48 ns/op 2.1213 us/op 0.09
browser block root to RootHex using toHex 157.04 ns/op 1.6882 us/op 0.09
browser block root to RootHex using toRootHex 149.23 ns/op 515.20 ns/op 0.29
browser fromHexInto(blob) 709.87 us/op 3.2107 ms/op 0.22
browser fromHex(blob) 698.31 ms/op 2.7710 s/op 0.25
Full benchmark results
Benchmark suite Current: 4198b05 Previous: 1ec12b4 Ratio
getPubkeys - index2pubkey - req 1000 vs - 250000 vc 746.19 us/op 2.0840 ms/op 0.36
getPubkeys - validatorsArr - req 1000 vs - 250000 vc 30.546 us/op 117.18 us/op 0.26
BLS verify - blst 881.14 us/op 1.9313 ms/op 0.46
BLS verifyMultipleSignatures 3 - blst 1.2756 ms/op 2.4956 ms/op 0.51
BLS verifyMultipleSignatures 8 - blst 2.0437 ms/op 2.9539 ms/op 0.69
BLS verifyMultipleSignatures 32 - blst 4.4520 ms/op 9.0772 ms/op 0.49
BLS verifyMultipleSignatures 64 - blst 8.2130 ms/op 17.969 ms/op 0.46
BLS verifyMultipleSignatures 128 - blst 15.733 ms/op 22.839 ms/op 0.69
BLS deserializing 10000 signatures 614.12 ms/op 1.4507 s/op 0.42
BLS deserializing 100000 signatures 6.3375 s/op 9.8630 s/op 0.64
BLS verifyMultipleSignatures - same message - 3 - blst 973.13 us/op 1.3266 ms/op 0.73
BLS verifyMultipleSignatures - same message - 8 - blst 1.1153 ms/op 1.2137 ms/op 0.92
BLS verifyMultipleSignatures - same message - 32 - blst 1.7162 ms/op 2.2515 ms/op 0.76
BLS verifyMultipleSignatures - same message - 64 - blst 2.4846 ms/op 3.4739 ms/op 0.72
BLS verifyMultipleSignatures - same message - 128 - blst 4.2520 ms/op 6.7222 ms/op 0.63
BLS aggregatePubkeys 32 - blst 17.804 us/op 55.723 us/op 0.32
BLS aggregatePubkeys 128 - blst 63.079 us/op 182.34 us/op 0.35
notSeenSlots=1 numMissedVotes=1 numBadVotes=10 41.038 ms/op 139.43 ms/op 0.29
notSeenSlots=1 numMissedVotes=0 numBadVotes=4 45.659 ms/op 79.105 ms/op 0.58
notSeenSlots=2 numMissedVotes=1 numBadVotes=10 36.410 ms/op 86.449 ms/op 0.42
getSlashingsAndExits - default max 51.194 us/op 116.31 us/op 0.44
getSlashingsAndExits - 2k 295.33 us/op 471.97 us/op 0.63
proposeBlockBody type=full, size=empty 5.2984 ms/op 9.7614 ms/op 0.54
isKnown best case - 1 super set check 417.00 ns/op 390.00 ns/op 1.07
isKnown normal case - 2 super set checks 413.00 ns/op 332.00 ns/op 1.24
isKnown worse case - 16 super set checks 411.00 ns/op 424.00 ns/op 0.97
InMemoryCheckpointStateCache - add get delete 2.6020 us/op 3.0160 us/op 0.86
validate api signedAggregateAndProof - struct 1.3525 ms/op 1.7532 ms/op 0.77
validate gossip signedAggregateAndProof - struct 1.4876 ms/op 2.8649 ms/op 0.52
batch validate gossip attestation - vc 640000 - chunk 32 109.92 us/op 248.22 us/op 0.44
batch validate gossip attestation - vc 640000 - chunk 64 94.829 us/op 186.41 us/op 0.51
batch validate gossip attestation - vc 640000 - chunk 128 88.435 us/op 196.72 us/op 0.45
batch validate gossip attestation - vc 640000 - chunk 256 90.198 us/op 139.06 us/op 0.65
pickEth1Vote - no votes 733.36 us/op 1.5431 ms/op 0.48
pickEth1Vote - max votes 5.1131 ms/op 7.9086 ms/op 0.65
pickEth1Vote - Eth1Data hashTreeRoot value x2048 9.2832 ms/op 16.232 ms/op 0.57
pickEth1Vote - Eth1Data hashTreeRoot tree x2048 15.160 ms/op 24.246 ms/op 0.63
pickEth1Vote - Eth1Data fastSerialize value x2048 337.36 us/op 736.40 us/op 0.46
pickEth1Vote - Eth1Data fastSerialize tree x2048 1.7928 ms/op 3.5027 ms/op 0.51
bytes32 toHexString 508.00 ns/op 609.00 ns/op 0.83
bytes32 Buffer.toString(hex) 409.00 ns/op 381.00 ns/op 1.07
bytes32 Buffer.toString(hex) from Uint8Array 490.00 ns/op 547.00 ns/op 0.90
bytes32 Buffer.toString(hex) + 0x 416.00 ns/op 353.00 ns/op 1.18
Object access 1 prop 0.30600 ns/op 0.17300 ns/op 1.77
Map access 1 prop 0.31000 ns/op 0.17700 ns/op 1.75
Object get x1000 4.8380 ns/op 8.9490 ns/op 0.54
Map get x1000 5.3680 ns/op 9.0720 ns/op 0.59
Object set x1000 20.925 ns/op 40.473 ns/op 0.52
Map set x1000 17.172 ns/op 27.876 ns/op 0.62
Return object 10000 times 0.28460 ns/op 0.45090 ns/op 0.63
Throw Error 10000 times 3.5400 us/op 6.6465 us/op 0.53
toHex 91.212 ns/op 198.21 ns/op 0.46
Buffer.from 87.578 ns/op 159.67 ns/op 0.55
shared Buffer 60.548 ns/op 107.84 ns/op 0.56
fastMsgIdFn sha256 / 200 bytes 1.8690 us/op 3.2340 us/op 0.58
fastMsgIdFn h32 xxhash / 200 bytes 375.00 ns/op 296.00 ns/op 1.27
fastMsgIdFn h64 xxhash / 200 bytes 423.00 ns/op 379.00 ns/op 1.12
fastMsgIdFn sha256 / 1000 bytes 5.8110 us/op 10.119 us/op 0.57
fastMsgIdFn h32 xxhash / 1000 bytes 517.00 ns/op 454.00 ns/op 1.14
fastMsgIdFn h64 xxhash / 1000 bytes 515.00 ns/op 507.00 ns/op 1.02
fastMsgIdFn sha256 / 10000 bytes 49.305 us/op 86.528 us/op 0.57
fastMsgIdFn h32 xxhash / 10000 bytes 1.9000 us/op 2.6630 us/op 0.71
fastMsgIdFn h64 xxhash / 10000 bytes 1.3330 us/op 1.5360 us/op 0.87
send data - 1000 256B messages 16.196 ms/op 21.762 ms/op 0.74
send data - 1000 512B messages 18.198 ms/op 27.486 ms/op 0.66
send data - 1000 1024B messages 24.182 ms/op 34.695 ms/op 0.70
send data - 1000 1200B messages 20.135 ms/op 37.380 ms/op 0.54
send data - 1000 2048B messages 17.006 ms/op 33.282 ms/op 0.51
send data - 1000 4096B messages 17.444 ms/op 40.564 ms/op 0.43
send data - 1000 16384B messages 26.984 ms/op 74.246 ms/op 0.36
send data - 1000 65536B messages 81.225 ms/op 174.20 ms/op 0.47
enrSubnets - fastDeserialize 64 bits 1.0220 us/op 2.0420 us/op 0.50
enrSubnets - ssz BitVector 64 bits 514.00 ns/op 621.00 ns/op 0.83
enrSubnets - fastDeserialize 4 bits 328.00 ns/op 294.00 ns/op 1.12
enrSubnets - ssz BitVector 4 bits 512.00 ns/op 717.00 ns/op 0.71
prioritizePeers score -10:0 att 32-0.1 sync 2-0 198.77 us/op 379.46 us/op 0.52
prioritizePeers score 0:0 att 32-0.25 sync 2-0.25 234.15 us/op 718.68 us/op 0.33
prioritizePeers score 0:0 att 32-0.5 sync 2-0.5 373.17 us/op 841.38 us/op 0.44
prioritizePeers score 0:0 att 64-0.75 sync 4-0.75 664.41 us/op 1.3480 ms/op 0.49
prioritizePeers score 0:0 att 64-1 sync 4-1 787.26 us/op 1.3534 ms/op 0.58
array of 16000 items push then shift 1.2355 us/op 3.9531 us/op 0.31
LinkedList of 16000 items push then shift 7.9500 ns/op 14.568 ns/op 0.55
array of 16000 items push then pop 69.162 ns/op 157.16 ns/op 0.44
LinkedList of 16000 items push then pop 6.3610 ns/op 17.297 ns/op 0.37
array of 24000 items push then shift 1.8393 us/op 3.5702 us/op 0.52
LinkedList of 24000 items push then shift 7.4160 ns/op 14.357 ns/op 0.52
array of 24000 items push then pop 97.165 ns/op 188.26 ns/op 0.52
LinkedList of 24000 items push then pop 6.2420 ns/op 8.3220 ns/op 0.75
intersect bitArray bitLen 8 5.2090 ns/op 8.0500 ns/op 0.65
intersect array and set length 8 33.233 ns/op 48.341 ns/op 0.69
intersect bitArray bitLen 128 25.712 ns/op 37.988 ns/op 0.68
intersect array and set length 128 529.06 ns/op 802.90 ns/op 0.66
bitArray.getTrueBitIndexes() bitLen 128 1.2080 us/op 1.6430 us/op 0.74
bitArray.getTrueBitIndexes() bitLen 248 1.9310 us/op 2.9220 us/op 0.66
bitArray.getTrueBitIndexes() bitLen 512 3.7950 us/op 5.3440 us/op 0.71
Buffer.concat 32 items 768.00 ns/op 1.4720 us/op 0.52
Uint8Array.set 32 items 989.00 ns/op 1.2740 us/op 0.78
Buffer.copy 1.9690 us/op 3.4360 us/op 0.57
Uint8Array.set - with subarray 1.8110 us/op 3.2860 us/op 0.55
Uint8Array.set - without subarray 995.00 ns/op 3.0130 us/op 0.33
getUint32 - dataview 389.00 ns/op 420.00 ns/op 0.93
getUint32 - manual 320.00 ns/op 245.00 ns/op 1.31
Set add up to 64 items then delete first 1.8434 us/op 4.1761 us/op 0.44
OrderedSet add up to 64 items then delete first 2.8521 us/op 7.4711 us/op 0.38
Set add up to 64 items then delete last 2.0923 us/op 3.5592 us/op 0.59
OrderedSet add up to 64 items then delete last 3.1512 us/op 10.274 us/op 0.31
Set add up to 64 items then delete middle 2.0776 us/op 6.9060 us/op 0.30
OrderedSet add up to 64 items then delete middle 4.5834 us/op 11.379 us/op 0.40
Set add up to 128 items then delete first 4.1107 us/op 9.3534 us/op 0.44
OrderedSet add up to 128 items then delete first 6.5948 us/op 14.462 us/op 0.46
Set add up to 128 items then delete last 5.1481 us/op 9.3887 us/op 0.55
OrderedSet add up to 128 items then delete last 6.1966 us/op 15.770 us/op 0.39
Set add up to 128 items then delete middle 4.4669 us/op 9.4966 us/op 0.47
OrderedSet add up to 128 items then delete middle 13.198 us/op 23.600 us/op 0.56
Set add up to 256 items then delete first 8.2296 us/op 17.361 us/op 0.47
OrderedSet add up to 256 items then delete first 12.994 us/op 28.526 us/op 0.46
Set add up to 256 items then delete last 8.0335 us/op 21.805 us/op 0.37
OrderedSet add up to 256 items then delete last 12.280 us/op 29.910 us/op 0.41
Set add up to 256 items then delete middle 7.9157 us/op 20.893 us/op 0.38
OrderedSet add up to 256 items then delete middle 35.278 us/op 102.05 us/op 0.35
transfer serialized Status (84 B) 1.9250 us/op 3.8930 us/op 0.49
copy serialized Status (84 B) 1.1830 us/op 2.3280 us/op 0.51
transfer serialized SignedVoluntaryExit (112 B) 1.9580 us/op 4.5020 us/op 0.43
copy serialized SignedVoluntaryExit (112 B) 1.1820 us/op 2.8130 us/op 0.42
transfer serialized ProposerSlashing (416 B) 1.9760 us/op 7.3690 us/op 0.27
copy serialized ProposerSlashing (416 B) 1.2210 us/op 4.4020 us/op 0.28
transfer serialized Attestation (485 B) 2.0270 us/op 7.1250 us/op 0.28
copy serialized Attestation (485 B) 1.2310 us/op 3.1400 us/op 0.39
transfer serialized AttesterSlashing (33232 B) 2.0160 us/op 4.3130 us/op 0.47
copy serialized AttesterSlashing (33232 B) 2.7350 us/op 5.9270 us/op 0.46
transfer serialized Small SignedBeaconBlock (128000 B) 2.0520 us/op 4.2340 us/op 0.48
copy serialized Small SignedBeaconBlock (128000 B) 6.2860 us/op 15.713 us/op 0.40
transfer serialized Avg SignedBeaconBlock (200000 B) 2.1240 us/op 4.9390 us/op 0.43
copy serialized Avg SignedBeaconBlock (200000 B) 9.7490 us/op 23.339 us/op 0.42
transfer serialized BlobsSidecar (524380 B) 2.9120 us/op 5.4390 us/op 0.54
copy serialized BlobsSidecar (524380 B) 68.405 us/op 85.260 us/op 0.80
transfer serialized Big SignedBeaconBlock (1000000 B) 3.6820 us/op 11.810 us/op 0.31
copy serialized Big SignedBeaconBlock (1000000 B) 193.07 us/op 223.03 us/op 0.87
pass gossip attestations to forkchoice per slot 2.4631 ms/op 10.558 ms/op 0.23
forkChoice updateHead vc 100000 bc 64 eq 0 361.46 us/op 1.5493 ms/op 0.23
forkChoice updateHead vc 600000 bc 64 eq 0 2.3675 ms/op 13.300 ms/op 0.18
forkChoice updateHead vc 1000000 bc 64 eq 0 4.0159 ms/op 15.514 ms/op 0.26
forkChoice updateHead vc 600000 bc 320 eq 0 2.3198 ms/op 8.2033 ms/op 0.28
forkChoice updateHead vc 600000 bc 1200 eq 0 2.4110 ms/op 10.842 ms/op 0.22
forkChoice updateHead vc 600000 bc 7200 eq 0 2.6289 ms/op 14.507 ms/op 0.18
forkChoice updateHead vc 600000 bc 64 eq 1000 9.3799 ms/op 40.192 ms/op 0.23
forkChoice updateHead vc 600000 bc 64 eq 10000 9.4447 ms/op 32.113 ms/op 0.29
forkChoice updateHead vc 600000 bc 64 eq 300000 12.146 ms/op 55.674 ms/op 0.22
computeDeltas 500000 validators 300 proto nodes 3.1915 ms/op 13.974 ms/op 0.23
computeDeltas 500000 validators 1200 proto nodes 3.2518 ms/op 8.2652 ms/op 0.39
computeDeltas 500000 validators 7200 proto nodes 3.1678 ms/op 8.0228 ms/op 0.39
computeDeltas 750000 validators 300 proto nodes 4.8912 ms/op 10.032 ms/op 0.49
computeDeltas 750000 validators 1200 proto nodes 4.8819 ms/op 9.9619 ms/op 0.49
computeDeltas 750000 validators 7200 proto nodes 4.8674 ms/op 9.3073 ms/op 0.52
computeDeltas 1400000 validators 300 proto nodes 9.3193 ms/op 20.821 ms/op 0.45
computeDeltas 1400000 validators 1200 proto nodes 9.3073 ms/op 23.113 ms/op 0.40
computeDeltas 1400000 validators 7200 proto nodes 9.4331 ms/op 24.675 ms/op 0.38
computeDeltas 2100000 validators 300 proto nodes 15.731 ms/op 21.019 ms/op 0.75
computeDeltas 2100000 validators 1200 proto nodes 15.903 ms/op 20.374 ms/op 0.78
computeDeltas 2100000 validators 7200 proto nodes 14.309 ms/op 33.521 ms/op 0.43
altair processAttestation - 250000 vs - 7PWei normalcase 1.7842 ms/op 3.0719 ms/op 0.58
altair processAttestation - 250000 vs - 7PWei worstcase 2.4734 ms/op 5.0377 ms/op 0.49
altair processAttestation - setStatus - 1/6 committees join 97.887 us/op 240.48 us/op 0.41
altair processAttestation - setStatus - 1/3 committees join 204.47 us/op 291.19 us/op 0.70
altair processAttestation - setStatus - 1/2 committees join 300.07 us/op 500.92 us/op 0.60
altair processAttestation - setStatus - 2/3 committees join 387.39 us/op 1.2272 ms/op 0.32
altair processAttestation - setStatus - 4/5 committees join 510.92 us/op 938.42 us/op 0.54
altair processAttestation - setStatus - 100% committees join 599.77 us/op 989.57 us/op 0.61
altair processBlock - 250000 vs - 7PWei normalcase 6.5755 ms/op 6.8545 ms/op 0.96
altair processBlock - 250000 vs - 7PWei normalcase hashState 26.293 ms/op 34.954 ms/op 0.75
altair processBlock - 250000 vs - 7PWei worstcase 28.165 ms/op 45.293 ms/op 0.62
altair processBlock - 250000 vs - 7PWei worstcase hashState 55.249 ms/op 135.95 ms/op 0.41
phase0 processBlock - 250000 vs - 7PWei normalcase 1.2406 ms/op 4.5019 ms/op 0.28
phase0 processBlock - 250000 vs - 7PWei worstcase 23.735 ms/op 28.081 ms/op 0.85
altair processEth1Data - 250000 vs - 7PWei normalcase 278.60 us/op 510.69 us/op 0.55
getExpectedWithdrawals 250000 eb:1,eth1:1,we:0,wn:0,smpl:15 6.3300 us/op 7.5900 us/op 0.83
getExpectedWithdrawals 250000 eb:0.95,eth1:0.1,we:0.05,wn:0,smpl:219 36.211 us/op 36.015 us/op 1.01
getExpectedWithdrawals 250000 eb:0.95,eth1:0.3,we:0.05,wn:0,smpl:42 10.714 us/op 12.613 us/op 0.85
getExpectedWithdrawals 250000 eb:0.95,eth1:0.7,we:0.05,wn:0,smpl:18 5.9610 us/op 7.7460 us/op 0.77
getExpectedWithdrawals 250000 eb:0.1,eth1:0.1,we:0,wn:0,smpl:1020 163.72 us/op 177.31 us/op 0.92
getExpectedWithdrawals 250000 eb:0.03,eth1:0.03,we:0,wn:0,smpl:11777 1.4956 ms/op 2.3550 ms/op 0.64
getExpectedWithdrawals 250000 eb:0.01,eth1:0.01,we:0,wn:0,smpl:16384 1.9150 ms/op 3.0071 ms/op 0.64
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,smpl:16384 1.9310 ms/op 3.2560 ms/op 0.59
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,nocache,smpl:16384 4.1117 ms/op 5.6657 ms/op 0.73
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,smpl:16384 1.9201 ms/op 3.1224 ms/op 0.61
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,nocache,smpl:16384 3.8934 ms/op 5.9392 ms/op 0.66
Tree 40 250000 create 355.26 ms/op 479.58 ms/op 0.74
Tree 40 250000 get(125000) 114.07 ns/op 162.88 ns/op 0.70
Tree 40 250000 set(125000) 1.2653 us/op 1.7590 us/op 0.72
Tree 40 250000 toArray() 18.557 ms/op 20.020 ms/op 0.93
Tree 40 250000 iterate all - toArray() + loop 10.397 ms/op 24.876 ms/op 0.42
Tree 40 250000 iterate all - get(i) 49.844 ms/op 94.110 ms/op 0.53
Array 250000 create 1.9919 ms/op 4.7540 ms/op 0.42
Array 250000 clone - spread 653.34 us/op 2.9045 ms/op 0.22
Array 250000 get(125000) 0.58500 ns/op 0.73600 ns/op 0.79
Array 250000 set(125000) 0.59800 ns/op 0.96500 ns/op 0.62
Array 250000 iterate all - loop 77.851 us/op 220.16 us/op 0.35
phase0 afterProcessEpoch - 250000 vs - 7PWei 38.232 ms/op 60.121 ms/op 0.64
Array.fill - length 1000000 2.7316 ms/op 4.4959 ms/op 0.61
Array push - length 1000000 10.452 ms/op 21.636 ms/op 0.48
Array.get 0.26867 ns/op 0.36164 ns/op 0.74
Uint8Array.get 0.34757 ns/op 0.64462 ns/op 0.54
phase0 beforeProcessEpoch - 250000 vs - 7PWei 14.768 ms/op 25.102 ms/op 0.59
altair processEpoch - mainnet_e81889 256.10 ms/op 472.36 ms/op 0.54
mainnet_e81889 - altair beforeProcessEpoch 17.209 ms/op 34.054 ms/op 0.51
mainnet_e81889 - altair processJustificationAndFinalization 5.0250 us/op 9.6570 us/op 0.52
mainnet_e81889 - altair processInactivityUpdates 5.0351 ms/op 6.3171 ms/op 0.80
mainnet_e81889 - altair processRewardsAndPenalties 46.833 ms/op 41.128 ms/op 1.14
mainnet_e81889 - altair processRegistryUpdates 1.1200 us/op 1.1910 us/op 0.94
mainnet_e81889 - altair processSlashings 446.00 ns/op 290.00 ns/op 1.54
mainnet_e81889 - altair processEth1DataReset 407.00 ns/op 293.00 ns/op 1.39
mainnet_e81889 - altair processEffectiveBalanceUpdates 1.0264 ms/op 2.4382 ms/op 0.42
mainnet_e81889 - altair processSlashingsReset 1.1600 us/op 1.5880 us/op 0.73
mainnet_e81889 - altair processRandaoMixesReset 1.4750 us/op 1.4570 us/op 1.01
mainnet_e81889 - altair processHistoricalRootsUpdate 420.00 ns/op 288.00 ns/op 1.46
mainnet_e81889 - altair processParticipationFlagUpdates 853.00 ns/op 823.00 ns/op 1.04
mainnet_e81889 - altair processSyncCommitteeUpdates 374.00 ns/op 174.00 ns/op 2.15
mainnet_e81889 - altair afterProcessEpoch 42.677 ms/op 49.921 ms/op 0.85
capella processEpoch - mainnet_e217614 969.58 ms/op 1.4895 s/op 0.65
mainnet_e217614 - capella beforeProcessEpoch 62.524 ms/op 116.86 ms/op 0.54
mainnet_e217614 - capella processJustificationAndFinalization 5.6520 us/op 9.3180 us/op 0.61
mainnet_e217614 - capella processInactivityUpdates 12.485 ms/op 27.274 ms/op 0.46
mainnet_e217614 - capella processRewardsAndPenalties 181.08 ms/op 221.71 ms/op 0.82
mainnet_e217614 - capella processRegistryUpdates 6.7280 us/op 8.1360 us/op 0.83
mainnet_e217614 - capella processSlashings 470.00 ns/op 225.00 ns/op 2.09
mainnet_e217614 - capella processEth1DataReset 412.00 ns/op 220.00 ns/op 1.87
mainnet_e217614 - capella processEffectiveBalanceUpdates 3.5659 ms/op 5.3824 ms/op 0.66
mainnet_e217614 - capella processSlashingsReset 1.0520 us/op 1.1060 us/op 0.95
mainnet_e217614 - capella processRandaoMixesReset 1.5590 us/op 1.5210 us/op 1.02
mainnet_e217614 - capella processHistoricalRootsUpdate 415.00 ns/op 269.00 ns/op 1.54
mainnet_e217614 - capella processParticipationFlagUpdates 724.00 ns/op 665.00 ns/op 1.09
mainnet_e217614 - capella afterProcessEpoch 111.38 ms/op 146.42 ms/op 0.76
phase0 processEpoch - mainnet_e58758 316.85 ms/op 342.58 ms/op 0.92
mainnet_e58758 - phase0 beforeProcessEpoch 87.168 ms/op 86.365 ms/op 1.01
mainnet_e58758 - phase0 processJustificationAndFinalization 6.6610 us/op 7.2350 us/op 0.92
mainnet_e58758 - phase0 processRewardsAndPenalties 44.417 ms/op 40.822 ms/op 1.09
mainnet_e58758 - phase0 processRegistryUpdates 3.3300 us/op 3.6580 us/op 0.91
mainnet_e58758 - phase0 processSlashings 405.00 ns/op 215.00 ns/op 1.88
mainnet_e58758 - phase0 processEth1DataReset 422.00 ns/op 213.00 ns/op 1.98
mainnet_e58758 - phase0 processEffectiveBalanceUpdates 971.29 us/op 1.4742 ms/op 0.66
mainnet_e58758 - phase0 processSlashingsReset 1.1830 us/op 1.1020 us/op 1.07
mainnet_e58758 - phase0 processRandaoMixesReset 1.4040 us/op 1.4200 us/op 0.99
mainnet_e58758 - phase0 processHistoricalRootsUpdate 421.00 ns/op 218.00 ns/op 1.93
mainnet_e58758 - phase0 processParticipationRecordUpdates 1.4770 us/op 1.0970 us/op 1.35
mainnet_e58758 - phase0 afterProcessEpoch 32.326 ms/op 43.469 ms/op 0.74
phase0 processEffectiveBalanceUpdates - 250000 normalcase 985.53 us/op 1.5553 ms/op 0.63
phase0 processEffectiveBalanceUpdates - 250000 worstcase 0.5 5.4824 ms/op 2.5777 ms/op 2.13
altair processInactivityUpdates - 250000 normalcase 17.690 ms/op 21.478 ms/op 0.82
altair processInactivityUpdates - 250000 worstcase 17.751 ms/op 19.953 ms/op 0.89
phase0 processRegistryUpdates - 250000 normalcase 5.9900 us/op 7.4980 us/op 0.80
phase0 processRegistryUpdates - 250000 badcase_full_deposits 318.36 us/op 243.99 us/op 1.30
phase0 processRegistryUpdates - 250000 worstcase 0.5 102.56 ms/op 114.77 ms/op 0.89
altair processRewardsAndPenalties - 250000 normalcase 27.694 ms/op 32.774 ms/op 0.84
altair processRewardsAndPenalties - 250000 worstcase 22.941 ms/op 31.225 ms/op 0.73
phase0 getAttestationDeltas - 250000 normalcase 6.4079 ms/op 10.368 ms/op 0.62
phase0 getAttestationDeltas - 250000 worstcase 4.9440 ms/op 8.5977 ms/op 0.58
phase0 processSlashings - 250000 worstcase 80.683 us/op 90.955 us/op 0.89
altair processSyncCommitteeUpdates - 250000 10.382 ms/op 16.163 ms/op 0.64
BeaconState.hashTreeRoot - No change 447.00 ns/op 299.00 ns/op 1.49
BeaconState.hashTreeRoot - 1 full validator 75.663 us/op 101.69 us/op 0.74
BeaconState.hashTreeRoot - 32 full validator 1.0994 ms/op 1.1138 ms/op 0.99
BeaconState.hashTreeRoot - 512 full validator 11.634 ms/op 14.059 ms/op 0.83
BeaconState.hashTreeRoot - 1 validator.effectiveBalance 90.207 us/op 139.62 us/op 0.65
BeaconState.hashTreeRoot - 32 validator.effectiveBalance 1.6176 ms/op 2.8900 ms/op 0.56
BeaconState.hashTreeRoot - 512 validator.effectiveBalance 20.720 ms/op 37.151 ms/op 0.56
BeaconState.hashTreeRoot - 1 balances 59.614 us/op 129.42 us/op 0.46
BeaconState.hashTreeRoot - 32 balances 629.95 us/op 1.5114 ms/op 0.42
BeaconState.hashTreeRoot - 512 balances 7.3273 ms/op 12.650 ms/op 0.58
BeaconState.hashTreeRoot - 250000 balances 144.51 ms/op 233.41 ms/op 0.62
aggregationBits - 2048 els - zipIndexesInBitList 20.043 us/op 35.937 us/op 0.56
byteArrayEquals 32 47.339 ns/op 91.574 ns/op 0.52
Buffer.compare 32 14.993 ns/op 29.053 ns/op 0.52
byteArrayEquals 1024 1.2298 us/op 2.7082 us/op 0.45
Buffer.compare 1024 23.192 ns/op 51.465 ns/op 0.45
byteArrayEquals 16384 19.411 us/op 42.664 us/op 0.45
Buffer.compare 16384 169.52 ns/op 305.47 ns/op 0.55
byteArrayEquals 123687377 146.50 ms/op 392.46 ms/op 0.37
Buffer.compare 123687377 5.5104 ms/op 8.4492 ms/op 0.65
byteArrayEquals 32 - diff last byte 45.826 ns/op 125.69 ns/op 0.36
Buffer.compare 32 - diff last byte 15.231 ns/op 28.894 ns/op 0.53
byteArrayEquals 1024 - diff last byte 1.2325 us/op 3.4494 us/op 0.36
Buffer.compare 1024 - diff last byte 21.785 ns/op 54.919 ns/op 0.40
byteArrayEquals 16384 - diff last byte 19.568 us/op 60.030 us/op 0.33
Buffer.compare 16384 - diff last byte 162.52 ns/op 357.96 ns/op 0.45
byteArrayEquals 123687377 - diff last byte 148.67 ms/op 270.95 ms/op 0.55
Buffer.compare 123687377 - diff last byte 5.6739 ms/op 8.7928 ms/op 0.65
byteArrayEquals 32 - random bytes 4.6950 ns/op 10.625 ns/op 0.44
Buffer.compare 32 - random bytes 14.833 ns/op 22.657 ns/op 0.65
byteArrayEquals 1024 - random bytes 4.6540 ns/op 11.471 ns/op 0.41
Buffer.compare 1024 - random bytes 14.816 ns/op 29.033 ns/op 0.51
byteArrayEquals 16384 - random bytes 4.6480 ns/op 8.8170 ns/op 0.53
Buffer.compare 16384 - random bytes 14.693 ns/op 24.593 ns/op 0.60
byteArrayEquals 123687377 - random bytes 7.5200 ns/op 8.6000 ns/op 0.87
Buffer.compare 123687377 - random bytes 17.720 ns/op 59.290 ns/op 0.30
regular array get 100000 times 29.722 us/op 94.402 us/op 0.31
wrappedArray get 100000 times 29.708 us/op 86.716 us/op 0.34
arrayWithProxy get 100000 times 11.346 ms/op 29.148 ms/op 0.39
ssz.Root.equals 42.356 ns/op 139.24 ns/op 0.30
byteArrayEquals 40.460 ns/op 166.04 ns/op 0.24
Buffer.compare 8.5680 ns/op 39.979 ns/op 0.21
processSlot - 1 slots 8.6680 us/op 35.701 us/op 0.24
processSlot - 32 slots 1.6977 ms/op 2.3273 ms/op 0.73
getEffectiveBalanceIncrementsZeroInactive - 250000 vs - 7PWei 2.8015 ms/op 5.1598 ms/op 0.54
getCommitteeAssignments - req 1 vs - 250000 vc 1.7350 ms/op 3.7478 ms/op 0.46
getCommitteeAssignments - req 100 vs - 250000 vc 3.4197 ms/op 7.2880 ms/op 0.47
getCommitteeAssignments - req 1000 vs - 250000 vc 3.6406 ms/op 5.6277 ms/op 0.65
findModifiedValidators - 10000 modified validators 726.61 ms/op 1.3886 s/op 0.52
findModifiedValidators - 1000 modified validators 617.92 ms/op 775.06 ms/op 0.80
findModifiedValidators - 100 modified validators 258.08 ms/op 412.15 ms/op 0.63
findModifiedValidators - 10 modified validators 155.87 ms/op 364.25 ms/op 0.43
findModifiedValidators - 1 modified validators 144.72 ms/op 437.80 ms/op 0.33
findModifiedValidators - no difference 133.07 ms/op 452.50 ms/op 0.29
compare ViewDUs 6.2108 s/op 10.190 s/op 0.61
compare each validator Uint8Array 1.7208 s/op 2.6317 s/op 0.65
compare ViewDU to Uint8Array 782.51 ms/op 1.8487 s/op 0.42
migrate state 1000000 validators, 24 modified, 0 new 832.98 ms/op 1.4425 s/op 0.58
migrate state 1000000 validators, 1700 modified, 1000 new 1.0926 s/op 2.2406 s/op 0.49
migrate state 1000000 validators, 3400 modified, 2000 new 1.2930 s/op 2.6264 s/op 0.49
migrate state 1500000 validators, 24 modified, 0 new 853.32 ms/op 1.6735 s/op 0.51
migrate state 1500000 validators, 1700 modified, 1000 new 1.0858 s/op 2.6936 s/op 0.40
migrate state 1500000 validators, 3400 modified, 2000 new 1.4272 s/op 2.7181 s/op 0.53
RootCache.getBlockRootAtSlot - 250000 vs - 7PWei 6.0000 ns/op 8.3600 ns/op 0.72
state getBlockRootAtSlot - 250000 vs - 7PWei 426.66 ns/op 1.4217 us/op 0.30
naive computeProposerIndex 100000 validators 47.560 ms/op 142.66 ms/op 0.33
computeProposerIndex 100000 validators 1.3396 ms/op 5.3863 ms/op 0.25
naiveGetNextSyncCommitteeIndices 1000 validators 6.5450 s/op 26.900 s/op 0.24
getNextSyncCommitteeIndices 1000 validators 98.903 ms/op 370.15 ms/op 0.27
naiveGetNextSyncCommitteeIndices 10000 validators 7.4566 s/op 30.301 s/op 0.25
getNextSyncCommitteeIndices 10000 validators 103.81 ms/op 549.81 ms/op 0.19
naiveGetNextSyncCommitteeIndices 100000 validators 7.5817 s/op 29.969 s/op 0.25
getNextSyncCommitteeIndices 100000 validators 103.30 ms/op 528.62 ms/op 0.20
naive computeShuffledIndex 100000 validators 20.225 s/op 81.869 s/op 0.25
cached computeShuffledIndex 100000 validators 466.19 ms/op 2.2012 s/op 0.21
naive computeShuffledIndex 2000000 validators 417.83 s/op 1139.1 s/op 0.37
cached computeShuffledIndex 2000000 validators 29.010 s/op 129.78 s/op 0.22
computeProposers - vc 250000 526.99 us/op 3.0237 ms/op 0.17
computeEpochShuffling - vc 250000 36.543 ms/op 188.05 ms/op 0.19
getNextSyncCommittee - vc 250000 8.9122 ms/op 48.187 ms/op 0.18
computeSigningRoot for AttestationData 15.174 us/op 96.990 us/op 0.16
hash AttestationData serialized data then Buffer.toString(base64) 1.1849 us/op 5.6607 us/op 0.21
toHexString serialized data 948.85 ns/op 6.1453 us/op 0.15
Buffer.toString(base64) 105.57 ns/op 596.85 ns/op 0.18
nodejs block root to RootHex using toHex 108.92 ns/op 550.96 ns/op 0.20
nodejs block root to RootHex using toRootHex 77.463 ns/op 381.36 ns/op 0.20
nodejs fromhex(blob) 85.844 ms/op 398.95 ms/op 0.22
nodejs fromHexInto(blob) 82.485 ms/op 245.37 ms/op 0.34
browser block root to RootHex using the deprecated toHexString 189.48 ns/op 2.1213 us/op 0.09
browser block root to RootHex using toHex 157.04 ns/op 1.6882 us/op 0.09
browser block root to RootHex using toRootHex 149.23 ns/op 515.20 ns/op 0.29
browser fromHexInto(blob) 709.87 us/op 3.2107 ms/op 0.22
browser fromHex(blob) 698.31 ms/op 2.7710 s/op 0.25

by benchmarkbot/action

@nflaig
Copy link
Member Author

nflaig commented Sep 10, 2025

/gemini review

Copy link
Contributor

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

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 introduces several improvements to the proposer boost reorg logic. The changes correctly restrict the reorg checks to blocks with a slot greater than or equal to the current slot, which prevents irrelevant logs during sync. By removing the isGossipBlock flag, the logic is now correctly applied to blocks from all sources, including API and req/resp, which enhances correctness. The refactoring to use a single currentSlot variable throughout the importBlock function is a good improvement for consistency and robustness. Overall, the changes are well-implemented and improve the quality of the codebase.

Copy link
Contributor

@ensi321 ensi321 left a comment

Choose a reason for hiding this comment

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

lgtm

@ensi321 ensi321 merged commit 6953c24 into unstable Sep 11, 2025
20 of 21 checks passed
@ensi321 ensi321 deleted the nflaig/proposer-boost-reorg-logs branch September 11, 2025 21:14
@wemeetagain
Copy link
Member

🎉 This PR is included in v1.35.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.

4 participants