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

Generalize filename regex for voting keys. #3970

Merged
merged 1 commit into from
May 4, 2022
Merged

Conversation

dadepo
Copy link
Contributor

@dadepo dadepo commented May 4, 2022

Motivation

Lodestar expects filename for key files to match the format exported by the eth2.0-deposit-cli library, even though the documentation states file name which contains 'keystore' and has the '.json' extension will be attempted to be imported.

This PR updates the behaviour to match what is documented.

Closes #3941

@dadepo dadepo requested a review from a team as a code owner May 4, 2022 15:11
@codecov
Copy link

codecov bot commented May 4, 2022

Codecov Report

Merging #3970 (a294fa7) into master (2d58a44) will increase coverage by 0.02%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##           master    #3970      +/-   ##
==========================================
+ Coverage   36.30%   36.32%   +0.02%     
==========================================
  Files         324      324              
  Lines        9107     9107              
  Branches     1468     1468              
==========================================
+ Hits         3306     3308       +2     
+ Misses       5628     5626       -2     
  Partials      173      173              

@github-actions
Copy link
Contributor

github-actions bot commented May 4, 2022

Performance Report

✔️ no performance regression detected

Full benchmark results
Benchmark suite Current: 55e61aa Previous: a3cb495 Ratio
BeaconState.hashTreeRoot - No change 509.00 ns/op 540.00 ns/op 0.94
BeaconState.hashTreeRoot - 1 full validator 66.281 us/op 55.083 us/op 1.20
BeaconState.hashTreeRoot - 32 full validator 650.61 us/op 545.85 us/op 1.19
BeaconState.hashTreeRoot - 512 full validator 6.9764 ms/op 6.0044 ms/op 1.16
BeaconState.hashTreeRoot - 1 validator.effectiveBalance 82.075 us/op 70.324 us/op 1.17
BeaconState.hashTreeRoot - 32 validator.effectiveBalance 1.1131 ms/op 957.38 us/op 1.16
BeaconState.hashTreeRoot - 512 validator.effectiveBalance 14.674 ms/op 13.434 ms/op 1.09
BeaconState.hashTreeRoot - 1 balances 63.935 us/op 53.034 us/op 1.21
BeaconState.hashTreeRoot - 32 balances 559.04 us/op 474.25 us/op 1.18
BeaconState.hashTreeRoot - 512 balances 5.3357 ms/op 4.6279 ms/op 1.15
BeaconState.hashTreeRoot - 250000 balances 106.75 ms/op 102.05 ms/op 1.05
processSlot - 1 slots 11.165 us/op 9.5420 us/op 1.17
processSlot - 32 slots 1.7847 ms/op 1.5799 ms/op 1.13
getCommitteeAssignments - req 1 vs - 250000 vc 5.2696 ms/op 5.2415 ms/op 1.01
getCommitteeAssignments - req 100 vs - 250000 vc 7.7883 ms/op 7.3016 ms/op 1.07
getCommitteeAssignments - req 1000 vs - 250000 vc 8.3807 ms/op 7.8429 ms/op 1.07
computeProposers - vc 250000 17.398 ms/op 16.627 ms/op 1.05
computeEpochShuffling - vc 250000 169.91 ms/op 158.93 ms/op 1.07
getNextSyncCommittee - vc 250000 287.53 ms/op 275.25 ms/op 1.04
altair processAttestation - 250000 vs - 7PWei normalcase 3.3378 ms/op 3.9244 ms/op 0.85
altair processAttestation - 250000 vs - 7PWei worstcase 4.9135 ms/op 5.5753 ms/op 0.88
altair processAttestation - setStatus - 1/6 committees join 160.48 us/op 195.17 us/op 0.82
altair processAttestation - setStatus - 1/3 committees join 321.40 us/op 380.33 us/op 0.85
altair processAttestation - setStatus - 1/2 committees join 467.41 us/op 527.76 us/op 0.89
altair processAttestation - setStatus - 2/3 committees join 616.27 us/op 678.48 us/op 0.91
altair processAttestation - setStatus - 4/5 committees join 842.98 us/op 944.43 us/op 0.89
altair processAttestation - setStatus - 100% committees join 1.0361 ms/op 1.1218 ms/op 0.92
altair processBlock - 250000 vs - 7PWei normalcase 23.610 ms/op 23.665 ms/op 1.00
altair processBlock - 250000 vs - 7PWei normalcase hashState 32.355 ms/op 34.344 ms/op 0.94
altair processBlock - 250000 vs - 7PWei worstcase 72.787 ms/op 75.794 ms/op 0.96
altair processBlock - 250000 vs - 7PWei worstcase hashState 111.11 ms/op 94.679 ms/op 1.17
altair processEth1Data - 250000 vs - 7PWei normalcase 672.23 us/op 806.54 us/op 0.83
altair processEpoch - mainnet_e81889 523.25 ms/op 467.27 ms/op 1.12
mainnet_e81889 - altair beforeProcessEpoch 108.99 ms/op 135.78 ms/op 0.80
mainnet_e81889 - altair processJustificationAndFinalization 19.050 us/op 25.084 us/op 0.76
mainnet_e81889 - altair processInactivityUpdates 8.9493 ms/op 10.947 ms/op 0.82
mainnet_e81889 - altair processRewardsAndPenalties 68.161 ms/op 131.82 ms/op 0.52
mainnet_e81889 - altair processRegistryUpdates 2.6190 us/op 3.8710 us/op 0.68
mainnet_e81889 - altair processSlashings 841.00 ns/op 1.2620 us/op 0.67
mainnet_e81889 - altair processEth1DataReset 859.00 ns/op 1.0930 us/op 0.79
mainnet_e81889 - altair processEffectiveBalanceUpdates 5.8269 ms/op 7.0392 ms/op 0.83
mainnet_e81889 - altair processSlashingsReset 4.0200 us/op 5.6690 us/op 0.71
mainnet_e81889 - altair processRandaoMixesReset 4.9050 us/op 6.7940 us/op 0.72
mainnet_e81889 - altair processHistoricalRootsUpdate 997.00 ns/op 1.4690 us/op 0.68
mainnet_e81889 - altair processParticipationFlagUpdates 2.3490 us/op 3.0520 us/op 0.77
mainnet_e81889 - altair processSyncCommitteeUpdates 1.1000 us/op 1.1870 us/op 0.93
mainnet_e81889 - altair afterProcessEpoch 217.01 ms/op 182.55 ms/op 1.19
altair processInactivityUpdates - 250000 normalcase 25.959 ms/op 30.432 ms/op 0.85
altair processInactivityUpdates - 250000 worstcase 22.023 ms/op 26.019 ms/op 0.85
altair processRewardsAndPenalties - 250000 normalcase 86.506 ms/op 78.763 ms/op 1.10
altair processRewardsAndPenalties - 250000 worstcase 86.907 ms/op 111.53 ms/op 0.78
altair processSyncCommitteeUpdates - 250000 296.61 ms/op 281.04 ms/op 1.06
Tree 40 250000 create 574.97 ms/op 641.40 ms/op 0.90
Tree 40 250000 get(125000) 246.03 ns/op 288.62 ns/op 0.85
Tree 40 250000 set(125000) 1.9549 us/op 2.1430 us/op 0.91
Tree 40 250000 toArray() 25.884 ms/op 31.324 ms/op 0.83
Tree 40 250000 iterate all - toArray() + loop 25.854 ms/op 31.005 ms/op 0.83
Tree 40 250000 iterate all - get(i) 110.83 ms/op 109.37 ms/op 1.01
MutableVector 250000 create 12.357 ms/op 14.623 ms/op 0.84
MutableVector 250000 get(125000) 11.012 ns/op 13.108 ns/op 0.84
MutableVector 250000 set(125000) 476.83 ns/op 567.08 ns/op 0.84
MutableVector 250000 toArray() 4.6797 ms/op 6.4947 ms/op 0.72
MutableVector 250000 iterate all - toArray() + loop 4.7474 ms/op 6.6496 ms/op 0.71
MutableVector 250000 iterate all - get(i) 2.6735 ms/op 3.4410 ms/op 0.78
Array 250000 create 4.5075 ms/op 5.9908 ms/op 0.75
Array 250000 clone - spread 1.6398 ms/op 2.5079 ms/op 0.65
Array 250000 get(125000) 0.98300 ns/op 1.1610 ns/op 0.85
Array 250000 set(125000) 0.97800 ns/op 1.1400 ns/op 0.86
Array 250000 iterate all - loop 153.85 us/op 168.91 us/op 0.91
effectiveBalanceIncrements clone Uint8Array 300000 49.362 us/op 78.446 us/op 0.63
effectiveBalanceIncrements clone MutableVector 300000 511.00 ns/op 530.00 ns/op 0.96
effectiveBalanceIncrements rw all Uint8Array 300000 241.38 us/op 301.81 us/op 0.80
effectiveBalanceIncrements rw all MutableVector 300000 130.53 ms/op 146.79 ms/op 0.89
aggregationBits - 2048 els - zipIndexesInBitList 20.420 us/op 23.452 us/op 0.87
regular array get 100000 times 60.596 us/op 67.449 us/op 0.90
wrappedArray get 100000 times 60.651 us/op 67.433 us/op 0.90
arrayWithProxy get 100000 times 31.635 ms/op 32.761 ms/op 0.97
ssz.Root.equals 492.00 ns/op 434.00 ns/op 1.13
byteArrayEquals 480.00 ns/op 440.00 ns/op 1.09
phase0 processBlock - 250000 vs - 7PWei normalcase 3.0684 ms/op 3.3400 ms/op 0.92
phase0 processBlock - 250000 vs - 7PWei worstcase 50.616 ms/op 45.512 ms/op 1.11
phase0 afterProcessEpoch - 250000 vs - 7PWei 187.33 ms/op 174.23 ms/op 1.08
phase0 beforeProcessEpoch - 250000 vs - 7PWei 59.831 ms/op 72.690 ms/op 0.82
phase0 processEpoch - mainnet_e58758 463.99 ms/op 498.77 ms/op 0.93
mainnet_e58758 - phase0 beforeProcessEpoch 164.57 ms/op 217.44 ms/op 0.76
mainnet_e58758 - phase0 processJustificationAndFinalization 17.174 us/op 22.576 us/op 0.76
mainnet_e58758 - phase0 processRewardsAndPenalties 64.369 ms/op 127.28 ms/op 0.51
mainnet_e58758 - phase0 processRegistryUpdates 8.0850 us/op 9.3320 us/op 0.87
mainnet_e58758 - phase0 processSlashings 936.00 ns/op 1.2600 us/op 0.74
mainnet_e58758 - phase0 processEth1DataReset 884.00 ns/op 1.0270 us/op 0.86
mainnet_e58758 - phase0 processEffectiveBalanceUpdates 4.7637 ms/op 6.3587 ms/op 0.75
mainnet_e58758 - phase0 processSlashingsReset 3.6970 us/op 5.3130 us/op 0.70
mainnet_e58758 - phase0 processRandaoMixesReset 4.5130 us/op 5.4670 us/op 0.83
mainnet_e58758 - phase0 processHistoricalRootsUpdate 1.1580 us/op 1.4710 us/op 0.79
mainnet_e58758 - phase0 processParticipationRecordUpdates 4.0350 us/op 5.0620 us/op 0.80
mainnet_e58758 - phase0 afterProcessEpoch 163.67 ms/op 152.55 ms/op 1.07
phase0 processEffectiveBalanceUpdates - 250000 normalcase 5.5535 ms/op 6.3401 ms/op 0.88
phase0 processEffectiveBalanceUpdates - 250000 worstcase 0.5 5.7681 ms/op 6.8694 ms/op 0.84
phase0 processRegistryUpdates - 250000 normalcase 6.5890 us/op 8.5200 us/op 0.77
phase0 processRegistryUpdates - 250000 badcase_full_deposits 381.92 us/op 434.01 us/op 0.88
phase0 processRegistryUpdates - 250000 worstcase 0.5 168.21 ms/op 213.73 ms/op 0.79
phase0 getAttestationDeltas - 250000 normalcase 12.643 ms/op 15.586 ms/op 0.81
phase0 getAttestationDeltas - 250000 worstcase 12.815 ms/op 15.369 ms/op 0.83
phase0 processSlashings - 250000 worstcase 5.1530 ms/op 5.9234 ms/op 0.87
shuffle list - 16384 els 11.328 ms/op 10.678 ms/op 1.06
shuffle list - 250000 els 167.72 ms/op 153.97 ms/op 1.09
getEffectiveBalanceIncrementsZeroInactive - 250000 vs - 7PWei 348.09 us/op 359.39 us/op 0.97
pass gossip attestations to forkchoice per slot 3.0313 ms/op 3.3897 ms/op 0.89
computeDeltas 3.2739 ms/op 3.3259 ms/op 0.98
computeProposerBoostScoreFromBalances 452.44 us/op 502.78 us/op 0.90
getPubkeys - index2pubkey - req 1000 vs - 250000 vc 1.6212 ms/op 2.1305 ms/op 0.76
getPubkeys - validatorsArr - req 1000 vs - 250000 vc 61.241 us/op 72.874 us/op 0.84
BLS verify - blst-native 2.1701 ms/op 1.8550 ms/op 1.17
BLS verifyMultipleSignatures 3 - blst-native 4.4757 ms/op 3.7922 ms/op 1.18
BLS verifyMultipleSignatures 8 - blst-native 9.6771 ms/op 8.1648 ms/op 1.19
BLS verifyMultipleSignatures 32 - blst-native 35.127 ms/op 29.630 ms/op 1.19
BLS aggregatePubkeys 32 - blst-native 47.222 us/op 39.928 us/op 1.18
BLS aggregatePubkeys 128 - blst-native 184.53 us/op 153.09 us/op 1.21
getAttestationsForBlock 47.521 ms/op 56.020 ms/op 0.85
CheckpointStateCache - add get delete 10.511 us/op 10.308 us/op 1.02
validate gossip signedAggregateAndProof - struct 5.0153 ms/op 4.2653 ms/op 1.18
validate gossip attestation - struct 2.3708 ms/op 2.0266 ms/op 1.17
pickEth1Vote - no votes 2.2172 ms/op 2.1850 ms/op 1.01
pickEth1Vote - max votes 17.299 ms/op 19.025 ms/op 0.91
pickEth1Vote - Eth1Data hashTreeRoot value x2048 12.276 ms/op 11.002 ms/op 1.12
pickEth1Vote - Eth1Data hashTreeRoot tree x2048 19.277 ms/op 19.828 ms/op 0.97
pickEth1Vote - Eth1Data fastSerialize value x2048 1.5442 ms/op 1.6743 ms/op 0.92
pickEth1Vote - Eth1Data fastSerialize tree x2048 11.391 ms/op 12.177 ms/op 0.94
bytes32 toHexString 891.00 ns/op 933.00 ns/op 0.95
bytes32 Buffer.toString(hex) 757.00 ns/op 681.00 ns/op 1.11
bytes32 Buffer.toString(hex) from Uint8Array 1.0030 us/op 915.00 ns/op 1.10
bytes32 Buffer.toString(hex) + 0x 763.00 ns/op 698.00 ns/op 1.09
Object access 1 prop 0.32600 ns/op 0.34300 ns/op 0.95
Map access 1 prop 0.30800 ns/op 0.29800 ns/op 1.03
Object get x1000 11.162 ns/op 17.130 ns/op 0.65
Map get x1000 1.0000 ns/op 1.0090 ns/op 0.99
Object set x1000 65.130 ns/op 108.89 ns/op 0.60
Map set x1000 41.925 ns/op 68.058 ns/op 0.62
Return object 10000 times 0.43940 ns/op 0.37100 ns/op 1.18
Throw Error 10000 times 5.9890 us/op 5.8652 us/op 1.02
enrSubnets - fastDeserialize 64 bits 2.5980 us/op 2.6710 us/op 0.97
enrSubnets - ssz BitVector 64 bits 855.00 ns/op 753.00 ns/op 1.14
enrSubnets - fastDeserialize 4 bits 396.00 ns/op 406.00 ns/op 0.98
enrSubnets - ssz BitVector 4 bits 804.00 ns/op 773.00 ns/op 1.04
RateTracker 1000000 limit, 1 obj count per request 176.67 ns/op 182.33 ns/op 0.97
RateTracker 1000000 limit, 2 obj count per request 128.19 ns/op 136.55 ns/op 0.94
RateTracker 1000000 limit, 4 obj count per request 104.68 ns/op 113.66 ns/op 0.92
RateTracker 1000000 limit, 8 obj count per request 92.275 ns/op 101.66 ns/op 0.91
RateTracker with prune 3.4180 us/op 3.8200 us/op 0.89
array of 16000 items push then shift 51.582 us/op 3.0858 us/op 16.72
LinkedList of 16000 items push then shift 11.897 ns/op 16.502 ns/op 0.72
array of 16000 items push then pop 172.70 ns/op 203.02 ns/op 0.85
LinkedList of 16000 items push then pop 11.410 ns/op 15.267 ns/op 0.75
array of 24000 items push then shift 77.353 us/op 4.5566 us/op 16.98
LinkedList of 24000 items push then shift 11.968 ns/op 18.449 ns/op 0.65
array of 24000 items push then pop 168.34 ns/op 193.15 ns/op 0.87
LinkedList of 24000 items push then pop 11.519 ns/op 17.022 ns/op 0.68

by benchmarkbot/action

@dapplion dapplion changed the title Be more lenient with accepted filename when reading voting keys. Generalize filename regex for voting keys. May 4, 2022
@dapplion dapplion merged commit 5758cbe into master May 4, 2022
@dapplion dapplion deleted the dadepo/fix-key-import branch May 4, 2022 16:58
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.

Unable to import keys exported from Prysm
2 participants