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: getHealth returns 206 status code if EL is optimistic or offline #6920

Merged
merged 2 commits into from
Jul 5, 2024

Conversation

nflaig
Copy link
Member

@nflaig nflaig commented Jun 29, 2024

Motivation

Description

getHealth returns 206 status code if EL is syncing / optimistic

Closes #6664

@nflaig
Copy link
Member Author

nflaig commented Jun 29, 2024

Something else to consider is if EL is offline, this is not clearly defined in the spec but Lodestar considers itself synced for 32 slots until head is too far behind but it's can't properly serve all requests, so it might be better to immediately return a 206 status code in that case as well.

Copy link

codecov bot commented Jun 29, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 62.52%. Comparing base (f69bc11) to head (3d69b79).

Additional details and impacted files
@@            Coverage Diff            @@
##           unstable    #6920   +/-   ##
=========================================
  Coverage     62.52%   62.52%           
=========================================
  Files           575      575           
  Lines         60985    60985           
  Branches       2118     2121    +3     
=========================================
+ Hits          38128    38129    +1     
+ Misses        22818    22817    -1     
  Partials         39       39           

Copy link
Contributor

github-actions bot commented Jun 29, 2024

Performance Report

✔️ no performance regression detected

Full benchmark results
Benchmark suite Current: 72b4661 Previous: d87a901 Ratio
getPubkeys - index2pubkey - req 1000 vs - 250000 vc 649.05 us/op 516.28 us/op 1.26
getPubkeys - validatorsArr - req 1000 vs - 250000 vc 37.440 us/op 37.733 us/op 0.99
BLS verify - blst-native 1.0427 ms/op 1.1111 ms/op 0.94
BLS verifyMultipleSignatures 3 - blst-native 2.2281 ms/op 2.3868 ms/op 0.93
BLS verifyMultipleSignatures 8 - blst-native 4.9309 ms/op 5.2575 ms/op 0.94
BLS verifyMultipleSignatures 32 - blst-native 18.110 ms/op 19.185 ms/op 0.94
BLS verifyMultipleSignatures 64 - blst-native 36.495 ms/op 37.936 ms/op 0.96
BLS verifyMultipleSignatures 128 - blst-native 71.667 ms/op 75.015 ms/op 0.96
BLS deserializing 10000 signatures 766.40 ms/op 794.42 ms/op 0.96
BLS deserializing 100000 signatures 7.6385 s/op 8.0156 s/op 0.95
BLS verifyMultipleSignatures - same message - 3 - blst-native 1.1226 ms/op 1.1417 ms/op 0.98
BLS verifyMultipleSignatures - same message - 8 - blst-native 1.2279 ms/op 1.2976 ms/op 0.95
BLS verifyMultipleSignatures - same message - 32 - blst-native 1.9218 ms/op 2.0382 ms/op 0.94
BLS verifyMultipleSignatures - same message - 64 - blst-native 2.8540 ms/op 3.4894 ms/op 0.82
BLS verifyMultipleSignatures - same message - 128 - blst-native 5.8613 ms/op 6.1630 ms/op 0.95
BLS aggregatePubkeys 32 - blst-native 22.870 us/op 23.693 us/op 0.97
BLS aggregatePubkeys 128 - blst-native 83.930 us/op 88.669 us/op 0.95
notSeenSlots=1 numMissedVotes=1 numBadVotes=10 57.477 ms/op 60.599 ms/op 0.95
notSeenSlots=1 numMissedVotes=0 numBadVotes=4 41.689 ms/op 45.178 ms/op 0.92
notSeenSlots=2 numMissedVotes=1 numBadVotes=10 27.056 ms/op 31.163 ms/op 0.87
getSlashingsAndExits - default max 73.949 us/op 73.939 us/op 1.00
getSlashingsAndExits - 2k 232.16 us/op 244.76 us/op 0.95
proposeBlockBody type=full, size=empty 4.9488 ms/op 4.9790 ms/op 0.99
isKnown best case - 1 super set check 458.00 ns/op 462.00 ns/op 0.99
isKnown normal case - 2 super set checks 458.00 ns/op 457.00 ns/op 1.00
isKnown worse case - 16 super set checks 466.00 ns/op 456.00 ns/op 1.02
InMemoryCheckpointStateCache - add get delete 3.8660 us/op 3.8230 us/op 1.01
validate api signedAggregateAndProof - struct 2.2558 ms/op 2.3082 ms/op 0.98
validate gossip signedAggregateAndProof - struct 2.2580 ms/op 2.3034 ms/op 0.98
validate gossip attestation - vc 640000 1.1167 ms/op 1.1201 ms/op 1.00
batch validate gossip attestation - vc 640000 - chunk 32 132.43 us/op 131.41 us/op 1.01
batch validate gossip attestation - vc 640000 - chunk 64 116.06 us/op 116.77 us/op 0.99
batch validate gossip attestation - vc 640000 - chunk 128 108.56 us/op 110.33 us/op 0.98
batch validate gossip attestation - vc 640000 - chunk 256 102.95 us/op 109.06 us/op 0.94
pickEth1Vote - no votes 842.05 us/op 818.11 us/op 1.03
pickEth1Vote - max votes 7.7633 ms/op 5.7678 ms/op 1.35
pickEth1Vote - Eth1Data hashTreeRoot value x2048 13.727 ms/op 9.4287 ms/op 1.46
pickEth1Vote - Eth1Data hashTreeRoot tree x2048 19.075 ms/op 15.641 ms/op 1.22
pickEth1Vote - Eth1Data fastSerialize value x2048 404.79 us/op 337.18 us/op 1.20
pickEth1Vote - Eth1Data fastSerialize tree x2048 6.9917 ms/op 7.1937 ms/op 0.97
bytes32 toHexString 578.00 ns/op 611.00 ns/op 0.95
bytes32 Buffer.toString(hex) 424.00 ns/op 440.00 ns/op 0.96
bytes32 Buffer.toString(hex) from Uint8Array 528.00 ns/op 547.00 ns/op 0.97
bytes32 Buffer.toString(hex) + 0x 426.00 ns/op 427.00 ns/op 1.00
Object access 1 prop 0.32500 ns/op 0.30800 ns/op 1.06
Map access 1 prop 0.32000 ns/op 0.30900 ns/op 1.04
Object get x1000 5.3490 ns/op 4.7810 ns/op 1.12
Map get x1000 5.9600 ns/op 5.5400 ns/op 1.08
Object set x1000 22.197 ns/op 22.508 ns/op 0.99
Map set x1000 18.620 ns/op 18.621 ns/op 1.00
Return object 10000 times 0.29620 ns/op 0.29990 ns/op 0.99
Throw Error 10000 times 2.7283 us/op 2.7011 us/op 1.01
fastMsgIdFn sha256 / 200 bytes 1.9560 us/op 1.9710 us/op 0.99
fastMsgIdFn h32 xxhash / 200 bytes 401.00 ns/op 409.00 ns/op 0.98
fastMsgIdFn h64 xxhash / 200 bytes 464.00 ns/op 453.00 ns/op 1.02
fastMsgIdFn sha256 / 1000 bytes 5.9660 us/op 6.0390 us/op 0.99
fastMsgIdFn h32 xxhash / 1000 bytes 517.00 ns/op 525.00 ns/op 0.98
fastMsgIdFn h64 xxhash / 1000 bytes 520.00 ns/op 528.00 ns/op 0.98
fastMsgIdFn sha256 / 10000 bytes 49.892 us/op 52.245 us/op 0.95
fastMsgIdFn h32 xxhash / 10000 bytes 1.8650 us/op 1.8840 us/op 0.99
fastMsgIdFn h64 xxhash / 10000 bytes 1.3170 us/op 1.3070 us/op 1.01
send data - 1000 256B messages 9.7181 ms/op 9.8411 ms/op 0.99
send data - 1000 512B messages 12.749 ms/op 13.058 ms/op 0.98
send data - 1000 1024B messages 20.280 ms/op 21.032 ms/op 0.96
send data - 1000 1200B messages 23.325 ms/op 22.802 ms/op 1.02
send data - 1000 2048B messages 28.475 ms/op 28.359 ms/op 1.00
send data - 1000 4096B messages 26.279 ms/op 24.802 ms/op 1.06
send data - 1000 16384B messages 64.392 ms/op 68.316 ms/op 0.94
send data - 1000 65536B messages 251.60 ms/op 237.85 ms/op 1.06
enrSubnets - fastDeserialize 64 bits 1.1300 us/op 1.1500 us/op 0.98
enrSubnets - ssz BitVector 64 bits 515.00 ns/op 551.00 ns/op 0.93
enrSubnets - fastDeserialize 4 bits 313.00 ns/op 355.00 ns/op 0.88
enrSubnets - ssz BitVector 4 bits 504.00 ns/op 557.00 ns/op 0.90
prioritizePeers score -10:0 att 32-0.1 sync 2-0 124.91 us/op 138.45 us/op 0.90
prioritizePeers score 0:0 att 32-0.25 sync 2-0.25 154.14 us/op 177.79 us/op 0.87
prioritizePeers score 0:0 att 32-0.5 sync 2-0.5 306.63 us/op 308.69 us/op 0.99
prioritizePeers score 0:0 att 64-0.75 sync 4-0.75 407.95 us/op 471.96 us/op 0.86
prioritizePeers score 0:0 att 64-1 sync 4-1 538.08 us/op 538.95 us/op 1.00
array of 16000 items push then shift 1.2847 us/op 1.2559 us/op 1.02
LinkedList of 16000 items push then shift 6.4490 ns/op 7.6440 ns/op 0.84
array of 16000 items push then pop 77.651 ns/op 124.99 ns/op 0.62
LinkedList of 16000 items push then pop 6.3280 ns/op 6.3420 ns/op 1.00
array of 24000 items push then shift 1.8878 us/op 1.9249 us/op 0.98
LinkedList of 24000 items push then shift 6.3300 ns/op 6.4600 ns/op 0.98
array of 24000 items push then pop 107.33 ns/op 108.85 ns/op 0.99
LinkedList of 24000 items push then pop 6.1630 ns/op 6.3100 ns/op 0.98
intersect bitArray bitLen 8 5.0880 ns/op 5.4460 ns/op 0.93
intersect array and set length 8 37.999 ns/op 39.930 ns/op 0.95
intersect bitArray bitLen 128 25.101 ns/op 26.613 ns/op 0.94
intersect array and set length 128 547.87 ns/op 587.12 ns/op 0.93
bitArray.getTrueBitIndexes() bitLen 128 2.0570 us/op 2.1410 us/op 0.96
bitArray.getTrueBitIndexes() bitLen 248 3.1360 us/op 2.8960 us/op 1.08
bitArray.getTrueBitIndexes() bitLen 512 6.4980 us/op 6.0840 us/op 1.07
Buffer.concat 32 items 1.0150 us/op 1.1660 us/op 0.87
Uint8Array.set 32 items 1.6770 us/op 1.5940 us/op 1.05
Buffer.copy 1.7770 us/op 1.7800 us/op 1.00
Uint8Array.set - with subarray 2.4050 us/op 2.3520 us/op 1.02
Uint8Array.set - without subarray 1.6720 us/op 1.7810 us/op 0.94
Set add up to 64 items then delete first 1.7714 us/op 1.7539 us/op 1.01
OrderedSet add up to 64 items then delete first 2.7622 us/op 2.8310 us/op 0.98
Set add up to 64 items then delete last 2.0331 us/op 2.0768 us/op 0.98
OrderedSet add up to 64 items then delete last 3.0717 us/op 3.1329 us/op 0.98
Set add up to 64 items then delete middle 2.0362 us/op 2.0780 us/op 0.98
OrderedSet add up to 64 items then delete middle 4.4596 us/op 4.5539 us/op 0.98
Set add up to 128 items then delete first 3.9604 us/op 4.0770 us/op 0.97
OrderedSet add up to 128 items then delete first 6.1518 us/op 6.4254 us/op 0.96
Set add up to 128 items then delete last 3.8805 us/op 3.9591 us/op 0.98
OrderedSet add up to 128 items then delete last 5.8895 us/op 6.0400 us/op 0.98
Set add up to 128 items then delete middle 3.8883 us/op 3.9699 us/op 0.98
OrderedSet add up to 128 items then delete middle 11.405 us/op 12.024 us/op 0.95
Set add up to 256 items then delete first 7.6934 us/op 7.9777 us/op 0.96
OrderedSet add up to 256 items then delete first 12.200 us/op 12.766 us/op 0.96
Set add up to 256 items then delete last 7.6093 us/op 7.7762 us/op 0.98
OrderedSet add up to 256 items then delete last 11.613 us/op 12.034 us/op 0.97
Set add up to 256 items then delete middle 7.5706 us/op 7.7617 us/op 0.98
OrderedSet add up to 256 items then delete middle 34.144 us/op 34.684 us/op 0.98
transfer serialized Status (84 B) 1.5040 us/op 1.4630 us/op 1.03
copy serialized Status (84 B) 1.2550 us/op 1.2770 us/op 0.98
transfer serialized SignedVoluntaryExit (112 B) 1.6490 us/op 1.4750 us/op 1.12
copy serialized SignedVoluntaryExit (112 B) 1.3180 us/op 1.2550 us/op 1.05
transfer serialized ProposerSlashing (416 B) 2.1650 us/op 1.5490 us/op 1.40
copy serialized ProposerSlashing (416 B) 1.8210 us/op 1.6010 us/op 1.14
transfer serialized Attestation (485 B) 2.2070 us/op 1.6520 us/op 1.34
copy serialized Attestation (485 B) 1.8460 us/op 1.3630 us/op 1.35
transfer serialized AttesterSlashing (33232 B) 2.1950 us/op 1.8650 us/op 1.18
copy serialized AttesterSlashing (33232 B) 4.1560 us/op 3.7160 us/op 1.12
transfer serialized Small SignedBeaconBlock (128000 B) 2.6470 us/op 2.0020 us/op 1.32
copy serialized Small SignedBeaconBlock (128000 B) 9.4740 us/op 10.450 us/op 0.91
transfer serialized Avg SignedBeaconBlock (200000 B) 3.4370 us/op 2.5950 us/op 1.32
copy serialized Avg SignedBeaconBlock (200000 B) 12.996 us/op 14.089 us/op 0.92
transfer serialized BlobsSidecar (524380 B) 2.9100 us/op 2.9520 us/op 0.99
copy serialized BlobsSidecar (524380 B) 74.974 us/op 87.951 us/op 0.85
transfer serialized Big SignedBeaconBlock (1000000 B) 3.3790 us/op 3.5070 us/op 0.96
copy serialized Big SignedBeaconBlock (1000000 B) 176.50 us/op 326.06 us/op 0.54
pass gossip attestations to forkchoice per slot 2.4537 ms/op 2.5701 ms/op 0.95
forkChoice updateHead vc 100000 bc 64 eq 0 380.13 us/op 471.84 us/op 0.81
forkChoice updateHead vc 600000 bc 64 eq 0 2.3494 ms/op 2.6297 ms/op 0.89
forkChoice updateHead vc 1000000 bc 64 eq 0 4.0542 ms/op 4.6138 ms/op 0.88
forkChoice updateHead vc 600000 bc 320 eq 0 2.6134 ms/op 2.5207 ms/op 1.04
forkChoice updateHead vc 600000 bc 1200 eq 0 2.3696 ms/op 2.5689 ms/op 0.92
forkChoice updateHead vc 600000 bc 7200 eq 0 3.0955 ms/op 2.8233 ms/op 1.10
forkChoice updateHead vc 600000 bc 64 eq 1000 9.6661 ms/op 9.6644 ms/op 1.00
forkChoice updateHead vc 600000 bc 64 eq 10000 9.4279 ms/op 9.5619 ms/op 0.99
forkChoice updateHead vc 600000 bc 64 eq 300000 10.955 ms/op 11.786 ms/op 0.93
computeDeltas 500000 validators 300 proto nodes 2.9762 ms/op 2.9917 ms/op 0.99
computeDeltas 500000 validators 1200 proto nodes 2.9705 ms/op 3.0944 ms/op 0.96
computeDeltas 500000 validators 7200 proto nodes 2.9755 ms/op 3.0398 ms/op 0.98
computeDeltas 750000 validators 300 proto nodes 4.4030 ms/op 4.6112 ms/op 0.95
computeDeltas 750000 validators 1200 proto nodes 4.4213 ms/op 4.5042 ms/op 0.98
computeDeltas 750000 validators 7200 proto nodes 4.3908 ms/op 4.3965 ms/op 1.00
computeDeltas 1400000 validators 300 proto nodes 8.0492 ms/op 8.2221 ms/op 0.98
computeDeltas 1400000 validators 1200 proto nodes 8.2286 ms/op 8.2180 ms/op 1.00
computeDeltas 1400000 validators 7200 proto nodes 8.1319 ms/op 8.1976 ms/op 0.99
computeDeltas 2100000 validators 300 proto nodes 12.424 ms/op 12.061 ms/op 1.03
computeDeltas 2100000 validators 1200 proto nodes 12.234 ms/op 12.074 ms/op 1.01
computeDeltas 2100000 validators 7200 proto nodes 12.102 ms/op 12.371 ms/op 0.98
altair processAttestation - 250000 vs - 7PWei normalcase 1.4069 ms/op 1.3205 ms/op 1.07
altair processAttestation - 250000 vs - 7PWei worstcase 2.0977 ms/op 2.0709 ms/op 1.01
altair processAttestation - setStatus - 1/6 committees join 65.176 us/op 60.905 us/op 1.07
altair processAttestation - setStatus - 1/3 committees join 128.83 us/op 122.72 us/op 1.05
altair processAttestation - setStatus - 1/2 committees join 186.74 us/op 190.82 us/op 0.98
altair processAttestation - setStatus - 2/3 committees join 255.47 us/op 260.91 us/op 0.98
altair processAttestation - setStatus - 4/5 committees join 391.36 us/op 382.79 us/op 1.02
altair processAttestation - setStatus - 100% committees join 478.35 us/op 461.22 us/op 1.04
altair processBlock - 250000 vs - 7PWei normalcase 3.2112 ms/op 4.0258 ms/op 0.80
altair processBlock - 250000 vs - 7PWei normalcase hashState 29.572 ms/op 29.123 ms/op 1.02
altair processBlock - 250000 vs - 7PWei worstcase 42.470 ms/op 42.882 ms/op 0.99
altair processBlock - 250000 vs - 7PWei worstcase hashState 79.281 ms/op 60.704 ms/op 1.31
phase0 processBlock - 250000 vs - 7PWei normalcase 2.0963 ms/op 1.7358 ms/op 1.21
phase0 processBlock - 250000 vs - 7PWei worstcase 23.714 ms/op 23.487 ms/op 1.01
altair processEth1Data - 250000 vs - 7PWei normalcase 232.13 us/op 242.22 us/op 0.96
getExpectedWithdrawals 250000 eb:1,eth1:1,we:0,wn:0,smpl:15 4.4670 us/op 3.8410 us/op 1.16
getExpectedWithdrawals 250000 eb:0.95,eth1:0.1,we:0.05,wn:0,smpl:219 18.508 us/op 18.332 us/op 1.01
getExpectedWithdrawals 250000 eb:0.95,eth1:0.3,we:0.05,wn:0,smpl:42 6.2610 us/op 6.6010 us/op 0.95
getExpectedWithdrawals 250000 eb:0.95,eth1:0.7,we:0.05,wn:0,smpl:18 2.6470 us/op 4.4490 us/op 0.59
getExpectedWithdrawals 250000 eb:0.1,eth1:0.1,we:0,wn:0,smpl:1020 78.981 us/op 69.419 us/op 1.14
getExpectedWithdrawals 250000 eb:0.03,eth1:0.03,we:0,wn:0,smpl:11777 752.84 us/op 752.50 us/op 1.00
getExpectedWithdrawals 250000 eb:0.01,eth1:0.01,we:0,wn:0,smpl:16384 1.0708 ms/op 641.96 us/op 1.67
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,smpl:16384 1.0237 ms/op 1.0186 ms/op 1.01
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,nocache,smpl:16384 2.0565 ms/op 1.9452 ms/op 1.06
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,smpl:16384 1.0834 ms/op 1.2129 ms/op 0.89
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,nocache,smpl:16384 2.8995 ms/op 3.1920 ms/op 0.91
Tree 40 250000 create 175.32 ms/op 173.63 ms/op 1.01
Tree 40 250000 get(125000) 116.20 ns/op 111.22 ns/op 1.04
Tree 40 250000 set(125000) 515.11 ns/op 506.95 ns/op 1.02
Tree 40 250000 toArray() 12.629 ms/op 9.5716 ms/op 1.32
Tree 40 250000 iterate all - toArray() + loop 12.264 ms/op 9.4960 ms/op 1.29
Tree 40 250000 iterate all - get(i) 39.611 ms/op 39.558 ms/op 1.00
MutableVector 250000 create 9.1153 ms/op 7.6832 ms/op 1.19
MutableVector 250000 get(125000) 5.6220 ns/op 5.5880 ns/op 1.01
MutableVector 250000 set(125000) 167.58 ns/op 151.38 ns/op 1.11
MutableVector 250000 toArray() 2.9605 ms/op 2.9338 ms/op 1.01
MutableVector 250000 iterate all - toArray() + loop 3.0209 ms/op 3.0193 ms/op 1.00
MutableVector 250000 iterate all - get(i) 1.3690 ms/op 1.5593 ms/op 0.88
Array 250000 create 2.6364 ms/op 2.3377 ms/op 1.13
Array 250000 clone - spread 1.1613 ms/op 1.2525 ms/op 0.93
Array 250000 get(125000) 0.56800 ns/op 0.57500 ns/op 0.99
Array 250000 set(125000) 0.58300 ns/op 0.59800 ns/op 0.97
Array 250000 iterate all - loop 73.226 us/op 77.148 us/op 0.95
effectiveBalanceIncrements clone Uint8Array 300000 18.083 us/op 13.514 us/op 1.34
effectiveBalanceIncrements clone MutableVector 300000 311.00 ns/op 314.00 ns/op 0.99
effectiveBalanceIncrements rw all Uint8Array 300000 159.01 us/op 167.07 us/op 0.95
effectiveBalanceIncrements rw all MutableVector 300000 50.251 ms/op 50.373 ms/op 1.00
phase0 afterProcessEpoch - 250000 vs - 7PWei 72.827 ms/op 76.054 ms/op 0.96
phase0 beforeProcessEpoch - 250000 vs - 7PWei 37.811 ms/op 39.270 ms/op 0.96
altair processEpoch - mainnet_e81889 357.87 ms/op 329.63 ms/op 1.09
mainnet_e81889 - altair beforeProcessEpoch 58.986 ms/op 35.486 ms/op 1.66
mainnet_e81889 - altair processJustificationAndFinalization 6.4130 us/op 10.356 us/op 0.62
mainnet_e81889 - altair processInactivityUpdates 4.0755 ms/op 5.4628 ms/op 0.75
mainnet_e81889 - altair processRewardsAndPenalties 53.343 ms/op 46.940 ms/op 1.14
mainnet_e81889 - altair processRegistryUpdates 1.9670 us/op 1.7930 us/op 1.10
mainnet_e81889 - altair processSlashings 797.00 ns/op 824.00 ns/op 0.97
mainnet_e81889 - altair processEth1DataReset 690.00 ns/op 735.00 ns/op 0.94
mainnet_e81889 - altair processEffectiveBalanceUpdates 1.3028 ms/op 1.2955 ms/op 1.01
mainnet_e81889 - altair processSlashingsReset 2.2450 us/op 2.5020 us/op 0.90
mainnet_e81889 - altair processRandaoMixesReset 2.7840 us/op 2.7990 us/op 0.99
mainnet_e81889 - altair processHistoricalRootsUpdate 705.00 ns/op 710.00 ns/op 0.99
mainnet_e81889 - altair processParticipationFlagUpdates 2.5230 us/op 1.5550 us/op 1.62
mainnet_e81889 - altair processSyncCommitteeUpdates 750.00 ns/op 772.00 ns/op 0.97
mainnet_e81889 - altair afterProcessEpoch 76.441 ms/op 79.831 ms/op 0.96
capella processEpoch - mainnet_e217614 1.2270 s/op 1.2421 s/op 0.99
mainnet_e217614 - capella beforeProcessEpoch 220.95 ms/op 236.03 ms/op 0.94
mainnet_e217614 - capella processJustificationAndFinalization 5.8220 us/op 11.981 us/op 0.49
mainnet_e217614 - capella processInactivityUpdates 14.787 ms/op 17.211 ms/op 0.86
mainnet_e217614 - capella processRewardsAndPenalties 260.98 ms/op 268.71 ms/op 0.97
mainnet_e217614 - capella processRegistryUpdates 6.8660 us/op 13.790 us/op 0.50
mainnet_e217614 - capella processSlashings 439.00 ns/op 875.00 ns/op 0.50
mainnet_e217614 - capella processEth1DataReset 410.00 ns/op 995.00 ns/op 0.41
mainnet_e217614 - capella processEffectiveBalanceUpdates 4.2298 ms/op 15.735 ms/op 0.27
mainnet_e217614 - capella processSlashingsReset 1.3930 us/op 5.5430 us/op 0.25
mainnet_e217614 - capella processRandaoMixesReset 1.7630 us/op 5.1500 us/op 0.34
mainnet_e217614 - capella processHistoricalRootsUpdate 441.00 ns/op 1.5570 us/op 0.28
mainnet_e217614 - capella processParticipationFlagUpdates 819.00 ns/op 1.9510 us/op 0.42
mainnet_e217614 - capella afterProcessEpoch 236.57 ms/op 216.68 ms/op 1.09
phase0 processEpoch - mainnet_e58758 329.54 ms/op 380.87 ms/op 0.87
mainnet_e58758 - phase0 beforeProcessEpoch 101.76 ms/op 121.94 ms/op 0.83
mainnet_e58758 - phase0 processJustificationAndFinalization 10.171 us/op 18.443 us/op 0.55
mainnet_e58758 - phase0 processRewardsAndPenalties 36.869 ms/op 25.891 ms/op 1.42
mainnet_e58758 - phase0 processRegistryUpdates 4.1940 us/op 9.1420 us/op 0.46
mainnet_e58758 - phase0 processSlashings 494.00 ns/op 770.00 ns/op 0.64
mainnet_e58758 - phase0 processEth1DataReset 440.00 ns/op 856.00 ns/op 0.51
mainnet_e58758 - phase0 processEffectiveBalanceUpdates 662.56 us/op 1.1723 ms/op 0.57
mainnet_e58758 - phase0 processSlashingsReset 1.2230 us/op 2.7470 us/op 0.45
mainnet_e58758 - phase0 processRandaoMixesReset 3.0590 us/op 2.0440 us/op 1.50
mainnet_e58758 - phase0 processHistoricalRootsUpdate 757.00 ns/op 441.00 ns/op 1.72
mainnet_e58758 - phase0 processParticipationRecordUpdates 2.4560 us/op 5.7860 us/op 0.42
mainnet_e58758 - phase0 afterProcessEpoch 62.083 ms/op 70.087 ms/op 0.89
phase0 processEffectiveBalanceUpdates - 250000 normalcase 1.3164 ms/op 813.58 us/op 1.62
phase0 processEffectiveBalanceUpdates - 250000 worstcase 0.5 1.0107 ms/op 1.3944 ms/op 0.72
altair processInactivityUpdates - 250000 normalcase 18.397 ms/op 18.115 ms/op 1.02
altair processInactivityUpdates - 250000 worstcase 17.490 ms/op 17.457 ms/op 1.00
phase0 processRegistryUpdates - 250000 normalcase 3.2050 us/op 5.9530 us/op 0.54
phase0 processRegistryUpdates - 250000 badcase_full_deposits 292.60 us/op 302.52 us/op 0.97
phase0 processRegistryUpdates - 250000 worstcase 0.5 106.66 ms/op 110.36 ms/op 0.97
altair processRewardsAndPenalties - 250000 normalcase 48.027 ms/op 44.707 ms/op 1.07
altair processRewardsAndPenalties - 250000 worstcase 45.887 ms/op 36.224 ms/op 1.27
phase0 getAttestationDeltas - 250000 normalcase 5.5747 ms/op 7.2376 ms/op 0.77
phase0 getAttestationDeltas - 250000 worstcase 6.0139 ms/op 8.0911 ms/op 0.74
phase0 processSlashings - 250000 worstcase 79.320 us/op 94.771 us/op 0.84
altair processSyncCommitteeUpdates - 250000 103.98 ms/op 115.98 ms/op 0.90
BeaconState.hashTreeRoot - No change 490.00 ns/op 616.00 ns/op 0.80
BeaconState.hashTreeRoot - 1 full validator 101.66 us/op 137.10 us/op 0.74
BeaconState.hashTreeRoot - 32 full validator 990.71 us/op 1.1547 ms/op 0.86
BeaconState.hashTreeRoot - 512 full validator 12.447 ms/op 12.793 ms/op 0.97
BeaconState.hashTreeRoot - 1 validator.effectiveBalance 150.28 us/op 159.80 us/op 0.94
BeaconState.hashTreeRoot - 32 validator.effectiveBalance 2.0277 ms/op 2.4495 ms/op 0.83
BeaconState.hashTreeRoot - 512 validator.effectiveBalance 24.508 ms/op 31.628 ms/op 0.77
BeaconState.hashTreeRoot - 1 balances 103.28 us/op 120.70 us/op 0.86
BeaconState.hashTreeRoot - 32 balances 1.2684 ms/op 1.0581 ms/op 1.20
BeaconState.hashTreeRoot - 512 balances 11.974 ms/op 6.7121 ms/op 1.78
BeaconState.hashTreeRoot - 250000 balances 178.70 ms/op 216.36 ms/op 0.83
aggregationBits - 2048 els - zipIndexesInBitList 19.784 us/op 31.026 us/op 0.64
byteArrayEquals 32 47.438 ns/op 48.735 ns/op 0.97
Buffer.compare 32 16.075 ns/op 15.542 ns/op 1.03
byteArrayEquals 1024 1.2704 us/op 1.2757 us/op 1.00
Buffer.compare 1024 23.152 ns/op 24.104 ns/op 0.96
byteArrayEquals 16384 20.118 us/op 20.922 us/op 0.96
Buffer.compare 16384 192.55 ns/op 184.75 ns/op 1.04
byteArrayEquals 123687377 151.37 ms/op 157.45 ms/op 0.96
Buffer.compare 123687377 3.6779 ms/op 6.9997 ms/op 0.53
byteArrayEquals 32 - diff last byte 46.741 ns/op 48.414 ns/op 0.97
Buffer.compare 32 - diff last byte 16.282 ns/op 16.244 ns/op 1.00
byteArrayEquals 1024 - diff last byte 1.2574 us/op 1.2996 us/op 0.97
Buffer.compare 1024 - diff last byte 23.356 ns/op 25.156 ns/op 0.93
byteArrayEquals 16384 - diff last byte 19.948 us/op 20.968 us/op 0.95
Buffer.compare 16384 - diff last byte 172.24 ns/op 206.13 ns/op 0.84
byteArrayEquals 123687377 - diff last byte 145.82 ms/op 152.30 ms/op 0.96
Buffer.compare 123687377 - diff last byte 3.7426 ms/op 6.5050 ms/op 0.58
byteArrayEquals 32 - random bytes 4.9200 ns/op 4.8290 ns/op 1.02
Buffer.compare 32 - random bytes 15.873 ns/op 15.669 ns/op 1.01
byteArrayEquals 1024 - random bytes 4.8540 ns/op 4.9140 ns/op 0.99
Buffer.compare 1024 - random bytes 16.514 ns/op 15.435 ns/op 1.07
byteArrayEquals 16384 - random bytes 4.8630 ns/op 4.9280 ns/op 0.99
Buffer.compare 16384 - random bytes 16.590 ns/op 15.685 ns/op 1.06
byteArrayEquals 123687377 - random bytes 7.8700 ns/op 7.9800 ns/op 0.99
Buffer.compare 123687377 - random bytes 19.710 ns/op 18.590 ns/op 1.06
regular array get 100000 times 30.704 us/op 30.655 us/op 1.00
wrappedArray get 100000 times 30.718 us/op 30.494 us/op 1.01
arrayWithProxy get 100000 times 11.094 ms/op 8.8857 ms/op 1.25
ssz.Root.equals 43.371 ns/op 44.216 ns/op 0.98
byteArrayEquals 38.677 ns/op 43.019 ns/op 0.90
Buffer.compare 9.6340 ns/op 8.9440 ns/op 1.08
shuffle list - 16384 els 4.9920 ms/op 5.7012 ms/op 0.88
shuffle list - 250000 els 73.326 ms/op 81.917 ms/op 0.90
processSlot - 1 slots 14.859 us/op 11.994 us/op 1.24
processSlot - 32 slots 2.7576 ms/op 2.6349 ms/op 1.05
getEffectiveBalanceIncrementsZeroInactive - 250000 vs - 7PWei 41.957 ms/op 36.560 ms/op 1.15
getCommitteeAssignments - req 1 vs - 250000 vc 1.7980 ms/op 1.7649 ms/op 1.02
getCommitteeAssignments - req 100 vs - 250000 vc 3.5153 ms/op 3.4828 ms/op 1.01
getCommitteeAssignments - req 1000 vs - 250000 vc 3.7689 ms/op 3.7196 ms/op 1.01
findModifiedValidators - 10000 modified validators 235.53 ms/op 216.53 ms/op 1.09
findModifiedValidators - 1000 modified validators 153.01 ms/op 146.48 ms/op 1.04
findModifiedValidators - 100 modified validators 140.87 ms/op 142.39 ms/op 0.99
findModifiedValidators - 10 modified validators 127.76 ms/op 135.05 ms/op 0.95
findModifiedValidators - 1 modified validators 143.97 ms/op 128.43 ms/op 1.12
findModifiedValidators - no difference 145.03 ms/op 156.97 ms/op 0.92
compare ViewDUs 2.9569 s/op 2.9490 s/op 1.00
compare each validator Uint8Array 1.4200 s/op 1.1731 s/op 1.21
compare ViewDU to Uint8Array 736.80 ms/op 725.82 ms/op 1.02
migrate state 1000000 validators, 24 modified, 0 new 574.67 ms/op 508.98 ms/op 1.13
migrate state 1000000 validators, 1700 modified, 1000 new 810.04 ms/op 677.18 ms/op 1.20
migrate state 1000000 validators, 3400 modified, 2000 new 1.0277 s/op 844.18 ms/op 1.22
migrate state 1500000 validators, 24 modified, 0 new 579.28 ms/op 533.91 ms/op 1.08
migrate state 1500000 validators, 1700 modified, 1000 new 810.25 ms/op 858.95 ms/op 0.94
migrate state 1500000 validators, 3400 modified, 2000 new 1.0252 s/op 978.06 ms/op 1.05
RootCache.getBlockRootAtSlot - 250000 vs - 7PWei 5.6900 ns/op 7.0400 ns/op 0.81
state getBlockRootAtSlot - 250000 vs - 7PWei 695.50 ns/op 357.81 ns/op 1.94
computeProposers - vc 250000 6.2766 ms/op 5.3130 ms/op 1.18
computeEpochShuffling - vc 250000 78.412 ms/op 83.497 ms/op 0.94
getNextSyncCommittee - vc 250000 106.45 ms/op 94.406 ms/op 1.13
computeSigningRoot for AttestationData 21.875 us/op 15.766 us/op 1.39
hash AttestationData serialized data then Buffer.toString(base64) 1.1805 us/op 1.1652 us/op 1.01
toHexString serialized data 781.14 ns/op 803.09 ns/op 0.97
Buffer.toString(base64) 138.94 ns/op 150.52 ns/op 0.92

by benchmarkbot/action

@nflaig nflaig changed the title fix: getHealth returns 206 status code if EL is syncing / optimistic fix: getHealth returns 206 status code if EL is optimistic or offline Jun 29, 2024
@nflaig
Copy link
Member Author

nflaig commented Jun 29, 2024

Something else to consider is if EL is offline, this is not clearly defined in the spec but Lodestar considers itself synced for 32 slots until head is too far behind but it's can't properly serve all requests, so it might be better to immediately return a 206 status code in that case as well.

@wemeetagain wemeetagain merged commit d56e871 into unstable Jul 5, 2024
21 checks passed
@wemeetagain wemeetagain deleted the nflaig/optimistic-health-check branch July 5, 2024 14:33
@wemeetagain
Copy link
Member

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

getHealth should return 206 status code if EL is syncing / optimistic
2 participants