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: increase block production timeouts to account for event loop lag #7420

Merged
merged 1 commit into from
Feb 3, 2025

Conversation

nflaig
Copy link
Member

@nflaig nflaig commented Feb 2, 2025

Motivation

Based on observations from mainnet nodes, it seems like we reject builder blocks in some cases either due to not being sent within cutoff time or due to timeout on the api call but looking at the response times these have been timely. The reason why those were rejected is either we started the block production race too late into the slot, which is mostly due to the fact that we take too much time to produce the common block body or the timeout was handled by the node with a delay, both of these cases are likely caused by event loop lag either due to GC or processing something else.

See discord for details.

Description

Increase block production timeouts to account for event loop lag

@nflaig nflaig requested a review from a team as a code owner February 2, 2025 12:33
*/
const BLOCK_PRODUCTION_RACE_CUTOFF_MS = 2_000;
const BLOCK_PRODUCTION_RACE_CUTOFF_MS = 2_500;
Copy link
Member Author

@nflaig nflaig Feb 2, 2025

Choose a reason for hiding this comment

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

In my opinion increasing this by 500ms should be fine because the previous value was absolute, meaning no matter at which time we started the block production race it would always give 2 seconds while now it's most of the time just 1.5-1.7 seconds since the cutoff it based on seconds into slot.

We also have a strict timeout on builder header request now which means this cutoff should rarely be relevant.

In addition, this value was chosen when we used JSON to pass the block around vc<>bn which added at least 500ms more to publish flow compared to using SSZ + we no longer flood publish blocks and blobs which makes it even less likely to orphan blocks.

Copy link
Contributor

Choose a reason for hiding this comment

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

pass the block around vc<>bn which added at least 500ms more to publish flow compared to using SSZ

ok this makes sense to me. so lgtm

Copy link

codecov bot commented Feb 2, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 50.26%. Comparing base (7982031) to head (89f4e4b).
Report is 1 commits behind head on unstable.

Additional details and impacted files
@@            Coverage Diff            @@
##           unstable    #7420   +/-   ##
=========================================
  Coverage     50.26%   50.26%           
=========================================
  Files           602      602           
  Lines         40376    40376           
  Branches       2206     2206           
=========================================
  Hits          20293    20293           
  Misses        20043    20043           
  Partials         40       40           

Copy link
Contributor

github-actions bot commented Feb 2, 2025

Performance Report

🚀🚀 Significant benchmark improvement detected

Benchmark suite Current: 086f8af Previous: 7982031 Ratio
phase0 getAttestationDeltas - 250000 normalcase 5.7794 ms/op 18.005 ms/op 0.32
Full benchmark results
Benchmark suite Current: 086f8af Previous: 7982031 Ratio
getPubkeys - index2pubkey - req 1000 vs - 250000 vc 951.82 us/op 795.93 us/op 1.20
getPubkeys - validatorsArr - req 1000 vs - 250000 vc 33.242 us/op 30.864 us/op 1.08
BLS verify - blst 823.33 us/op 881.25 us/op 0.93
BLS verifyMultipleSignatures 3 - blst 1.1713 ms/op 1.1959 ms/op 0.98
BLS verifyMultipleSignatures 8 - blst 1.6278 ms/op 2.0342 ms/op 0.80
BLS verifyMultipleSignatures 32 - blst 4.7984 ms/op 4.3855 ms/op 1.09
BLS verifyMultipleSignatures 64 - blst 8.8082 ms/op 10.153 ms/op 0.87
BLS verifyMultipleSignatures 128 - blst 16.838 ms/op 16.003 ms/op 1.05
BLS deserializing 10000 signatures 676.64 ms/op 639.75 ms/op 1.06
BLS deserializing 100000 signatures 6.7888 s/op 6.3466 s/op 1.07
BLS verifyMultipleSignatures - same message - 3 - blst 885.03 us/op 912.50 us/op 0.97
BLS verifyMultipleSignatures - same message - 8 - blst 1.0277 ms/op 1.0615 ms/op 0.97
BLS verifyMultipleSignatures - same message - 32 - blst 1.6816 ms/op 1.6351 ms/op 1.03
BLS verifyMultipleSignatures - same message - 64 - blst 2.5615 ms/op 2.5388 ms/op 1.01
BLS verifyMultipleSignatures - same message - 128 - blst 4.2504 ms/op 4.1676 ms/op 1.02
BLS aggregatePubkeys 32 - blst 18.972 us/op 17.680 us/op 1.07
BLS aggregatePubkeys 128 - blst 68.654 us/op 62.511 us/op 1.10
notSeenSlots=1 numMissedVotes=1 numBadVotes=10 49.592 ms/op 45.499 ms/op 1.09
notSeenSlots=1 numMissedVotes=0 numBadVotes=4 44.537 ms/op 39.918 ms/op 1.12
notSeenSlots=2 numMissedVotes=1 numBadVotes=10 34.647 ms/op 32.529 ms/op 1.07
getSlashingsAndExits - default max 73.183 us/op 55.968 us/op 1.31
getSlashingsAndExits - 2k 280.52 us/op 315.80 us/op 0.89
proposeBlockBody type=full, size=empty 4.7140 ms/op 5.1521 ms/op 0.91
isKnown best case - 1 super set check 194.00 ns/op 398.00 ns/op 0.49
isKnown normal case - 2 super set checks 193.00 ns/op 394.00 ns/op 0.49
isKnown worse case - 16 super set checks 192.00 ns/op 391.00 ns/op 0.49
InMemoryCheckpointStateCache - add get delete 2.2750 us/op 2.3930 us/op 0.95
validate api signedAggregateAndProof - struct 1.3526 ms/op 1.5242 ms/op 0.89
validate gossip signedAggregateAndProof - struct 1.3437 ms/op 1.5156 ms/op 0.89
batch validate gossip attestation - vc 640000 - chunk 32 116.50 us/op 113.21 us/op 1.03
batch validate gossip attestation - vc 640000 - chunk 64 100.76 us/op 95.986 us/op 1.05
batch validate gossip attestation - vc 640000 - chunk 128 93.464 us/op 87.560 us/op 1.07
batch validate gossip attestation - vc 640000 - chunk 256 95.756 us/op 90.840 us/op 1.05
pickEth1Vote - no votes 955.83 us/op 776.47 us/op 1.23
pickEth1Vote - max votes 5.9917 ms/op 7.5267 ms/op 0.80
pickEth1Vote - Eth1Data hashTreeRoot value x2048 11.835 ms/op 12.267 ms/op 0.96
pickEth1Vote - Eth1Data hashTreeRoot tree x2048 20.566 ms/op 21.768 ms/op 0.94
pickEth1Vote - Eth1Data fastSerialize value x2048 420.10 us/op 336.32 us/op 1.25
pickEth1Vote - Eth1Data fastSerialize tree x2048 2.8913 ms/op 3.1583 ms/op 0.92
bytes32 toHexString 365.00 ns/op 653.00 ns/op 0.56
bytes32 Buffer.toString(hex) 233.00 ns/op 437.00 ns/op 0.53
bytes32 Buffer.toString(hex) from Uint8Array 319.00 ns/op 477.00 ns/op 0.67
bytes32 Buffer.toString(hex) + 0x 237.00 ns/op 404.00 ns/op 0.59
Object access 1 prop 0.11600 ns/op 0.29400 ns/op 0.39
Map access 1 prop 0.12300 ns/op 0.30400 ns/op 0.40
Object get x1000 5.8350 ns/op 4.9490 ns/op 1.18
Map get x1000 6.1360 ns/op 5.5320 ns/op 1.11
Object set x1000 27.583 ns/op 20.201 ns/op 1.37
Map set x1000 18.696 ns/op 16.763 ns/op 1.12
Return object 10000 times 0.28370 ns/op 0.29590 ns/op 0.96
Throw Error 10000 times 4.1822 us/op 3.6588 us/op 1.14
toHex 133.88 ns/op 102.13 ns/op 1.31
Buffer.from 117.49 ns/op 89.946 ns/op 1.31
shared Buffer 84.843 ns/op 60.720 ns/op 1.40
fastMsgIdFn sha256 / 200 bytes 2.1400 us/op 1.8740 us/op 1.14
fastMsgIdFn h32 xxhash / 200 bytes 200.00 ns/op 371.00 ns/op 0.54
fastMsgIdFn h64 xxhash / 200 bytes 254.00 ns/op 419.00 ns/op 0.61
fastMsgIdFn sha256 / 1000 bytes 7.0090 us/op 5.5950 us/op 1.25
fastMsgIdFn h32 xxhash / 1000 bytes 330.00 ns/op 487.00 ns/op 0.68
fastMsgIdFn h64 xxhash / 1000 bytes 327.00 ns/op 483.00 ns/op 0.68
fastMsgIdFn sha256 / 10000 bytes 63.435 us/op 47.157 us/op 1.35
fastMsgIdFn h32 xxhash / 10000 bytes 1.7780 us/op 1.7890 us/op 0.99
fastMsgIdFn h64 xxhash / 10000 bytes 1.1720 us/op 1.2490 us/op 0.94
send data - 1000 256B messages 11.551 ms/op 11.600 ms/op 1.00
send data - 1000 512B messages 15.251 ms/op 15.825 ms/op 0.96
send data - 1000 1024B messages 24.874 ms/op 26.275 ms/op 0.95
send data - 1000 1200B messages 20.087 ms/op 21.962 ms/op 0.91
send data - 1000 2048B messages 21.245 ms/op 23.492 ms/op 0.90
send data - 1000 4096B messages 25.984 ms/op 26.181 ms/op 0.99
send data - 1000 16384B messages 58.823 ms/op 50.114 ms/op 1.17
send data - 1000 65536B messages 210.58 ms/op 283.89 ms/op 0.74
enrSubnets - fastDeserialize 64 bits 1.6430 us/op 976.00 ns/op 1.68
enrSubnets - ssz BitVector 64 bits 322.00 ns/op 513.00 ns/op 0.63
enrSubnets - fastDeserialize 4 bits 123.00 ns/op 335.00 ns/op 0.37
enrSubnets - ssz BitVector 4 bits 314.00 ns/op 601.00 ns/op 0.52
prioritizePeers score -10:0 att 32-0.1 sync 2-0 115.68 us/op 102.79 us/op 1.13
prioritizePeers score 0:0 att 32-0.25 sync 2-0.25 133.25 us/op 127.45 us/op 1.05
prioritizePeers score 0:0 att 32-0.5 sync 2-0.5 190.47 us/op 212.55 us/op 0.90
prioritizePeers score 0:0 att 64-0.75 sync 4-0.75 358.71 us/op 327.09 us/op 1.10
prioritizePeers score 0:0 att 64-1 sync 4-1 438.85 us/op 394.73 us/op 1.11
array of 16000 items push then shift 1.5626 us/op 1.2303 us/op 1.27
LinkedList of 16000 items push then shift 6.6900 ns/op 7.4120 ns/op 0.90
array of 16000 items push then pop 72.073 ns/op 67.187 ns/op 1.07
LinkedList of 16000 items push then pop 6.6470 ns/op 6.2000 ns/op 1.07
array of 24000 items push then shift 2.3054 us/op 1.8479 us/op 1.25
LinkedList of 24000 items push then shift 6.8290 ns/op 7.1250 ns/op 0.96
array of 24000 items push then pop 96.097 ns/op 99.835 ns/op 0.96
LinkedList of 24000 items push then pop 6.6620 ns/op 6.3650 ns/op 1.05
intersect bitArray bitLen 8 6.1200 ns/op 11.419 ns/op 0.54
intersect array and set length 8 36.228 ns/op 65.433 ns/op 0.55
intersect bitArray bitLen 128 28.558 ns/op 26.755 ns/op 1.07
intersect array and set length 128 599.78 ns/op 540.39 ns/op 1.11
bitArray.getTrueBitIndexes() bitLen 128 987.00 ns/op 1.2120 us/op 0.81
bitArray.getTrueBitIndexes() bitLen 248 1.7270 us/op 1.9870 us/op 0.87
bitArray.getTrueBitIndexes() bitLen 512 3.5250 us/op 3.8630 us/op 0.91
Buffer.concat 32 items 589.00 ns/op 841.00 ns/op 0.70
Uint8Array.set 32 items 992.00 ns/op 1.5380 us/op 0.64
Buffer.copy 2.0830 us/op 2.4300 us/op 0.86
Uint8Array.set - with subarray 1.7420 us/op 2.4060 us/op 0.72
Uint8Array.set - without subarray 883.00 ns/op 1.4350 us/op 0.62
getUint32 - dataview 192.00 ns/op 376.00 ns/op 0.51
getUint32 - manual 115.00 ns/op 306.00 ns/op 0.38
Set add up to 64 items then delete first 2.1071 us/op 2.3614 us/op 0.89
OrderedSet add up to 64 items then delete first 3.2745 us/op 3.8436 us/op 0.85
Set add up to 64 items then delete last 2.3908 us/op 2.3513 us/op 1.02
OrderedSet add up to 64 items then delete last 3.5230 us/op 4.2802 us/op 0.82
Set add up to 64 items then delete middle 2.4700 us/op 2.6458 us/op 0.93
OrderedSet add up to 64 items then delete middle 5.2311 us/op 5.7143 us/op 0.92
Set add up to 128 items then delete first 5.2044 us/op 5.1558 us/op 1.01
OrderedSet add up to 128 items then delete first 7.6381 us/op 8.6711 us/op 0.88
Set add up to 128 items then delete last 4.8738 us/op 4.9183 us/op 0.99
OrderedSet add up to 128 items then delete last 7.2980 us/op 8.1924 us/op 0.89
Set add up to 128 items then delete middle 5.0006 us/op 4.9898 us/op 1.00
OrderedSet add up to 128 items then delete middle 13.298 us/op 14.153 us/op 0.94
Set add up to 256 items then delete first 10.085 us/op 10.678 us/op 0.94
OrderedSet add up to 256 items then delete first 16.182 us/op 17.273 us/op 0.94
Set add up to 256 items then delete last 9.5970 us/op 9.9844 us/op 0.96
OrderedSet add up to 256 items then delete last 14.429 us/op 16.152 us/op 0.89
Set add up to 256 items then delete middle 9.5177 us/op 9.9895 us/op 0.95
OrderedSet add up to 256 items then delete middle 43.075 us/op 41.454 us/op 1.04
transfer serialized Status (84 B) 2.1870 us/op 2.5050 us/op 0.87
copy serialized Status (84 B) 1.2300 us/op 1.9220 us/op 0.64
transfer serialized SignedVoluntaryExit (112 B) 2.1800 us/op 2.6210 us/op 0.83
copy serialized SignedVoluntaryExit (112 B) 1.1750 us/op 1.9170 us/op 0.61
transfer serialized ProposerSlashing (416 B) 2.3270 us/op 2.8730 us/op 0.81
copy serialized ProposerSlashing (416 B) 1.3030 us/op 2.0790 us/op 0.63
transfer serialized Attestation (485 B) 2.2680 us/op 3.0570 us/op 0.74
copy serialized Attestation (485 B) 1.3900 us/op 2.0610 us/op 0.67
transfer serialized AttesterSlashing (33232 B) 2.8000 us/op 3.2310 us/op 0.87
copy serialized AttesterSlashing (33232 B) 3.9110 us/op 5.1610 us/op 0.76
transfer serialized Small SignedBeaconBlock (128000 B) 3.2670 us/op 3.3670 us/op 0.97
copy serialized Small SignedBeaconBlock (128000 B) 9.2000 us/op 13.121 us/op 0.70
transfer serialized Avg SignedBeaconBlock (200000 B) 3.6970 us/op 3.5930 us/op 1.03
copy serialized Avg SignedBeaconBlock (200000 B) 15.262 us/op 20.446 us/op 0.75
transfer serialized BlobsSidecar (524380 B) 3.8340 us/op 6.2570 us/op 0.61
copy serialized BlobsSidecar (524380 B) 65.948 us/op 87.037 us/op 0.76
transfer serialized Big SignedBeaconBlock (1000000 B) 4.3000 us/op 5.0960 us/op 0.84
copy serialized Big SignedBeaconBlock (1000000 B) 112.50 us/op 118.47 us/op 0.95
pass gossip attestations to forkchoice per slot 2.6524 ms/op 2.4126 ms/op 1.10
forkChoice updateHead vc 100000 bc 64 eq 0 441.44 us/op 357.04 us/op 1.24
forkChoice updateHead vc 600000 bc 64 eq 0 2.7056 ms/op 2.3709 ms/op 1.14
forkChoice updateHead vc 1000000 bc 64 eq 0 4.6659 ms/op 4.1560 ms/op 1.12
forkChoice updateHead vc 600000 bc 320 eq 0 2.7360 ms/op 2.4172 ms/op 1.13
forkChoice updateHead vc 600000 bc 1200 eq 0 2.7776 ms/op 2.4210 ms/op 1.15
forkChoice updateHead vc 600000 bc 7200 eq 0 2.9803 ms/op 2.9020 ms/op 1.03
forkChoice updateHead vc 600000 bc 64 eq 1000 10.170 ms/op 9.2432 ms/op 1.10
forkChoice updateHead vc 600000 bc 64 eq 10000 10.067 ms/op 9.1213 ms/op 1.10
forkChoice updateHead vc 600000 bc 64 eq 300000 13.802 ms/op 12.069 ms/op 1.14
computeDeltas 500000 validators 300 proto nodes 3.8795 ms/op 3.2642 ms/op 1.19
computeDeltas 500000 validators 1200 proto nodes 3.8848 ms/op 3.1869 ms/op 1.22
computeDeltas 500000 validators 7200 proto nodes 3.8935 ms/op 3.0804 ms/op 1.26
computeDeltas 750000 validators 300 proto nodes 5.7328 ms/op 5.0519 ms/op 1.13
computeDeltas 750000 validators 1200 proto nodes 5.6914 ms/op 4.9986 ms/op 1.14
computeDeltas 750000 validators 7200 proto nodes 5.7283 ms/op 4.8697 ms/op 1.18
computeDeltas 1400000 validators 300 proto nodes 10.774 ms/op 9.2848 ms/op 1.16
computeDeltas 1400000 validators 1200 proto nodes 10.803 ms/op 9.6495 ms/op 1.12
computeDeltas 1400000 validators 7200 proto nodes 10.812 ms/op 9.5530 ms/op 1.13
computeDeltas 2100000 validators 300 proto nodes 16.069 ms/op 14.150 ms/op 1.14
computeDeltas 2100000 validators 1200 proto nodes 16.035 ms/op 13.497 ms/op 1.19
computeDeltas 2100000 validators 7200 proto nodes 15.967 ms/op 13.777 ms/op 1.16
altair processAttestation - 250000 vs - 7PWei normalcase 1.9607 ms/op 1.8420 ms/op 1.06
altair processAttestation - 250000 vs - 7PWei worstcase 2.8452 ms/op 3.4327 ms/op 0.83
altair processAttestation - setStatus - 1/6 committees join 119.36 us/op 115.12 us/op 1.04
altair processAttestation - setStatus - 1/3 committees join 226.99 us/op 195.25 us/op 1.16
altair processAttestation - setStatus - 1/2 committees join 324.06 us/op 301.77 us/op 1.07
altair processAttestation - setStatus - 2/3 committees join 420.18 us/op 376.10 us/op 1.12
altair processAttestation - setStatus - 4/5 committees join 588.50 us/op 524.77 us/op 1.12
altair processAttestation - setStatus - 100% committees join 695.76 us/op 620.24 us/op 1.12
altair processBlock - 250000 vs - 7PWei normalcase 4.3735 ms/op 4.8052 ms/op 0.91
altair processBlock - 250000 vs - 7PWei normalcase hashState 30.468 ms/op 36.296 ms/op 0.84
altair processBlock - 250000 vs - 7PWei worstcase 36.568 ms/op 44.104 ms/op 0.83
altair processBlock - 250000 vs - 7PWei worstcase hashState 83.813 ms/op 91.117 ms/op 0.92
phase0 processBlock - 250000 vs - 7PWei normalcase 1.6822 ms/op 1.7090 ms/op 0.98
phase0 processBlock - 250000 vs - 7PWei worstcase 21.530 ms/op 26.796 ms/op 0.80
altair processEth1Data - 250000 vs - 7PWei normalcase 325.66 us/op 263.65 us/op 1.24
getExpectedWithdrawals 250000 eb:1,eth1:1,we:0,wn:0,smpl:15 4.6500 us/op 6.0110 us/op 0.77
getExpectedWithdrawals 250000 eb:0.95,eth1:0.1,we:0.05,wn:0,smpl:219 28.952 us/op 29.064 us/op 1.00
getExpectedWithdrawals 250000 eb:0.95,eth1:0.3,we:0.05,wn:0,smpl:42 7.4380 us/op 8.1400 us/op 0.91
getExpectedWithdrawals 250000 eb:0.95,eth1:0.7,we:0.05,wn:0,smpl:18 4.6840 us/op 6.3050 us/op 0.74
getExpectedWithdrawals 250000 eb:0.1,eth1:0.1,we:0,wn:0,smpl:1020 103.13 us/op 120.30 us/op 0.86
getExpectedWithdrawals 250000 eb:0.03,eth1:0.03,we:0,wn:0,smpl:11777 919.16 us/op 784.49 us/op 1.17
getExpectedWithdrawals 250000 eb:0.01,eth1:0.01,we:0,wn:0,smpl:16384 1.3076 ms/op 1.0893 ms/op 1.20
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,smpl:16384 1.3218 ms/op 1.6109 ms/op 0.82
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,nocache,smpl:16384 3.2149 ms/op 3.3642 ms/op 0.96
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,smpl:16384 1.3643 ms/op 1.0941 ms/op 1.25
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,nocache,smpl:16384 3.3347 ms/op 3.6101 ms/op 0.92
Tree 40 250000 create 410.15 ms/op 622.31 ms/op 0.66
Tree 40 250000 get(125000) 136.32 ns/op 109.89 ns/op 1.24
Tree 40 250000 set(125000) 1.4043 us/op 2.2597 us/op 0.62
Tree 40 250000 toArray() 14.826 ms/op 22.825 ms/op 0.65
Tree 40 250000 iterate all - toArray() + loop 15.437 ms/op 21.115 ms/op 0.73
Tree 40 250000 iterate all - get(i) 51.906 ms/op 53.794 ms/op 0.96
Array 250000 create 2.3919 ms/op 3.7523 ms/op 0.64
Array 250000 clone - spread 864.36 us/op 682.13 us/op 1.27
Array 250000 get(125000) 0.40000 ns/op 0.57800 ns/op 0.69
Array 250000 set(125000) 0.42000 ns/op 0.58700 ns/op 0.72
Array 250000 iterate all - loop 108.34 us/op 83.449 us/op 1.30
phase0 afterProcessEpoch - 250000 vs - 7PWei 47.509 ms/op 40.582 ms/op 1.17
Array.fill - length 1000000 3.3784 ms/op 4.6708 ms/op 0.72
Array push - length 1000000 12.479 ms/op 10.332 ms/op 1.21
Array.get 0.27072 ns/op 0.26558 ns/op 1.02
Uint8Array.get 0.43405 ns/op 0.34943 ns/op 1.24
phase0 beforeProcessEpoch - 250000 vs - 7PWei 23.632 ms/op 18.447 ms/op 1.28
altair processEpoch - mainnet_e81889 264.49 ms/op 301.58 ms/op 0.88
mainnet_e81889 - altair beforeProcessEpoch 19.740 ms/op 18.430 ms/op 1.07
mainnet_e81889 - altair processJustificationAndFinalization 5.3720 us/op 5.3680 us/op 1.00
mainnet_e81889 - altair processInactivityUpdates 3.9383 ms/op 3.4914 ms/op 1.13
mainnet_e81889 - altair processRewardsAndPenalties 38.249 ms/op 49.965 ms/op 0.77
mainnet_e81889 - altair processRegistryUpdates 689.00 ns/op 903.00 ns/op 0.76
mainnet_e81889 - altair processSlashings 170.00 ns/op 412.00 ns/op 0.41
mainnet_e81889 - altair processEth1DataReset 168.00 ns/op 403.00 ns/op 0.42
mainnet_e81889 - altair processEffectiveBalanceUpdates 1.2195 ms/op 959.60 us/op 1.27
mainnet_e81889 - altair processSlashingsReset 853.00 ns/op 1.0910 us/op 0.78
mainnet_e81889 - altair processRandaoMixesReset 1.1030 us/op 1.3030 us/op 0.85
mainnet_e81889 - altair processHistoricalRootsUpdate 171.00 ns/op 396.00 ns/op 0.43
mainnet_e81889 - altair processParticipationFlagUpdates 503.00 ns/op 735.00 ns/op 0.68
mainnet_e81889 - altair processSyncCommitteeUpdates 133.00 ns/op 361.00 ns/op 0.37
mainnet_e81889 - altair afterProcessEpoch 49.852 ms/op 43.609 ms/op 1.14
capella processEpoch - mainnet_e217614 950.50 ms/op 1.1084 s/op 0.86
mainnet_e217614 - capella beforeProcessEpoch 68.246 ms/op 75.123 ms/op 0.91
mainnet_e217614 - capella processJustificationAndFinalization 5.0390 us/op 5.0060 us/op 1.01
mainnet_e217614 - capella processInactivityUpdates 16.575 ms/op 16.592 ms/op 1.00
mainnet_e217614 - capella processRewardsAndPenalties 178.63 ms/op 198.38 ms/op 0.90
mainnet_e217614 - capella processRegistryUpdates 6.2030 us/op 7.5570 us/op 0.82
mainnet_e217614 - capella processSlashings 173.00 ns/op 502.00 ns/op 0.34
mainnet_e217614 - capella processEth1DataReset 170.00 ns/op 504.00 ns/op 0.34
mainnet_e217614 - capella processEffectiveBalanceUpdates 10.676 ms/op 17.392 ms/op 0.61
mainnet_e217614 - capella processSlashingsReset 849.00 ns/op 1.2380 us/op 0.69
mainnet_e217614 - capella processRandaoMixesReset 1.1110 us/op 1.3980 us/op 0.79
mainnet_e217614 - capella processHistoricalRootsUpdate 173.00 ns/op 481.00 ns/op 0.36
mainnet_e217614 - capella processParticipationFlagUpdates 636.00 ns/op 862.00 ns/op 0.74
mainnet_e217614 - capella afterProcessEpoch 121.92 ms/op 106.92 ms/op 1.14
phase0 processEpoch - mainnet_e58758 291.00 ms/op 365.06 ms/op 0.80
mainnet_e58758 - phase0 beforeProcessEpoch 63.196 ms/op 95.620 ms/op 0.66
mainnet_e58758 - phase0 processJustificationAndFinalization 5.2110 us/op 5.7320 us/op 0.91
mainnet_e58758 - phase0 processRewardsAndPenalties 31.901 ms/op 39.956 ms/op 0.80
mainnet_e58758 - phase0 processRegistryUpdates 3.0230 us/op 2.9520 us/op 1.02
mainnet_e58758 - phase0 processSlashings 171.00 ns/op 447.00 ns/op 0.38
mainnet_e58758 - phase0 processEth1DataReset 170.00 ns/op 489.00 ns/op 0.35
mainnet_e58758 - phase0 processEffectiveBalanceUpdates 1.0070 ms/op 870.12 us/op 1.16
mainnet_e58758 - phase0 processSlashingsReset 875.00 ns/op 1.3060 us/op 0.67
mainnet_e58758 - phase0 processRandaoMixesReset 1.1180 us/op 1.5800 us/op 0.71
mainnet_e58758 - phase0 processHistoricalRootsUpdate 172.00 ns/op 420.00 ns/op 0.41
mainnet_e58758 - phase0 processParticipationRecordUpdates 871.00 ns/op 1.4810 us/op 0.59
mainnet_e58758 - phase0 afterProcessEpoch 41.239 ms/op 38.447 ms/op 1.07
phase0 processEffectiveBalanceUpdates - 250000 normalcase 1.2589 ms/op 1.0238 ms/op 1.23
phase0 processEffectiveBalanceUpdates - 250000 worstcase 0.5 1.9681 ms/op 1.5357 ms/op 1.28
altair processInactivityUpdates - 250000 normalcase 16.438 ms/op 16.810 ms/op 0.98
altair processInactivityUpdates - 250000 worstcase 16.394 ms/op 19.878 ms/op 0.82
phase0 processRegistryUpdates - 250000 normalcase 6.4210 us/op 7.8440 us/op 0.82
phase0 processRegistryUpdates - 250000 badcase_full_deposits 213.75 us/op 310.63 us/op 0.69
phase0 processRegistryUpdates - 250000 worstcase 0.5 98.477 ms/op 97.955 ms/op 1.01
altair processRewardsAndPenalties - 250000 normalcase 39.773 ms/op 42.920 ms/op 0.93
altair processRewardsAndPenalties - 250000 worstcase 33.651 ms/op 33.813 ms/op 1.00
phase0 getAttestationDeltas - 250000 normalcase 5.7794 ms/op 18.005 ms/op 0.32
phase0 getAttestationDeltas - 250000 worstcase 16.135 ms/op 6.6229 ms/op 2.44
phase0 processSlashings - 250000 worstcase 79.318 us/op 99.224 us/op 0.80
altair processSyncCommitteeUpdates - 250000 121.28 ms/op 99.509 ms/op 1.22
BeaconState.hashTreeRoot - No change 203.00 ns/op 451.00 ns/op 0.45
BeaconState.hashTreeRoot - 1 full validator 84.683 us/op 66.260 us/op 1.28
BeaconState.hashTreeRoot - 32 full validator 729.42 us/op 899.82 us/op 0.81
BeaconState.hashTreeRoot - 512 full validator 8.3668 ms/op 8.5446 ms/op 0.98
BeaconState.hashTreeRoot - 1 validator.effectiveBalance 87.027 us/op 91.999 us/op 0.95
BeaconState.hashTreeRoot - 32 validator.effectiveBalance 1.2186 ms/op 1.3112 ms/op 0.93
BeaconState.hashTreeRoot - 512 validator.effectiveBalance 19.837 ms/op 19.218 ms/op 1.03
BeaconState.hashTreeRoot - 1 balances 67.842 us/op 65.318 us/op 1.04
BeaconState.hashTreeRoot - 32 balances 633.47 us/op 576.80 us/op 1.10
BeaconState.hashTreeRoot - 512 balances 6.8331 ms/op 6.3027 ms/op 1.08
BeaconState.hashTreeRoot - 250000 balances 144.37 ms/op 137.10 ms/op 1.05
aggregationBits - 2048 els - zipIndexesInBitList 20.898 us/op 21.433 us/op 0.98
byteArrayEquals 32 53.792 ns/op 47.044 ns/op 1.14
Buffer.compare 32 16.665 ns/op 15.744 ns/op 1.06
byteArrayEquals 1024 1.5460 us/op 1.3068 us/op 1.18
Buffer.compare 1024 23.656 ns/op 24.500 ns/op 0.97
byteArrayEquals 16384 24.596 us/op 20.706 us/op 1.19
Buffer.compare 16384 188.13 ns/op 184.35 ns/op 1.02
byteArrayEquals 123687377 185.46 ms/op 155.53 ms/op 1.19
Buffer.compare 123687377 6.6865 ms/op 5.2423 ms/op 1.28
byteArrayEquals 32 - diff last byte 51.014 ns/op 47.886 ns/op 1.07
Buffer.compare 32 - diff last byte 16.499 ns/op 16.894 ns/op 0.98
byteArrayEquals 1024 - diff last byte 1.5402 us/op 1.2732 us/op 1.21
Buffer.compare 1024 - diff last byte 24.072 ns/op 25.136 ns/op 0.96
byteArrayEquals 16384 - diff last byte 24.539 us/op 21.539 us/op 1.14
Buffer.compare 16384 - diff last byte 175.02 ns/op 177.03 ns/op 0.99
byteArrayEquals 123687377 - diff last byte 185.23 ms/op 155.41 ms/op 1.19
Buffer.compare 123687377 - diff last byte 6.6428 ms/op 7.0310 ms/op 0.94
byteArrayEquals 32 - random bytes 4.9480 ns/op 5.0300 ns/op 0.98
Buffer.compare 32 - random bytes 16.500 ns/op 16.035 ns/op 1.03
byteArrayEquals 1024 - random bytes 4.9550 ns/op 4.9950 ns/op 0.99
Buffer.compare 1024 - random bytes 16.476 ns/op 15.721 ns/op 1.05
byteArrayEquals 16384 - random bytes 4.9530 ns/op 5.0030 ns/op 0.99
Buffer.compare 16384 - random bytes 16.477 ns/op 15.833 ns/op 1.04
byteArrayEquals 123687377 - random bytes 6.1400 ns/op 7.9400 ns/op 0.77
Buffer.compare 123687377 - random bytes 17.940 ns/op 18.730 ns/op 0.96
regular array get 100000 times 32.342 us/op 31.439 us/op 1.03
wrappedArray get 100000 times 32.131 us/op 31.329 us/op 1.03
arrayWithProxy get 100000 times 13.336 ms/op 9.3698 ms/op 1.42
ssz.Root.equals 44.740 ns/op 45.128 ns/op 0.99
byteArrayEquals 43.967 ns/op 44.481 ns/op 0.99
Buffer.compare 9.9670 ns/op 9.1860 ns/op 1.09
processSlot - 1 slots 9.8830 us/op 11.294 us/op 0.88
processSlot - 32 slots 1.9650 ms/op 2.5699 ms/op 0.76
getEffectiveBalanceIncrementsZeroInactive - 250000 vs - 7PWei 48.874 ms/op 60.160 ms/op 0.81
getCommitteeAssignments - req 1 vs - 250000 vc 1.9733 ms/op 1.8735 ms/op 1.05
getCommitteeAssignments - req 100 vs - 250000 vc 3.7959 ms/op 3.7171 ms/op 1.02
getCommitteeAssignments - req 1000 vs - 250000 vc 4.0378 ms/op 3.9352 ms/op 1.03
findModifiedValidators - 10000 modified validators 711.71 ms/op 1.0185 s/op 0.70
findModifiedValidators - 1000 modified validators 692.16 ms/op 747.35 ms/op 0.93
findModifiedValidators - 100 modified validators 251.20 ms/op 358.75 ms/op 0.70
findModifiedValidators - 10 modified validators 198.31 ms/op 261.07 ms/op 0.76
findModifiedValidators - 1 modified validators 174.28 ms/op 179.52 ms/op 0.97
findModifiedValidators - no difference 251.72 ms/op 155.72 ms/op 1.62
compare ViewDUs 6.0215 s/op 6.6545 s/op 0.90
compare each validator Uint8Array 1.3071 s/op 1.4128 s/op 0.93
compare ViewDU to Uint8Array 1.0592 s/op 733.08 ms/op 1.44
migrate state 1000000 validators, 24 modified, 0 new 790.00 ms/op 818.67 ms/op 0.96
migrate state 1000000 validators, 1700 modified, 1000 new 1.1066 s/op 1.1822 s/op 0.94
migrate state 1000000 validators, 3400 modified, 2000 new 1.1461 s/op 1.3061 s/op 0.88
migrate state 1500000 validators, 24 modified, 0 new 856.86 ms/op 917.41 ms/op 0.93
migrate state 1500000 validators, 1700 modified, 1000 new 1.1307 s/op 1.0224 s/op 1.11
migrate state 1500000 validators, 3400 modified, 2000 new 1.2243 s/op 1.2375 s/op 0.99
RootCache.getBlockRootAtSlot - 250000 vs - 7PWei 4.1600 ns/op 5.8400 ns/op 0.71
state getBlockRootAtSlot - 250000 vs - 7PWei 392.99 ns/op 477.35 ns/op 0.82
computeProposers - vc 250000 6.6398 ms/op 5.6249 ms/op 1.18
computeEpochShuffling - vc 250000 41.971 ms/op 35.693 ms/op 1.18
getNextSyncCommittee - vc 250000 123.91 ms/op 113.43 ms/op 1.09
computeSigningRoot for AttestationData 16.655 us/op 21.248 us/op 0.78
hash AttestationData serialized data then Buffer.toString(base64) 1.5297 us/op 1.1840 us/op 1.29
toHexString serialized data 816.92 ns/op 881.06 ns/op 0.93
Buffer.toString(base64) 164.14 ns/op 111.67 ns/op 1.47
nodejs block root to RootHex using toHex 153.42 ns/op 102.97 ns/op 1.49
nodejs block root to RootHex using toRootHex 85.396 ns/op 65.877 ns/op 1.30
browser block root to RootHex using the deprecated toHexString 208.83 ns/op 187.24 ns/op 1.12
browser block root to RootHex using toHex 169.53 ns/op 155.35 ns/op 1.09
browser block root to RootHex using toRootHex 157.95 ns/op 148.84 ns/op 1.06

by benchmarkbot/action

Copy link
Contributor

@g11tech g11tech left a comment

Choose a reason for hiding this comment

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

lgtm

@wemeetagain wemeetagain merged commit 048741b into unstable Feb 3, 2025
20 checks passed
@wemeetagain wemeetagain deleted the nflaig/block-timeouts branch February 3, 2025 15:15
philknows pushed a commit that referenced this pull request Feb 3, 2025
…#7420)

**Motivation**

Based on observations from mainnet nodes, it seems like we reject
builder blocks in some cases either due to not being sent within cutoff
time or due to timeout on the api call but looking at the response times
these have been timely. The reason why those were rejected is either we
started the block production race too late into the slot, which is
mostly due to the fact that we take too much time to produce the common
block body or the timeout was handled by the node with a delay, both of
these cases are likely caused by event loop lag either due to GC or
processing something else.

See
[discord](https://discord.com/channels/593655374469660673/1331991458152058991/1335576180815958088)
for details.

**Description**

Increase block production timeouts to account for event loop lag
@wemeetagain
Copy link
Member

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