Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: proposer boost reorg #7428

Draft
wants to merge 10 commits into
base: unstable
Choose a base branch
from
Draft

fix: proposer boost reorg #7428

wants to merge 10 commits into from

Conversation

twoeths
Copy link
Contributor

@twoeths twoeths commented Feb 5, 2025

Motivation

Description

  • do not issue fcl right after importing a block
  • move/isolate the fcl call in a chain function
  • delay it in PrepareNextSlotScheduler instead
  • follow Lighthouse to do it 500ms before the next slot via FORK_CHOICE_LOOKAHEAD_FACTOR constant, this accounts for very late block

Closes #7235

@twoeths twoeths requested a review from a team as a code owner February 5, 2025 03:56
@twoeths
Copy link
Contributor Author

twoeths commented Feb 5, 2025

a summary of the issue:

  • block *32 came before 4s into the slot, call fcu() right away. Now EL saw *32 as head
  • block *33 came after 4s into the slot, call fcu() right away. Now EL saw *33 as head
  • 4s before slot *34, we call fcu() with the head of *32. EL ignores and return null payload id because it found that's the ancestor of its current head

how this fixes the issue by sending fcu call in order:

  • block *32 came before 4s into the slot
  • 500ms before slot *33, call fcu(). Now EL tracks block *32 as head
  • block *33 came after 4s into the slot, do not call fcu() right away
  • 4s before slot *34, we call fcu() to build the block on block *32, it should work fine
  • 500ms before slot *34, do not call fcu() again

so compared to the old flow, now we consistently call fcu() once per slot even when we're block proposer instead of 2

Copy link

codecov bot commented Feb 5, 2025

Codecov Report

Attention: Patch coverage is 0% with 1 line in your changes missing coverage. Please review.

Project coverage is 50.45%. Comparing base (9a2cf74) to head (596cda0).
Report is 2 commits behind head on unstable.

Additional details and impacted files
@@             Coverage Diff              @@
##           unstable    #7428      +/-   ##
============================================
- Coverage     50.46%   50.45%   -0.01%     
============================================
  Files           603      603              
  Lines         40655    40662       +7     
  Branches       2226     2226              
============================================
  Hits          20517    20517              
- Misses        20098    20105       +7     
  Partials         40       40              

Copy link
Contributor

github-actions bot commented Feb 5, 2025

Performance Report

🚀🚀 Significant benchmark improvement detected

Benchmark suite Current: cda6973 Previous: 94e41ed Ratio
cached computeShuffledIndex 2000000 validators 14.352 s/op 54.539 s/op 0.26
Full benchmark results
Benchmark suite Current: cda6973 Previous: 94e41ed Ratio
getPubkeys - index2pubkey - req 1000 vs - 250000 vc 757.90 us/op 1.0563 ms/op 0.72
getPubkeys - validatorsArr - req 1000 vs - 250000 vc 32.173 us/op 38.094 us/op 0.84
BLS verify - blst 902.55 us/op 1.0080 ms/op 0.90
BLS verifyMultipleSignatures 3 - blst 1.3132 ms/op 1.7303 ms/op 0.76
BLS verifyMultipleSignatures 8 - blst 2.0792 ms/op 2.0835 ms/op 1.00
BLS verifyMultipleSignatures 32 - blst 4.4340 ms/op 5.4135 ms/op 0.82
BLS verifyMultipleSignatures 64 - blst 8.2894 ms/op 10.609 ms/op 0.78
BLS verifyMultipleSignatures 128 - blst 15.686 ms/op 18.286 ms/op 0.86
BLS deserializing 10000 signatures 591.68 ms/op 712.96 ms/op 0.83
BLS deserializing 100000 signatures 5.9416 s/op 7.5063 s/op 0.79
BLS verifyMultipleSignatures - same message - 3 - blst 934.01 us/op 1.0077 ms/op 0.93
BLS verifyMultipleSignatures - same message - 8 - blst 1.0605 ms/op 1.3832 ms/op 0.77
BLS verifyMultipleSignatures - same message - 32 - blst 1.5995 ms/op 1.8514 ms/op 0.86
BLS verifyMultipleSignatures - same message - 64 - blst 2.4181 ms/op 2.8509 ms/op 0.85
BLS verifyMultipleSignatures - same message - 128 - blst 3.9122 ms/op 4.4054 ms/op 0.89
BLS aggregatePubkeys 32 - blst 16.690 us/op 20.237 us/op 0.82
BLS aggregatePubkeys 128 - blst 58.991 us/op 72.526 us/op 0.81
notSeenSlots=1 numMissedVotes=1 numBadVotes=10 52.286 ms/op 74.989 ms/op 0.70
notSeenSlots=1 numMissedVotes=0 numBadVotes=4 35.491 ms/op 80.700 ms/op 0.44
notSeenSlots=2 numMissedVotes=1 numBadVotes=10 30.218 ms/op 60.761 ms/op 0.50
getSlashingsAndExits - default max 54.429 us/op 110.08 us/op 0.49
getSlashingsAndExits - 2k 256.29 us/op 381.58 us/op 0.67
proposeBlockBody type=full, size=empty 4.0032 ms/op 4.9460 ms/op 0.81
isKnown best case - 1 super set check 372.00 ns/op 201.00 ns/op 1.85
isKnown normal case - 2 super set checks 367.00 ns/op 195.00 ns/op 1.88
isKnown worse case - 16 super set checks 367.00 ns/op 190.00 ns/op 1.93
InMemoryCheckpointStateCache - add get delete 2.4070 us/op 2.4060 us/op 1.00
validate api signedAggregateAndProof - struct 1.9271 ms/op 1.9918 ms/op 0.97
validate gossip signedAggregateAndProof - struct 1.9822 ms/op 1.7812 ms/op 1.11
batch validate gossip attestation - vc 640000 - chunk 32 102.63 us/op 163.95 us/op 0.63
batch validate gossip attestation - vc 640000 - chunk 64 92.721 us/op 139.66 us/op 0.66
batch validate gossip attestation - vc 640000 - chunk 128 86.276 us/op 130.06 us/op 0.66
batch validate gossip attestation - vc 640000 - chunk 256 88.603 us/op 151.28 us/op 0.59
pickEth1Vote - no votes 706.94 us/op 1.1109 ms/op 0.64
pickEth1Vote - max votes 4.4944 ms/op 11.574 ms/op 0.39
pickEth1Vote - Eth1Data hashTreeRoot value x2048 16.930 ms/op 23.722 ms/op 0.71
pickEth1Vote - Eth1Data hashTreeRoot tree x2048 21.247 ms/op 23.225 ms/op 0.91
pickEth1Vote - Eth1Data fastSerialize value x2048 343.08 us/op 497.56 us/op 0.69
pickEth1Vote - Eth1Data fastSerialize tree x2048 2.5520 ms/op 4.8609 ms/op 0.53
bytes32 toHexString 510.00 ns/op 395.00 ns/op 1.29
bytes32 Buffer.toString(hex) 418.00 ns/op 278.00 ns/op 1.50
bytes32 Buffer.toString(hex) from Uint8Array 494.00 ns/op 346.00 ns/op 1.43
bytes32 Buffer.toString(hex) + 0x 413.00 ns/op 286.00 ns/op 1.44
Object access 1 prop 0.30500 ns/op 0.12900 ns/op 2.36
Map access 1 prop 0.30700 ns/op 0.13100 ns/op 2.34
Object get x1000 4.8080 ns/op 6.6170 ns/op 0.73
Map get x1000 5.3350 ns/op 7.0380 ns/op 0.76
Object set x1000 18.493 ns/op 43.610 ns/op 0.42
Map set x1000 15.917 ns/op 31.205 ns/op 0.51
Return object 10000 times 0.27520 ns/op 0.45100 ns/op 0.61
Throw Error 10000 times 3.2141 us/op 6.1202 us/op 0.53
toHex 93.108 ns/op 163.42 ns/op 0.57
Buffer.from 84.952 ns/op 252.81 ns/op 0.34
shared Buffer 57.119 ns/op 121.55 ns/op 0.47
fastMsgIdFn sha256 / 200 bytes 1.8310 us/op 2.8900 us/op 0.63
fastMsgIdFn h32 xxhash / 200 bytes 365.00 ns/op 271.00 ns/op 1.35
fastMsgIdFn h64 xxhash / 200 bytes 430.00 ns/op 382.00 ns/op 1.13
fastMsgIdFn sha256 / 1000 bytes 5.7230 us/op 7.6650 us/op 0.75
fastMsgIdFn h32 xxhash / 1000 bytes 490.00 ns/op 476.00 ns/op 1.03
fastMsgIdFn h64 xxhash / 1000 bytes 520.00 ns/op 463.00 ns/op 1.12
fastMsgIdFn sha256 / 10000 bytes 49.109 us/op 73.345 us/op 0.67
fastMsgIdFn h32 xxhash / 10000 bytes 1.8770 us/op 2.0010 us/op 0.94
fastMsgIdFn h64 xxhash / 10000 bytes 1.3260 us/op 1.7070 us/op 0.78
send data - 1000 256B messages 8.8875 ms/op 11.563 ms/op 0.77
send data - 1000 512B messages 14.178 ms/op 34.590 ms/op 0.41
send data - 1000 1024B messages 19.866 ms/op 38.862 ms/op 0.51
send data - 1000 1200B messages 14.610 ms/op 34.682 ms/op 0.42
send data - 1000 2048B messages 14.876 ms/op 31.957 ms/op 0.47
send data - 1000 4096B messages 17.935 ms/op 42.538 ms/op 0.42
send data - 1000 16384B messages 47.619 ms/op 93.279 ms/op 0.51
send data - 1000 65536B messages 231.49 ms/op 339.46 ms/op 0.68
enrSubnets - fastDeserialize 64 bits 945.00 ns/op 1.0800 us/op 0.88
enrSubnets - ssz BitVector 64 bits 492.00 ns/op 399.00 ns/op 1.23
enrSubnets - fastDeserialize 4 bits 314.00 ns/op 200.00 ns/op 1.57
enrSubnets - ssz BitVector 4 bits 484.00 ns/op 382.00 ns/op 1.27
prioritizePeers score -10:0 att 32-0.1 sync 2-0 93.054 us/op 144.99 us/op 0.64
prioritizePeers score 0:0 att 32-0.25 sync 2-0.25 112.08 us/op 191.30 us/op 0.59
prioritizePeers score 0:0 att 32-0.5 sync 2-0.5 163.99 us/op 247.38 us/op 0.66
prioritizePeers score 0:0 att 64-0.75 sync 4-0.75 308.69 us/op 522.53 us/op 0.59
prioritizePeers score 0:0 att 64-1 sync 4-1 375.01 us/op 605.94 us/op 0.62
array of 16000 items push then shift 1.1723 us/op 2.3187 us/op 0.51
LinkedList of 16000 items push then shift 6.5910 ns/op 8.6350 ns/op 0.76
array of 16000 items push then pop 62.020 ns/op 118.04 ns/op 0.53
LinkedList of 16000 items push then pop 5.8200 ns/op 12.449 ns/op 0.47
array of 24000 items push then shift 1.7201 us/op 3.1976 us/op 0.54
LinkedList of 24000 items push then shift 6.3430 ns/op 12.114 ns/op 0.52
array of 24000 items push then pop 84.256 ns/op 160.06 ns/op 0.53
LinkedList of 24000 items push then pop 6.1110 ns/op 8.5330 ns/op 0.72
intersect bitArray bitLen 8 5.3900 ns/op 7.3080 ns/op 0.74
intersect array and set length 8 32.273 ns/op 43.906 ns/op 0.74
intersect bitArray bitLen 128 26.483 ns/op 34.402 ns/op 0.77
intersect array and set length 128 539.92 ns/op 697.51 ns/op 0.77
bitArray.getTrueBitIndexes() bitLen 128 1.1080 us/op 1.1930 us/op 0.93
bitArray.getTrueBitIndexes() bitLen 248 1.7580 us/op 2.2110 us/op 0.80
bitArray.getTrueBitIndexes() bitLen 512 3.2200 us/op 5.9040 us/op 0.55
Buffer.concat 32 items 755.00 ns/op 788.00 ns/op 0.96
Uint8Array.set 32 items 1.0510 us/op 3.0760 us/op 0.34
Buffer.copy 2.1430 us/op 3.0500 us/op 0.70
Uint8Array.set - with subarray 2.8010 us/op 2.5070 us/op 1.12
Uint8Array.set - without subarray 1.2620 us/op 2.1010 us/op 0.60
getUint32 - dataview 363.00 ns/op 218.00 ns/op 1.67
getUint32 - manual 305.00 ns/op 134.00 ns/op 2.28
Set add up to 64 items then delete first 1.6477 us/op 2.7896 us/op 0.59
OrderedSet add up to 64 items then delete first 2.5641 us/op 6.5681 us/op 0.39
Set add up to 64 items then delete last 1.8769 us/op 4.2871 us/op 0.44
OrderedSet add up to 64 items then delete last 2.8277 us/op 6.2356 us/op 0.45
Set add up to 64 items then delete middle 1.8772 us/op 2.7445 us/op 0.68
OrderedSet add up to 64 items then delete middle 4.1611 us/op 7.9353 us/op 0.52
Set add up to 128 items then delete first 3.7313 us/op 8.2673 us/op 0.45
OrderedSet add up to 128 items then delete first 5.8580 us/op 12.134 us/op 0.48
Set add up to 128 items then delete last 3.6116 us/op 7.2372 us/op 0.50
OrderedSet add up to 128 items then delete last 5.5156 us/op 12.023 us/op 0.46
Set add up to 128 items then delete middle 3.6061 us/op 9.1067 us/op 0.40
OrderedSet add up to 128 items then delete middle 11.047 us/op 23.896 us/op 0.46
Set add up to 256 items then delete first 7.3935 us/op 15.311 us/op 0.48
OrderedSet add up to 256 items then delete first 11.613 us/op 27.725 us/op 0.42
Set add up to 256 items then delete last 7.1370 us/op 15.262 us/op 0.47
OrderedSet add up to 256 items then delete last 11.076 us/op 23.316 us/op 0.48
Set add up to 256 items then delete middle 7.1158 us/op 16.128 us/op 0.44
OrderedSet add up to 256 items then delete middle 32.413 us/op 54.632 us/op 0.59
transfer serialized Status (84 B) 2.0050 us/op 6.1670 us/op 0.33
copy serialized Status (84 B) 1.1630 us/op 2.8740 us/op 0.40
transfer serialized SignedVoluntaryExit (112 B) 2.0050 us/op 6.7150 us/op 0.30
copy serialized SignedVoluntaryExit (112 B) 1.2080 us/op 3.7920 us/op 0.32
transfer serialized ProposerSlashing (416 B) 2.0630 us/op 5.5120 us/op 0.37
copy serialized ProposerSlashing (416 B) 1.3140 us/op 3.7040 us/op 0.35
transfer serialized Attestation (485 B) 2.0730 us/op 4.6010 us/op 0.45
copy serialized Attestation (485 B) 1.2980 us/op 2.9140 us/op 0.45
transfer serialized AttesterSlashing (33232 B) 2.2750 us/op 4.1920 us/op 0.54
copy serialized AttesterSlashing (33232 B) 3.0210 us/op 7.0660 us/op 0.43
transfer serialized Small SignedBeaconBlock (128000 B) 2.5380 us/op 4.7510 us/op 0.53
copy serialized Small SignedBeaconBlock (128000 B) 8.4740 us/op 25.351 us/op 0.33
transfer serialized Avg SignedBeaconBlock (200000 B) 2.5840 us/op 5.4980 us/op 0.47
copy serialized Avg SignedBeaconBlock (200000 B) 7.9450 us/op 41.184 us/op 0.19
transfer serialized BlobsSidecar (524380 B) 3.1260 us/op 9.8430 us/op 0.32
copy serialized BlobsSidecar (524380 B) 52.553 us/op 130.30 us/op 0.40
transfer serialized Big SignedBeaconBlock (1000000 B) 3.5630 us/op 5.5630 us/op 0.64
copy serialized Big SignedBeaconBlock (1000000 B) 179.54 us/op 231.26 us/op 0.78
pass gossip attestations to forkchoice per slot 2.1890 ms/op 3.3433 ms/op 0.65
forkChoice updateHead vc 100000 bc 64 eq 0 328.41 us/op 523.29 us/op 0.63
forkChoice updateHead vc 600000 bc 64 eq 0 2.0686 ms/op 4.6637 ms/op 0.44
forkChoice updateHead vc 1000000 bc 64 eq 0 3.6613 ms/op 7.1998 ms/op 0.51
forkChoice updateHead vc 600000 bc 320 eq 0 2.0920 ms/op 5.8251 ms/op 0.36
forkChoice updateHead vc 600000 bc 1200 eq 0 2.1086 ms/op 3.6660 ms/op 0.58
forkChoice updateHead vc 600000 bc 7200 eq 0 2.4594 ms/op 4.2932 ms/op 0.57
forkChoice updateHead vc 600000 bc 64 eq 1000 9.5259 ms/op 11.218 ms/op 0.85
forkChoice updateHead vc 600000 bc 64 eq 10000 8.9295 ms/op 11.306 ms/op 0.79
forkChoice updateHead vc 600000 bc 64 eq 300000 10.816 ms/op 19.032 ms/op 0.57
computeDeltas 500000 validators 300 proto nodes 3.0075 ms/op 4.5326 ms/op 0.66
computeDeltas 500000 validators 1200 proto nodes 3.0498 ms/op 4.9689 ms/op 0.61
computeDeltas 500000 validators 7200 proto nodes 3.0067 ms/op 4.2022 ms/op 0.72
computeDeltas 750000 validators 300 proto nodes 4.5989 ms/op 6.0962 ms/op 0.75
computeDeltas 750000 validators 1200 proto nodes 4.5390 ms/op 6.1079 ms/op 0.74
computeDeltas 750000 validators 7200 proto nodes 4.5500 ms/op 5.9979 ms/op 0.76
computeDeltas 1400000 validators 300 proto nodes 8.7503 ms/op 11.069 ms/op 0.79
computeDeltas 1400000 validators 1200 proto nodes 8.6626 ms/op 11.111 ms/op 0.78
computeDeltas 1400000 validators 7200 proto nodes 8.7050 ms/op 11.418 ms/op 0.76
computeDeltas 2100000 validators 300 proto nodes 13.482 ms/op 17.361 ms/op 0.78
computeDeltas 2100000 validators 1200 proto nodes 12.757 ms/op 17.097 ms/op 0.75
computeDeltas 2100000 validators 7200 proto nodes 13.309 ms/op 17.071 ms/op 0.78
altair processAttestation - 250000 vs - 7PWei normalcase 1.8867 ms/op 2.6498 ms/op 0.71
altair processAttestation - 250000 vs - 7PWei worstcase 2.6750 ms/op 3.5654 ms/op 0.75
altair processAttestation - setStatus - 1/6 committees join 99.601 us/op 139.15 us/op 0.72
altair processAttestation - setStatus - 1/3 committees join 196.23 us/op 260.88 us/op 0.75
altair processAttestation - setStatus - 1/2 committees join 272.07 us/op 358.43 us/op 0.76
altair processAttestation - setStatus - 2/3 committees join 346.21 us/op 466.42 us/op 0.74
altair processAttestation - setStatus - 4/5 committees join 490.65 us/op 652.71 us/op 0.75
altair processAttestation - setStatus - 100% committees join 588.55 us/op 731.41 us/op 0.80
altair processBlock - 250000 vs - 7PWei normalcase 4.2388 ms/op 6.5437 ms/op 0.65
altair processBlock - 250000 vs - 7PWei normalcase hashState 31.602 ms/op 42.106 ms/op 0.75
altair processBlock - 250000 vs - 7PWei worstcase 38.167 ms/op 42.544 ms/op 0.90
altair processBlock - 250000 vs - 7PWei worstcase hashState 82.595 ms/op 95.464 ms/op 0.87
phase0 processBlock - 250000 vs - 7PWei normalcase 1.5276 ms/op 1.8822 ms/op 0.81
phase0 processBlock - 250000 vs - 7PWei worstcase 27.323 ms/op 25.247 ms/op 1.08
altair processEth1Data - 250000 vs - 7PWei normalcase 260.58 us/op 359.80 us/op 0.72
getExpectedWithdrawals 250000 eb:1,eth1:1,we:0,wn:0,smpl:15 4.2850 us/op 5.4480 us/op 0.79
getExpectedWithdrawals 250000 eb:0.95,eth1:0.1,we:0.05,wn:0,smpl:219 15.298 us/op 37.123 us/op 0.41
getExpectedWithdrawals 250000 eb:0.95,eth1:0.3,we:0.05,wn:0,smpl:42 7.0810 us/op 9.8270 us/op 0.72
getExpectedWithdrawals 250000 eb:0.95,eth1:0.7,we:0.05,wn:0,smpl:18 2.6280 us/op 5.8200 us/op 0.45
getExpectedWithdrawals 250000 eb:0.1,eth1:0.1,we:0,wn:0,smpl:1020 67.573 us/op 95.090 us/op 0.71
getExpectedWithdrawals 250000 eb:0.03,eth1:0.03,we:0,wn:0,smpl:11777 795.48 us/op 1.7815 ms/op 0.45
getExpectedWithdrawals 250000 eb:0.01,eth1:0.01,we:0,wn:0,smpl:16384 1.0487 ms/op 1.9728 ms/op 0.53
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,smpl:16384 1.0708 ms/op 1.9465 ms/op 0.55
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,nocache,smpl:16384 2.6897 ms/op 3.3808 ms/op 0.80
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,smpl:16384 1.1415 ms/op 2.5734 ms/op 0.44
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,nocache,smpl:16384 2.6416 ms/op 3.3627 ms/op 0.79
Tree 40 250000 create 351.20 ms/op 400.95 ms/op 0.88
Tree 40 250000 get(125000) 111.06 ns/op 143.59 ns/op 0.77
Tree 40 250000 set(125000) 1.2240 us/op 1.4341 us/op 0.85
Tree 40 250000 toArray() 20.462 ms/op 14.987 ms/op 1.37
Tree 40 250000 iterate all - toArray() + loop 17.674 ms/op 15.486 ms/op 1.14
Tree 40 250000 iterate all - get(i) 48.592 ms/op 50.590 ms/op 0.96
Array 250000 create 1.9731 ms/op 2.8190 ms/op 0.70
Array 250000 clone - spread 638.00 us/op 791.17 us/op 0.81
Array 250000 get(125000) 0.56300 ns/op 0.40300 ns/op 1.40
Array 250000 set(125000) 0.58900 ns/op 0.42800 ns/op 1.38
Array 250000 iterate all - loop 77.427 us/op 102.36 us/op 0.76
phase0 afterProcessEpoch - 250000 vs - 7PWei 42.066 ms/op 48.247 ms/op 0.87
Array.fill - length 1000000 2.5686 ms/op 6.6284 ms/op 0.39
Array push - length 1000000 9.9062 ms/op 12.687 ms/op 0.78
Array.get 0.26717 ns/op 0.26558 ns/op 1.01
Uint8Array.get 0.35023 ns/op 0.42717 ns/op 0.82
phase0 beforeProcessEpoch - 250000 vs - 7PWei 13.591 ms/op 17.192 ms/op 0.79
altair processEpoch - mainnet_e81889 230.44 ms/op 302.60 ms/op 0.76
mainnet_e81889 - altair beforeProcessEpoch 17.189 ms/op 17.429 ms/op 0.99
mainnet_e81889 - altair processJustificationAndFinalization 5.2670 us/op 6.6800 us/op 0.79
mainnet_e81889 - altair processInactivityUpdates 3.3677 ms/op 4.0544 ms/op 0.83
mainnet_e81889 - altair processRewardsAndPenalties 36.067 ms/op 59.775 ms/op 0.60
mainnet_e81889 - altair processRegistryUpdates 882.00 ns/op 638.00 ns/op 1.38
mainnet_e81889 - altair processSlashings 406.00 ns/op 177.00 ns/op 2.29
mainnet_e81889 - altair processEth1DataReset 395.00 ns/op 175.00 ns/op 2.26
mainnet_e81889 - altair processEffectiveBalanceUpdates 1.0305 ms/op 1.2375 ms/op 0.83
mainnet_e81889 - altair processSlashingsReset 1.0180 us/op 1.0680 us/op 0.95
mainnet_e81889 - altair processRandaoMixesReset 1.2580 us/op 1.4180 us/op 0.89
mainnet_e81889 - altair processHistoricalRootsUpdate 395.00 ns/op 178.00 ns/op 2.22
mainnet_e81889 - altair processParticipationFlagUpdates 717.00 ns/op 609.00 ns/op 1.18
mainnet_e81889 - altair processSyncCommitteeUpdates 365.00 ns/op 145.00 ns/op 2.52
mainnet_e81889 - altair afterProcessEpoch 42.113 ms/op 51.255 ms/op 0.82
capella processEpoch - mainnet_e217614 865.73 ms/op 996.26 ms/op 0.87
mainnet_e217614 - capella beforeProcessEpoch 60.197 ms/op 70.166 ms/op 0.86
mainnet_e217614 - capella processJustificationAndFinalization 4.1770 us/op 5.6070 us/op 0.74
mainnet_e217614 - capella processInactivityUpdates 10.431 ms/op 15.527 ms/op 0.67
mainnet_e217614 - capella processRewardsAndPenalties 211.67 ms/op 233.89 ms/op 0.90
mainnet_e217614 - capella processRegistryUpdates 5.2350 us/op 8.2310 us/op 0.64
mainnet_e217614 - capella processSlashings 386.00 ns/op 176.00 ns/op 2.19
mainnet_e217614 - capella processEth1DataReset 377.00 ns/op 185.00 ns/op 2.04
mainnet_e217614 - capella processEffectiveBalanceUpdates 4.0063 ms/op 9.1467 ms/op 0.44
mainnet_e217614 - capella processSlashingsReset 1.2910 us/op 945.00 ns/op 1.37
mainnet_e217614 - capella processRandaoMixesReset 1.3260 us/op 1.1360 us/op 1.17
mainnet_e217614 - capella processHistoricalRootsUpdate 386.00 ns/op 175.00 ns/op 2.21
mainnet_e217614 - capella processParticipationFlagUpdates 689.00 ns/op 518.00 ns/op 1.33
mainnet_e217614 - capella afterProcessEpoch 103.46 ms/op 122.60 ms/op 0.84
phase0 processEpoch - mainnet_e58758 306.22 ms/op 299.76 ms/op 1.02
mainnet_e58758 - phase0 beforeProcessEpoch 72.196 ms/op 78.061 ms/op 0.92
mainnet_e58758 - phase0 processJustificationAndFinalization 4.4470 us/op 7.4600 us/op 0.60
mainnet_e58758 - phase0 processRewardsAndPenalties 35.976 ms/op 41.099 ms/op 0.88
mainnet_e58758 - phase0 processRegistryUpdates 3.1740 us/op 4.1900 us/op 0.76
mainnet_e58758 - phase0 processSlashings 376.00 ns/op 189.00 ns/op 1.99
mainnet_e58758 - phase0 processEth1DataReset 373.00 ns/op 174.00 ns/op 2.14
mainnet_e58758 - phase0 processEffectiveBalanceUpdates 763.79 us/op 1.0192 ms/op 0.75
mainnet_e58758 - phase0 processSlashingsReset 1.1220 us/op 883.00 ns/op 1.27
mainnet_e58758 - phase0 processRandaoMixesReset 1.2080 us/op 1.8590 us/op 0.65
mainnet_e58758 - phase0 processHistoricalRootsUpdate 372.00 ns/op 174.00 ns/op 2.14
mainnet_e58758 - phase0 processParticipationRecordUpdates 1.1560 us/op 890.00 ns/op 1.30
mainnet_e58758 - phase0 afterProcessEpoch 35.109 ms/op 43.485 ms/op 0.81
phase0 processEffectiveBalanceUpdates - 250000 normalcase 923.39 us/op 1.3434 ms/op 0.69
phase0 processEffectiveBalanceUpdates - 250000 worstcase 0.5 1.3202 ms/op 1.8081 ms/op 0.73
altair processInactivityUpdates - 250000 normalcase 14.105 ms/op 18.110 ms/op 0.78
altair processInactivityUpdates - 250000 worstcase 17.214 ms/op 23.415 ms/op 0.74
phase0 processRegistryUpdates - 250000 normalcase 5.2730 us/op 10.887 us/op 0.48
phase0 processRegistryUpdates - 250000 badcase_full_deposits 293.63 us/op 425.01 us/op 0.69
phase0 processRegistryUpdates - 250000 worstcase 0.5 102.31 ms/op 112.68 ms/op 0.91
altair processRewardsAndPenalties - 250000 normalcase 45.164 ms/op 56.850 ms/op 0.79
altair processRewardsAndPenalties - 250000 worstcase 35.419 ms/op 44.328 ms/op 0.80
phase0 getAttestationDeltas - 250000 normalcase 5.9162 ms/op 6.7977 ms/op 0.87
phase0 getAttestationDeltas - 250000 worstcase 6.0183 ms/op 6.7712 ms/op 0.89
phase0 processSlashings - 250000 worstcase 89.304 us/op 97.925 us/op 0.91
altair processSyncCommitteeUpdates - 250000 96.790 ms/op 119.84 ms/op 0.81
BeaconState.hashTreeRoot - No change 429.00 ns/op 211.00 ns/op 2.03
BeaconState.hashTreeRoot - 1 full validator 78.202 us/op 97.417 us/op 0.80
BeaconState.hashTreeRoot - 32 full validator 777.96 us/op 780.07 us/op 1.00
BeaconState.hashTreeRoot - 512 full validator 7.3408 ms/op 11.850 ms/op 0.62
BeaconState.hashTreeRoot - 1 validator.effectiveBalance 76.098 us/op 106.61 us/op 0.71
BeaconState.hashTreeRoot - 32 validator.effectiveBalance 1.2476 ms/op 1.3912 ms/op 0.90
BeaconState.hashTreeRoot - 512 validator.effectiveBalance 27.472 ms/op 26.390 ms/op 1.04
BeaconState.hashTreeRoot - 1 balances 67.724 us/op 93.093 us/op 0.73
BeaconState.hashTreeRoot - 32 balances 621.72 us/op 972.02 us/op 0.64
BeaconState.hashTreeRoot - 512 balances 6.1756 ms/op 7.9797 ms/op 0.77
BeaconState.hashTreeRoot - 250000 balances 162.69 ms/op 191.02 ms/op 0.85
aggregationBits - 2048 els - zipIndexesInBitList 17.620 us/op 21.072 us/op 0.84
byteArrayEquals 32 46.784 ns/op 52.669 ns/op 0.89
Buffer.compare 32 14.671 ns/op 16.807 ns/op 0.87
byteArrayEquals 1024 1.2480 us/op 1.5780 us/op 0.79
Buffer.compare 1024 23.745 ns/op 24.410 ns/op 0.97
byteArrayEquals 16384 18.956 us/op 25.214 us/op 0.75
Buffer.compare 16384 165.56 ns/op 203.73 ns/op 0.81
byteArrayEquals 123687377 143.33 ms/op 192.04 ms/op 0.75
Buffer.compare 123687377 5.3970 ms/op 6.7249 ms/op 0.80
byteArrayEquals 32 - diff last byte 44.997 ns/op 52.547 ns/op 0.86
Buffer.compare 32 - diff last byte 14.724 ns/op 17.164 ns/op 0.86
byteArrayEquals 1024 - diff last byte 1.1985 us/op 1.6058 us/op 0.75
Buffer.compare 1024 - diff last byte 21.217 ns/op 25.382 ns/op 0.84
byteArrayEquals 16384 - diff last byte 19.052 us/op 25.364 us/op 0.75
Buffer.compare 16384 - diff last byte 184.41 ns/op 204.04 ns/op 0.90
byteArrayEquals 123687377 - diff last byte 144.80 ms/op 191.77 ms/op 0.76
Buffer.compare 123687377 - diff last byte 5.4176 ms/op 6.7896 ms/op 0.80
byteArrayEquals 32 - random bytes 4.6530 ns/op 5.1230 ns/op 0.91
Buffer.compare 32 - random bytes 14.947 ns/op 17.011 ns/op 0.88
byteArrayEquals 1024 - random bytes 4.7420 ns/op 5.0930 ns/op 0.93
Buffer.compare 1024 - random bytes 15.545 ns/op 17.019 ns/op 0.91
byteArrayEquals 16384 - random bytes 4.7040 ns/op 5.1560 ns/op 0.91
Buffer.compare 16384 - random bytes 15.811 ns/op 17.192 ns/op 0.92
byteArrayEquals 123687377 - random bytes 7.8000 ns/op 6.9100 ns/op 1.13
Buffer.compare 123687377 - random bytes 18.780 ns/op 19.010 ns/op 0.99
regular array get 100000 times 29.438 us/op 33.599 us/op 0.88
wrappedArray get 100000 times 29.393 us/op 33.326 us/op 0.88
arrayWithProxy get 100000 times 9.4413 ms/op 13.968 ms/op 0.68
ssz.Root.equals 37.832 ns/op 45.937 ns/op 0.82
byteArrayEquals 39.196 ns/op 45.229 ns/op 0.87
Buffer.compare 9.1340 ns/op 10.541 ns/op 0.87
processSlot - 1 slots 8.9090 us/op 11.124 us/op 0.80
processSlot - 32 slots 2.2751 ms/op 2.8888 ms/op 0.79
getEffectiveBalanceIncrementsZeroInactive - 250000 vs - 7PWei 58.559 ms/op 57.935 ms/op 1.01
getCommitteeAssignments - req 1 vs - 250000 vc 1.7165 ms/op 2.2633 ms/op 0.76
getCommitteeAssignments - req 100 vs - 250000 vc 3.3768 ms/op 4.3149 ms/op 0.78
getCommitteeAssignments - req 1000 vs - 250000 vc 3.5839 ms/op 4.5937 ms/op 0.78
findModifiedValidators - 10000 modified validators 761.98 ms/op 810.29 ms/op 0.94
findModifiedValidators - 1000 modified validators 645.63 ms/op 758.50 ms/op 0.85
findModifiedValidators - 100 modified validators 159.30 ms/op 274.85 ms/op 0.58
findModifiedValidators - 10 modified validators 132.73 ms/op 154.36 ms/op 0.86
findModifiedValidators - 1 modified validators 125.11 ms/op 163.07 ms/op 0.77
findModifiedValidators - no difference 126.64 ms/op 174.65 ms/op 0.73
compare ViewDUs 6.1099 s/op 6.7649 s/op 0.90
compare each validator Uint8Array 1.5317 s/op 1.7470 s/op 0.88
compare ViewDU to Uint8Array 847.36 ms/op 1.3655 s/op 0.62
migrate state 1000000 validators, 24 modified, 0 new 848.59 ms/op 922.91 ms/op 0.92
migrate state 1000000 validators, 1700 modified, 1000 new 1.1449 s/op 1.1910 s/op 0.96
migrate state 1000000 validators, 3400 modified, 2000 new 1.1147 s/op 1.3420 s/op 0.83
migrate state 1500000 validators, 24 modified, 0 new 782.86 ms/op 933.63 ms/op 0.84
migrate state 1500000 validators, 1700 modified, 1000 new 1.1198 s/op 1.0992 s/op 1.02
migrate state 1500000 validators, 3400 modified, 2000 new 1.2126 s/op 1.3567 s/op 0.89
RootCache.getBlockRootAtSlot - 250000 vs - 7PWei 5.5500 ns/op 4.3800 ns/op 1.27
state getBlockRootAtSlot - 250000 vs - 7PWei 592.57 ns/op 624.38 ns/op 0.95
naive computeProposerIndex 100000 validators 44.014 ms/op 49.925 ms/op 0.88
computeProposerIndex 100000 validators 6.5514 ms/op 9.2983 ms/op 0.70
naiveGetNextSyncCommitteeIndices 1000 validators 6.0045 s/op 7.7578 s/op 0.77
getNextSyncCommitteeIndices 1000 validators 208.73 ms/op 321.57 ms/op 0.65
naiveGetNextSyncCommitteeIndices 10000 validators 6.4012 s/op 8.6470 s/op 0.74
getNextSyncCommitteeIndices 10000 validators 353.11 ms/op 341.61 ms/op 1.03
naiveGetNextSyncCommitteeIndices 100000 validators 6.4671 s/op 8.6627 s/op 0.75
getNextSyncCommitteeIndices 100000 validators 239.75 ms/op 278.44 ms/op 0.86
naive computeShuffledIndex 100000 validators 19.114 s/op 24.681 s/op 0.77
cached computeShuffledIndex 100000 validators 462.22 ms/op 588.69 ms/op 0.79
naive computeShuffledIndex 2000000 validators 395.27 s/op 506.40 s/op 0.78
cached computeShuffledIndex 2000000 validators 14.352 s/op 54.539 s/op 0.26
computeProposers - vc 250000 7.7563 ms/op 11.703 ms/op 0.66
computeEpochShuffling - vc 250000 35.100 ms/op 45.343 ms/op 0.77
getNextSyncCommittee - vc 250000 112.55 ms/op 270.03 ms/op 0.42
computeSigningRoot for AttestationData 16.307 us/op 31.771 us/op 0.51
hash AttestationData serialized data then Buffer.toString(base64) 1.1644 us/op 1.6389 us/op 0.71
toHexString serialized data 936.28 ns/op 1.5831 us/op 0.59
Buffer.toString(base64) 109.76 ns/op 165.19 ns/op 0.66
nodejs block root to RootHex using toHex 113.32 ns/op 158.72 ns/op 0.71
nodejs block root to RootHex using toRootHex 73.122 ns/op 87.516 ns/op 0.84
browser block root to RootHex using the deprecated toHexString 189.72 ns/op 237.75 ns/op 0.80
browser block root to RootHex using toHex 155.70 ns/op 180.63 ns/op 0.86
browser block root to RootHex using toRootHex 142.11 ns/op 169.31 ns/op 0.84

by benchmarkbot/action

@twoeths
Copy link
Contributor Author

twoeths commented Feb 7, 2025

Deployed to feat2 for verification. 2 things to test:

  • gossip block received/delay is the same
  • able to propose blocks successfully

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.

The approach makes sense to me. Look forward to the test result👍

@twoeths
Copy link
Contributor Author

twoeths commented Feb 10, 2025

some metrics after 3 days of testing:

  • fcu is not consistently 1 per slot, even when we have block proposal duties. We can see a straight line compared starting from Feb 07
Screenshot 2025-02-10 at 15 30 19
  • no block proposal error
Screenshot 2025-02-10 at 15 32 37
  • some proposed blocks on holesky in the last 2 days so that we can double check later if we want to: 3605054, 3604926, 3604084, 3603735, 3601192, 3599821, 3594319, 3593271
  • these metrics are the same: gossip block processed/become head, validator performance

@twoeths twoeths marked this pull request as draft February 10, 2025 11:19
@twoeths
Copy link
Contributor Author

twoeths commented Feb 10, 2025

converted to draft, need to figure out failed sim tests in this PR

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.

Block proposer error when weak head detected
2 participants