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

Add lightclient cmd #3937

Merged
merged 1 commit into from
Apr 25, 2022
Merged

Add lightclient cmd #3937

merged 1 commit into from
Apr 25, 2022

Conversation

twoeths
Copy link
Contributor

@twoeths twoeths commented Apr 19, 2022

Motivation

This command help me found #3933 so I'm adding it here

Description

Add lightclient command, sample: ./bin/lodestar lightclient --network prater --checkpointRoot ${hexString} --beaconApiUrl ${beaconApiUrl} --logFile lightclient.log --logLevelFile debug

@twoeths twoeths requested a review from a team as a code owner April 19, 2022 03:07
@codecov
Copy link

codecov bot commented Apr 19, 2022

Codecov Report

Merging #3937 (cad55ca) into master (9f0c7a6) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master    #3937   +/-   ##
=======================================
  Coverage   36.33%   36.33%           
=======================================
  Files         324      324           
  Lines        9063     9063           
  Branches     1455     1455           
=======================================
  Hits         3293     3293           
  Misses       5597     5597           
  Partials      173      173           

@github-actions
Copy link
Contributor

Performance Report

✔️ no performance regression detected

Full benchmark results
Benchmark suite Current: ed2ebb7 Previous: eef2c86 Ratio
BeaconState.hashTreeRoot - No change 638.00 ns/op 474.00 ns/op 1.35
BeaconState.hashTreeRoot - 1 full validator 66.614 us/op 48.433 us/op 1.38
BeaconState.hashTreeRoot - 32 full validator 667.58 us/op 477.32 us/op 1.40
BeaconState.hashTreeRoot - 512 full validator 7.2066 ms/op 5.3860 ms/op 1.34
BeaconState.hashTreeRoot - 1 validator.effectiveBalance 82.898 us/op 61.740 us/op 1.34
BeaconState.hashTreeRoot - 32 validator.effectiveBalance 1.1384 ms/op 845.32 us/op 1.35
BeaconState.hashTreeRoot - 512 validator.effectiveBalance 15.761 ms/op 11.869 ms/op 1.33
BeaconState.hashTreeRoot - 1 balances 63.217 us/op 46.495 us/op 1.36
BeaconState.hashTreeRoot - 32 balances 564.15 us/op 419.29 us/op 1.35
BeaconState.hashTreeRoot - 512 balances 5.4376 ms/op 4.1485 ms/op 1.31
BeaconState.hashTreeRoot - 250000 balances 112.33 ms/op 89.042 ms/op 1.26
processSlot - 1 slots 11.651 us/op 8.6670 us/op 1.34
processSlot - 32 slots 1.8396 ms/op 1.4045 ms/op 1.31
getCommitteeAssignments - req 1 vs - 250000 vc 6.2883 ms/op 4.6224 ms/op 1.36
getCommitteeAssignments - req 100 vs - 250000 vc 8.7399 ms/op 6.3756 ms/op 1.37
getCommitteeAssignments - req 1000 vs - 250000 vc 9.3310 ms/op 6.8288 ms/op 1.37
computeProposers - vc 250000 20.290 ms/op 14.928 ms/op 1.36
computeEpochShuffling - vc 250000 191.44 ms/op 140.92 ms/op 1.36
getNextSyncCommittee - vc 250000 335.93 ms/op 247.97 ms/op 1.35
altair processAttestation - 250000 vs - 7PWei normalcase 4.5493 ms/op 3.6780 ms/op 1.24
altair processAttestation - 250000 vs - 7PWei worstcase 6.6223 ms/op 5.1338 ms/op 1.29
altair processAttestation - setStatus - 1/6 committees join 227.92 us/op 175.42 us/op 1.30
altair processAttestation - setStatus - 1/3 committees join 437.98 us/op 339.06 us/op 1.29
altair processAttestation - setStatus - 1/2 committees join 617.48 us/op 470.92 us/op 1.31
altair processAttestation - setStatus - 2/3 committees join 799.12 us/op 606.22 us/op 1.32
altair processAttestation - setStatus - 4/5 committees join 1.0987 ms/op 841.79 us/op 1.31
altair processAttestation - setStatus - 100% committees join 1.3326 ms/op 995.21 us/op 1.34
altair processBlock - 250000 vs - 7PWei normalcase 32.576 ms/op 25.336 ms/op 1.29
altair processBlock - 250000 vs - 7PWei normalcase hashState 39.091 ms/op 33.169 ms/op 1.18
altair processBlock - 250000 vs - 7PWei worstcase 82.768 ms/op 74.530 ms/op 1.11
altair processBlock - 250000 vs - 7PWei worstcase hashState 113.41 ms/op 88.469 ms/op 1.28
altair processEth1Data - 250000 vs - 7PWei normalcase 876.72 us/op 749.68 us/op 1.17
altair processEpoch - mainnet_e81889 640.92 ms/op 439.16 ms/op 1.46
mainnet_e81889 - altair beforeProcessEpoch 169.62 ms/op 159.19 ms/op 1.07
mainnet_e81889 - altair processJustificationAndFinalization 36.318 us/op 22.170 us/op 1.64
mainnet_e81889 - altair processInactivityUpdates 12.886 ms/op 10.742 ms/op 1.20
mainnet_e81889 - altair processRewardsAndPenalties 95.240 ms/op 129.20 ms/op 0.74
mainnet_e81889 - altair processRegistryUpdates 8.9030 us/op 3.6150 us/op 2.46
mainnet_e81889 - altair processSlashings 3.3150 us/op 1.0140 us/op 3.27
mainnet_e81889 - altair processEth1DataReset 3.4350 us/op 1.1690 us/op 2.94
mainnet_e81889 - altair processEffectiveBalanceUpdates 7.5837 ms/op 5.6717 ms/op 1.34
mainnet_e81889 - altair processSlashingsReset 11.326 us/op 6.1960 us/op 1.83
mainnet_e81889 - altair processRandaoMixesReset 13.169 us/op 5.2740 us/op 2.50
mainnet_e81889 - altair processHistoricalRootsUpdate 4.3660 us/op 1.7000 us/op 2.57
mainnet_e81889 - altair processParticipationFlagUpdates 8.8960 us/op 3.1180 us/op 2.85
mainnet_e81889 - altair processSyncCommitteeUpdates 2.8470 us/op 1.1510 us/op 2.47
mainnet_e81889 - altair afterProcessEpoch 228.69 ms/op 164.15 ms/op 1.39
altair processInactivityUpdates - 250000 normalcase 42.627 ms/op 37.224 ms/op 1.15
altair processInactivityUpdates - 250000 worstcase 32.588 ms/op 25.808 ms/op 1.26
altair processRewardsAndPenalties - 250000 normalcase 133.42 ms/op 76.589 ms/op 1.74
altair processRewardsAndPenalties - 250000 worstcase 126.78 ms/op 73.268 ms/op 1.73
altair processSyncCommitteeUpdates - 250000 344.11 ms/op 258.88 ms/op 1.33
Tree 40 250000 create 773.79 ms/op 676.44 ms/op 1.14
Tree 40 250000 get(125000) 338.52 ns/op 254.94 ns/op 1.33
Tree 40 250000 set(125000) 2.4093 us/op 2.3257 us/op 1.04
Tree 40 250000 toArray() 36.710 ms/op 30.811 ms/op 1.19
Tree 40 250000 iterate all - toArray() + loop 36.762 ms/op 31.239 ms/op 1.18
Tree 40 250000 iterate all - get(i) 130.04 ms/op 99.340 ms/op 1.31
MutableVector 250000 create 17.725 ms/op 14.117 ms/op 1.26
MutableVector 250000 get(125000) 17.756 ns/op 13.248 ns/op 1.34
MutableVector 250000 set(125000) 669.32 ns/op 602.12 ns/op 1.11
MutableVector 250000 toArray() 7.6256 ms/op 6.5506 ms/op 1.16
MutableVector 250000 iterate all - toArray() + loop 7.7453 ms/op 6.5457 ms/op 1.18
MutableVector 250000 iterate all - get(i) 3.9300 ms/op 3.0754 ms/op 1.28
Array 250000 create 6.9217 ms/op 5.6012 ms/op 1.24
Array 250000 clone - spread 3.0068 ms/op 2.4639 ms/op 1.22
Array 250000 get(125000) 1.3670 ns/op 1.1160 ns/op 1.22
Array 250000 set(125000) 1.3370 ns/op 1.1330 ns/op 1.18
Array 250000 iterate all - loop 199.07 us/op 148.16 us/op 1.34
effectiveBalanceIncrements clone Uint8Array 300000 91.180 us/op 81.338 us/op 1.12
effectiveBalanceIncrements clone MutableVector 300000 915.00 ns/op 769.00 ns/op 1.19
effectiveBalanceIncrements rw all Uint8Array 300000 360.56 us/op 266.25 us/op 1.35
effectiveBalanceIncrements rw all MutableVector 300000 208.93 ms/op 188.08 ms/op 1.11
aggregationBits - 2048 els - zipIndexesInBitList 32.106 us/op 30.871 us/op 1.04
regular array get 100000 times 80.253 us/op 59.480 us/op 1.35
wrappedArray get 100000 times 79.816 us/op 59.479 us/op 1.34
arrayWithProxy get 100000 times 36.712 ms/op 25.582 ms/op 1.44
ssz.Root.equals 577.00 ns/op 445.00 ns/op 1.30
byteArrayEquals 531.00 ns/op 437.00 ns/op 1.22
phase0 processBlock - 250000 vs - 7PWei normalcase 4.1076 ms/op 3.6072 ms/op 1.14
phase0 processBlock - 250000 vs - 7PWei worstcase 54.501 ms/op 41.227 ms/op 1.32
phase0 afterProcessEpoch - 250000 vs - 7PWei 209.30 ms/op 155.88 ms/op 1.34
phase0 beforeProcessEpoch - 250000 vs - 7PWei 79.745 ms/op 73.689 ms/op 1.08
phase0 processEpoch - mainnet_e58758 613.19 ms/op 545.96 ms/op 1.12
mainnet_e58758 - phase0 beforeProcessEpoch 265.56 ms/op 223.41 ms/op 1.19
mainnet_e58758 - phase0 processJustificationAndFinalization 31.757 us/op 21.699 us/op 1.46
mainnet_e58758 - phase0 processRewardsAndPenalties 98.185 ms/op 110.22 ms/op 0.89
mainnet_e58758 - phase0 processRegistryUpdates 16.873 us/op 11.514 us/op 1.47
mainnet_e58758 - phase0 processSlashings 3.2970 us/op 1.4330 us/op 2.30
mainnet_e58758 - phase0 processEth1DataReset 3.1150 us/op 1.1100 us/op 2.81
mainnet_e58758 - phase0 processEffectiveBalanceUpdates 6.6548 ms/op 5.0691 ms/op 1.31
mainnet_e58758 - phase0 processSlashingsReset 9.8060 us/op 5.5860 us/op 1.76
mainnet_e58758 - phase0 processRandaoMixesReset 12.827 us/op 6.3610 us/op 2.02
mainnet_e58758 - phase0 processHistoricalRootsUpdate 4.3080 us/op 1.3200 us/op 3.26
mainnet_e58758 - phase0 processParticipationRecordUpdates 11.070 us/op 5.0840 us/op 2.18
mainnet_e58758 - phase0 afterProcessEpoch 182.62 ms/op 135.74 ms/op 1.35
phase0 processEffectiveBalanceUpdates - 250000 normalcase 7.5776 ms/op 5.7917 ms/op 1.31
phase0 processEffectiveBalanceUpdates - 250000 worstcase 0.5 8.1464 ms/op 5.9671 ms/op 1.37
phase0 processRegistryUpdates - 250000 normalcase 16.867 us/op 9.7090 us/op 1.74
phase0 processRegistryUpdates - 250000 badcase_full_deposits 516.99 us/op 367.00 us/op 1.41
phase0 processRegistryUpdates - 250000 worstcase 0.5 279.81 ms/op 215.02 ms/op 1.30
phase0 getAttestationDeltas - 250000 normalcase 18.138 ms/op 14.883 ms/op 1.22
phase0 getAttestationDeltas - 250000 worstcase 17.703 ms/op 14.046 ms/op 1.26
phase0 processSlashings - 250000 worstcase 7.4032 ms/op 4.8813 ms/op 1.52
shuffle list - 16384 els 13.916 ms/op 9.4407 ms/op 1.47
shuffle list - 250000 els 185.16 ms/op 136.39 ms/op 1.36
getEffectiveBalanceIncrementsZeroInactive - 250000 vs - 7PWei 475.84 us/op 328.21 us/op 1.45
pass gossip attestations to forkchoice per slot 4.0020 ms/op 3.4156 ms/op 1.17
computeDeltas 3.7248 ms/op 3.5258 ms/op 1.06
computeProposerBoostScoreFromBalances 598.94 us/op 443.73 us/op 1.35
getPubkeys - index2pubkey - req 1000 vs - 250000 vc 2.1784 ms/op 2.1873 ms/op 1.00
getPubkeys - validatorsArr - req 1000 vs - 250000 vc 87.972 us/op 68.732 us/op 1.28
BLS verify - blst-native 2.2137 ms/op 1.6404 ms/op 1.35
BLS verifyMultipleSignatures 3 - blst-native 4.5522 ms/op 3.3560 ms/op 1.36
BLS verifyMultipleSignatures 8 - blst-native 9.7719 ms/op 7.2209 ms/op 1.35
BLS verifyMultipleSignatures 32 - blst-native 35.463 ms/op 26.169 ms/op 1.36
BLS aggregatePubkeys 32 - blst-native 47.202 us/op 34.579 us/op 1.37
BLS aggregatePubkeys 128 - blst-native 183.43 us/op 135.92 us/op 1.35
getAttestationsForBlock 71.131 ms/op 55.323 ms/op 1.29
CheckpointStateCache - add get delete 12.737 us/op 9.6310 us/op 1.32
validate gossip signedAggregateAndProof - struct 5.1188 ms/op 3.7900 ms/op 1.35
validate gossip attestation - struct 2.4355 ms/op 1.7787 ms/op 1.37
pickEth1Vote - no votes 2.6322 ms/op 1.9462 ms/op 1.35
pickEth1Vote - max votes 23.159 ms/op 18.152 ms/op 1.28
pickEth1Vote - Eth1Data hashTreeRoot value x2048 13.048 ms/op 9.9361 ms/op 1.31
pickEth1Vote - Eth1Data hashTreeRoot tree x2048 24.821 ms/op 20.395 ms/op 1.22
pickEth1Vote - Eth1Data fastSerialize value x2048 1.9690 ms/op 1.4800 ms/op 1.33
pickEth1Vote - Eth1Data fastSerialize tree x2048 15.738 ms/op 12.062 ms/op 1.30
bytes32 toHexString 1.2090 us/op 890.00 ns/op 1.36
bytes32 Buffer.toString(hex) 867.00 ns/op 669.00 ns/op 1.30
bytes32 Buffer.toString(hex) from Uint8Array 1.1370 us/op 857.00 ns/op 1.33
bytes32 Buffer.toString(hex) + 0x 877.00 ns/op 653.00 ns/op 1.34
Object access 1 prop 0.45900 ns/op 0.32100 ns/op 1.43
Map access 1 prop 0.39000 ns/op 0.26800 ns/op 1.46
Object get x1000 20.975 ns/op 16.622 ns/op 1.26
Map get x1000 1.2000 ns/op 0.90200 ns/op 1.33
Object set x1000 126.51 ns/op 100.37 ns/op 1.26
Map set x1000 78.927 ns/op 61.233 ns/op 1.29
Return object 10000 times 0.44480 ns/op 0.33090 ns/op 1.34
Throw Error 10000 times 6.8945 us/op 5.2153 us/op 1.32
enrSubnets - fastDeserialize 64 bits 1.0800 us/op 817.00 ns/op 1.32
enrSubnets - ssz BitVector 64 bits 919.00 ns/op 656.00 ns/op 1.40
enrSubnets - fastDeserialize 4 bits 509.00 ns/op 367.00 ns/op 1.39
enrSubnets - ssz BitVector 4 bits 937.00 ns/op 663.00 ns/op 1.41
RateTracker 1000000 limit, 1 obj count per request 216.02 ns/op 162.26 ns/op 1.33
RateTracker 1000000 limit, 2 obj count per request 161.37 ns/op 120.73 ns/op 1.34
RateTracker 1000000 limit, 4 obj count per request 134.14 ns/op 103.18 ns/op 1.30
RateTracker 1000000 limit, 8 obj count per request 120.12 ns/op 90.557 ns/op 1.33
RateTracker with prune 4.5810 us/op 3.6870 us/op 1.24
array of 16000 items push then shift 3.6857 us/op 2.7252 us/op 1.35
LinkedList of 16000 items push then shift 19.284 ns/op 17.256 ns/op 1.12
array of 16000 items push then pop 236.46 ns/op 198.38 ns/op 1.19
LinkedList of 16000 items push then pop 19.242 ns/op 14.978 ns/op 1.28
array of 24000 items push then shift 5.4595 us/op 4.0336 us/op 1.35
LinkedList of 24000 items push then shift 22.641 ns/op 21.247 ns/op 1.07
array of 24000 items push then pop 230.47 ns/op 179.73 ns/op 1.28
LinkedList of 24000 items push then pop 20.947 ns/op 17.423 ns/op 1.20

by benchmarkbot/action

Copy link
Member

@wemeetagain wemeetagain left a comment

Choose a reason for hiding this comment

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

LGTM, useful for testing and just following the chain

@wemeetagain wemeetagain merged commit 67fb374 into master Apr 25, 2022
@wemeetagain wemeetagain deleted the tuyen/lightclient-cmd branch April 25, 2022 13:25
@dapplion
Copy link
Contributor

Let's goo! Nice addition

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.

4 participants