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

Parse remote key's pubkeys into format expected by validator store. #4405

Merged
merged 1 commit into from
Aug 13, 2022

Conversation

dadepo
Copy link
Contributor

@dadepo dadepo commented Aug 12, 2022

Motivation

Pubkeys passed via the externalSigner.pubkeys, flag, if prefixed by 0x leads to parsing error. (See #3817), if not prefixed with0x the validator client runs alright, but it is not picked for validator duties since the validator store expects known pubkeys to be prefixed with 0x.

Description

Prevents parsing error if pubkeys with 0x prefix is passed in. If not prefixed, ensures that the pubkey is prefixed with 0x

Closes #3817
Closes #4367

@dadepo dadepo requested a review from a team as a code owner August 12, 2022 16:35
@github-actions
Copy link
Contributor

Performance Report

✔️ no performance regression detected

Full benchmark results
Benchmark suite Current: 227ebc2 Previous: 551ad74 Ratio
getPubkeys - index2pubkey - req 1000 vs - 250000 vc 2.2442 ms/op 2.0487 ms/op 1.10
getPubkeys - validatorsArr - req 1000 vs - 250000 vc 75.724 us/op 68.452 us/op 1.11
BLS verify - blst-native 1.8554 ms/op 2.2567 ms/op 0.82
BLS verifyMultipleSignatures 3 - blst-native 3.8219 ms/op 4.5676 ms/op 0.84
BLS verifyMultipleSignatures 8 - blst-native 8.1837 ms/op 9.8269 ms/op 0.83
BLS verifyMultipleSignatures 32 - blst-native 29.696 ms/op 35.876 ms/op 0.83
BLS aggregatePubkeys 32 - blst-native 39.761 us/op 47.426 us/op 0.84
BLS aggregatePubkeys 128 - blst-native 152.65 us/op 185.15 us/op 0.82
getAttestationsForBlock 171.89 ms/op 153.91 ms/op 1.12
isKnown best case - 1 super set check 437.00 ns/op 494.00 ns/op 0.88
isKnown normal case - 2 super set checks 466.00 ns/op 486.00 ns/op 0.96
isKnown worse case - 16 super set checks 435.00 ns/op 491.00 ns/op 0.89
CheckpointStateCache - add get delete 9.0920 us/op 9.4890 us/op 0.96
validate gossip signedAggregateAndProof - struct 4.2682 ms/op 5.0806 ms/op 0.84
validate gossip attestation - struct 2.0304 ms/op 2.4070 ms/op 0.84
altair verifyImport mainnet_s3766816:31 8.8847 s/op 8.9532 s/op 0.99
pickEth1Vote - no votes 2.1308 ms/op 2.1112 ms/op 1.01
pickEth1Vote - max votes 23.286 ms/op 21.622 ms/op 1.08
pickEth1Vote - Eth1Data hashTreeRoot value x2048 11.509 ms/op 13.146 ms/op 0.88
pickEth1Vote - Eth1Data hashTreeRoot tree x2048 21.851 ms/op 21.187 ms/op 1.03
pickEth1Vote - Eth1Data fastSerialize value x2048 1.6780 ms/op 1.5199 ms/op 1.10
pickEth1Vote - Eth1Data fastSerialize tree x2048 17.410 ms/op 15.123 ms/op 1.15
bytes32 toHexString 1.3040 us/op 1.0200 us/op 1.28
bytes32 Buffer.toString(hex) 745.00 ns/op 836.00 ns/op 0.89
bytes32 Buffer.toString(hex) from Uint8Array 1.0130 us/op 1.0590 us/op 0.96
bytes32 Buffer.toString(hex) + 0x 746.00 ns/op 823.00 ns/op 0.91
Object access 1 prop 0.39300 ns/op 0.38200 ns/op 1.03
Map access 1 prop 0.29300 ns/op 0.31500 ns/op 0.93
Object get x1000 17.749 ns/op 11.302 ns/op 1.57
Map get x1000 1.0140 ns/op 0.93900 ns/op 1.08
Object set x1000 130.48 ns/op 76.910 ns/op 1.70
Map set x1000 78.918 ns/op 50.647 ns/op 1.56
Return object 10000 times 0.36730 ns/op 0.44770 ns/op 0.82
Throw Error 10000 times 5.9518 us/op 6.3963 us/op 0.93
enrSubnets - fastDeserialize 64 bits 2.8850 us/op 2.9870 us/op 0.97
enrSubnets - ssz BitVector 64 bits 774.00 ns/op 843.00 ns/op 0.92
enrSubnets - fastDeserialize 4 bits 431.00 ns/op 406.00 ns/op 1.06
enrSubnets - ssz BitVector 4 bits 782.00 ns/op 861.00 ns/op 0.91
prioritizePeers score -10:0 att 32-0.1 sync 2-0 98.930 us/op 94.703 us/op 1.04
prioritizePeers score 0:0 att 32-0.25 sync 2-0.25 125.47 us/op 117.23 us/op 1.07
prioritizePeers score 0:0 att 32-0.5 sync 2-0.5 232.66 us/op 215.04 us/op 1.08
prioritizePeers score 0:0 att 64-0.75 sync 4-0.75 499.85 us/op 420.40 us/op 1.19
prioritizePeers score 0:0 att 64-1 sync 4-1 463.43 us/op 418.29 us/op 1.11
RateTracker 1000000 limit, 1 obj count per request 200.95 ns/op 194.92 ns/op 1.03
RateTracker 1000000 limit, 2 obj count per request 168.14 ns/op 143.31 ns/op 1.17
RateTracker 1000000 limit, 4 obj count per request 132.23 ns/op 117.28 ns/op 1.13
RateTracker 1000000 limit, 8 obj count per request 124.91 ns/op 104.59 ns/op 1.19
RateTracker with prune 5.4570 us/op 4.3880 us/op 1.24
array of 16000 items push then shift 3.2110 us/op 52.196 us/op 0.06
LinkedList of 16000 items push then shift 29.220 ns/op 16.693 ns/op 1.75
array of 16000 items push then pop 275.41 ns/op 230.48 ns/op 1.19
LinkedList of 16000 items push then pop 23.579 ns/op 14.657 ns/op 1.61
array of 24000 items push then shift 4.5685 us/op 78.766 us/op 0.06
LinkedList of 24000 items push then shift 31.560 ns/op 21.226 ns/op 1.49
array of 24000 items push then pop 211.26 ns/op 205.75 ns/op 1.03
LinkedList of 24000 items push then pop 23.813 ns/op 16.791 ns/op 1.42
intersect bitArray bitLen 8 11.759 ns/op 10.796 ns/op 1.09
intersect array and set length 8 176.78 ns/op 147.70 ns/op 1.20
intersect bitArray bitLen 128 61.993 ns/op 56.151 ns/op 1.10
intersect array and set length 128 2.3845 us/op 1.8885 us/op 1.26
Buffer.concat 32 items 1.9470 ns/op 1.8340 ns/op 1.06
pass gossip attestations to forkchoice per slot 3.2466 ms/op 4.8131 ms/op 0.67
computeDeltas 3.5899 ms/op 3.2424 ms/op 1.11
computeProposerBoostScoreFromBalances 907.83 us/op 820.29 us/op 1.11
altair processAttestation - 250000 vs - 7PWei normalcase 4.7052 ms/op 3.8761 ms/op 1.21
altair processAttestation - 250000 vs - 7PWei worstcase 6.7278 ms/op 5.7296 ms/op 1.17
altair processAttestation - setStatus - 1/6 committees join 214.87 us/op 182.40 us/op 1.18
altair processAttestation - setStatus - 1/3 committees join 412.49 us/op 351.95 us/op 1.17
altair processAttestation - setStatus - 1/2 committees join 574.09 us/op 497.86 us/op 1.15
altair processAttestation - setStatus - 2/3 committees join 743.33 us/op 662.18 us/op 1.12
altair processAttestation - setStatus - 4/5 committees join 1.0294 ms/op 907.51 us/op 1.13
altair processAttestation - setStatus - 100% committees join 1.2149 ms/op 1.1153 ms/op 1.09
altair processBlock - 250000 vs - 7PWei normalcase 29.499 ms/op 24.692 ms/op 1.19
altair processBlock - 250000 vs - 7PWei normalcase hashState 41.101 ms/op 47.899 ms/op 0.86
altair processBlock - 250000 vs - 7PWei worstcase 92.047 ms/op 81.503 ms/op 1.13
altair processBlock - 250000 vs - 7PWei worstcase hashState 103.27 ms/op 104.18 ms/op 0.99
phase0 processBlock - 250000 vs - 7PWei normalcase 4.8002 ms/op 4.1138 ms/op 1.17
phase0 processBlock - 250000 vs - 7PWei worstcase 47.553 ms/op 54.040 ms/op 0.88
altair processEth1Data - 250000 vs - 7PWei normalcase 764.03 us/op 806.45 us/op 0.95
Tree 40 250000 create 819.63 ms/op 762.05 ms/op 1.08
Tree 40 250000 get(125000) 291.87 ns/op 236.12 ns/op 1.24
Tree 40 250000 set(125000) 3.0412 us/op 2.2033 us/op 1.38
Tree 40 250000 toArray() 34.864 ms/op 27.959 ms/op 1.25
Tree 40 250000 iterate all - toArray() + loop 35.223 ms/op 28.662 ms/op 1.23
Tree 40 250000 iterate all - get(i) 116.87 ms/op 112.74 ms/op 1.04
MutableVector 250000 create 16.775 ms/op 15.465 ms/op 1.08
MutableVector 250000 get(125000) 15.083 ns/op 11.127 ns/op 1.36
MutableVector 250000 set(125000) 717.42 ns/op 617.75 ns/op 1.16
MutableVector 250000 toArray() 8.0529 ms/op 6.6175 ms/op 1.22
MutableVector 250000 iterate all - toArray() + loop 8.2659 ms/op 7.0006 ms/op 1.18
MutableVector 250000 iterate all - get(i) 3.4414 ms/op 2.6951 ms/op 1.28
Array 250000 create 7.4393 ms/op 6.6763 ms/op 1.11
Array 250000 clone - spread 4.0713 ms/op 3.6990 ms/op 1.10
Array 250000 get(125000) 1.7130 ns/op 1.6550 ns/op 1.04
Array 250000 set(125000) 1.7460 ns/op 1.6540 ns/op 1.06
Array 250000 iterate all - loop 169.57 us/op 154.25 us/op 1.10
effectiveBalanceIncrements clone Uint8Array 300000 100.38 us/op 209.65 us/op 0.48
effectiveBalanceIncrements clone MutableVector 300000 1.3260 us/op 746.00 ns/op 1.78
effectiveBalanceIncrements rw all Uint8Array 300000 252.53 us/op 253.54 us/op 1.00
effectiveBalanceIncrements rw all MutableVector 300000 217.28 ms/op 144.04 ms/op 1.51
phase0 afterProcessEpoch - 250000 vs - 7PWei 186.06 ms/op 189.11 ms/op 0.98
phase0 beforeProcessEpoch - 250000 vs - 7PWei 121.26 ms/op 60.097 ms/op 2.02
altair processEpoch - mainnet_e81889 614.18 ms/op 588.04 ms/op 1.04
mainnet_e81889 - altair beforeProcessEpoch 168.52 ms/op 82.060 ms/op 2.05
mainnet_e81889 - altair processJustificationAndFinalization 28.662 us/op 21.546 us/op 1.33
mainnet_e81889 - altair processInactivityUpdates 11.684 ms/op 9.1866 ms/op 1.27
mainnet_e81889 - altair processRewardsAndPenalties 98.419 ms/op 142.73 ms/op 0.69
mainnet_e81889 - altair processRegistryUpdates 4.5540 us/op 4.0260 us/op 1.13
mainnet_e81889 - altair processSlashings 936.00 ns/op 863.00 ns/op 1.08
mainnet_e81889 - altair processEth1DataReset 931.00 ns/op 913.00 ns/op 1.02
mainnet_e81889 - altair processEffectiveBalanceUpdates 2.4780 ms/op 2.3923 ms/op 1.04
mainnet_e81889 - altair processSlashingsReset 7.2580 us/op 7.8290 us/op 0.93
mainnet_e81889 - altair processRandaoMixesReset 7.8510 us/op 6.0810 us/op 1.29
mainnet_e81889 - altair processHistoricalRootsUpdate 1.0740 us/op 947.00 ns/op 1.13
mainnet_e81889 - altair processParticipationFlagUpdates 3.7090 us/op 3.2660 us/op 1.14
mainnet_e81889 - altair processSyncCommitteeUpdates 925.00 ns/op 1.0300 us/op 0.90
mainnet_e81889 - altair afterProcessEpoch 205.07 ms/op 199.66 ms/op 1.03
phase0 processEpoch - mainnet_e58758 570.68 ms/op 495.11 ms/op 1.15
mainnet_e58758 - phase0 beforeProcessEpoch 253.49 ms/op 202.10 ms/op 1.25
mainnet_e58758 - phase0 processJustificationAndFinalization 19.932 us/op 20.036 us/op 0.99
mainnet_e58758 - phase0 processRewardsAndPenalties 128.60 ms/op 95.888 ms/op 1.34
mainnet_e58758 - phase0 processRegistryUpdates 11.779 us/op 10.024 us/op 1.18
mainnet_e58758 - phase0 processSlashings 1.2820 us/op 874.00 ns/op 1.47
mainnet_e58758 - phase0 processEth1DataReset 1.0010 us/op 1.1370 us/op 0.88
mainnet_e58758 - phase0 processEffectiveBalanceUpdates 2.2415 ms/op 1.6488 ms/op 1.36
mainnet_e58758 - phase0 processSlashingsReset 6.4380 us/op 5.2540 us/op 1.23
mainnet_e58758 - phase0 processRandaoMixesReset 9.5680 us/op 6.4760 us/op 1.48
mainnet_e58758 - phase0 processHistoricalRootsUpdate 1.0420 us/op 1.0240 us/op 1.02
mainnet_e58758 - phase0 processParticipationRecordUpdates 6.4920 us/op 5.4710 us/op 1.19
mainnet_e58758 - phase0 afterProcessEpoch 161.99 ms/op 167.59 ms/op 0.97
phase0 processEffectiveBalanceUpdates - 250000 normalcase 2.5483 ms/op 1.9906 ms/op 1.28
phase0 processEffectiveBalanceUpdates - 250000 worstcase 0.5 3.4867 ms/op 2.2518 ms/op 1.55
altair processInactivityUpdates - 250000 normalcase 49.094 ms/op 35.576 ms/op 1.38
altair processInactivityUpdates - 250000 worstcase 53.708 ms/op 40.453 ms/op 1.33
phase0 processRegistryUpdates - 250000 normalcase 10.894 us/op 8.2130 us/op 1.33
phase0 processRegistryUpdates - 250000 badcase_full_deposits 504.35 us/op 364.13 us/op 1.39
phase0 processRegistryUpdates - 250000 worstcase 0.5 229.49 ms/op 176.00 ms/op 1.30
altair processRewardsAndPenalties - 250000 normalcase 102.09 ms/op 83.383 ms/op 1.22
altair processRewardsAndPenalties - 250000 worstcase 138.87 ms/op 95.769 ms/op 1.45
phase0 getAttestationDeltas - 250000 normalcase 13.260 ms/op 13.016 ms/op 1.02
phase0 getAttestationDeltas - 250000 worstcase 13.514 ms/op 12.788 ms/op 1.06
phase0 processSlashings - 250000 worstcase 5.3729 ms/op 5.1869 ms/op 1.04
altair processSyncCommitteeUpdates - 250000 284.75 ms/op 301.38 ms/op 0.94
BeaconState.hashTreeRoot - No change 496.00 ns/op 542.00 ns/op 0.92
BeaconState.hashTreeRoot - 1 full validator 64.569 us/op 77.687 us/op 0.83
BeaconState.hashTreeRoot - 32 full validator 630.95 us/op 736.85 us/op 0.86
BeaconState.hashTreeRoot - 512 full validator 6.8991 ms/op 7.0928 ms/op 0.97
BeaconState.hashTreeRoot - 1 validator.effectiveBalance 80.827 us/op 104.36 us/op 0.77
BeaconState.hashTreeRoot - 32 validator.effectiveBalance 1.4032 ms/op 1.3367 ms/op 1.05
BeaconState.hashTreeRoot - 512 validator.effectiveBalance 16.119 ms/op 17.366 ms/op 0.93
BeaconState.hashTreeRoot - 1 balances 58.126 us/op 69.741 us/op 0.83
BeaconState.hashTreeRoot - 32 balances 584.14 us/op 654.39 us/op 0.89
BeaconState.hashTreeRoot - 512 balances 5.9942 ms/op 6.4786 ms/op 0.93
BeaconState.hashTreeRoot - 250000 balances 93.506 ms/op 107.12 ms/op 0.87
aggregationBits - 2048 els - zipIndexesInBitList 37.776 us/op 31.685 us/op 1.19
regular array get 100000 times 67.409 us/op 64.091 us/op 1.05
wrappedArray get 100000 times 67.437 us/op 61.465 us/op 1.10
arrayWithProxy get 100000 times 29.077 ms/op 29.429 ms/op 0.99
ssz.Root.equals 566.00 ns/op 565.00 ns/op 1.00
byteArrayEquals 573.00 ns/op 550.00 ns/op 1.04
shuffle list - 16384 els 11.613 ms/op 11.787 ms/op 0.99
shuffle list - 250000 els 166.10 ms/op 169.33 ms/op 0.98
processSlot - 1 slots 12.153 us/op 14.580 us/op 0.83
processSlot - 32 slots 1.8280 ms/op 2.1805 ms/op 0.84
getEffectiveBalanceIncrementsZeroInactive - 250000 vs - 7PWei 415.09 us/op 386.14 us/op 1.07
getCommitteeAssignments - req 1 vs - 250000 vc 5.3285 ms/op 5.4861 ms/op 0.97
getCommitteeAssignments - req 100 vs - 250000 vc 7.3195 ms/op 8.0365 ms/op 0.91
getCommitteeAssignments - req 1000 vs - 250000 vc 7.7647 ms/op 8.5759 ms/op 0.91
RootCache.getBlockRootAtSlot - 250000 vs - 7PWei 9.7900 ns/op 7.9100 ns/op 1.24
state getBlockRootAtSlot - 250000 vs - 7PWei 1.1314 us/op 1.0632 us/op 1.06
computeProposers - vc 250000 16.984 ms/op 18.602 ms/op 0.91
computeEpochShuffling - vc 250000 171.55 ms/op 172.40 ms/op 1.00
getNextSyncCommittee - vc 250000 282.29 ms/op 300.09 ms/op 0.94

by benchmarkbot/action

@dapplion dapplion merged commit d39e2f9 into unstable Aug 13, 2022
@dapplion dapplion deleted the dadepo/fix-remote-signer branch August 13, 2022 14:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants