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

Align light client related endpoints #4168

Merged
merged 10 commits into from
Jun 26, 2022
Merged

Conversation

dadepo
Copy link
Contributor

@dadepo dadepo commented Jun 16, 2022

Motivation

Update the current light client endpoints to be in line with feedback received on 181

Updated endpoints are now listed here

Closes #3952

@github-actions
Copy link
Contributor

github-actions bot commented Jun 16, 2022

Performance Report

✔️ no performance regression detected

Full benchmark results
Benchmark suite Current: 66af1ac Previous: 6cef5d9 Ratio
altair processAttestation - 250000 vs - 7PWei normalcase 3.5051 ms/op 3.3589 ms/op 1.04
altair processAttestation - 250000 vs - 7PWei worstcase 5.5509 ms/op 5.2130 ms/op 1.06
altair processAttestation - setStatus - 1/6 committees join 199.63 us/op 168.96 us/op 1.18
altair processAttestation - setStatus - 1/3 committees join 383.14 us/op 340.70 us/op 1.12
altair processAttestation - setStatus - 1/2 committees join 537.84 us/op 489.41 us/op 1.10
altair processAttestation - setStatus - 2/3 committees join 692.85 us/op 643.93 us/op 1.08
altair processAttestation - setStatus - 4/5 committees join 949.76 us/op 902.41 us/op 1.05
altair processAttestation - setStatus - 100% committees join 1.1364 ms/op 1.0936 ms/op 1.04
altair processBlock - 250000 vs - 7PWei normalcase 26.581 ms/op 24.008 ms/op 1.11
altair processBlock - 250000 vs - 7PWei normalcase hashState 34.713 ms/op 32.151 ms/op 1.08
altair processBlock - 250000 vs - 7PWei worstcase 74.652 ms/op 78.790 ms/op 0.95
altair processBlock - 250000 vs - 7PWei worstcase hashState 98.916 ms/op 100.42 ms/op 0.99
phase0 processBlock - 250000 vs - 7PWei normalcase 3.3673 ms/op 3.2601 ms/op 1.03
phase0 processBlock - 250000 vs - 7PWei worstcase 45.682 ms/op 50.994 ms/op 0.90
altair processEth1Data - 250000 vs - 7PWei normalcase 715.47 us/op 678.00 us/op 1.06
Tree 40 250000 create 851.38 ms/op 744.40 ms/op 1.14
Tree 40 250000 get(125000) 290.96 ns/op 230.38 ns/op 1.26
Tree 40 250000 set(125000) 2.5708 us/op 2.3023 us/op 1.12
Tree 40 250000 toArray() 32.635 ms/op 27.618 ms/op 1.18
Tree 40 250000 iterate all - toArray() + loop 33.093 ms/op 27.878 ms/op 1.19
Tree 40 250000 iterate all - get(i) 111.91 ms/op 111.25 ms/op 1.01
MutableVector 250000 create 17.626 ms/op 14.331 ms/op 1.23
MutableVector 250000 get(125000) 15.127 ns/op 12.077 ns/op 1.25
MutableVector 250000 set(125000) 675.51 ns/op 579.30 ns/op 1.17
MutableVector 250000 toArray() 6.8633 ms/op 6.0326 ms/op 1.14
MutableVector 250000 iterate all - toArray() + loop 7.0868 ms/op 6.2387 ms/op 1.14
MutableVector 250000 iterate all - get(i) 3.2815 ms/op 2.6980 ms/op 1.22
Array 250000 create 6.2757 ms/op 6.2183 ms/op 1.01
Array 250000 clone - spread 3.6248 ms/op 3.6655 ms/op 0.99
Array 250000 get(125000) 1.5360 ns/op 1.6670 ns/op 0.92
Array 250000 set(125000) 1.5610 ns/op 1.6100 ns/op 0.97
Array 250000 iterate all - loop 167.85 us/op 151.09 us/op 1.11
effectiveBalanceIncrements clone Uint8Array 300000 180.82 us/op 62.531 us/op 2.89
effectiveBalanceIncrements clone MutableVector 300000 719.00 ns/op 1.2230 us/op 0.59
effectiveBalanceIncrements rw all Uint8Array 300000 252.40 us/op 247.46 us/op 1.02
effectiveBalanceIncrements rw all MutableVector 300000 181.01 ms/op 194.50 ms/op 0.93
phase0 afterProcessEpoch - 250000 vs - 7PWei 191.86 ms/op 187.86 ms/op 1.02
phase0 beforeProcessEpoch - 250000 vs - 7PWei 76.993 ms/op 57.239 ms/op 1.35
altair processEpoch - mainnet_e81889 582.09 ms/op 542.48 ms/op 1.07
mainnet_e81889 - altair beforeProcessEpoch 135.22 ms/op 79.721 ms/op 1.70
mainnet_e81889 - altair processJustificationAndFinalization 26.908 us/op 17.803 us/op 1.51
mainnet_e81889 - altair processInactivityUpdates 12.379 ms/op 9.5092 ms/op 1.30
mainnet_e81889 - altair processRewardsAndPenalties 139.74 ms/op 132.78 ms/op 1.05
mainnet_e81889 - altair processRegistryUpdates 4.5720 us/op 2.6710 us/op 1.71
mainnet_e81889 - altair processSlashings 1.2270 us/op 529.00 ns/op 2.32
mainnet_e81889 - altair processEth1DataReset 1.1000 us/op 640.00 ns/op 1.72
mainnet_e81889 - altair processEffectiveBalanceUpdates 3.0080 ms/op 2.7029 ms/op 1.11
mainnet_e81889 - altair processSlashingsReset 8.1120 us/op 5.5370 us/op 1.47
mainnet_e81889 - altair processRandaoMixesReset 8.7090 us/op 4.4900 us/op 1.94
mainnet_e81889 - altair processHistoricalRootsUpdate 1.1090 us/op 611.00 ns/op 1.82
mainnet_e81889 - altair processParticipationFlagUpdates 3.4560 us/op 2.3130 us/op 1.49
mainnet_e81889 - altair processSyncCommitteeUpdates 670.00 ns/op 631.00 ns/op 1.06
mainnet_e81889 - altair afterProcessEpoch 196.21 ms/op 194.94 ms/op 1.01
phase0 processEpoch - mainnet_e58758 529.99 ms/op 473.55 ms/op 1.12
mainnet_e58758 - phase0 beforeProcessEpoch 206.71 ms/op 153.25 ms/op 1.35
mainnet_e58758 - phase0 processJustificationAndFinalization 26.858 us/op 16.593 us/op 1.62
mainnet_e58758 - phase0 processRewardsAndPenalties 132.66 ms/op 61.227 ms/op 2.17
mainnet_e58758 - phase0 processRegistryUpdates 12.034 us/op 7.9430 us/op 1.52
mainnet_e58758 - phase0 processSlashings 1.0040 us/op 596.00 ns/op 1.68
mainnet_e58758 - phase0 processEth1DataReset 1.0590 us/op 635.00 ns/op 1.67
mainnet_e58758 - phase0 processEffectiveBalanceUpdates 2.4787 ms/op 1.8622 ms/op 1.33
mainnet_e58758 - phase0 processSlashingsReset 5.0960 us/op 3.2210 us/op 1.58
mainnet_e58758 - phase0 processRandaoMixesReset 7.1120 us/op 4.6910 us/op 1.52
mainnet_e58758 - phase0 processHistoricalRootsUpdate 1.2770 us/op 636.00 ns/op 2.01
mainnet_e58758 - phase0 processParticipationRecordUpdates 6.7790 us/op 3.7450 us/op 1.81
mainnet_e58758 - phase0 afterProcessEpoch 162.84 ms/op 163.24 ms/op 1.00
phase0 processEffectiveBalanceUpdates - 250000 normalcase 2.9082 ms/op 2.1982 ms/op 1.32
phase0 processEffectiveBalanceUpdates - 250000 worstcase 0.5 3.0085 ms/op 2.5156 ms/op 1.20
altair processInactivityUpdates - 250000 normalcase 28.488 ms/op 21.631 ms/op 1.32
altair processInactivityUpdates - 250000 worstcase 28.157 ms/op 22.518 ms/op 1.25
phase0 processRegistryUpdates - 250000 normalcase 10.032 us/op 6.3210 us/op 1.59
phase0 processRegistryUpdates - 250000 badcase_full_deposits 462.67 us/op 371.59 us/op 1.25
phase0 processRegistryUpdates - 250000 worstcase 0.5 214.08 ms/op 166.45 ms/op 1.29
altair processRewardsAndPenalties - 250000 normalcase 114.00 ms/op 94.569 ms/op 1.21
altair processRewardsAndPenalties - 250000 worstcase 119.34 ms/op 92.963 ms/op 1.28
phase0 getAttestationDeltas - 250000 normalcase 12.140 ms/op 12.073 ms/op 1.01
phase0 getAttestationDeltas - 250000 worstcase 12.083 ms/op 12.170 ms/op 0.99
phase0 processSlashings - 250000 worstcase 5.4071 ms/op 5.0343 ms/op 1.07
altair processSyncCommitteeUpdates - 250000 282.16 ms/op 292.11 ms/op 0.97
BeaconState.hashTreeRoot - No change 546.00 ns/op 630.00 ns/op 0.87
BeaconState.hashTreeRoot - 1 full validator 58.282 us/op 72.181 us/op 0.81
BeaconState.hashTreeRoot - 32 full validator 655.67 us/op 725.12 us/op 0.90
BeaconState.hashTreeRoot - 512 full validator 5.9498 ms/op 7.2408 ms/op 0.82
BeaconState.hashTreeRoot - 1 validator.effectiveBalance 76.367 us/op 91.656 us/op 0.83
BeaconState.hashTreeRoot - 32 validator.effectiveBalance 970.14 us/op 1.2890 ms/op 0.75
BeaconState.hashTreeRoot - 512 validator.effectiveBalance 15.326 ms/op 16.797 ms/op 0.91
BeaconState.hashTreeRoot - 1 balances 60.744 us/op 63.296 us/op 0.96
BeaconState.hashTreeRoot - 32 balances 735.13 us/op 656.05 us/op 1.12
BeaconState.hashTreeRoot - 512 balances 4.8714 ms/op 5.7885 ms/op 0.84
BeaconState.hashTreeRoot - 250000 balances 84.521 ms/op 95.493 ms/op 0.89
aggregationBits - 2048 els - zipIndexesInBitList 34.169 us/op 28.169 us/op 1.21
regular array get 100000 times 67.428 us/op 61.075 us/op 1.10
wrappedArray get 100000 times 67.463 us/op 60.643 us/op 1.11
arrayWithProxy get 100000 times 30.423 ms/op 28.422 ms/op 1.07
ssz.Root.equals 516.00 ns/op 493.00 ns/op 1.05
byteArrayEquals 502.00 ns/op 489.00 ns/op 1.03
shuffle list - 16384 els 11.058 ms/op 11.288 ms/op 0.98
shuffle list - 250000 els 166.27 ms/op 165.75 ms/op 1.00
processSlot - 1 slots 12.463 us/op 13.533 us/op 0.92
processSlot - 32 slots 1.7706 ms/op 1.9878 ms/op 0.89
getEffectiveBalanceIncrementsZeroInactive - 250000 vs - 7PWei 405.82 us/op 397.23 us/op 1.02
getCommitteeAssignments - req 1 vs - 250000 vc 5.2673 ms/op 5.3784 ms/op 0.98
getCommitteeAssignments - req 100 vs - 250000 vc 7.3153 ms/op 7.8399 ms/op 0.93
getCommitteeAssignments - req 1000 vs - 250000 vc 7.7761 ms/op 8.4908 ms/op 0.92
computeProposers - vc 250000 18.940 ms/op 18.942 ms/op 1.00
computeEpochShuffling - vc 250000 170.77 ms/op 170.45 ms/op 1.00
getNextSyncCommittee - vc 250000 279.28 ms/op 288.56 ms/op 0.97
pass gossip attestations to forkchoice per slot 5.9943 ms/op 5.1114 ms/op 1.17
computeDeltas 3.9831 ms/op 3.4052 ms/op 1.17
computeProposerBoostScoreFromBalances 907.52 us/op 804.19 us/op 1.13
getPubkeys - index2pubkey - req 1000 vs - 250000 vc 2.2769 ms/op 2.2981 ms/op 0.99
getPubkeys - validatorsArr - req 1000 vs - 250000 vc 81.073 us/op 72.310 us/op 1.12
BLS verify - blst-native 1.8566 ms/op 2.1686 ms/op 0.86
BLS verifyMultipleSignatures 3 - blst-native 3.8124 ms/op 4.4923 ms/op 0.85
BLS verifyMultipleSignatures 8 - blst-native 8.1983 ms/op 9.7058 ms/op 0.84
BLS verifyMultipleSignatures 32 - blst-native 29.764 ms/op 35.280 ms/op 0.84
BLS aggregatePubkeys 32 - blst-native 39.550 us/op 47.419 us/op 0.83
BLS aggregatePubkeys 128 - blst-native 153.27 us/op 183.00 us/op 0.84
getAttestationsForBlock 70.073 ms/op 57.872 ms/op 1.21
isKnown best case - 1 super set check 447.00 ns/op 506.00 ns/op 0.88
isKnown normal case - 2 super set checks 443.00 ns/op 493.00 ns/op 0.90
isKnown worse case - 16 super set checks 445.00 ns/op 498.00 ns/op 0.89
CheckpointStateCache - add get delete 10.794 us/op 11.147 us/op 0.97
validate gossip signedAggregateAndProof - struct 4.2588 ms/op 5.0184 ms/op 0.85
validate gossip attestation - struct 2.0280 ms/op 2.3691 ms/op 0.86
altair verifyImport mainnet_s3766816:31 6.1719 s/op 6.8309 s/op 0.90
pickEth1Vote - no votes 2.0291 ms/op 2.1269 ms/op 0.95
pickEth1Vote - max votes 24.247 ms/op 24.683 ms/op 0.98
pickEth1Vote - Eth1Data hashTreeRoot value x2048 11.679 ms/op 13.407 ms/op 0.87
pickEth1Vote - Eth1Data hashTreeRoot tree x2048 20.321 ms/op 21.469 ms/op 0.95
pickEth1Vote - Eth1Data fastSerialize value x2048 1.5533 ms/op 1.5956 ms/op 0.97
pickEth1Vote - Eth1Data fastSerialize tree x2048 17.518 ms/op 17.610 ms/op 0.99
bytes32 toHexString 1.0680 us/op 1.1050 us/op 0.97
bytes32 Buffer.toString(hex) 684.00 ns/op 774.00 ns/op 0.88
bytes32 Buffer.toString(hex) from Uint8Array 887.00 ns/op 981.00 ns/op 0.90
bytes32 Buffer.toString(hex) + 0x 676.00 ns/op 811.00 ns/op 0.83
Object access 1 prop 0.35200 ns/op 0.40500 ns/op 0.87
Map access 1 prop 0.29300 ns/op 0.31900 ns/op 0.92
Object get x1000 17.915 ns/op 10.668 ns/op 1.68
Map get x1000 1.0200 ns/op 0.97100 ns/op 1.05
Object set x1000 120.80 ns/op 80.186 ns/op 1.51
Map set x1000 75.341 ns/op 52.763 ns/op 1.43
Return object 10000 times 0.38050 ns/op 0.44710 ns/op 0.85
Throw Error 10000 times 5.9985 us/op 5.9191 us/op 1.01
enrSubnets - fastDeserialize 64 bits 2.7250 us/op 2.9640 us/op 0.92
enrSubnets - ssz BitVector 64 bits 765.00 ns/op 873.00 ns/op 0.88
enrSubnets - fastDeserialize 4 bits 416.00 ns/op 435.00 ns/op 0.96
enrSubnets - ssz BitVector 4 bits 769.00 ns/op 864.00 ns/op 0.89
prioritizePeers score -10:0 att 32-0.1 sync 2-0 93.005 us/op 88.700 us/op 1.05
prioritizePeers score 0:0 att 32-0.25 sync 2-0.25 127.03 us/op 115.34 us/op 1.10
prioritizePeers score 0:0 att 32-0.5 sync 2-0.5 227.42 us/op 206.46 us/op 1.10
prioritizePeers score 0:0 att 64-0.75 sync 4-0.75 481.70 us/op 403.76 us/op 1.19
prioritizePeers score 0:0 att 64-1 sync 4-1 467.21 us/op 406.93 us/op 1.15
RateTracker 1000000 limit, 1 obj count per request 199.46 ns/op 190.67 ns/op 1.05
RateTracker 1000000 limit, 2 obj count per request 152.68 ns/op 140.98 ns/op 1.08
RateTracker 1000000 limit, 4 obj count per request 132.79 ns/op 116.46 ns/op 1.14
RateTracker 1000000 limit, 8 obj count per request 119.24 ns/op 104.64 ns/op 1.14
RateTracker with prune 6.2110 us/op 4.4570 us/op 1.39
array of 16000 items push then shift 3.2024 us/op 51.659 us/op 0.06
LinkedList of 16000 items push then shift 32.054 ns/op 17.211 ns/op 1.86
array of 16000 items push then pop 251.85 ns/op 209.88 ns/op 1.20
LinkedList of 16000 items push then pop 24.037 ns/op 14.594 ns/op 1.65
array of 24000 items push then shift 4.5746 us/op 77.425 us/op 0.06
LinkedList of 24000 items push then shift 32.592 ns/op 22.012 ns/op 1.48
array of 24000 items push then pop 199.68 ns/op 199.11 ns/op 1.00
LinkedList of 24000 items push then pop 24.426 ns/op 16.190 ns/op 1.51
intersect bitArray bitLen 8 11.587 ns/op 10.841 ns/op 1.07
intersect array and set length 8 167.75 ns/op 151.95 ns/op 1.10
intersect bitArray bitLen 128 72.032 ns/op 57.464 ns/op 1.25
intersect array and set length 128 2.2389 us/op 1.8902 us/op 1.18

by benchmarkbot/action

@wemeetagain
Copy link
Member

Can you follow the naming here:
ethereum/beacon-APIs#181 (comment)

@dadepo dadepo force-pushed the dadepo/align-lc-endpoints branch from c589b69 to 3f10e9a Compare June 21, 2022 12:21
@dadepo dadepo marked this pull request as ready for review June 24, 2022 23:12
@dadepo dadepo requested a review from a team as a code owner June 24, 2022 23:12
dapplion
dapplion previously approved these changes Jun 26, 2022
@dapplion dapplion force-pushed the dadepo/align-lc-endpoints branch from 1fa22db to b12bdb5 Compare June 26, 2022 10:36
@dapplion dapplion added the meta-breaking-change Introduces breaking changes to DB, Validator, Beacon Node, or CLI interfaces. Handle with care! label Jun 26, 2022
@dapplion dapplion enabled auto-merge (squash) June 26, 2022 10:37
@dapplion dapplion merged commit bdfe551 into unstable Jun 26, 2022
@dapplion dapplion deleted the dadepo/align-lc-endpoints branch June 26, 2022 11:03
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.

Align light client API
3 participants