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

Improve LightClientIniter onFinalized #3174

Merged
merged 1 commit into from
Sep 15, 2021

Conversation

twoeths
Copy link
Contributor

@twoeths twoeths commented Sep 15, 2021

Motivation

LightclientIniter did not consume the computeWeakSubjectivityPeriodCachedState as implemented in #3096

Description

Use computeWeakSubjectivityPeriodCachedState in LightClientIniter

@codecov
Copy link

codecov bot commented Sep 15, 2021

Codecov Report

Merging #3174 (4ceb881) into master (54b95c2) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master    #3174   +/-   ##
=======================================
  Coverage   58.89%   58.89%           
=======================================
  Files         374      374           
  Lines        9099     9099           
  Branches     1347     1347           
=======================================
  Hits         5359     5359           
  Misses       3358     3358           
  Partials      382      382           

@codeclimate
Copy link

codeclimate bot commented Sep 15, 2021

Code Climate has analyzed commit 4ceb881 and detected 0 issues on this pull request.

View more on Code Climate.

@github-actions
Copy link
Contributor

Performance Report

✔️ no performance regression detected

Full benchmark results
Benchmark suite Current: 6c9ceaf Previous: 54b95c2 Ratio
BeaconState.hashTreeRoot - No change 880.00 ns/op 704.00 ns/op 1.25
BeaconState.hashTreeRoot - 1 full validator 97.068 us/op 76.706 us/op 1.27
BeaconState.hashTreeRoot - 32 full validator 1.3973 ms/op 1.1006 ms/op 1.27
BeaconState.hashTreeRoot - 512 full validator 18.044 ms/op 13.950 ms/op 1.29
BeaconState.hashTreeRoot - 1 validator.effectiveBalance 91.598 us/op 77.969 us/op 1.17
BeaconState.hashTreeRoot - 32 validator.effectiveBalance 1.3833 ms/op 1.1693 ms/op 1.18
BeaconState.hashTreeRoot - 512 validator.effectiveBalance 22.096 ms/op 17.121 ms/op 1.29
BeaconState.hashTreeRoot - 1 balances 72.098 us/op 52.139 us/op 1.38
BeaconState.hashTreeRoot - 32 balances 616.70 us/op 489.51 us/op 1.26
BeaconState.hashTreeRoot - 512 balances 6.5361 ms/op 4.7177 ms/op 1.39
BeaconState.hashTreeRoot - 250000 balances 108.96 ms/op 90.616 ms/op 1.20
processSlot - 1 slots 51.723 us/op 41.129 us/op 1.26
processSlot - 32 slots 2.6355 ms/op 2.2874 ms/op 1.15
getCommitteeAssignments - req 1 vs - 250000 vc 6.2016 ms/op 5.2818 ms/op 1.17
getCommitteeAssignments - req 100 vs - 250000 vc 8.6708 ms/op 7.4446 ms/op 1.16
getCommitteeAssignments - req 1000 vs - 250000 vc 9.2623 ms/op 8.4286 ms/op 1.10
computeProposers - vc 250000 26.044 ms/op 22.592 ms/op 1.15
computeEpochShuffling - vc 250000 242.59 ms/op 204.61 ms/op 1.19
getNextSyncCommittee - vc 250000 449.73 ms/op 370.90 ms/op 1.21
altair processBlock - 250000 vs - 7PWei normalcase 93.777 ms/op 94.223 ms/op 1.00
altair processBlock - 250000 vs - 7PWei worstcase 234.78 ms/op 229.50 ms/op 1.02
altair processEpoch - pyrmont_e62330 594.08 ms/op 544.29 ms/op 1.09
pyrmont_e62330 - altair beforeProcessEpoch 165.82 ms/op 155.89 ms/op 1.06
pyrmont_e62330 - altair processJustificationAndFinalization 81.091 us/op 69.706 us/op 1.16
pyrmont_e62330 - altair processInactivityUpdates 84.671 ms/op 77.468 ms/op 1.09
pyrmont_e62330 - altair processRewardsAndPenalties 68.095 ms/op 59.769 ms/op 1.14
pyrmont_e62330 - altair processRegistryUpdates 11.606 us/op 11.290 us/op 1.03
pyrmont_e62330 - altair processSlashings 3.3520 us/op 4.6930 us/op 0.71
pyrmont_e62330 - altair processEth1DataReset 2.7640 us/op 4.4260 us/op 0.62
pyrmont_e62330 - altair processEffectiveBalanceUpdates 6.6391 ms/op 5.6725 ms/op 1.17
pyrmont_e62330 - altair processSlashingsReset 15.302 us/op 23.212 us/op 0.66
pyrmont_e62330 - altair processRandaoMixesReset 18.026 us/op 34.067 us/op 0.53
pyrmont_e62330 - altair processHistoricalRootsUpdate 3.6700 us/op 5.7480 us/op 0.64
pyrmont_e62330 - altair processParticipationFlagUpdates 51.783 ms/op 50.919 ms/op 1.02
pyrmont_e62330 - altair processSyncCommitteeUpdates 2.8130 us/op 3.7650 us/op 0.75
pyrmont_e62330 - altair afterProcessEpoch 143.02 ms/op 112.52 ms/op 1.27
altair processInactivityUpdates - 250000 normalcase 234.82 ms/op 203.35 ms/op 1.15
altair processInactivityUpdates - 250000 worstcase 231.66 ms/op 202.97 ms/op 1.14
altair processParticipationFlagUpdates - 250000 anycase 102.81 ms/op 95.279 ms/op 1.08
altair processRewardsAndPenalties - 250000 normalcase 135.46 ms/op 118.61 ms/op 1.14
altair processRewardsAndPenalties - 250000 worstcase 136.33 ms/op 126.64 ms/op 1.08
altair processSyncCommitteeUpdates - 250000 450.48 ms/op 356.54 ms/op 1.26
Tree 40 250000 create 546.44 ms/op 447.81 ms/op 1.22
Tree 40 250000 get(125000) 319.25 ns/op 267.78 ns/op 1.19
Tree 40 250000 set(125000) 1.6344 us/op 1.4505 us/op 1.13
Tree 40 250000 toArray() 44.479 ms/op 36.906 ms/op 1.21
Tree 40 250000 iterate all - toArray() + loop 45.600 ms/op 37.773 ms/op 1.21
Tree 40 250000 iterate all - get(i) 123.25 ms/op 101.77 ms/op 1.21
MutableVector 250000 create 26.938 ms/op 24.011 ms/op 1.12
MutableVector 250000 get(125000) 15.457 ns/op 13.316 ns/op 1.16
MutableVector 250000 set(125000) 660.17 ns/op 512.23 ns/op 1.29
MutableVector 250000 toArray() 8.6193 ms/op 7.8833 ms/op 1.09
MutableVector 250000 iterate all - toArray() + loop 9.5849 ms/op 7.9070 ms/op 1.21
MutableVector 250000 iterate all - get(i) 3.9605 ms/op 3.3645 ms/op 1.18
Array 250000 create 6.3020 ms/op 4.7307 ms/op 1.33
Array 250000 clone - spread 2.1970 ms/op 1.7153 ms/op 1.28
Array 250000 get(125000) 1.3590 ns/op 1.1680 ns/op 1.16
Array 250000 set(125000) 1.3550 ns/op 0.79400 ns/op 1.71
Array 250000 iterate all - loop 199.39 us/op 170.08 us/op 1.17
aggregationBits - 2048 els - readonlyValues 282.86 us/op 233.82 us/op 1.21
aggregationBits - 2048 els - zipIndexesInBitList 48.702 us/op 38.446 us/op 1.27
ssz.Root.equals 1.5580 us/op 1.2820 us/op 1.22
ssz.Root.equals with valueOf() 1.7670 us/op 1.3970 us/op 1.26
byteArrayEquals with valueOf() 1.7900 us/op 1.3600 us/op 1.32
phase0 processBlock - 250000 vs - 7PWei normalcase 14.521 ms/op 12.277 ms/op 1.18
phase0 processBlock - 250000 vs - 7PWei worstcase 91.970 ms/op 76.049 ms/op 1.21
phase0 afterProcessEpoch - 250000 vs - 7PWei 255.32 ms/op 209.47 ms/op 1.22
phase0 beforeProcessEpoch - 250000 vs - 7PWei 649.31 ms/op 557.44 ms/op 1.16
phase0 processEpoch - mainnet_e58758 936.70 ms/op 867.93 ms/op 1.08
mainnet_e58758 - phase0 beforeProcessEpoch 541.92 ms/op 514.83 ms/op 1.05
mainnet_e58758 - phase0 processJustificationAndFinalization 74.802 us/op 86.524 us/op 0.86
mainnet_e58758 - phase0 processRewardsAndPenalties 93.584 ms/op 82.312 ms/op 1.14
mainnet_e58758 - phase0 processRegistryUpdates 50.874 us/op 41.816 us/op 1.22
mainnet_e58758 - phase0 processSlashings 3.0930 us/op 2.9540 us/op 1.05
mainnet_e58758 - phase0 processEth1DataReset 2.7760 us/op 3.1480 us/op 0.88
mainnet_e58758 - phase0 processEffectiveBalanceUpdates 10.964 ms/op 9.6010 ms/op 1.14
mainnet_e58758 - phase0 processSlashingsReset 15.078 us/op 15.259 us/op 0.99
mainnet_e58758 - phase0 processRandaoMixesReset 21.212 us/op 18.513 us/op 1.15
mainnet_e58758 - phase0 processHistoricalRootsUpdate 3.6790 us/op 3.3340 us/op 1.10
mainnet_e58758 - phase0 processParticipationRecordUpdates 15.454 us/op 15.546 us/op 0.99
mainnet_e58758 - phase0 afterProcessEpoch 225.88 ms/op 194.19 ms/op 1.16
phase0 processEffectiveBalanceUpdates - 250000 normalcase 15.657 ms/op 11.729 ms/op 1.33
phase0 processEffectiveBalanceUpdates - 250000 worstcase 0.5 1.4547 s/op 1.3303 s/op 1.09
phase0 processRegistryUpdates - 250000 normalcase 49.657 us/op 44.502 us/op 1.12
phase0 processRegistryUpdates - 250000 badcase_full_deposits 3.9319 ms/op 3.6000 ms/op 1.09
phase0 processRegistryUpdates - 250000 worstcase 0.5 1.9666 s/op 1.7666 s/op 1.11
phase0 getAttestationDeltas - 250000 normalcase 42.802 ms/op 37.277 ms/op 1.15
phase0 getAttestationDeltas - 250000 worstcase 42.704 ms/op 38.083 ms/op 1.12
phase0 processSlashings - 250000 worstcase 45.485 ms/op 39.786 ms/op 1.14
shuffle list - 16384 els 15.701 ms/op 13.969 ms/op 1.12
shuffle list - 250000 els 225.16 ms/op 202.59 ms/op 1.11
getEffectiveBalances - 250000 vs - 7PWei 13.521 ms/op 11.101 ms/op 1.22
getPubkeys - index2pubkey - req 1000 vs - 250000 vc 2.3993 ms/op 2.0573 ms/op 1.17
getPubkeys - validatorsArr - req 1000 vs - 250000 vc 1.2249 ms/op 1.0466 ms/op 1.17
BLS verify - blst-native 2.2208 ms/op 2.0089 ms/op 1.11
BLS verifyMultipleSignatures 3 - blst-native 4.5667 ms/op 4.1386 ms/op 1.10
BLS verifyMultipleSignatures 8 - blst-native 9.8639 ms/op 8.5138 ms/op 1.16
BLS verifyMultipleSignatures 32 - blst-native 35.665 ms/op 32.004 ms/op 1.11
BLS aggregatePubkeys 32 - blst-native 48.311 us/op 45.049 us/op 1.07
BLS aggregatePubkeys 128 - blst-native 186.45 us/op 176.27 us/op 1.06
getAttestationsForBlock 86.515 ms/op 86.631 ms/op 1.00
CheckpointStateCache - add get delete 18.350 us/op 16.175 us/op 1.13
validate gossip signedAggregateAndProof - struct 5.3471 ms/op 4.9422 ms/op 1.08
validate gossip signedAggregateAndProof - treeBacked 5.3455 ms/op 4.7794 ms/op 1.12
validate gossip attestation - struct 2.4920 ms/op 2.2588 ms/op 1.10
validate gossip attestation - treeBacked 2.5059 ms/op 2.2277 ms/op 1.12

by benchmarkbot/action

@dapplion dapplion merged commit 0338012 into master Sep 15, 2021
@dapplion dapplion deleted the tuyen/improve-LightClientIniter-onFinalized branch September 15, 2021 07:45
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.

3 participants