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

Deprecate accounts CLI #4104

Merged
merged 5 commits into from
Jun 7, 2022
Merged

Deprecate accounts CLI #4104

merged 5 commits into from
Jun 7, 2022

Conversation

dapplion
Copy link
Contributor

@dapplion dapplion commented Jun 3, 2022

Motivation

Reviewing our keymanager server + remote keys API i found issues reconciling how keys are handled across the account CLI + automatic validator cmd key loading and the keymanager server.

Having the account CLI is not necessary anymore and add maintenance burden that now it's causing issues.

Description

From existing commands:

  • lodestar account:
    • validator:
      • create: DEPRECATED
      • deposit: DEPRECATED
      • import: moved to validator import
      • list: DEPRECATED
      • recover: DEPRECATED
      • slashing-protection: moved to validator slashing-protection
      • voluntary-exit: moved to validator voluntary-exit
    • wallet:
      • create: DEPRECATED
      • list: DEPRECATED
      • recover: DEPRECATED

Then the logic to load keys can be merged into the validator sub-command. This PR only deprecates and move commands. In future PRs I'll reduce the complexity of dealing with validator dirs.

With this PR, running any account [$0..] command triggers a deprecation notice

$ ../../node_modules/.bin/ts-node --esm src/index.ts account validator slashing-protection export
 ✖ DEPRECATED

Please use the official tools to perform your deposits
- eth2.0-deposit-cli: https://github.com/ethereum/eth2.0-deposit-cli
- Ethereum Foundation launchpad: https://launchpad.ethereum.org

For commands slashing-protection, voluntary-exit and import, use the validator command:
- validator slashing-protection <command>
- validator voluntary-exit
- validator import

Closes #3300

@dapplion dapplion requested a review from a team as a code owner June 3, 2022 04:46
@dapplion dapplion changed the title Dapplion/remove account Deprecate accounts CLI Jun 3, 2022
@dapplion dapplion mentioned this pull request Jun 3, 2022
4 tasks
@github-actions
Copy link
Contributor

github-actions bot commented Jun 3, 2022

Performance Report

✔️ no performance regression detected

Full benchmark results
Benchmark suite Current: d4cfc0a Previous: b5e24f7 Ratio
BeaconState.hashTreeRoot - No change 559.00 ns/op 478.00 ns/op 1.17
BeaconState.hashTreeRoot - 1 full validator 70.743 us/op 55.303 us/op 1.28
BeaconState.hashTreeRoot - 32 full validator 726.29 us/op 546.52 us/op 1.33
BeaconState.hashTreeRoot - 512 full validator 7.5339 ms/op 6.0901 ms/op 1.24
BeaconState.hashTreeRoot - 1 validator.effectiveBalance 91.798 us/op 71.242 us/op 1.29
BeaconState.hashTreeRoot - 32 validator.effectiveBalance 1.3123 ms/op 957.54 us/op 1.37
BeaconState.hashTreeRoot - 512 validator.effectiveBalance 16.841 ms/op 13.181 ms/op 1.28
BeaconState.hashTreeRoot - 1 balances 72.529 us/op 54.851 us/op 1.32
BeaconState.hashTreeRoot - 32 balances 627.85 us/op 479.73 us/op 1.31
BeaconState.hashTreeRoot - 512 balances 5.7527 ms/op 4.6394 ms/op 1.24
BeaconState.hashTreeRoot - 250000 balances 117.66 ms/op 102.29 ms/op 1.15
processSlot - 1 slots 14.791 us/op 10.627 us/op 1.39
processSlot - 32 slots 2.2406 ms/op 1.5780 ms/op 1.42
getCommitteeAssignments - req 1 vs - 250000 vc 5.7598 ms/op 5.3430 ms/op 1.08
getCommitteeAssignments - req 100 vs - 250000 vc 8.0402 ms/op 7.2947 ms/op 1.10
getCommitteeAssignments - req 1000 vs - 250000 vc 8.7960 ms/op 7.7371 ms/op 1.14
computeProposers - vc 250000 19.944 ms/op 16.016 ms/op 1.25
computeEpochShuffling - vc 250000 179.93 ms/op 169.76 ms/op 1.06
getNextSyncCommittee - vc 250000 333.43 ms/op 266.85 ms/op 1.25
altair processAttestation - 250000 vs - 7PWei normalcase 5.2236 ms/op 3.7418 ms/op 1.40
altair processAttestation - 250000 vs - 7PWei worstcase 7.6675 ms/op 5.5095 ms/op 1.39
altair processAttestation - setStatus - 1/6 committees join 228.07 us/op 188.08 us/op 1.21
altair processAttestation - setStatus - 1/3 committees join 435.91 us/op 373.65 us/op 1.17
altair processAttestation - setStatus - 1/2 committees join 590.26 us/op 516.81 us/op 1.14
altair processAttestation - setStatus - 2/3 committees join 838.07 us/op 665.70 us/op 1.26
altair processAttestation - setStatus - 4/5 committees join 1.1018 ms/op 923.09 us/op 1.19
altair processAttestation - setStatus - 100% committees join 1.3225 ms/op 1.0915 ms/op 1.21
altair processBlock - 250000 vs - 7PWei normalcase 34.030 ms/op 25.068 ms/op 1.36
altair processBlock - 250000 vs - 7PWei normalcase hashState 43.662 ms/op 38.067 ms/op 1.15
altair processBlock - 250000 vs - 7PWei worstcase 88.705 ms/op 80.935 ms/op 1.10
altair processBlock - 250000 vs - 7PWei worstcase hashState 132.50 ms/op 97.446 ms/op 1.36
altair processEth1Data - 250000 vs - 7PWei normalcase 995.00 us/op 849.22 us/op 1.17
altair processEpoch - mainnet_e81889 639.75 ms/op 488.44 ms/op 1.31
mainnet_e81889 - altair beforeProcessEpoch 116.96 ms/op 142.34 ms/op 0.82
mainnet_e81889 - altair processJustificationAndFinalization 69.670 us/op 21.378 us/op 3.26
mainnet_e81889 - altair processInactivityUpdates 12.093 ms/op 11.416 ms/op 1.06
mainnet_e81889 - altair processRewardsAndPenalties 192.18 ms/op 137.22 ms/op 1.40
mainnet_e81889 - altair processRegistryUpdates 14.697 us/op 3.4690 us/op 4.24
mainnet_e81889 - altair processSlashings 4.5410 us/op 1.0940 us/op 4.15
mainnet_e81889 - altair processEth1DataReset 3.9030 us/op 1.0210 us/op 3.82
mainnet_e81889 - altair processEffectiveBalanceUpdates 3.0096 ms/op 2.5948 ms/op 1.16
mainnet_e81889 - altair processSlashingsReset 21.163 us/op 4.9400 us/op 4.28
mainnet_e81889 - altair processRandaoMixesReset 25.002 us/op 6.0820 us/op 4.11
mainnet_e81889 - altair processHistoricalRootsUpdate 4.4820 us/op 1.1970 us/op 3.74
mainnet_e81889 - altair processParticipationFlagUpdates 15.094 us/op 4.5860 us/op 3.29
mainnet_e81889 - altair processSyncCommitteeUpdates 3.9720 us/op 1.3680 us/op 2.90
mainnet_e81889 - altair afterProcessEpoch 212.05 ms/op 198.67 ms/op 1.07
altair processInactivityUpdates - 250000 normalcase 41.283 ms/op 33.918 ms/op 1.22
altair processInactivityUpdates - 250000 worstcase 34.824 ms/op 28.169 ms/op 1.24
altair processRewardsAndPenalties - 250000 normalcase 146.11 ms/op 119.38 ms/op 1.22
altair processRewardsAndPenalties - 250000 worstcase 91.728 ms/op 140.14 ms/op 0.65
altair processSyncCommitteeUpdates - 250000 343.35 ms/op 279.97 ms/op 1.23
Tree 40 250000 create 1.0558 s/op 816.28 ms/op 1.29
Tree 40 250000 get(125000) 335.06 ns/op 292.25 ns/op 1.15
Tree 40 250000 set(125000) 3.5343 us/op 2.2342 us/op 1.58
Tree 40 250000 toArray() 38.569 ms/op 31.465 ms/op 1.23
Tree 40 250000 iterate all - toArray() + loop 40.477 ms/op 31.754 ms/op 1.27
Tree 40 250000 iterate all - get(i) 140.23 ms/op 111.92 ms/op 1.25
MutableVector 250000 create 21.557 ms/op 14.515 ms/op 1.49
MutableVector 250000 get(125000) 14.396 ns/op 14.754 ns/op 0.98
MutableVector 250000 set(125000) 871.99 ns/op 599.35 ns/op 1.45
MutableVector 250000 toArray() 7.3164 ms/op 6.6056 ms/op 1.11
MutableVector 250000 iterate all - toArray() + loop 7.4730 ms/op 6.8241 ms/op 1.10
MutableVector 250000 iterate all - get(i) 3.2945 ms/op 3.4376 ms/op 0.96
Array 250000 create 7.4404 ms/op 5.8364 ms/op 1.27
Array 250000 clone - spread 4.4430 ms/op 3.1378 ms/op 1.42
Array 250000 get(125000) 1.9550 ns/op 1.4070 ns/op 1.39
Array 250000 set(125000) 1.8120 ns/op 1.3960 ns/op 1.30
Array 250000 iterate all - loop 147.40 us/op 167.79 us/op 0.88
effectiveBalanceIncrements clone Uint8Array 300000 241.54 us/op 83.337 us/op 2.90
effectiveBalanceIncrements clone MutableVector 300000 758.00 ns/op 1.0420 us/op 0.73
effectiveBalanceIncrements rw all Uint8Array 300000 295.82 us/op 252.50 us/op 1.17
effectiveBalanceIncrements rw all MutableVector 300000 211.27 ms/op 191.01 ms/op 1.11
aggregationBits - 2048 els - zipIndexesInBitList 30.692 us/op 30.121 us/op 1.02
regular array get 100000 times 57.059 us/op 67.419 us/op 0.85
wrappedArray get 100000 times 56.516 us/op 67.419 us/op 0.84
arrayWithProxy get 100000 times 41.474 ms/op 29.645 ms/op 1.40
ssz.Root.equals 583.00 ns/op 510.00 ns/op 1.14
byteArrayEquals 574.00 ns/op 496.00 ns/op 1.16
phase0 processBlock - 250000 vs - 7PWei normalcase 4.5810 ms/op 3.6216 ms/op 1.26
phase0 processBlock - 250000 vs - 7PWei worstcase 56.736 ms/op 46.376 ms/op 1.22
phase0 afterProcessEpoch - 250000 vs - 7PWei 202.96 ms/op 191.83 ms/op 1.06
phase0 beforeProcessEpoch - 250000 vs - 7PWei 82.813 ms/op 105.28 ms/op 0.79
phase0 processEpoch - mainnet_e58758 611.29 ms/op 606.58 ms/op 1.01
mainnet_e58758 - phase0 beforeProcessEpoch 279.68 ms/op 261.39 ms/op 1.07
mainnet_e58758 - phase0 processJustificationAndFinalization 69.278 us/op 22.646 us/op 3.06
mainnet_e58758 - phase0 processRewardsAndPenalties 156.74 ms/op 79.690 ms/op 1.97
mainnet_e58758 - phase0 processRegistryUpdates 32.751 us/op 14.985 us/op 2.19
mainnet_e58758 - phase0 processSlashings 4.1310 us/op 1.4540 us/op 2.84
mainnet_e58758 - phase0 processEth1DataReset 3.6920 us/op 1.1680 us/op 3.16
mainnet_e58758 - phase0 processEffectiveBalanceUpdates 2.5872 ms/op 2.0013 ms/op 1.29
mainnet_e58758 - phase0 processSlashingsReset 20.502 us/op 6.6590 us/op 3.08
mainnet_e58758 - phase0 processRandaoMixesReset 26.833 us/op 8.3820 us/op 3.20
mainnet_e58758 - phase0 processHistoricalRootsUpdate 5.3020 us/op 1.4430 us/op 3.67
mainnet_e58758 - phase0 processParticipationRecordUpdates 24.552 us/op 6.8850 us/op 3.57
mainnet_e58758 - phase0 afterProcessEpoch 171.42 ms/op 162.79 ms/op 1.05
phase0 processEffectiveBalanceUpdates - 250000 normalcase 2.3661 ms/op 2.8607 ms/op 0.83
phase0 processEffectiveBalanceUpdates - 250000 worstcase 0.5 2.5894 ms/op 3.0523 ms/op 0.85
phase0 processRegistryUpdates - 250000 normalcase 27.793 us/op 10.727 us/op 2.59
phase0 processRegistryUpdates - 250000 badcase_full_deposits 514.76 us/op 414.65 us/op 1.24
phase0 processRegistryUpdates - 250000 worstcase 0.5 239.15 ms/op 211.24 ms/op 1.13
phase0 getAttestationDeltas - 250000 normalcase 15.422 ms/op 13.483 ms/op 1.14
phase0 getAttestationDeltas - 250000 worstcase 15.710 ms/op 13.841 ms/op 1.14
phase0 processSlashings - 250000 worstcase 6.7674 ms/op 5.5833 ms/op 1.21
shuffle list - 16384 els 11.826 ms/op 11.271 ms/op 1.05
shuffle list - 250000 els 172.87 ms/op 165.36 ms/op 1.05
getEffectiveBalanceIncrementsZeroInactive - 250000 vs - 7PWei 443.03 us/op 384.26 us/op 1.15
pass gossip attestations to forkchoice per slot 3.8125 ms/op 3.2272 ms/op 1.18
computeDeltas 4.3570 ms/op 3.5251 ms/op 1.24
computeProposerBoostScoreFromBalances 900.79 us/op 921.17 us/op 0.98
getPubkeys - index2pubkey - req 1000 vs - 250000 vc 2.4446 ms/op 2.1981 ms/op 1.11
getPubkeys - validatorsArr - req 1000 vs - 250000 vc 102.30 us/op 76.270 us/op 1.34
BLS verify - blst-native 2.3317 ms/op 1.8587 ms/op 1.25
BLS verifyMultipleSignatures 3 - blst-native 4.5821 ms/op 3.8040 ms/op 1.20
BLS verifyMultipleSignatures 8 - blst-native 10.170 ms/op 8.1949 ms/op 1.24
BLS verifyMultipleSignatures 32 - blst-native 36.093 ms/op 29.692 ms/op 1.22
BLS aggregatePubkeys 32 - blst-native 48.117 us/op 39.295 us/op 1.22
BLS aggregatePubkeys 128 - blst-native 187.96 us/op 153.57 us/op 1.22
getAttestationsForBlock 81.825 ms/op 57.965 ms/op 1.41
isKnown best case - 1 super set check 541.00 ns/op 442.00 ns/op 1.22
isKnown normal case - 2 super set checks 513.00 ns/op 428.00 ns/op 1.20
isKnown worse case - 16 super set checks 524.00 ns/op 427.00 ns/op 1.23
CheckpointStateCache - add get delete 13.339 us/op 11.726 us/op 1.14
validate gossip signedAggregateAndProof - struct 5.0875 ms/op 4.6165 ms/op 1.10
validate gossip attestation - struct 2.4547 ms/op 2.0533 ms/op 1.20
altair verifyImport mainnet_s3766816:31 7.4980 s/op 6.2488 s/op 1.20
pickEth1Vote - no votes 2.6556 ms/op 2.0238 ms/op 1.31
pickEth1Vote - max votes 29.195 ms/op 24.189 ms/op 1.21
pickEth1Vote - Eth1Data hashTreeRoot value x2048 15.279 ms/op 11.137 ms/op 1.37
pickEth1Vote - Eth1Data hashTreeRoot tree x2048 27.509 ms/op 25.239 ms/op 1.09
pickEth1Vote - Eth1Data fastSerialize value x2048 1.9371 ms/op 1.4258 ms/op 1.36
pickEth1Vote - Eth1Data fastSerialize tree x2048 21.546 ms/op 12.974 ms/op 1.66
bytes32 toHexString 1.2930 us/op 958.00 ns/op 1.35
bytes32 Buffer.toString(hex) 826.00 ns/op 678.00 ns/op 1.22
bytes32 Buffer.toString(hex) from Uint8Array 1.1220 us/op 878.00 ns/op 1.28
bytes32 Buffer.toString(hex) + 0x 841.00 ns/op 673.00 ns/op 1.25
Object access 1 prop 0.44900 ns/op 0.32000 ns/op 1.40
Map access 1 prop 0.35500 ns/op 0.28100 ns/op 1.26
Object get x1000 17.539 ns/op 17.966 ns/op 0.98
Map get x1000 1.0820 ns/op 0.97600 ns/op 1.11
Object set x1000 128.87 ns/op 108.30 ns/op 1.19
Map set x1000 90.618 ns/op 68.465 ns/op 1.32
Return object 10000 times 0.43950 ns/op 0.37880 ns/op 1.16
Throw Error 10000 times 7.0656 us/op 6.0543 us/op 1.17
enrSubnets - fastDeserialize 64 bits 3.3070 us/op 2.3850 us/op 1.39
enrSubnets - ssz BitVector 64 bits 886.00 ns/op 683.00 ns/op 1.30
enrSubnets - fastDeserialize 4 bits 448.00 ns/op 361.00 ns/op 1.24
enrSubnets - ssz BitVector 4 bits 914.00 ns/op 692.00 ns/op 1.32
prioritizePeers score -10:0 att 32-0.1 sync 2-0 120.38 us/op 89.554 us/op 1.34
prioritizePeers score 0:0 att 32-0.25 sync 2-0.25 159.03 us/op 123.17 us/op 1.29
prioritizePeers score 0:0 att 32-0.5 sync 2-0.5 297.75 us/op 196.95 us/op 1.51
prioritizePeers score 0:0 att 64-0.75 sync 4-0.75 633.66 us/op 431.15 us/op 1.47
prioritizePeers score 0:0 att 64-1 sync 4-1 548.78 us/op 457.39 us/op 1.20
RateTracker 1000000 limit, 1 obj count per request 208.33 ns/op 195.90 ns/op 1.06
RateTracker 1000000 limit, 2 obj count per request 158.74 ns/op 146.92 ns/op 1.08
RateTracker 1000000 limit, 4 obj count per request 129.07 ns/op 123.71 ns/op 1.04
RateTracker 1000000 limit, 8 obj count per request 115.26 ns/op 117.91 ns/op 0.98
RateTracker with prune 5.3640 us/op 4.0890 us/op 1.31
array of 16000 items push then shift 5.2294 us/op 3.1576 us/op 1.66
LinkedList of 16000 items push then shift 32.208 ns/op 23.761 ns/op 1.36
array of 16000 items push then pop 285.06 ns/op 218.06 ns/op 1.31
LinkedList of 16000 items push then pop 25.738 ns/op 19.973 ns/op 1.29
array of 24000 items push then shift 7.8369 us/op 4.5534 us/op 1.72
LinkedList of 24000 items push then shift 31.142 ns/op 22.752 ns/op 1.37
array of 24000 items push then pop 236.61 ns/op 187.10 ns/op 1.26
LinkedList of 24000 items push then pop 24.452 ns/op 19.586 ns/op 1.25
intersect bitArray bitLen 8 12.866 ns/op 11.482 ns/op 1.12
intersect array and set length 8 198.80 ns/op 152.38 ns/op 1.30
intersect bitArray bitLen 128 72.975 ns/op 72.113 ns/op 1.01
intersect array and set length 128 2.5082 us/op 2.1252 us/op 1.18

by benchmarkbot/action

@dapplion dapplion added the meta-breaking-change Introduces breaking changes to DB, Validator, Beacon Node, or CLI interfaces. Handle with care! label Jun 3, 2022
@wemeetagain
Copy link
Member

tests failing but lgtm

@dadepo
Copy link
Contributor

dadepo commented Jun 3, 2022

Is it possible to not deprecate lodestar account validator list but move it instead to validator command? I recently had to use it to see the active keys a vc is running and it was quite handy.

@dapplion dapplion added this to the Audit 2022Q2-batch2 milestone Jun 4, 2022
@dapplion
Copy link
Contributor Author

dapplion commented Jun 4, 2022

Re-added the list command with e2e test for import + list flow

@wemeetagain wemeetagain merged commit f74f9ef into unstable Jun 7, 2022
@wemeetagain wemeetagain deleted the dapplion/remove-account branch June 7, 2022 16:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
meta-breaking-change Introduces breaking changes to DB, Validator, Beacon Node, or CLI interfaces. Handle with care!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Deprecate accounts CLI
3 participants