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

prefix light client paths with beacon #4413

Merged
merged 1 commit into from
Aug 15, 2022

Conversation

dadepo
Copy link
Contributor

@dadepo dadepo commented Aug 15, 2022

Motivation

In other to further harmonise the REST endpoint for light client, this PR prefixes the paths with beacon. That is /eth2/v1/light_client to /eth2/v1/beacon/light_client/...

Additional context

Based on the comments here and here

Closes #4354

@dadepo dadepo requested a review from a team as a code owner August 15, 2022 09:03
@github-actions
Copy link
Contributor

Performance Report

✔️ no performance regression detected

Full benchmark results
Benchmark suite Current: 8588280 Previous: 20edb58 Ratio
getPubkeys - index2pubkey - req 1000 vs - 250000 vc 1.8793 ms/op 2.3467 ms/op 0.80
getPubkeys - validatorsArr - req 1000 vs - 250000 vc 72.198 us/op 82.711 us/op 0.87
BLS verify - blst-native 1.6447 ms/op 2.7172 ms/op 0.61
BLS verifyMultipleSignatures 3 - blst-native 3.3566 ms/op 5.5908 ms/op 0.60
BLS verifyMultipleSignatures 8 - blst-native 7.2526 ms/op 11.947 ms/op 0.61
BLS verifyMultipleSignatures 32 - blst-native 26.215 ms/op 43.367 ms/op 0.60
BLS aggregatePubkeys 32 - blst-native 35.309 us/op 59.241 us/op 0.60
BLS aggregatePubkeys 128 - blst-native 135.00 us/op 230.22 us/op 0.59
getAttestationsForBlock 161.76 ms/op 174.90 ms/op 0.92
isKnown best case - 1 super set check 388.00 ns/op 512.00 ns/op 0.76
isKnown normal case - 2 super set checks 376.00 ns/op 477.00 ns/op 0.79
isKnown worse case - 16 super set checks 378.00 ns/op 456.00 ns/op 0.83
CheckpointStateCache - add get delete 7.7610 us/op 9.4510 us/op 0.82
validate gossip signedAggregateAndProof - struct 3.7534 ms/op 5.7184 ms/op 0.66
validate gossip attestation - struct 1.7894 ms/op 2.6761 ms/op 0.67
altair verifyImport mainnet_s3766816:31 4.4153 s/op 5.7110 s/op 0.77
pickEth1Vote - no votes 2.1549 ms/op 2.2622 ms/op 0.95
pickEth1Vote - max votes 23.254 ms/op 23.302 ms/op 1.00
pickEth1Vote - Eth1Data hashTreeRoot value x2048 11.625 ms/op 15.513 ms/op 0.75
pickEth1Vote - Eth1Data hashTreeRoot tree x2048 24.358 ms/op 19.848 ms/op 1.23
pickEth1Vote - Eth1Data fastSerialize value x2048 1.6289 ms/op 1.5506 ms/op 1.05
pickEth1Vote - Eth1Data fastSerialize tree x2048 13.985 ms/op 12.698 ms/op 1.10
bytes32 toHexString 1.0600 us/op 1.0490 us/op 1.01
bytes32 Buffer.toString(hex) 737.00 ns/op 733.00 ns/op 1.01
bytes32 Buffer.toString(hex) from Uint8Array 904.00 ns/op 935.00 ns/op 0.97
bytes32 Buffer.toString(hex) + 0x 729.00 ns/op 739.00 ns/op 0.99
Object access 1 prop 0.34000 ns/op 0.35200 ns/op 0.97
Map access 1 prop 0.29500 ns/op 0.31100 ns/op 0.95
Object get x1000 18.649 ns/op 15.060 ns/op 1.24
Map get x1000 0.99100 ns/op 1.0330 ns/op 0.96
Object set x1000 107.81 ns/op 105.15 ns/op 1.03
Map set x1000 65.932 ns/op 76.358 ns/op 0.86
Return object 10000 times 0.37350 ns/op 0.41510 ns/op 0.90
Throw Error 10000 times 5.8629 us/op 6.9526 us/op 0.84
enrSubnets - fastDeserialize 64 bits 2.4910 us/op 2.8940 us/op 0.86
enrSubnets - ssz BitVector 64 bits 684.00 ns/op 839.00 ns/op 0.82
enrSubnets - fastDeserialize 4 bits 344.00 ns/op 410.00 ns/op 0.84
enrSubnets - ssz BitVector 4 bits 709.00 ns/op 803.00 ns/op 0.88
prioritizePeers score -10:0 att 32-0.1 sync 2-0 92.308 us/op 104.70 us/op 0.88
prioritizePeers score 0:0 att 32-0.25 sync 2-0.25 110.49 us/op 156.42 us/op 0.71
prioritizePeers score 0:0 att 32-0.5 sync 2-0.5 190.63 us/op 260.90 us/op 0.73
prioritizePeers score 0:0 att 64-0.75 sync 4-0.75 410.58 us/op 575.94 us/op 0.71
prioritizePeers score 0:0 att 64-1 sync 4-1 410.20 us/op 624.34 us/op 0.66
RateTracker 1000000 limit, 1 obj count per request 186.28 ns/op 209.58 ns/op 0.89
RateTracker 1000000 limit, 2 obj count per request 140.06 ns/op 141.01 ns/op 0.99
RateTracker 1000000 limit, 4 obj count per request 116.74 ns/op 129.81 ns/op 0.90
RateTracker 1000000 limit, 8 obj count per request 105.17 ns/op 107.99 ns/op 0.97
RateTracker with prune 4.0110 us/op 4.3000 us/op 0.93
array of 16000 items push then shift 2.7916 us/op 5.1064 us/op 0.55
LinkedList of 16000 items push then shift 27.687 ns/op 32.528 ns/op 0.85
array of 16000 items push then pop 210.77 ns/op 222.69 ns/op 0.95
LinkedList of 16000 items push then pop 21.484 ns/op 25.470 ns/op 0.84
array of 24000 items push then shift 4.0359 us/op 7.9289 us/op 0.51
LinkedList of 24000 items push then shift 27.007 ns/op 30.659 ns/op 0.88
array of 24000 items push then pop 196.37 ns/op 220.28 ns/op 0.89
LinkedList of 24000 items push then pop 22.167 ns/op 24.862 ns/op 0.89
intersect bitArray bitLen 8 10.369 ns/op 14.840 ns/op 0.70
intersect array and set length 8 142.63 ns/op 170.04 ns/op 0.84
intersect bitArray bitLen 128 54.614 ns/op 66.997 ns/op 0.82
intersect array and set length 128 2.0165 us/op 2.1784 us/op 0.93
Buffer.concat 32 items 1.7290 ns/op 2.1060 ns/op 0.82
pass gossip attestations to forkchoice per slot 3.0723 ms/op 3.5148 ms/op 0.87
computeDeltas 3.6311 ms/op 4.1671 ms/op 0.87
computeProposerBoostScoreFromBalances 813.01 us/op 843.08 us/op 0.96
altair processAttestation - 250000 vs - 7PWei normalcase 4.4943 ms/op 4.5696 ms/op 0.98
altair processAttestation - 250000 vs - 7PWei worstcase 6.7110 ms/op 6.7974 ms/op 0.99
altair processAttestation - setStatus - 1/6 committees join 194.67 us/op 259.93 us/op 0.75
altair processAttestation - setStatus - 1/3 committees join 368.35 us/op 484.11 us/op 0.76
altair processAttestation - setStatus - 1/2 committees join 515.66 us/op 747.34 us/op 0.69
altair processAttestation - setStatus - 2/3 committees join 666.12 us/op 845.13 us/op 0.79
altair processAttestation - setStatus - 4/5 committees join 911.82 us/op 1.1639 ms/op 0.78
altair processAttestation - setStatus - 100% committees join 1.2217 ms/op 1.4362 ms/op 0.85
altair processBlock - 250000 vs - 7PWei normalcase 24.859 ms/op 33.667 ms/op 0.74
altair processBlock - 250000 vs - 7PWei normalcase hashState 44.807 ms/op 47.271 ms/op 0.95
altair processBlock - 250000 vs - 7PWei worstcase 86.738 ms/op 107.27 ms/op 0.81
altair processBlock - 250000 vs - 7PWei worstcase hashState 84.355 ms/op 137.55 ms/op 0.61
phase0 processBlock - 250000 vs - 7PWei normalcase 3.9037 ms/op 4.0910 ms/op 0.95
phase0 processBlock - 250000 vs - 7PWei worstcase 48.157 ms/op 63.603 ms/op 0.76
altair processEth1Data - 250000 vs - 7PWei normalcase 1.0114 ms/op 1.6777 ms/op 0.60
Tree 40 250000 create 815.42 ms/op 906.10 ms/op 0.90
Tree 40 250000 get(125000) 325.75 ns/op 323.71 ns/op 1.01
Tree 40 250000 set(125000) 2.5915 us/op 2.7891 us/op 0.93
Tree 40 250000 toArray() 36.456 ms/op 35.241 ms/op 1.03
Tree 40 250000 iterate all - toArray() + loop 36.189 ms/op 35.713 ms/op 1.01
Tree 40 250000 iterate all - get(i) 114.29 ms/op 141.43 ms/op 0.81
MutableVector 250000 create 11.596 ms/op 28.254 ms/op 0.41
MutableVector 250000 get(125000) 13.200 ns/op 14.856 ns/op 0.89
MutableVector 250000 set(125000) 514.88 ns/op 665.90 ns/op 0.77
MutableVector 250000 toArray() 6.7795 ms/op 6.4591 ms/op 1.05
MutableVector 250000 iterate all - toArray() + loop 6.8819 ms/op 6.2435 ms/op 1.10
MutableVector 250000 iterate all - get(i) 2.8990 ms/op 3.3053 ms/op 0.88
Array 250000 create 6.0583 ms/op 5.9278 ms/op 1.02
Array 250000 clone - spread 2.5078 ms/op 2.5752 ms/op 0.97
Array 250000 get(125000) 1.0620 ns/op 1.1180 ns/op 0.95
Array 250000 set(125000) 1.0610 ns/op 1.1820 ns/op 0.90
Array 250000 iterate all - loop 148.16 us/op 134.59 us/op 1.10
effectiveBalanceIncrements clone Uint8Array 300000 74.611 us/op 88.708 us/op 0.84
effectiveBalanceIncrements clone MutableVector 300000 709.00 ns/op 763.00 ns/op 0.93
effectiveBalanceIncrements rw all Uint8Array 300000 222.85 us/op 279.53 us/op 0.80
effectiveBalanceIncrements rw all MutableVector 300000 178.58 ms/op 196.14 ms/op 0.91
phase0 afterProcessEpoch - 250000 vs - 7PWei 182.76 ms/op 205.63 ms/op 0.89
phase0 beforeProcessEpoch - 250000 vs - 7PWei 153.99 ms/op 153.05 ms/op 1.01
altair processEpoch - mainnet_e81889 699.17 ms/op 772.34 ms/op 0.91
mainnet_e81889 - altair beforeProcessEpoch 223.60 ms/op 215.34 ms/op 1.04
mainnet_e81889 - altair processJustificationAndFinalization 20.581 us/op 71.825 us/op 0.29
mainnet_e81889 - altair processInactivityUpdates 11.517 ms/op 11.927 ms/op 0.97
mainnet_e81889 - altair processRewardsAndPenalties 178.39 ms/op 204.54 ms/op 0.87
mainnet_e81889 - altair processRegistryUpdates 4.0950 us/op 14.676 us/op 0.28
mainnet_e81889 - altair processSlashings 874.00 ns/op 3.7790 us/op 0.23
mainnet_e81889 - altair processEth1DataReset 860.00 ns/op 4.2520 us/op 0.20
mainnet_e81889 - altair processEffectiveBalanceUpdates 3.0379 ms/op 2.7424 ms/op 1.11
mainnet_e81889 - altair processSlashingsReset 7.2450 us/op 33.699 us/op 0.21
mainnet_e81889 - altair processRandaoMixesReset 7.0750 us/op 29.162 us/op 0.24
mainnet_e81889 - altair processHistoricalRootsUpdate 909.00 ns/op 5.0800 us/op 0.18
mainnet_e81889 - altair processParticipationFlagUpdates 3.6050 us/op 17.300 us/op 0.21
mainnet_e81889 - altair processSyncCommitteeUpdates 834.00 ns/op 4.5930 us/op 0.18
mainnet_e81889 - altair afterProcessEpoch 174.88 ms/op 196.75 ms/op 0.89
phase0 processEpoch - mainnet_e58758 676.88 ms/op 770.65 ms/op 0.88
mainnet_e58758 - phase0 beforeProcessEpoch 293.35 ms/op 336.91 ms/op 0.87
mainnet_e58758 - phase0 processJustificationAndFinalization 22.936 us/op 65.100 us/op 0.35
mainnet_e58758 - phase0 processRewardsAndPenalties 150.65 ms/op 167.14 ms/op 0.90
mainnet_e58758 - phase0 processRegistryUpdates 9.3340 us/op 36.669 us/op 0.25
mainnet_e58758 - phase0 processSlashings 727.00 ns/op 3.9490 us/op 0.18
mainnet_e58758 - phase0 processEth1DataReset 981.00 ns/op 3.5910 us/op 0.27
mainnet_e58758 - phase0 processEffectiveBalanceUpdates 1.9644 ms/op 2.4801 ms/op 0.79
mainnet_e58758 - phase0 processSlashingsReset 4.5200 us/op 15.792 us/op 0.29
mainnet_e58758 - phase0 processRandaoMixesReset 5.4870 us/op 23.302 us/op 0.24
mainnet_e58758 - phase0 processHistoricalRootsUpdate 1.2060 us/op 4.1010 us/op 0.29
mainnet_e58758 - phase0 processParticipationRecordUpdates 5.5340 us/op 23.517 us/op 0.24
mainnet_e58758 - phase0 afterProcessEpoch 144.64 ms/op 171.25 ms/op 0.84
phase0 processEffectiveBalanceUpdates - 250000 normalcase 2.3288 ms/op 2.5467 ms/op 0.91
phase0 processEffectiveBalanceUpdates - 250000 worstcase 0.5 2.9977 ms/op 3.1456 ms/op 0.95
altair processInactivityUpdates - 250000 normalcase 64.488 ms/op 77.124 ms/op 0.84
altair processInactivityUpdates - 250000 worstcase 41.379 ms/op 71.929 ms/op 0.58
phase0 processRegistryUpdates - 250000 normalcase 8.8120 us/op 34.994 us/op 0.25
phase0 processRegistryUpdates - 250000 badcase_full_deposits 390.04 us/op 492.35 us/op 0.79
phase0 processRegistryUpdates - 250000 worstcase 0.5 283.65 ms/op 301.34 ms/op 0.94
altair processRewardsAndPenalties - 250000 normalcase 153.87 ms/op 175.54 ms/op 0.88
altair processRewardsAndPenalties - 250000 worstcase 158.16 ms/op 171.64 ms/op 0.92
phase0 getAttestationDeltas - 250000 normalcase 11.401 ms/op 12.754 ms/op 0.89
phase0 getAttestationDeltas - 250000 worstcase 11.817 ms/op 14.376 ms/op 0.82
phase0 processSlashings - 250000 worstcase 4.9163 ms/op 6.4962 ms/op 0.76
altair processSyncCommitteeUpdates - 250000 270.17 ms/op 328.10 ms/op 0.82
BeaconState.hashTreeRoot - No change 422.00 ns/op 576.00 ns/op 0.73
BeaconState.hashTreeRoot - 1 full validator 64.878 us/op 73.681 us/op 0.88
BeaconState.hashTreeRoot - 32 full validator 650.15 us/op 830.66 us/op 0.78
BeaconState.hashTreeRoot - 512 full validator 7.2628 ms/op 12.295 ms/op 0.59
BeaconState.hashTreeRoot - 1 validator.effectiveBalance 87.867 us/op 108.91 us/op 0.81
BeaconState.hashTreeRoot - 32 validator.effectiveBalance 1.2167 ms/op 1.5353 ms/op 0.79
BeaconState.hashTreeRoot - 512 validator.effectiveBalance 14.693 ms/op 19.724 ms/op 0.74
BeaconState.hashTreeRoot - 1 balances 58.968 us/op 74.699 us/op 0.79
BeaconState.hashTreeRoot - 32 balances 557.74 us/op 802.65 us/op 0.69
BeaconState.hashTreeRoot - 512 balances 5.8215 ms/op 7.5099 ms/op 0.78
BeaconState.hashTreeRoot - 250000 balances 79.843 ms/op 111.21 ms/op 0.72
aggregationBits - 2048 els - zipIndexesInBitList 27.016 us/op 27.226 us/op 0.99
regular array get 100000 times 59.470 us/op 52.717 us/op 1.13
wrappedArray get 100000 times 59.254 us/op 53.800 us/op 1.10
arrayWithProxy get 100000 times 29.824 ms/op 37.607 ms/op 0.79
ssz.Root.equals 454.00 ns/op 642.00 ns/op 0.71
byteArrayEquals 386.00 ns/op 547.00 ns/op 0.71
shuffle list - 16384 els 9.9262 ms/op 11.888 ms/op 0.84
shuffle list - 250000 els 144.80 ms/op 173.51 ms/op 0.83
processSlot - 1 slots 12.311 us/op 16.497 us/op 0.75
processSlot - 32 slots 1.5064 ms/op 2.2653 ms/op 0.66
getEffectiveBalanceIncrementsZeroInactive - 250000 vs - 7PWei 318.92 us/op 611.64 us/op 0.52
getCommitteeAssignments - req 1 vs - 250000 vc 4.7136 ms/op 5.6983 ms/op 0.83
getCommitteeAssignments - req 100 vs - 250000 vc 6.4854 ms/op 8.1420 ms/op 0.80
getCommitteeAssignments - req 1000 vs - 250000 vc 6.8729 ms/op 8.3962 ms/op 0.82
RootCache.getBlockRootAtSlot - 250000 vs - 7PWei 8.5900 ns/op 9.4100 ns/op 0.91
state getBlockRootAtSlot - 250000 vs - 7PWei 1.0018 us/op 1.0608 us/op 0.94
computeProposers - vc 250000 14.472 ms/op 17.940 ms/op 0.81
computeEpochShuffling - vc 250000 150.84 ms/op 170.00 ms/op 0.89
getNextSyncCommittee - vc 250000 245.78 ms/op 298.55 ms/op 0.82

by benchmarkbot/action

@dapplion
Copy link
Contributor

Are these the final endpoints following a pre-agreed spec? If not, they should use the v0 version

@wemeetagain wemeetagain merged commit db9450b into unstable Aug 15, 2022
@wemeetagain wemeetagain deleted the dadepo/prefix-light-client-path-with-beacon branch August 15, 2022 16:30
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.

Prefix the light client path with beacon
3 participants