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

Move shufflings code together into seed util #3710

Merged
merged 1 commit into from
Feb 7, 2022

Conversation

dapplion
Copy link
Contributor

@dapplion dapplion commented Feb 7, 2022

Motivation

Now functions to compute proposer and attester shufflings were splited in multiple files. Move together into seed

Description

  • Move shufflings code together into seed util

@dapplion dapplion force-pushed the dapplion/computeProposers branch from faee037 to d4c9912 Compare February 7, 2022 05:18
@codecov
Copy link

codecov bot commented Feb 7, 2022

Codecov Report

Merging #3710 (d4c9912) into master (96b5959) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master    #3710   +/-   ##
=======================================
  Coverage   37.17%   37.17%           
=======================================
  Files         322      322           
  Lines        8723     8723           
  Branches     1350     1350           
=======================================
  Hits         3243     3243           
  Misses       5338     5338           
  Partials      142      142           

@github-actions
Copy link
Contributor

github-actions bot commented Feb 7, 2022

Performance Report

✔️ no performance regression detected

Full benchmark results
Benchmark suite Current: 0fe41ac Previous: 96b5959 Ratio
BeaconState.hashTreeRoot - No change 562.00 ns/op 555.00 ns/op 1.01
BeaconState.hashTreeRoot - 1 full validator 122.12 us/op 124.57 us/op 0.98
BeaconState.hashTreeRoot - 32 full validator 1.8161 ms/op 1.8875 ms/op 0.96
BeaconState.hashTreeRoot - 512 full validator 23.449 ms/op 24.561 ms/op 0.95
BeaconState.hashTreeRoot - 1 validator.effectiveBalance 118.38 us/op 120.80 us/op 0.98
BeaconState.hashTreeRoot - 32 validator.effectiveBalance 2.0094 ms/op 2.0240 ms/op 0.99
BeaconState.hashTreeRoot - 512 validator.effectiveBalance 27.583 ms/op 26.769 ms/op 1.03
BeaconState.hashTreeRoot - 1 balances 86.494 us/op 81.140 us/op 1.07
BeaconState.hashTreeRoot - 32 balances 732.94 us/op 754.58 us/op 0.97
BeaconState.hashTreeRoot - 512 balances 7.3718 ms/op 7.2181 ms/op 1.02
BeaconState.hashTreeRoot - 250000 balances 131.06 ms/op 131.57 ms/op 1.00
processSlot - 1 slots 57.895 us/op 47.191 us/op 1.23
processSlot - 32 slots 2.8266 ms/op 2.8462 ms/op 0.99
getCommitteeAssignments - req 1 vs - 250000 vc 5.2789 ms/op 5.2440 ms/op 1.01
getCommitteeAssignments - req 100 vs - 250000 vc 7.2703 ms/op 7.3125 ms/op 0.99
getCommitteeAssignments - req 1000 vs - 250000 vc 7.7296 ms/op 7.7520 ms/op 1.00
computeProposers - vc 250000 20.682 ms/op 20.683 ms/op 1.00
computeEpochShuffling - vc 250000 170.57 ms/op 187.10 ms/op 0.91
getNextSyncCommittee - vc 250000 313.39 ms/op 335.13 ms/op 0.94
altair processAttestation - 250000 vs - 7PWei normalcase 43.347 ms/op 40.601 ms/op 1.07
altair processAttestation - 250000 vs - 7PWei worstcase 45.628 ms/op 40.524 ms/op 1.13
altair processAttestation - setStatus - 1/6 committees join 10.576 ms/op 9.5366 ms/op 1.11
altair processAttestation - setStatus - 1/3 committees join 26.824 ms/op 19.574 ms/op 1.37
altair processAttestation - setStatus - 1/2 committees join 40.440 ms/op 31.106 ms/op 1.30
altair processAttestation - setStatus - 2/3 committees join 53.355 ms/op 42.018 ms/op 1.27
altair processAttestation - setStatus - 4/5 committees join 60.543 ms/op 50.300 ms/op 1.20
altair processAttestation - setStatus - 100% committees join 80.608 ms/op 63.630 ms/op 1.27
altair processAttestation - updateEpochParticipants - 1/6 committees join 12.923 ms/op 10.699 ms/op 1.21
altair processAttestation - updateEpochParticipants - 1/3 committees join 24.826 ms/op 22.956 ms/op 1.08
altair processAttestation - updateEpochParticipants - 1/2 committees join 26.048 ms/op 26.641 ms/op 0.98
altair processAttestation - updateEpochParticipants - 2/3 committees join 32.472 ms/op 32.856 ms/op 0.99
altair processAttestation - updateEpochParticipants - 4/5 committees join 30.590 ms/op 28.805 ms/op 1.06
altair processAttestation - updateEpochParticipants - 100% committees join 35.035 ms/op 29.933 ms/op 1.17
altair processAttestation - updateAllStatus 22.812 ms/op 21.896 ms/op 1.04
altair processBlock - 250000 vs - 7PWei normalcase 41.083 ms/op 43.303 ms/op 0.95
altair processBlock - 250000 vs - 7PWei worstcase 114.57 ms/op 133.29 ms/op 0.86
altair processEpoch - mainnet_e81889 1.0870 s/op 1.1202 s/op 0.97
mainnet_e81889 - altair beforeProcessEpoch 274.38 ms/op 264.92 ms/op 1.04
mainnet_e81889 - altair processJustificationAndFinalization 45.500 us/op 82.634 us/op 0.55
mainnet_e81889 - altair processInactivityUpdates 17.577 ms/op 17.700 ms/op 0.99
mainnet_e81889 - altair processRewardsAndPenalties 227.39 ms/op 295.49 ms/op 0.77
mainnet_e81889 - altair processRegistryUpdates 6.0090 us/op 5.3240 us/op 1.13
mainnet_e81889 - altair processSlashings 1.2610 us/op 1000.0 ns/op 1.26
mainnet_e81889 - altair processEth1DataReset 2.2090 us/op 971.00 ns/op 2.27
mainnet_e81889 - altair processEffectiveBalanceUpdates 10.255 ms/op 11.259 ms/op 0.91
mainnet_e81889 - altair processSlashingsReset 8.8420 us/op 8.4090 us/op 1.05
mainnet_e81889 - altair processRandaoMixesReset 11.738 us/op 11.451 us/op 1.03
mainnet_e81889 - altair processHistoricalRootsUpdate 1.6120 us/op 1.1800 us/op 1.37
mainnet_e81889 - altair processParticipationFlagUpdates 157.99 ms/op 98.737 ms/op 1.60
mainnet_e81889 - altair processSyncCommitteeUpdates 1.1280 us/op 1.0450 us/op 1.08
mainnet_e81889 - altair afterProcessEpoch 203.26 ms/op 222.27 ms/op 0.91
altair processInactivityUpdates - 250000 normalcase 76.785 ms/op 65.184 ms/op 1.18
altair processInactivityUpdates - 250000 worstcase 66.249 ms/op 65.948 ms/op 1.00
altair processParticipationFlagUpdates - 250000 anycase 89.772 ms/op 90.651 ms/op 0.99
altair processRewardsAndPenalties - 250000 normalcase 215.71 ms/op 204.30 ms/op 1.06
altair processRewardsAndPenalties - 250000 worstcase 236.54 ms/op 210.46 ms/op 1.12
altair processSyncCommitteeUpdates - 250000 371.00 ms/op 351.38 ms/op 1.06
Tree 40 250000 create 914.08 ms/op 625.19 ms/op 1.46
Tree 40 250000 get(125000) 323.83 ns/op 330.15 ns/op 0.98
Tree 40 250000 set(125000) 2.5194 us/op 2.0091 us/op 1.25
Tree 40 250000 toArray() 49.986 ms/op 37.840 ms/op 1.32
Tree 40 250000 iterate all - toArray() + loop 49.729 ms/op 43.895 ms/op 1.13
Tree 40 250000 iterate all - get(i) 122.47 ms/op 118.82 ms/op 1.03
MutableVector 250000 create 26.431 ms/op 24.348 ms/op 1.09
MutableVector 250000 get(125000) 14.328 ns/op 14.275 ns/op 1.00
MutableVector 250000 set(125000) 650.32 ns/op 463.19 ns/op 1.40
MutableVector 250000 toArray() 9.8385 ms/op 8.3513 ms/op 1.18
MutableVector 250000 iterate all - toArray() + loop 9.0566 ms/op 8.6331 ms/op 1.05
MutableVector 250000 iterate all - get(i) 3.0436 ms/op 3.4170 ms/op 0.89
Array 250000 create 5.7381 ms/op 5.1920 ms/op 1.11
Array 250000 clone - spread 2.8630 ms/op 2.3633 ms/op 1.21
Array 250000 get(125000) 1.0880 ns/op 1.0730 ns/op 1.01
Array 250000 set(125000) 1.0950 ns/op 1.0720 ns/op 1.02
Array 250000 iterate all - loop 148.12 us/op 167.76 us/op 0.88
aggregationBits - 2048 els - readonlyValues 268.44 us/op 239.71 us/op 1.12
aggregationBits - 2048 els - zipIndexesInBitList 52.735 us/op 48.066 us/op 1.10
regular array get 100000 times 67.564 us/op 67.367 us/op 1.00
wrappedArray get 100000 times 67.508 us/op 67.643 us/op 1.00
arrayWithProxy get 100000 times 28.769 ms/op 28.329 ms/op 1.02
ssz.Root.equals 1.3140 us/op 1.0970 us/op 1.20
ssz.Root.equals with valueOf() 1.6380 us/op 1.3730 us/op 1.19
byteArrayEquals with valueOf() 1.5200 us/op 1.3580 us/op 1.12
phase0 processBlock - 250000 vs - 7PWei normalcase 11.077 ms/op 10.437 ms/op 1.06
phase0 processBlock - 250000 vs - 7PWei worstcase 74.799 ms/op 76.017 ms/op 0.98
phase0 afterProcessEpoch - 250000 vs - 7PWei 199.54 ms/op 208.10 ms/op 0.96
phase0 beforeProcessEpoch - 250000 vs - 7PWei 588.43 ms/op 561.90 ms/op 1.05
phase0 processEpoch - mainnet_e58758 847.69 ms/op 799.88 ms/op 1.06
mainnet_e58758 - phase0 beforeProcessEpoch 510.59 ms/op 403.59 ms/op 1.27
mainnet_e58758 - phase0 processJustificationAndFinalization 44.823 us/op 115.61 us/op 0.39
mainnet_e58758 - phase0 processRewardsAndPenalties 169.91 ms/op 128.45 ms/op 1.32
mainnet_e58758 - phase0 processRegistryUpdates 34.777 us/op 35.191 us/op 0.99
mainnet_e58758 - phase0 processSlashings 1.3360 us/op 2.1370 us/op 0.63
mainnet_e58758 - phase0 processEth1DataReset 1.0670 us/op 1.7380 us/op 0.61
mainnet_e58758 - phase0 processEffectiveBalanceUpdates 8.9062 ms/op 9.4213 ms/op 0.95
mainnet_e58758 - phase0 processSlashingsReset 7.7490 us/op 12.898 us/op 0.60
mainnet_e58758 - phase0 processRandaoMixesReset 12.057 us/op 17.375 us/op 0.69
mainnet_e58758 - phase0 processHistoricalRootsUpdate 1.2770 us/op 2.3700 us/op 0.54
mainnet_e58758 - phase0 processParticipationRecordUpdates 8.1570 us/op 11.914 us/op 0.68
mainnet_e58758 - phase0 afterProcessEpoch 175.85 ms/op 181.17 ms/op 0.97
phase0 processEffectiveBalanceUpdates - 250000 normalcase 11.080 ms/op 11.095 ms/op 1.00
phase0 processEffectiveBalanceUpdates - 250000 worstcase 0.5 1.4694 s/op 1.2614 s/op 1.16
phase0 processRegistryUpdates - 250000 normalcase 35.815 us/op 34.608 us/op 1.03
phase0 processRegistryUpdates - 250000 badcase_full_deposits 3.0283 ms/op 2.7335 ms/op 1.11
phase0 processRegistryUpdates - 250000 worstcase 0.5 1.8345 s/op 1.6341 s/op 1.12
phase0 getAttestationDeltas - 250000 normalcase 77.167 ms/op 73.224 ms/op 1.05
phase0 getAttestationDeltas - 250000 worstcase 71.053 ms/op 73.905 ms/op 0.96
phase0 processSlashings - 250000 worstcase 53.593 ms/op 34.740 ms/op 1.54
shuffle list - 16384 els 13.149 ms/op 12.867 ms/op 1.02
shuffle list - 250000 els 189.69 ms/op 184.90 ms/op 1.03
getEffectiveBalances - 250000 vs - 7PWei 12.786 ms/op 9.7904 ms/op 1.31
pass gossip attestations to forkchoice per slot 15.627 ms/op 14.615 ms/op 1.07
computeDeltas 3.9530 ms/op 3.4202 ms/op 1.16
computeProposerBoostScoreFromBalances 307.80 us/op 337.19 us/op 0.91
getPubkeys - index2pubkey - req 1000 vs - 250000 vc 2.4391 ms/op 2.0190 ms/op 1.21
getPubkeys - validatorsArr - req 1000 vs - 250000 vc 606.25 us/op 699.61 us/op 0.87
BLS verify - blst-native 1.6405 ms/op 1.8608 ms/op 0.88
BLS verifyMultipleSignatures 3 - blst-native 3.3660 ms/op 3.8258 ms/op 0.88
BLS verifyMultipleSignatures 8 - blst-native 7.2616 ms/op 8.2476 ms/op 0.88
BLS verifyMultipleSignatures 32 - blst-native 26.346 ms/op 29.916 ms/op 0.88
BLS aggregatePubkeys 32 - blst-native 34.665 us/op 40.355 us/op 0.86
BLS aggregatePubkeys 128 - blst-native 135.80 us/op 154.20 us/op 0.88
getAttestationsForBlock 92.642 ms/op 78.124 ms/op 1.19
CheckpointStateCache - add get delete 18.784 us/op 18.041 us/op 1.04
validate gossip signedAggregateAndProof - struct 4.0720 ms/op 4.4636 ms/op 0.91
validate gossip signedAggregateAndProof - treeBacked 3.9003 ms/op 4.4019 ms/op 0.89
validate gossip attestation - struct 1.8455 ms/op 2.0994 ms/op 0.88
validate gossip attestation - treeBacked 1.8642 ms/op 2.1004 ms/op 0.89
bytes32 toHexString 1.5610 us/op 1.5660 us/op 1.00
bytes32 Buffer.toString(hex) 648.00 ns/op 649.00 ns/op 1.00
bytes32 Buffer.toString(hex) from Uint8Array 915.00 ns/op 936.00 ns/op 0.98
bytes32 Buffer.toString(hex) + 0x 645.00 ns/op 655.00 ns/op 0.98
Object access 1 prop 0.31100 ns/op 0.30700 ns/op 1.01
Map access 1 prop 0.25500 ns/op 0.28000 ns/op 0.91
Object get x1000 17.353 ns/op 22.944 ns/op 0.76
Map get x1000 0.86400 ns/op 1.0070 ns/op 0.86
Object set x1000 106.41 ns/op 105.74 ns/op 1.01
Map set x1000 63.308 ns/op 59.527 ns/op 1.06
Return object 10000 times 0.32850 ns/op 0.36480 ns/op 0.90
Throw Error 10000 times 5.2624 us/op 5.9147 us/op 0.89
enrSubnets - fastDeserialize 64 bits 1.1730 us/op 1.1460 us/op 1.02
enrSubnets - ssz BitVector 64 bits 14.875 us/op 16.350 us/op 0.91
enrSubnets - fastDeserialize 4 bits 403.00 ns/op 400.00 ns/op 1.01
enrSubnets - ssz BitVector 4 bits 2.6790 us/op 2.9360 us/op 0.91
RateTracker 1000000 limit, 1 obj count per request 165.38 ns/op 173.28 ns/op 0.95
RateTracker 1000000 limit, 2 obj count per request 125.04 ns/op 128.22 ns/op 0.98
RateTracker 1000000 limit, 4 obj count per request 104.18 ns/op 105.75 ns/op 0.99
RateTracker 1000000 limit, 8 obj count per request 95.960 ns/op 94.497 ns/op 1.02
RateTracker with prune 4.4620 us/op 3.4770 us/op 1.28

by benchmarkbot/action

@twoeths twoeths merged commit 6ebae5c into master Feb 7, 2022
@twoeths twoeths deleted the dapplion/computeProposers branch February 7, 2022 07:48
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.

2 participants