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

chore!: use node v20 throughout monorepo #5730

Merged
merged 27 commits into from
Jul 16, 2023
Merged

chore!: use node v20 throughout monorepo #5730

merged 27 commits into from
Jul 16, 2023

Conversation

wemeetagain
Copy link
Member

@wemeetagain wemeetagain commented Jul 5, 2023

Motivation

Since #5611, we support node v20, but we aren't using it everywhere

Description

Update docs, workflows, types, and docker images to use node 20

TODO

  • Update sim tests to node 20

@wemeetagain wemeetagain requested a review from a team as a code owner July 5, 2023 14:22
@wemeetagain wemeetagain changed the title chore!: use node 20 throughout monorepo chore!: use node v20 throughout monorepo Jul 5, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Jul 6, 2023

Performance Report

✔️ no performance regression detected

🚀🚀 Significant benchmark improvement detected

Benchmark suite Current: f562e87 Previous: cdca9fb Ratio
computeProposerBoostScoreFromBalances 391.53 us/op 1.9511 ms/op 0.20
Full benchmark results
Benchmark suite Current: f562e87 Previous: cdca9fb Ratio
getPubkeys - index2pubkey - req 1000 vs - 250000 vc 566.88 us/op 569.54 us/op 1.00
getPubkeys - validatorsArr - req 1000 vs - 250000 vc 76.981 us/op 50.357 us/op 1.53
BLS verify - blst-native 1.2599 ms/op 1.2602 ms/op 1.00
BLS verifyMultipleSignatures 3 - blst-native 2.5829 ms/op 2.5493 ms/op 1.01
BLS verifyMultipleSignatures 8 - blst-native 5.4577 ms/op 5.5415 ms/op 0.98
BLS verifyMultipleSignatures 32 - blst-native 19.588 ms/op 19.968 ms/op 0.98
BLS aggregatePubkeys 32 - blst-native 26.160 us/op 26.700 us/op 0.98
BLS aggregatePubkeys 128 - blst-native 98.610 us/op 102.34 us/op 0.96
getAttestationsForBlock 57.421 ms/op 58.633 ms/op 0.98
isKnown best case - 1 super set check 296.00 ns/op 274.00 ns/op 1.08
isKnown normal case - 2 super set checks 287.00 ns/op 261.00 ns/op 1.10
isKnown worse case - 16 super set checks 283.00 ns/op 258.00 ns/op 1.10
CheckpointStateCache - add get delete 5.1450 us/op 5.6930 us/op 0.90
validate api signedAggregateAndProof - struct 2.8232 ms/op 2.7908 ms/op 1.01
validate gossip signedAggregateAndProof - struct 2.8185 ms/op 2.8305 ms/op 1.00
validate api attestation - struct 1.3389 ms/op 1.3435 ms/op 1.00
validate gossip attestation - struct 1.3567 ms/op 1.3415 ms/op 1.01
pickEth1Vote - no votes 1.2153 ms/op 1.3140 ms/op 0.92
pickEth1Vote - max votes 7.9913 ms/op 9.1681 ms/op 0.87
pickEth1Vote - Eth1Data hashTreeRoot value x2048 8.5103 ms/op 8.5170 ms/op 1.00
pickEth1Vote - Eth1Data hashTreeRoot tree x2048 13.612 ms/op 14.739 ms/op 0.92
pickEth1Vote - Eth1Data fastSerialize value x2048 584.38 us/op 695.66 us/op 0.84
pickEth1Vote - Eth1Data fastSerialize tree x2048 5.7150 ms/op 4.5740 ms/op 1.25
bytes32 toHexString 502.00 ns/op 480.00 ns/op 1.05
bytes32 Buffer.toString(hex) 288.00 ns/op 363.00 ns/op 0.79
bytes32 Buffer.toString(hex) from Uint8Array 438.00 ns/op 566.00 ns/op 0.77
bytes32 Buffer.toString(hex) + 0x 286.00 ns/op 352.00 ns/op 0.81
Object access 1 prop 0.16000 ns/op 0.16600 ns/op 0.96
Map access 1 prop 0.14200 ns/op 0.16200 ns/op 0.88
Object get x1000 8.1910 ns/op 6.6970 ns/op 1.22
Map get x1000 0.63500 ns/op 0.59000 ns/op 1.08
Object set x1000 51.958 ns/op 52.755 ns/op 0.98
Map set x1000 38.870 ns/op 44.999 ns/op 0.86
Return object 10000 times 0.24120 ns/op 0.24150 ns/op 1.00
Throw Error 10000 times 3.9649 us/op 4.2628 us/op 0.93
fastMsgIdFn sha256 / 200 bytes 3.4180 us/op 3.5020 us/op 0.98
fastMsgIdFn h32 xxhash / 200 bytes 308.00 ns/op 279.00 ns/op 1.10
fastMsgIdFn h64 xxhash / 200 bytes 377.00 ns/op 403.00 ns/op 0.94
fastMsgIdFn sha256 / 1000 bytes 11.703 us/op 11.682 us/op 1.00
fastMsgIdFn h32 xxhash / 1000 bytes 453.00 ns/op 414.00 ns/op 1.09
fastMsgIdFn h64 xxhash / 1000 bytes 447.00 ns/op 483.00 ns/op 0.93
fastMsgIdFn sha256 / 10000 bytes 105.66 us/op 104.58 us/op 1.01
fastMsgIdFn h32 xxhash / 10000 bytes 2.0380 us/op 1.9800 us/op 1.03
fastMsgIdFn h64 xxhash / 10000 bytes 1.4130 us/op 1.4110 us/op 1.00
enrSubnets - fastDeserialize 64 bits 1.4050 us/op 1.2960 us/op 1.08
enrSubnets - ssz BitVector 64 bits 453.00 ns/op 500.00 ns/op 0.91
enrSubnets - fastDeserialize 4 bits 170.00 ns/op 169.00 ns/op 1.01
enrSubnets - ssz BitVector 4 bits 411.00 ns/op 513.00 ns/op 0.80
prioritizePeers score -10:0 att 32-0.1 sync 2-0 101.84 us/op 101.84 us/op 1.00
prioritizePeers score 0:0 att 32-0.25 sync 2-0.25 120.88 us/op 134.63 us/op 0.90
prioritizePeers score 0:0 att 32-0.5 sync 2-0.5 161.39 us/op 184.45 us/op 0.87
prioritizePeers score 0:0 att 64-0.75 sync 4-0.75 324.66 us/op 309.43 us/op 1.05
prioritizePeers score 0:0 att 64-1 sync 4-1 367.31 us/op 367.92 us/op 1.00
array of 16000 items push then shift 1.6457 us/op 1.6424 us/op 1.00
LinkedList of 16000 items push then shift 9.2440 ns/op 8.9140 ns/op 1.04
array of 16000 items push then pop 59.353 ns/op 88.841 ns/op 0.67
LinkedList of 16000 items push then pop 8.8250 ns/op 8.6620 ns/op 1.02
array of 24000 items push then shift 2.4140 us/op 2.3871 us/op 1.01
LinkedList of 24000 items push then shift 8.8290 ns/op 8.8530 ns/op 1.00
array of 24000 items push then pop 112.03 ns/op 82.787 ns/op 1.35
LinkedList of 24000 items push then pop 8.7880 ns/op 8.6210 ns/op 1.02
intersect bitArray bitLen 8 6.8760 ns/op 13.344 ns/op 0.52
intersect array and set length 8 61.388 ns/op 76.652 ns/op 0.80
intersect bitArray bitLen 128 33.934 ns/op 44.294 ns/op 0.77
intersect array and set length 128 865.54 ns/op 1.0831 us/op 0.80
bitArray.getTrueBitIndexes() bitLen 128 1.7800 us/op 1.3880 us/op 1.28
bitArray.getTrueBitIndexes() bitLen 248 2.9890 us/op 2.3260 us/op 1.29
bitArray.getTrueBitIndexes() bitLen 512 5.7550 us/op 4.6640 us/op 1.23
Buffer.concat 32 items 1.0590 us/op 2.6470 us/op 0.40
Uint8Array.set 32 items 2.2180 us/op 2.0880 us/op 1.06
transfer serialized Status (84 B) 1.8770 us/op 1.9780 us/op 0.95
copy serialized Status (84 B) 1.6380 us/op 1.6760 us/op 0.98
transfer serialized SignedVoluntaryExit (112 B) 2.0410 us/op 2.0520 us/op 0.99
copy serialized SignedVoluntaryExit (112 B) 1.7350 us/op 1.6850 us/op 1.03
transfer serialized ProposerSlashing (416 B) 2.8320 us/op 2.2140 us/op 1.28
copy serialized ProposerSlashing (416 B) 2.4860 us/op 1.9450 us/op 1.28
transfer serialized Attestation (485 B) 2.5730 us/op 2.5970 us/op 0.99
copy serialized Attestation (485 B) 2.4590 us/op 2.0860 us/op 1.18
transfer serialized AttesterSlashing (33232 B) 2.4740 us/op 2.5580 us/op 0.97
copy serialized AttesterSlashing (33232 B) 6.5860 us/op 5.5140 us/op 1.19
transfer serialized Small SignedBeaconBlock (128000 B) 2.6410 us/op 2.7810 us/op 0.95
copy serialized Small SignedBeaconBlock (128000 B) 17.180 us/op 41.206 us/op 0.42
transfer serialized Avg SignedBeaconBlock (200000 B) 2.9850 us/op 3.0960 us/op 0.96
copy serialized Avg SignedBeaconBlock (200000 B) 28.110 us/op 27.911 us/op 1.01
transfer serialized BlobsSidecar (524380 B) 3.0680 us/op 3.1420 us/op 0.98
copy serialized BlobsSidecar (524380 B) 92.838 us/op 120.35 us/op 0.77
transfer serialized Big SignedBeaconBlock (1000000 B) 3.2310 us/op 3.2720 us/op 0.99
copy serialized Big SignedBeaconBlock (1000000 B) 175.36 us/op 286.46 us/op 0.61
pass gossip attestations to forkchoice per slot 2.1923 ms/op 2.7842 ms/op 0.79
forkChoice updateHead vc 100000 bc 64 eq 0 2.1497 ms/op 2.0627 ms/op 1.04
forkChoice updateHead vc 600000 bc 64 eq 0 14.090 ms/op 12.468 ms/op 1.13
forkChoice updateHead vc 1000000 bc 64 eq 0 23.146 ms/op 18.887 ms/op 1.23
forkChoice updateHead vc 600000 bc 320 eq 0 17.292 ms/op 16.688 ms/op 1.04
forkChoice updateHead vc 600000 bc 1200 eq 0 92.086 ms/op 82.008 ms/op 1.12
forkChoice updateHead vc 600000 bc 64 eq 1000 22.379 ms/op 20.562 ms/op 1.09
forkChoice updateHead vc 600000 bc 64 eq 10000 24.481 ms/op 22.804 ms/op 1.07
forkChoice updateHead vc 600000 bc 64 eq 300000 30.112 ms/op 29.230 ms/op 1.03
computeDeltas 3.2021 ms/op 3.2789 ms/op 0.98
computeProposerBoostScoreFromBalances 391.53 us/op 1.9511 ms/op 0.20
altair processAttestation - 250000 vs - 7PWei normalcase 2.3259 ms/op 2.4242 ms/op 0.96
altair processAttestation - 250000 vs - 7PWei worstcase 3.5565 ms/op 3.4133 ms/op 1.04
altair processAttestation - setStatus - 1/6 committees join 156.64 us/op 144.48 us/op 1.08
altair processAttestation - setStatus - 1/3 committees join 298.22 us/op 279.15 us/op 1.07
altair processAttestation - setStatus - 1/2 committees join 407.58 us/op 378.56 us/op 1.08
altair processAttestation - setStatus - 2/3 committees join 510.56 us/op 466.46 us/op 1.09
altair processAttestation - setStatus - 4/5 committees join 706.91 us/op 665.79 us/op 1.06
altair processAttestation - setStatus - 100% committees join 829.05 us/op 775.95 us/op 1.07
altair processBlock - 250000 vs - 7PWei normalcase 9.5775 ms/op 16.693 ms/op 0.57
altair processBlock - 250000 vs - 7PWei normalcase hashState 16.134 ms/op 28.025 ms/op 0.58
altair processBlock - 250000 vs - 7PWei worstcase 36.686 ms/op 47.422 ms/op 0.77
altair processBlock - 250000 vs - 7PWei worstcase hashState 58.624 ms/op 67.500 ms/op 0.87
phase0 processBlock - 250000 vs - 7PWei normalcase 2.5104 ms/op 2.3856 ms/op 1.05
phase0 processBlock - 250000 vs - 7PWei worstcase 30.770 ms/op 29.034 ms/op 1.06
altair processEth1Data - 250000 vs - 7PWei normalcase 487.35 us/op 477.06 us/op 1.02
getExpectedWithdrawals 250000 eb:1,eth1:1,we:0,wn:0,smpl:15 8.9440 us/op 9.3750 us/op 0.95
getExpectedWithdrawals 250000 eb:0.95,eth1:0.1,we:0.05,wn:0,smpl:219 41.642 us/op 32.152 us/op 1.30
getExpectedWithdrawals 250000 eb:0.95,eth1:0.3,we:0.05,wn:0,smpl:42 18.223 us/op 12.153 us/op 1.50
getExpectedWithdrawals 250000 eb:0.95,eth1:0.7,we:0.05,wn:0,smpl:18 9.9970 us/op 11.962 us/op 0.84
getExpectedWithdrawals 250000 eb:0.1,eth1:0.1,we:0,wn:0,smpl:1020 117.82 us/op 118.44 us/op 0.99
getExpectedWithdrawals 250000 eb:0.03,eth1:0.03,we:0,wn:0,smpl:11777 1.0230 ms/op 656.50 us/op 1.56
getExpectedWithdrawals 250000 eb:0.01,eth1:0.01,we:0,wn:0,smpl:16384 1.9170 ms/op 924.19 us/op 2.07
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,smpl:16384 1.5505 ms/op 915.31 us/op 1.69
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,nocache,smpl:16384 3.2137 ms/op 2.4489 ms/op 1.31
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,smpl:16384 2.7053 ms/op 1.5426 ms/op 1.75
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,nocache,smpl:16384 4.9709 ms/op 3.9097 ms/op 1.27
Tree 40 250000 create 304.81 ms/op 336.58 ms/op 0.91
Tree 40 250000 get(125000) 190.33 ns/op 195.59 ns/op 0.97
Tree 40 250000 set(125000) 891.83 ns/op 1.0566 us/op 0.84
Tree 40 250000 toArray() 17.126 ms/op 22.006 ms/op 0.78
Tree 40 250000 iterate all - toArray() + loop 17.394 ms/op 22.293 ms/op 0.78
Tree 40 250000 iterate all - get(i) 67.095 ms/op 75.845 ms/op 0.88
MutableVector 250000 create 11.710 ms/op 11.698 ms/op 1.00
MutableVector 250000 get(125000) 6.3150 ns/op 6.5770 ns/op 0.96
MutableVector 250000 set(125000) 254.35 ns/op 281.66 ns/op 0.90
MutableVector 250000 toArray() 3.2497 ms/op 3.9284 ms/op 0.83
MutableVector 250000 iterate all - toArray() + loop 2.9908 ms/op 3.3164 ms/op 0.90
MutableVector 250000 iterate all - get(i) 1.5294 ms/op 1.5431 ms/op 0.99
Array 250000 create 2.6911 ms/op 2.8300 ms/op 0.95
Array 250000 clone - spread 975.67 us/op 1.3263 ms/op 0.74
Array 250000 get(125000) 0.48100 ns/op 0.63500 ns/op 0.76
Array 250000 set(125000) 0.55800 ns/op 0.70800 ns/op 0.79
Array 250000 iterate all - loop 108.11 us/op 83.356 us/op 1.30
effectiveBalanceIncrements clone Uint8Array 300000 22.827 us/op 33.238 us/op 0.69
effectiveBalanceIncrements clone MutableVector 300000 256.00 ns/op 418.00 ns/op 0.61
effectiveBalanceIncrements rw all Uint8Array 300000 176.45 us/op 170.25 us/op 1.04
effectiveBalanceIncrements rw all MutableVector 300000 72.241 ms/op 95.836 ms/op 0.75
phase0 afterProcessEpoch - 250000 vs - 7PWei 112.16 ms/op 115.10 ms/op 0.97
phase0 beforeProcessEpoch - 250000 vs - 7PWei 37.435 ms/op 36.145 ms/op 1.04
altair processEpoch - mainnet_e81889 312.86 ms/op 328.11 ms/op 0.95
mainnet_e81889 - altair beforeProcessEpoch 55.907 ms/op 71.129 ms/op 0.79
mainnet_e81889 - altair processJustificationAndFinalization 14.697 us/op 19.087 us/op 0.77
mainnet_e81889 - altair processInactivityUpdates 5.1280 ms/op 7.2763 ms/op 0.70
mainnet_e81889 - altair processRewardsAndPenalties 50.641 ms/op 99.767 ms/op 0.51
mainnet_e81889 - altair processRegistryUpdates 2.2310 us/op 5.0010 us/op 0.45
mainnet_e81889 - altair processSlashings 391.00 ns/op 722.00 ns/op 0.54
mainnet_e81889 - altair processEth1DataReset 451.00 ns/op 748.00 ns/op 0.60
mainnet_e81889 - altair processEffectiveBalanceUpdates 1.2525 ms/op 1.3288 ms/op 0.94
mainnet_e81889 - altair processSlashingsReset 2.5810 us/op 6.3550 us/op 0.41
mainnet_e81889 - altair processRandaoMixesReset 3.8870 us/op 6.9640 us/op 0.56
mainnet_e81889 - altair processHistoricalRootsUpdate 968.00 ns/op 964.00 ns/op 1.00
mainnet_e81889 - altair processParticipationFlagUpdates 1.8350 us/op 11.542 us/op 0.16
mainnet_e81889 - altair processSyncCommitteeUpdates 566.00 ns/op 1.7290 us/op 0.33
mainnet_e81889 - altair afterProcessEpoch 125.56 ms/op 167.65 ms/op 0.75
phase0 processEpoch - mainnet_e58758 355.69 ms/op 440.45 ms/op 0.81
mainnet_e58758 - phase0 beforeProcessEpoch 134.99 ms/op 145.69 ms/op 0.93
mainnet_e58758 - phase0 processJustificationAndFinalization 13.584 us/op 19.321 us/op 0.70
mainnet_e58758 - phase0 processRewardsAndPenalties 65.354 ms/op 65.545 ms/op 1.00
mainnet_e58758 - phase0 processRegistryUpdates 9.1000 us/op 9.9480 us/op 0.91
mainnet_e58758 - phase0 processSlashings 473.00 ns/op 483.00 ns/op 0.98
mainnet_e58758 - phase0 processEth1DataReset 399.00 ns/op 531.00 ns/op 0.75
mainnet_e58758 - phase0 processEffectiveBalanceUpdates 1.2205 ms/op 1.0342 ms/op 1.18
mainnet_e58758 - phase0 processSlashingsReset 2.4970 us/op 5.9900 us/op 0.42
mainnet_e58758 - phase0 processRandaoMixesReset 3.8390 us/op 5.3180 us/op 0.72
mainnet_e58758 - phase0 processHistoricalRootsUpdate 550.00 ns/op 992.00 ns/op 0.55
mainnet_e58758 - phase0 processParticipationRecordUpdates 2.9470 us/op 4.8630 us/op 0.61
mainnet_e58758 - phase0 afterProcessEpoch 95.323 ms/op 99.889 ms/op 0.95
phase0 processEffectiveBalanceUpdates - 250000 normalcase 1.2091 ms/op 1.2780 ms/op 0.95
phase0 processEffectiveBalanceUpdates - 250000 worstcase 0.5 1.3870 ms/op 1.6775 ms/op 0.83
altair processInactivityUpdates - 250000 normalcase 22.933 ms/op 27.104 ms/op 0.85
altair processInactivityUpdates - 250000 worstcase 23.025 ms/op 29.820 ms/op 0.77
phase0 processRegistryUpdates - 250000 normalcase 9.4920 us/op 9.0060 us/op 1.05
phase0 processRegistryUpdates - 250000 badcase_full_deposits 309.59 us/op 281.42 us/op 1.10
phase0 processRegistryUpdates - 250000 worstcase 0.5 120.19 ms/op 132.56 ms/op 0.91
altair processRewardsAndPenalties - 250000 normalcase 71.413 ms/op 75.264 ms/op 0.95
altair processRewardsAndPenalties - 250000 worstcase 68.754 ms/op 75.553 ms/op 0.91
phase0 getAttestationDeltas - 250000 normalcase 7.4709 ms/op 9.8177 ms/op 0.76
phase0 getAttestationDeltas - 250000 worstcase 7.4386 ms/op 7.2299 ms/op 1.03
phase0 processSlashings - 250000 worstcase 2.3627 ms/op 3.9830 ms/op 0.59
altair processSyncCommitteeUpdates - 250000 145.01 ms/op 181.98 ms/op 0.80
BeaconState.hashTreeRoot - No change 259.00 ns/op 281.00 ns/op 0.92
BeaconState.hashTreeRoot - 1 full validator 51.282 us/op 54.032 us/op 0.95
BeaconState.hashTreeRoot - 32 full validator 522.38 us/op 563.46 us/op 0.93
BeaconState.hashTreeRoot - 512 full validator 5.6961 ms/op 5.7251 ms/op 0.99
BeaconState.hashTreeRoot - 1 validator.effectiveBalance 62.265 us/op 65.455 us/op 0.95
BeaconState.hashTreeRoot - 32 validator.effectiveBalance 899.19 us/op 929.96 us/op 0.97
BeaconState.hashTreeRoot - 512 validator.effectiveBalance 10.906 ms/op 12.361 ms/op 0.88
BeaconState.hashTreeRoot - 1 balances 51.808 us/op 54.476 us/op 0.95
BeaconState.hashTreeRoot - 32 balances 442.90 us/op 458.20 us/op 0.97
BeaconState.hashTreeRoot - 512 balances 4.3705 ms/op 4.5272 ms/op 0.97
BeaconState.hashTreeRoot - 250000 balances 74.021 ms/op 95.535 ms/op 0.77
aggregationBits - 2048 els - zipIndexesInBitList 13.975 us/op 22.013 us/op 0.63
regular array get 100000 times 32.554 us/op 52.210 us/op 0.62
wrappedArray get 100000 times 32.513 us/op 34.907 us/op 0.93
arrayWithProxy get 100000 times 14.230 ms/op 16.332 ms/op 0.87
ssz.Root.equals 202.00 ns/op 591.00 ns/op 0.34
byteArrayEquals 207.00 ns/op 601.00 ns/op 0.34
shuffle list - 16384 els 6.8629 ms/op 7.1873 ms/op 0.95
shuffle list - 250000 els 100.55 ms/op 105.21 ms/op 0.96
processSlot - 1 slots 8.2950 us/op 9.2780 us/op 0.89
processSlot - 32 slots 1.3753 ms/op 1.4554 ms/op 0.94
getEffectiveBalanceIncrementsZeroInactive - 250000 vs - 7PWei 55.532 ms/op 38.698 ms/op 1.44
getCommitteeAssignments - req 1 vs - 250000 vc 2.4838 ms/op 2.9719 ms/op 0.84
getCommitteeAssignments - req 100 vs - 250000 vc 3.6619 ms/op 4.2867 ms/op 0.85
getCommitteeAssignments - req 1000 vs - 250000 vc 3.9244 ms/op 4.6451 ms/op 0.84
RootCache.getBlockRootAtSlot - 250000 vs - 7PWei 4.3500 ns/op 5.0700 ns/op 0.86
state getBlockRootAtSlot - 250000 vs - 7PWei 661.83 ns/op 901.74 ns/op 0.73
computeProposers - vc 250000 9.1755 ms/op 11.270 ms/op 0.81
computeEpochShuffling - vc 250000 101.64 ms/op 105.86 ms/op 0.96
getNextSyncCommittee - vc 250000 150.61 ms/op 181.83 ms/op 0.83
computeSigningRoot for AttestationData 13.027 us/op 14.023 us/op 0.93
hash AttestationData serialized data then Buffer.toString(base64) 2.2387 us/op 2.5321 us/op 0.88
toHexString serialized data 1.0276 us/op 1.1575 us/op 0.89
Buffer.toString(base64) 213.06 ns/op 343.29 ns/op 0.62

by benchmarkbot/action

@dapplion
Copy link
Contributor

dapplion commented Jul 7, 2023

Can you confirm the performance regression locally? Seems legit

packages/params/test/e2e/overridePreset.test.ts Dismissed Show dismissed Hide dismissed
packages/params/test/e2e/overridePreset.test.ts Dismissed Show dismissed Hide dismissed
packages/params/test/e2e/setPreset.test.ts Dismissed Show dismissed Hide dismissed
packages/params/test/e2e/setPreset.test.ts Dismissed Show dismissed Hide dismissed
@wemeetagain
Copy link
Member Author

Dockerfile Show resolved Hide resolved
@nflaig
Copy link
Member

nflaig commented Jul 14, 2023

This error is only happening in CI, not locally
https://github.com/ChainSafe/lodestar/actions/runs/5522181144/jobs/10071384231?pr=5730#step:11:6935

Can't reproduce this either, installed several different node versions. Might have to check which node version is actually used in the CI.

@nflaig
Copy link
Member

nflaig commented Jul 14, 2023

No idea what is going on with sim tests, @nazarhussain any ideas?

This reverts commit e1f07be.
@nazarhussain
Copy link
Contributor

Based on the error, seems like the beacon node had not started.

FetchError: request to http://127.0.0.1:5004/eth/v1/node/peer_count failed, reason: socket hang up

@nflaig
Copy link
Member

nflaig commented Jul 14, 2023

I think it is somehow related with error thrown after updating cross-fetch, still can't make sense of why this produces correct results locally.

@nazarhussain
Copy link
Contributor

nazarhussain commented Jul 14, 2023

Internally the error says lodestar could not connect to the EL. But Geth is running fine, so it seems like some firewall issue on docker which didn't allowed connecting the host machine to docker container on local IP.

[node-1-cl-lodestar] [4384]: Eph 0/1 1.779[node-1-cl-lodestar/eth1] �[31merror�[39m: Error updating eth1 chain cache request to http://127.0.0.1:9001/ failed, reason: connect ECONNREFUSED 127.0.0.1:9001
FetchError: request to http://127.0.0.1:9001/ failed, reason: connect ECONNREFUSED 127.0.0.1:9001

@wemeetagain
Copy link
Member Author

I updated cross-fetch because the error was present, but it didn't fix it.
I think the problem is related to updated behavior of the native fetch implementation, something that changed between v18 and v20.

@wemeetagain
Copy link
Member Author

It seems that node 20 now has fetch available natively without needing the --experimental-fetch flag.
So that probably explains the difference in behavior.

philknows
philknows previously approved these changes Jul 14, 2023
nflaig
nflaig previously approved these changes Jul 14, 2023
@nazarhussain nazarhussain dismissed stale reviews from nflaig and philknows via f716f64 July 15, 2023 21:03
await expect(eth1JsonRpcClient.fetch(payload, {timeout})).to.be.rejectedWith(error);

try {
await eth1JsonRpcClient.fetch(payload, {timeout});
Copy link
Member

Choose a reason for hiding this comment

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

@nazarhussain try/catch is problematic here, test case would pass if no error is thrown

Either have to do explicit fail if there is no error like it is done here

expect.fail("Second decrypt should fail due to failure to get lockfile");

or can use .to.be.rejected.then pattern

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes I knew that pattern, but we discussed earlier to not use the nested then/catch and prefer try/catch.

Copy link
Member

Choose a reason for hiding this comment

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

In that case need to explicitly fail the test if there is no error

@@ -8,7 +8,7 @@
[![Ethereum Consensus Spec v1.1.10](https://img.shields.io/badge/ETH%20consensus--spec-1.1.10-blue)](https://github.com/ethereum/consensus-specs/releases/tag/v1.1.10)
[![codecov](https://codecov.io/gh/ChainSafe/lodestar/branch/unstable/graph/badge.svg)](https://codecov.io/gh/ChainSafe/lodestar)
![ES Version](https://img.shields.io/badge/ES-2020-yellow)
![Node Version](https://img.shields.io/badge/node-18.15.x-green)
![Node Version](https://img.shields.io/badge/node-20.x-green)
Copy link
Member

Choose a reason for hiding this comment

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

@wemeetagain I updated this to 20.x as well, not sure if it was intentionally not updated before but as we discussed that we want to advocate for using node 20 I think we should update it here as well.

Last reference to 18.x is in package.json but that might be to disruptive for users to update to 20.x, although we could ensure everyone is using node 20 this way

"node": ">=18.15.0"

@@ -2,7 +2,7 @@

## Prerequisites

Make sure to have [Yarn installed](https://classic.yarnpkg.com/en/docs/install). It is also recommended to [install NVM (Node Version Manager)](https://github.com/nvm-sh/nvm) and use the LTS version (currently v18) of [NodeJS](https://nodejs.org/en/).
Make sure to have [Yarn installed](https://classic.yarnpkg.com/en/docs/install). It is also recommended to [install NVM (Node Version Manager)](https://github.com/nvm-sh/nvm) and use the LTS version (currently v20) of [NodeJS](https://nodejs.org/en/).
Copy link
Member

Choose a reason for hiding this comment

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

Just a note: v20 is not yet LTS version until 2023-10-24, see nodejs-release-working-group for schedule

@nflaig nflaig closed this Jul 16, 2023
@nflaig nflaig reopened this Jul 16, 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.

Looks good to me now, everything besides sim tests are using node 20 now.

@wemeetagain
Copy link
Member Author

Ok, when CI is finished running, I'll change the branch rules and merge this

Comment on lines 156 to 162
await expect(eth1JsonRpcClient.fetch(payload, {timeout})).to.be.rejected.then((error) => {
if (testCase.errorCode) {
expect((error as FetchError).code).to.eql(testCase.errorCode);
expect((error as FetchError).code).to.be.equal(testCase.errorCode);
} else {
expect((error as Error).message).includes(testCase.error);
expect((error as Error).message).to.include(testCase.error);
}
}
});
Copy link
Contributor

@nazarhussain nazarhussain Jul 16, 2023

Choose a reason for hiding this comment

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

I think we discussed to no use the nested then/catch and prefer try/catch.

Copy link
Member

Choose a reason for hiding this comment

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

I was not part of that discussion but in my opinion try/catch in tests should be last resort if there are no other options to use built-in assertion syntax

@wemeetagain wemeetagain merged commit 6e01421 into unstable Jul 16, 2023
23 checks passed
@wemeetagain wemeetagain deleted the cayman/node-20 branch July 16, 2023 12:17
@nflaig
Copy link
Member

nflaig commented Jul 17, 2023

Regarding the failing sim tests on node 20, it looks like the issue is related to node-fetch and Lighthouse.

I am using the script mentioned here #5737 (comment) to fetch the state.

For getStateV2 I am getting an error after few milliseconds which looks similar to the error in sim tests

/home/nico/projects/test/debug-getStatev2/node_modules/node-fetch/lib/index.js:1505
                        reject(new FetchError(`request to ${request.url} failed, reason: ${err.message}`, 'system', err));
                               ^
FetchError: request to http://localhost:5052/eth/v2/debug/beacon/states/6896350 failed, reason: socket hang up
    at ClientRequest.<anonymous> (/home/nico/projects/test/debug-getStatev2/node_modules/node-fetch/lib/index.js:1505:11)
    at ClientRequest.emit (node:events:512:28)
    at Socket.socketOnEnd (node:_http_client:519:9)
    at Socket.emit (node:events:524:35)
    at endReadableNT (node:internal/streams/readable:1378:12)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
  type: 'system',
  errno: 'ECONNRESET',
  code: 'ECONNRESET'
}

There is an open issue for it already

Edit: I created an issue to track this

@wemeetagain
Copy link
Member Author

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

5 participants