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: offline error message when node is shutting down #5797

Merged
merged 10 commits into from
Aug 8, 2023

Conversation

nazarhussain
Copy link
Contributor

Motivation

There should not be a false error log.

Description

Currently when node is shutting down, it shows an error message that EL engine is turned offline, which is not the valid case.

Steps to test or reproduce

  • Run the beacon-node
  • Wait for log message to show EL engine is syncing
  • Shutdown the beacon-node

@nazarhussain nazarhussain self-assigned this Jul 24, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Jul 24, 2023

Performance Report

✔️ no performance regression detected

Full benchmark results
Benchmark suite Current: 302ac8b Previous: 108b8ed Ratio
getPubkeys - index2pubkey - req 1000 vs - 250000 vc 644.70 us/op 780.38 us/op 0.83
getPubkeys - validatorsArr - req 1000 vs - 250000 vc 77.353 us/op 120.06 us/op 0.64
BLS verify - blst-native 1.2401 ms/op 1.3013 ms/op 0.95
BLS verifyMultipleSignatures 3 - blst-native 2.5243 ms/op 2.8477 ms/op 0.89
BLS verifyMultipleSignatures 8 - blst-native 5.4248 ms/op 6.1171 ms/op 0.89
BLS verifyMultipleSignatures 32 - blst-native 19.601 ms/op 20.451 ms/op 0.96
BLS aggregatePubkeys 32 - blst-native 25.896 us/op 27.376 us/op 0.95
BLS aggregatePubkeys 128 - blst-native 101.89 us/op 106.71 us/op 0.95
getAttestationsForBlock 58.049 ms/op 85.337 ms/op 0.68
isKnown best case - 1 super set check 293.00 ns/op 616.00 ns/op 0.48
isKnown normal case - 2 super set checks 269.00 ns/op 588.00 ns/op 0.46
isKnown worse case - 16 super set checks 267.00 ns/op 562.00 ns/op 0.48
CheckpointStateCache - add get delete 5.4340 us/op 6.2810 us/op 0.87
validate api signedAggregateAndProof - struct 2.8019 ms/op 2.9893 ms/op 0.94
validate gossip signedAggregateAndProof - struct 2.8660 ms/op 2.9705 ms/op 0.96
validate api attestation - struct 1.3369 ms/op 1.5025 ms/op 0.89
validate gossip attestation - struct 1.3570 ms/op 1.4665 ms/op 0.93
pickEth1Vote - no votes 1.2717 ms/op 1.4174 ms/op 0.90
pickEth1Vote - max votes 12.349 ms/op 13.352 ms/op 0.92
pickEth1Vote - Eth1Data hashTreeRoot value x2048 9.6629 ms/op 10.247 ms/op 0.94
pickEth1Vote - Eth1Data hashTreeRoot tree x2048 18.266 ms/op 21.102 ms/op 0.87
pickEth1Vote - Eth1Data fastSerialize value x2048 744.31 us/op 721.12 us/op 1.03
pickEth1Vote - Eth1Data fastSerialize tree x2048 7.8465 ms/op 5.9958 ms/op 1.31
bytes32 toHexString 594.00 ns/op 833.00 ns/op 0.71
bytes32 Buffer.toString(hex) 325.00 ns/op 362.00 ns/op 0.90
bytes32 Buffer.toString(hex) from Uint8Array 539.00 ns/op 630.00 ns/op 0.86
bytes32 Buffer.toString(hex) + 0x 320.00 ns/op 356.00 ns/op 0.90
Object access 1 prop 0.21800 ns/op 0.24300 ns/op 0.90
Map access 1 prop 0.17200 ns/op 0.16200 ns/op 1.06
Object get x1000 8.3470 ns/op 8.4090 ns/op 0.99
Map get x1000 0.77200 ns/op 0.80400 ns/op 0.96
Object set x1000 66.124 ns/op 78.731 ns/op 0.84
Map set x1000 47.108 ns/op 60.201 ns/op 0.78
Return object 10000 times 0.25590 ns/op 0.38390 ns/op 0.67
Throw Error 10000 times 4.0343 us/op 4.9301 us/op 0.82
fastMsgIdFn sha256 / 200 bytes 3.3950 us/op 3.8160 us/op 0.89
fastMsgIdFn h32 xxhash / 200 bytes 331.00 ns/op 371.00 ns/op 0.89
fastMsgIdFn h64 xxhash / 200 bytes 394.00 ns/op 433.00 ns/op 0.91
fastMsgIdFn sha256 / 1000 bytes 11.904 us/op 12.216 us/op 0.97
fastMsgIdFn h32 xxhash / 1000 bytes 489.00 ns/op 498.00 ns/op 0.98
fastMsgIdFn h64 xxhash / 1000 bytes 487.00 ns/op 498.00 ns/op 0.98
fastMsgIdFn sha256 / 10000 bytes 108.89 us/op 109.72 us/op 0.99
fastMsgIdFn h32 xxhash / 10000 bytes 2.1130 us/op 2.1250 us/op 0.99
fastMsgIdFn h64 xxhash / 10000 bytes 1.4430 us/op 1.4360 us/op 1.00
enrSubnets - fastDeserialize 64 bits 1.5080 us/op 1.4430 us/op 1.05
enrSubnets - ssz BitVector 64 bits 552.00 ns/op 468.00 ns/op 1.18
enrSubnets - fastDeserialize 4 bits 250.00 ns/op 229.00 ns/op 1.09
enrSubnets - ssz BitVector 4 bits 567.00 ns/op 616.00 ns/op 0.92
prioritizePeers score -10:0 att 32-0.1 sync 2-0 117.20 us/op 120.83 us/op 0.97
prioritizePeers score 0:0 att 32-0.25 sync 2-0.25 153.97 us/op 153.89 us/op 1.00
prioritizePeers score 0:0 att 32-0.5 sync 2-0.5 209.44 us/op 207.45 us/op 1.01
prioritizePeers score 0:0 att 64-0.75 sync 4-0.75 356.01 us/op 368.73 us/op 0.97
prioritizePeers score 0:0 att 64-1 sync 4-1 387.46 us/op 382.31 us/op 1.01
array of 16000 items push then shift 1.6442 us/op 1.6196 us/op 1.02
LinkedList of 16000 items push then shift 9.5200 ns/op 9.2780 ns/op 1.03
array of 16000 items push then pop 61.019 ns/op 61.473 ns/op 0.99
LinkedList of 16000 items push then pop 9.2520 ns/op 8.9450 ns/op 1.03
array of 24000 items push then shift 2.7568 us/op 2.5373 us/op 1.09
LinkedList of 24000 items push then shift 9.2930 ns/op 9.1220 ns/op 1.02
array of 24000 items push then pop 122.00 ns/op 126.24 ns/op 0.97
LinkedList of 24000 items push then pop 10.000 ns/op 9.4510 ns/op 1.06
intersect bitArray bitLen 8 7.0500 ns/op 6.9410 ns/op 1.02
intersect array and set length 8 87.244 ns/op 71.181 ns/op 1.23
intersect bitArray bitLen 128 35.022 ns/op 32.716 ns/op 1.07
intersect array and set length 128 1.0704 us/op 995.63 ns/op 1.08
bitArray.getTrueBitIndexes() bitLen 128 1.8250 us/op 2.1040 us/op 0.87
bitArray.getTrueBitIndexes() bitLen 248 3.2750 us/op 3.0770 us/op 1.06
bitArray.getTrueBitIndexes() bitLen 512 7.1310 us/op 6.7300 us/op 1.06
Buffer.concat 32 items 1.1530 us/op 1.1560 us/op 1.00
Uint8Array.set 32 items 2.0940 us/op 2.0190 us/op 1.04
transfer serialized Status (84 B) 1.9720 us/op 2.1890 us/op 0.90
copy serialized Status (84 B) 1.6990 us/op 1.7170 us/op 0.99
transfer serialized SignedVoluntaryExit (112 B) 2.1340 us/op 2.3550 us/op 0.91
copy serialized SignedVoluntaryExit (112 B) 1.7930 us/op 1.7930 us/op 1.00
transfer serialized ProposerSlashing (416 B) 2.5320 us/op 2.8220 us/op 0.90
copy serialized ProposerSlashing (416 B) 2.3000 us/op 2.6830 us/op 0.86
transfer serialized Attestation (485 B) 2.5150 us/op 2.9820 us/op 0.84
copy serialized Attestation (485 B) 2.2400 us/op 2.7760 us/op 0.81
transfer serialized AttesterSlashing (33232 B) 2.5870 us/op 2.8900 us/op 0.90
copy serialized AttesterSlashing (33232 B) 8.4550 us/op 7.3920 us/op 1.14
transfer serialized Small SignedBeaconBlock (128000 B) 3.2530 us/op 3.2150 us/op 1.01
copy serialized Small SignedBeaconBlock (128000 B) 24.141 us/op 16.310 us/op 1.48
transfer serialized Avg SignedBeaconBlock (200000 B) 4.0550 us/op 3.4770 us/op 1.17
copy serialized Avg SignedBeaconBlock (200000 B) 30.912 us/op 25.863 us/op 1.20
transfer serialized BlobsSidecar (524380 B) 4.5710 us/op 3.3010 us/op 1.38
copy serialized BlobsSidecar (524380 B) 94.584 us/op 81.186 us/op 1.17
transfer serialized Big SignedBeaconBlock (1000000 B) 4.3430 us/op 3.7750 us/op 1.15
copy serialized Big SignedBeaconBlock (1000000 B) 203.42 us/op 159.23 us/op 1.28
pass gossip attestations to forkchoice per slot 2.3409 ms/op 2.1602 ms/op 1.08
forkChoice updateHead vc 100000 bc 64 eq 0 2.3225 ms/op 2.2036 ms/op 1.05
forkChoice updateHead vc 600000 bc 64 eq 0 15.146 ms/op 11.237 ms/op 1.35
forkChoice updateHead vc 1000000 bc 64 eq 0 24.325 ms/op 18.199 ms/op 1.34
forkChoice updateHead vc 600000 bc 320 eq 0 18.987 ms/op 16.934 ms/op 1.12
forkChoice updateHead vc 600000 bc 1200 eq 0 93.207 ms/op 86.481 ms/op 1.08
forkChoice updateHead vc 600000 bc 64 eq 1000 23.469 ms/op 19.029 ms/op 1.23
forkChoice updateHead vc 600000 bc 64 eq 10000 26.781 ms/op 21.052 ms/op 1.27
forkChoice updateHead vc 600000 bc 64 eq 300000 53.766 ms/op 28.474 ms/op 1.89
computeDeltas 3.5507 ms/op 3.7991 ms/op 0.93
computeProposerBoostScoreFromBalances 394.95 us/op 390.80 us/op 1.01
altair processAttestation - 250000 vs - 7PWei normalcase 2.1584 ms/op 2.1280 ms/op 1.01
altair processAttestation - 250000 vs - 7PWei worstcase 3.2511 ms/op 3.1982 ms/op 1.02
altair processAttestation - setStatus - 1/6 committees join 176.88 us/op 141.15 us/op 1.25
altair processAttestation - setStatus - 1/3 committees join 343.13 us/op 276.95 us/op 1.24
altair processAttestation - setStatus - 1/2 committees join 463.31 us/op 380.23 us/op 1.22
altair processAttestation - setStatus - 2/3 committees join 589.10 us/op 473.85 us/op 1.24
altair processAttestation - setStatus - 4/5 committees join 790.04 us/op 666.39 us/op 1.19
altair processAttestation - setStatus - 100% committees join 918.78 us/op 799.03 us/op 1.15
altair processBlock - 250000 vs - 7PWei normalcase 10.798 ms/op 10.548 ms/op 1.02
altair processBlock - 250000 vs - 7PWei normalcase hashState 16.764 ms/op 16.895 ms/op 0.99
altair processBlock - 250000 vs - 7PWei worstcase 38.752 ms/op 42.610 ms/op 0.91
altair processBlock - 250000 vs - 7PWei worstcase hashState 59.107 ms/op 62.939 ms/op 0.94
phase0 processBlock - 250000 vs - 7PWei normalcase 2.8064 ms/op 2.6056 ms/op 1.08
phase0 processBlock - 250000 vs - 7PWei worstcase 31.845 ms/op 30.056 ms/op 1.06
altair processEth1Data - 250000 vs - 7PWei normalcase 463.00 us/op 497.53 us/op 0.93
getExpectedWithdrawals 250000 eb:1,eth1:1,we:0,wn:0,smpl:15 16.078 us/op 14.303 us/op 1.12
getExpectedWithdrawals 250000 eb:0.95,eth1:0.1,we:0.05,wn:0,smpl:219 76.179 us/op 72.715 us/op 1.05
getExpectedWithdrawals 250000 eb:0.95,eth1:0.3,we:0.05,wn:0,smpl:42 25.855 us/op 25.972 us/op 1.00
getExpectedWithdrawals 250000 eb:0.95,eth1:0.7,we:0.05,wn:0,smpl:18 12.056 us/op 15.946 us/op 0.76
getExpectedWithdrawals 250000 eb:0.1,eth1:0.1,we:0,wn:0,smpl:1020 228.75 us/op 208.95 us/op 1.09
getExpectedWithdrawals 250000 eb:0.03,eth1:0.03,we:0,wn:0,smpl:11777 2.0232 ms/op 1.7167 ms/op 1.18
getExpectedWithdrawals 250000 eb:0.01,eth1:0.01,we:0,wn:0,smpl:16384 2.8904 ms/op 1.8415 ms/op 1.57
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,smpl:16384 1.6132 ms/op 2.0225 ms/op 0.80
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,nocache,smpl:16384 3.1362 ms/op 3.1972 ms/op 0.98
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,smpl:16384 2.3608 ms/op 2.1712 ms/op 1.09
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,nocache,smpl:16384 4.6979 ms/op 5.2353 ms/op 0.90
Tree 40 250000 create 335.36 ms/op 344.28 ms/op 0.97
Tree 40 250000 get(125000) 201.69 ns/op 200.13 ns/op 1.01
Tree 40 250000 set(125000) 915.36 ns/op 877.39 ns/op 1.04
Tree 40 250000 toArray() 17.313 ms/op 18.424 ms/op 0.94
Tree 40 250000 iterate all - toArray() + loop 17.276 ms/op 20.883 ms/op 0.83
Tree 40 250000 iterate all - get(i) 66.474 ms/op 69.794 ms/op 0.95
MutableVector 250000 create 15.051 ms/op 13.681 ms/op 1.10
MutableVector 250000 get(125000) 6.7280 ns/op 6.7370 ns/op 1.00
MutableVector 250000 set(125000) 251.34 ns/op 274.33 ns/op 0.92
MutableVector 250000 toArray() 3.3402 ms/op 3.1507 ms/op 1.06
MutableVector 250000 iterate all - toArray() + loop 3.4167 ms/op 4.8146 ms/op 0.71
MutableVector 250000 iterate all - get(i) 1.6315 ms/op 1.6285 ms/op 1.00
Array 250000 create 2.8412 ms/op 2.7439 ms/op 1.04
Array 250000 clone - spread 1.1270 ms/op 933.68 us/op 1.21
Array 250000 get(125000) 0.54700 ns/op 0.48000 ns/op 1.14
Array 250000 set(125000) 0.63800 ns/op 0.55600 ns/op 1.15
Array 250000 iterate all - loop 85.750 us/op 106.14 us/op 0.81
effectiveBalanceIncrements clone Uint8Array 300000 29.322 us/op 20.920 us/op 1.40
effectiveBalanceIncrements clone MutableVector 300000 324.00 ns/op 252.00 ns/op 1.29
effectiveBalanceIncrements rw all Uint8Array 300000 184.09 us/op 178.72 us/op 1.03
effectiveBalanceIncrements rw all MutableVector 300000 85.248 ms/op 74.574 ms/op 1.14
phase0 afterProcessEpoch - 250000 vs - 7PWei 118.32 ms/op 117.26 ms/op 1.01
phase0 beforeProcessEpoch - 250000 vs - 7PWei 53.918 ms/op 42.335 ms/op 1.27
altair processEpoch - mainnet_e81889 343.22 ms/op 337.70 ms/op 1.02
mainnet_e81889 - altair beforeProcessEpoch 60.491 ms/op 66.027 ms/op 0.92
mainnet_e81889 - altair processJustificationAndFinalization 16.937 us/op 18.181 us/op 0.93
mainnet_e81889 - altair processInactivityUpdates 5.7531 ms/op 6.3787 ms/op 0.90
mainnet_e81889 - altair processRewardsAndPenalties 77.829 ms/op 59.048 ms/op 1.32
mainnet_e81889 - altair processRegistryUpdates 2.2200 us/op 2.8020 us/op 0.79
mainnet_e81889 - altair processSlashings 390.00 ns/op 483.00 ns/op 0.81
mainnet_e81889 - altair processEth1DataReset 439.00 ns/op 757.00 ns/op 0.58
mainnet_e81889 - altair processEffectiveBalanceUpdates 1.4563 ms/op 1.5126 ms/op 0.96
mainnet_e81889 - altair processSlashingsReset 2.5230 us/op 4.0620 us/op 0.62
mainnet_e81889 - altair processRandaoMixesReset 8.4230 us/op 5.6940 us/op 1.48
mainnet_e81889 - altair processHistoricalRootsUpdate 751.00 ns/op 862.00 ns/op 0.87
mainnet_e81889 - altair processParticipationFlagUpdates 1.8780 us/op 2.7900 us/op 0.67
mainnet_e81889 - altair processSyncCommitteeUpdates 494.00 ns/op 461.00 ns/op 1.07
mainnet_e81889 - altair afterProcessEpoch 129.54 ms/op 135.91 ms/op 0.95
capella processEpoch - mainnet_e217614 1.1297 s/op 1.0765 s/op 1.05
mainnet_e217614 - capella beforeProcessEpoch 272.39 ms/op 250.20 ms/op 1.09
mainnet_e217614 - capella processJustificationAndFinalization 17.403 us/op 20.292 us/op 0.86
mainnet_e217614 - capella processInactivityUpdates 18.710 ms/op 16.342 ms/op 1.14
mainnet_e217614 - capella processRewardsAndPenalties 345.15 ms/op 319.33 ms/op 1.08
mainnet_e217614 - capella processRegistryUpdates 36.461 us/op 27.855 us/op 1.31
mainnet_e217614 - capella processSlashings 1.4220 us/op 813.00 ns/op 1.75
mainnet_e217614 - capella processEth1DataReset 994.00 ns/op 502.00 ns/op 1.98
mainnet_e217614 - capella processEffectiveBalanceUpdates 6.4826 ms/op 4.2045 ms/op 1.54
mainnet_e217614 - capella processSlashingsReset 6.9160 us/op 3.3010 us/op 2.10
mainnet_e217614 - capella processRandaoMixesReset 11.332 us/op 7.2300 us/op 1.57
mainnet_e217614 - capella processHistoricalRootsUpdate 2.3370 us/op 853.00 ns/op 2.74
mainnet_e217614 - capella processParticipationFlagUpdates 5.5220 us/op 2.2220 us/op 2.49
mainnet_e217614 - capella afterProcessEpoch 400.80 ms/op 307.98 ms/op 1.30
phase0 processEpoch - mainnet_e58758 455.04 ms/op 370.69 ms/op 1.23
mainnet_e58758 - phase0 beforeProcessEpoch 231.78 ms/op 133.44 ms/op 1.74
mainnet_e58758 - phase0 processJustificationAndFinalization 31.571 us/op 19.230 us/op 1.64
mainnet_e58758 - phase0 processRewardsAndPenalties 86.061 ms/op 66.075 ms/op 1.30
mainnet_e58758 - phase0 processRegistryUpdates 18.735 us/op 14.324 us/op 1.31
mainnet_e58758 - phase0 processSlashings 1.0120 us/op 675.00 ns/op 1.50
mainnet_e58758 - phase0 processEth1DataReset 709.00 ns/op 661.00 ns/op 1.07
mainnet_e58758 - phase0 processEffectiveBalanceUpdates 1.3894 ms/op 1.4149 ms/op 0.98
mainnet_e58758 - phase0 processSlashingsReset 4.1860 us/op 5.5580 us/op 0.75
mainnet_e58758 - phase0 processRandaoMixesReset 5.7340 us/op 7.0200 us/op 0.82
mainnet_e58758 - phase0 processHistoricalRootsUpdate 851.00 ns/op 718.00 ns/op 1.19
mainnet_e58758 - phase0 processParticipationRecordUpdates 9.1280 us/op 7.1690 us/op 1.27
mainnet_e58758 - phase0 afterProcessEpoch 106.63 ms/op 120.21 ms/op 0.89
phase0 processEffectiveBalanceUpdates - 250000 normalcase 1.6911 ms/op 1.7144 ms/op 0.99
phase0 processEffectiveBalanceUpdates - 250000 worstcase 0.5 2.3293 ms/op 1.9502 ms/op 1.19
altair processInactivityUpdates - 250000 normalcase 37.871 ms/op 28.723 ms/op 1.32
altair processInactivityUpdates - 250000 worstcase 39.888 ms/op 25.189 ms/op 1.58
phase0 processRegistryUpdates - 250000 normalcase 19.991 us/op 11.817 us/op 1.69
phase0 processRegistryUpdates - 250000 badcase_full_deposits 509.18 us/op 411.81 us/op 1.24
phase0 processRegistryUpdates - 250000 worstcase 0.5 158.04 ms/op 143.87 ms/op 1.10
altair processRewardsAndPenalties - 250000 normalcase 75.711 ms/op 70.056 ms/op 1.08
altair processRewardsAndPenalties - 250000 worstcase 72.278 ms/op 77.146 ms/op 0.94
phase0 getAttestationDeltas - 250000 normalcase 8.8877 ms/op 7.9950 ms/op 1.11
phase0 getAttestationDeltas - 250000 worstcase 9.7599 ms/op 9.3751 ms/op 1.04
phase0 processSlashings - 250000 worstcase 2.6524 ms/op 2.4550 ms/op 1.08
altair processSyncCommitteeUpdates - 250000 159.89 ms/op 166.24 ms/op 0.96
BeaconState.hashTreeRoot - No change 284.00 ns/op 296.00 ns/op 0.96
BeaconState.hashTreeRoot - 1 full validator 58.737 us/op 62.625 us/op 0.94
BeaconState.hashTreeRoot - 32 full validator 536.42 us/op 624.83 us/op 0.86
BeaconState.hashTreeRoot - 512 full validator 6.4900 ms/op 6.1305 ms/op 1.06
BeaconState.hashTreeRoot - 1 validator.effectiveBalance 67.649 us/op 69.505 us/op 0.97
BeaconState.hashTreeRoot - 32 validator.effectiveBalance 992.39 us/op 1.0334 ms/op 0.96
BeaconState.hashTreeRoot - 512 validator.effectiveBalance 13.812 ms/op 12.667 ms/op 1.09
BeaconState.hashTreeRoot - 1 balances 52.833 us/op 55.603 us/op 0.95
BeaconState.hashTreeRoot - 32 balances 485.22 us/op 526.06 us/op 0.92
BeaconState.hashTreeRoot - 512 balances 5.0960 ms/op 4.6998 ms/op 1.08
BeaconState.hashTreeRoot - 250000 balances 76.837 ms/op 86.204 ms/op 0.89
aggregationBits - 2048 els - zipIndexesInBitList 17.645 us/op 15.855 us/op 1.11
regular array get 100000 times 45.074 us/op 45.752 us/op 0.99
wrappedArray get 100000 times 33.615 us/op 37.213 us/op 0.90
arrayWithProxy get 100000 times 16.098 ms/op 16.510 ms/op 0.98
ssz.Root.equals 249.00 ns/op 255.00 ns/op 0.98
byteArrayEquals 255.00 ns/op 250.00 ns/op 1.02
shuffle list - 16384 els 7.3381 ms/op 7.3515 ms/op 1.00
shuffle list - 250000 els 108.37 ms/op 106.09 ms/op 1.02
processSlot - 1 slots 10.228 us/op 9.7960 us/op 1.04
processSlot - 32 slots 1.4513 ms/op 1.4744 ms/op 0.98
getEffectiveBalanceIncrementsZeroInactive - 250000 vs - 7PWei 60.998 ms/op 58.297 ms/op 1.05
getCommitteeAssignments - req 1 vs - 250000 vc 2.6509 ms/op 2.5987 ms/op 1.02
getCommitteeAssignments - req 100 vs - 250000 vc 3.8128 ms/op 3.7694 ms/op 1.01
getCommitteeAssignments - req 1000 vs - 250000 vc 4.2346 ms/op 4.1721 ms/op 1.01
RootCache.getBlockRootAtSlot - 250000 vs - 7PWei 5.6700 ns/op 4.7300 ns/op 1.20
state getBlockRootAtSlot - 250000 vs - 7PWei 894.40 ns/op 522.64 ns/op 1.71
computeProposers - vc 250000 10.125 ms/op 8.6516 ms/op 1.17
computeEpochShuffling - vc 250000 118.09 ms/op 106.82 ms/op 1.11
getNextSyncCommittee - vc 250000 173.88 ms/op 152.44 ms/op 1.14
computeSigningRoot for AttestationData 15.856 us/op 13.749 us/op 1.15
hash AttestationData serialized data then Buffer.toString(base64) 2.8270 us/op 2.4230 us/op 1.17
toHexString serialized data 2.0923 us/op 1.0899 us/op 1.92
Buffer.toString(base64) 309.38 ns/op 220.52 ns/op 1.40

by benchmarkbot/action

@nazarhussain nazarhussain marked this pull request as ready for review July 31, 2023 12:37
@nazarhussain nazarhussain requested a review from a team as a code owner July 31, 2023 12:37
@nazarhussain nazarhussain changed the title fix: don't show offline error when node is shutting down fix: offline error message when node is shutting down Jul 31, 2023
Copy link
Member

@nflaig nflaig left a comment

Choose a reason for hiding this comment

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

As the EL status changes rely on error.code returned from fetch, we might wanna merge #5811 first to make sure EL status still works and adapt error codes here in this PR if required.

I added a bunch of tests in the PR to make sure error codes still work as expected, see fetch.test.ts.

Based on codes defined here

export const HTTP_FATAL_ERROR_CODES = ["ECONNREFUSED", "ENOTFOUND", "EAI_AGAIN"];
export const HTTP_CONNECTION_ERROR_CODES = ["ECONNRESET", "ECONNABORTED"];

It seems like EAI_AGAIN, ECONNRESET, and ECONNABORTED are not covered, @nazarhussain if by any chance you know how to produce them I would add them to the test cases.

packages/beacon-node/src/execution/engine/http.ts Outdated Show resolved Hide resolved
packages/beacon-node/src/execution/engine/http.ts Outdated Show resolved Hide resolved
import {ErrorJsonRpcResponse, HttpRpcError} from "../../../../src/eth1/provider/jsonRpcHttpClient.js";

describe("execution/engine/utils", () => {
describe("getExecutionEngineState", () => {
Copy link
Member

@nflaig nflaig Jul 31, 2023

Choose a reason for hiding this comment

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

These tests are great!

As this relies on error.code returned from fetch, we might wanna merge #5811 first to make sure EL status is still works.

Tests would not catch if error.code returned from fetch changes, will have to cover all cases in fetch.test.ts to make sure we can rely on those error codes.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

These are very standard error codes must comply with any fetch implementation. Testing regressively native implementations is not suggested. But for node/browser compatibility of fetch we should have some basic tests.

Copy link
Member

Choose a reason for hiding this comment

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

Yes, I doubt the error codes will ever change, I just tested different cases in regard to custom FetchError added in #5811 but these are rather meant to test if FetchError works as expected.

Since we use native fetch now it is even more unlikely we get unexpected errors. As per my understanding the codes you are checking right now for EL offline/auth failed should be alright and it is anyhow hard produce specific error codes (#5811 (comment)).

packages/beacon-node/src/execution/engine/http.ts Outdated Show resolved Hide resolved
@nazarhussain
Copy link
Contributor Author

It seems like EAI_AGAIN, ECONNRESET, and ECONNABORTED are not covered, @nazarhussain if by any chance you know how to produce them I would add them to the test cases.

For those e need to create a custom server implementation which reset the client connections. I don't think it's important enough to mock a server for now.

Copy link
Member

@nflaig nflaig left a comment

Choose a reason for hiding this comment

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

Just some minor remarks, would suggest another review from someone else, maybe @g11tech who is more familiar with this code.

packages/beacon-node/src/execution/engine/http.ts Outdated Show resolved Hide resolved
}
}

function getExecutionEngineStateForPayloadError(
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
function getExecutionEngineStateForPayloadError(
function getELStateFromPayloadError(

)
// If there are errors by EL like connection refused, internal error, they need to be
// treated separate from being INVALID. For now, just pass the error upstream.
.catch((e: Error): EngineApiRpcReturnTypes[typeof method] => {
Copy link
Contributor

Choose a reason for hiding this comment

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

this error handling is required upstream in processBlocks (as well as to not downgrade the peer in case of UNAVAILABLE)

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.

restore the previous error hadling in new payload

@@ -30,7 +30,7 @@ export enum ExecutePayloadStatus {
UNSAFE_OPTIMISTIC_STATUS = "UNSAFE_OPTIMISTIC_STATUS",
}

export enum ExecutionEngineState {
export enum ExecutionState {
Copy link
Contributor

Choose a reason for hiding this comment

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

i am thinking if ExecutionState might cause confusion over reference to actual execution state, in that case original ExecutionEngineState is preferable

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If I use ExecutionEngineState, then would prefer to use the same vocabulary/wording to other places for variables and functions. That will lead to almost similar to what we had earlier. Will it be ok?

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

@g11tech g11tech merged commit df2f4d3 into unstable Aug 8, 2023
11 checks passed
@g11tech g11tech deleted the nh/fix-el-status-message branch August 8, 2023 07:42
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