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

Handle multiple own sync committee aggregator per subnet #4135

Merged
merged 4 commits into from
Jun 9, 2022

Conversation

dapplion
Copy link
Contributor

@dapplion dapplion commented Jun 9, 2022

Motivation

Our current implementation does not consider the case where we control multiple sync committee aggregator per subnet.

If you run

lodestar dev --genesisValidators 32 --startValidators 0..31 --params.ALTAIR_FORK_EPOCH 0

The process will spam the logs with tons of PublishError.Duplicate errors.

The issue is that the validator client produces on aggregate per index in sync committee instead of one aggregate per subnet.

Description

With this PR running the above command prints no errors at all =D

@dapplion dapplion requested a review from a team as a code owner June 9, 2022 14:05
@github-actions
Copy link
Contributor

github-actions bot commented Jun 9, 2022

Performance Report

✔️ no performance regression detected

Full benchmark results
Benchmark suite Current: c4fff81 Previous: 4bbe4a3 Ratio
altair processAttestation - 250000 vs - 7PWei normalcase 4.4329 ms/op 3.4258 ms/op 1.29
altair processAttestation - 250000 vs - 7PWei worstcase 7.5225 ms/op 5.3676 ms/op 1.40
altair processAttestation - setStatus - 1/6 committees join 243.31 us/op 198.93 us/op 1.22
altair processAttestation - setStatus - 1/3 committees join 465.38 us/op 383.47 us/op 1.21
altair processAttestation - setStatus - 1/2 committees join 653.47 us/op 539.04 us/op 1.21
altair processAttestation - setStatus - 2/3 committees join 843.40 us/op 700.63 us/op 1.20
altair processAttestation - setStatus - 4/5 committees join 1.1634 ms/op 957.78 us/op 1.21
altair processAttestation - setStatus - 100% committees join 1.3758 ms/op 1.0087 ms/op 1.36
altair processBlock - 250000 vs - 7PWei normalcase 33.696 ms/op 26.394 ms/op 1.28
altair processBlock - 250000 vs - 7PWei normalcase hashState 39.387 ms/op 33.670 ms/op 1.17
altair processBlock - 250000 vs - 7PWei worstcase 91.427 ms/op 76.657 ms/op 1.19
altair processBlock - 250000 vs - 7PWei worstcase hashState 119.42 ms/op 89.822 ms/op 1.33
phase0 processBlock - 250000 vs - 7PWei normalcase 4.1459 ms/op 3.4568 ms/op 1.20
phase0 processBlock - 250000 vs - 7PWei worstcase 54.434 ms/op 40.909 ms/op 1.33
altair processEth1Data - 250000 vs - 7PWei normalcase 891.51 us/op 701.18 us/op 1.27
Tree 40 250000 create 903.37 ms/op 750.99 ms/op 1.20
Tree 40 250000 get(125000) 346.96 ns/op 283.83 ns/op 1.22
Tree 40 250000 set(125000) 3.0397 us/op 2.2482 us/op 1.35
Tree 40 250000 toArray() 37.777 ms/op 31.112 ms/op 1.21
Tree 40 250000 iterate all - toArray() + loop 37.883 ms/op 31.388 ms/op 1.21
Tree 40 250000 iterate all - get(i) 132.55 ms/op 107.89 ms/op 1.23
MutableVector 250000 create 22.378 ms/op 17.171 ms/op 1.30
MutableVector 250000 get(125000) 17.720 ns/op 14.764 ns/op 1.20
MutableVector 250000 set(125000) 720.54 ns/op 618.06 ns/op 1.17
MutableVector 250000 toArray() 8.5116 ms/op 6.8858 ms/op 1.24
MutableVector 250000 iterate all - toArray() + loop 8.8692 ms/op 6.8694 ms/op 1.29
MutableVector 250000 iterate all - get(i) 3.9339 ms/op 3.4413 ms/op 1.14
Array 250000 create 8.0229 ms/op 6.2754 ms/op 1.28
Array 250000 clone - spread 4.1519 ms/op 3.5407 ms/op 1.17
Array 250000 get(125000) 1.7890 ns/op 1.4240 ns/op 1.26
Array 250000 set(125000) 1.7640 ns/op 1.4340 ns/op 1.23
Array 250000 iterate all - loop 204.29 us/op 148.05 us/op 1.38
effectiveBalanceIncrements clone Uint8Array 300000 109.48 us/op 85.820 us/op 1.28
effectiveBalanceIncrements clone MutableVector 300000 774.00 ns/op 1.0770 us/op 0.72
effectiveBalanceIncrements rw all Uint8Array 300000 303.08 us/op 222.63 us/op 1.36
effectiveBalanceIncrements rw all MutableVector 300000 186.68 ms/op 189.43 ms/op 0.99
phase0 afterProcessEpoch - 250000 vs - 7PWei 231.87 ms/op 166.53 ms/op 1.39
phase0 beforeProcessEpoch - 250000 vs - 7PWei 77.532 ms/op 84.372 ms/op 0.92
altair processEpoch - mainnet_e81889 657.41 ms/op 472.15 ms/op 1.39
mainnet_e81889 - altair beforeProcessEpoch 164.23 ms/op 131.40 ms/op 1.25
mainnet_e81889 - altair processJustificationAndFinalization 28.101 us/op 23.253 us/op 1.21
mainnet_e81889 - altair processInactivityUpdates 13.825 ms/op 11.237 ms/op 1.23
mainnet_e81889 - altair processRewardsAndPenalties 101.28 ms/op 85.302 ms/op 1.19
mainnet_e81889 - altair processRegistryUpdates 7.1120 us/op 4.5640 us/op 1.56
mainnet_e81889 - altair processSlashings 1.8810 us/op 1.0040 us/op 1.87
mainnet_e81889 - altair processEth1DataReset 2.2300 us/op 1.0510 us/op 2.12
mainnet_e81889 - altair processEffectiveBalanceUpdates 2.8939 ms/op 2.4290 ms/op 1.19
mainnet_e81889 - altair processSlashingsReset 10.612 us/op 8.6840 us/op 1.22
mainnet_e81889 - altair processRandaoMixesReset 12.538 us/op 7.8950 us/op 1.59
mainnet_e81889 - altair processHistoricalRootsUpdate 1.8800 us/op 1.2950 us/op 1.45
mainnet_e81889 - altair processParticipationFlagUpdates 8.8740 us/op 3.7850 us/op 2.34
mainnet_e81889 - altair processSyncCommitteeUpdates 1.8700 us/op 1.3940 us/op 1.34
mainnet_e81889 - altair afterProcessEpoch 231.93 ms/op 204.02 ms/op 1.14
phase0 processEpoch - mainnet_e58758 589.86 ms/op 512.79 ms/op 1.15
mainnet_e58758 - phase0 beforeProcessEpoch 220.55 ms/op 227.12 ms/op 0.97
mainnet_e58758 - phase0 processJustificationAndFinalization 23.886 us/op 23.576 us/op 1.01
mainnet_e58758 - phase0 processRewardsAndPenalties 82.633 ms/op 119.73 ms/op 0.69
mainnet_e58758 - phase0 processRegistryUpdates 16.727 us/op 10.702 us/op 1.56
mainnet_e58758 - phase0 processSlashings 1.6770 us/op 1.0060 us/op 1.67
mainnet_e58758 - phase0 processEth1DataReset 1.7770 us/op 903.00 ns/op 1.97
mainnet_e58758 - phase0 processEffectiveBalanceUpdates 2.4098 ms/op 1.8075 ms/op 1.33
mainnet_e58758 - phase0 processSlashingsReset 9.5960 us/op 6.3550 us/op 1.51
mainnet_e58758 - phase0 processRandaoMixesReset 13.658 us/op 7.6980 us/op 1.77
mainnet_e58758 - phase0 processHistoricalRootsUpdate 2.1230 us/op 1.0590 us/op 2.00
mainnet_e58758 - phase0 processParticipationRecordUpdates 10.601 us/op 6.4810 us/op 1.64
mainnet_e58758 - phase0 afterProcessEpoch 191.62 ms/op 150.32 ms/op 1.27
phase0 processEffectiveBalanceUpdates - 250000 normalcase 3.5297 ms/op 2.8781 ms/op 1.23
phase0 processEffectiveBalanceUpdates - 250000 worstcase 0.5 3.8290 ms/op 3.1902 ms/op 1.20
altair processInactivityUpdates - 250000 normalcase 27.896 ms/op 25.018 ms/op 1.12
altair processInactivityUpdates - 250000 worstcase 32.608 ms/op 34.163 ms/op 0.95
phase0 processRegistryUpdates - 250000 normalcase 14.373 us/op 9.9440 us/op 1.45
phase0 processRegistryUpdates - 250000 badcase_full_deposits 486.04 us/op 390.32 us/op 1.25
phase0 processRegistryUpdates - 250000 worstcase 0.5 273.89 ms/op 204.15 ms/op 1.34
altair processRewardsAndPenalties - 250000 normalcase 118.57 ms/op 118.71 ms/op 1.00
altair processRewardsAndPenalties - 250000 worstcase 117.24 ms/op 106.40 ms/op 1.10
phase0 getAttestationDeltas - 250000 normalcase 16.064 ms/op 11.917 ms/op 1.35
phase0 getAttestationDeltas - 250000 worstcase 16.236 ms/op 13.148 ms/op 1.23
phase0 processSlashings - 250000 worstcase 6.8752 ms/op 5.6313 ms/op 1.22
altair processSyncCommitteeUpdates - 250000 334.62 ms/op 277.40 ms/op 1.21
BeaconState.hashTreeRoot - No change 723.00 ns/op 562.00 ns/op 1.29
BeaconState.hashTreeRoot - 1 full validator 75.648 us/op 55.329 us/op 1.37
BeaconState.hashTreeRoot - 32 full validator 661.74 us/op 634.58 us/op 1.04
BeaconState.hashTreeRoot - 512 full validator 7.4008 ms/op 6.5397 ms/op 1.13
BeaconState.hashTreeRoot - 1 validator.effectiveBalance 90.995 us/op 81.963 us/op 1.11
BeaconState.hashTreeRoot - 32 validator.effectiveBalance 1.3657 ms/op 1.1257 ms/op 1.21
BeaconState.hashTreeRoot - 512 validator.effectiveBalance 18.751 ms/op 19.314 ms/op 0.97
BeaconState.hashTreeRoot - 1 balances 75.024 us/op 99.944 us/op 0.75
BeaconState.hashTreeRoot - 32 balances 691.88 us/op 519.37 us/op 1.33
BeaconState.hashTreeRoot - 512 balances 6.2697 ms/op 4.9417 ms/op 1.27
BeaconState.hashTreeRoot - 250000 balances 103.25 ms/op 81.377 ms/op 1.27
aggregationBits - 2048 els - zipIndexesInBitList 40.598 us/op 34.190 us/op 1.19
regular array get 100000 times 80.989 us/op 67.503 us/op 1.20
wrappedArray get 100000 times 81.008 us/op 67.421 us/op 1.20
arrayWithProxy get 100000 times 34.070 ms/op 30.658 ms/op 1.11
ssz.Root.equals 579.00 ns/op 531.00 ns/op 1.09
byteArrayEquals 578.00 ns/op 517.00 ns/op 1.12
shuffle list - 16384 els 13.227 ms/op 11.157 ms/op 1.19
shuffle list - 250000 els 194.11 ms/op 167.77 ms/op 1.16
processSlot - 1 slots 14.946 us/op 12.316 us/op 1.21
processSlot - 32 slots 2.0913 ms/op 1.7885 ms/op 1.17
getEffectiveBalanceIncrementsZeroInactive - 250000 vs - 7PWei 487.41 us/op 409.42 us/op 1.19
getCommitteeAssignments - req 1 vs - 250000 vc 6.3457 ms/op 5.2842 ms/op 1.20
getCommitteeAssignments - req 100 vs - 250000 vc 8.8471 ms/op 7.3115 ms/op 1.21
getCommitteeAssignments - req 1000 vs - 250000 vc 9.5000 ms/op 7.7679 ms/op 1.22
computeProposers - vc 250000 21.649 ms/op 17.827 ms/op 1.21
computeEpochShuffling - vc 250000 198.05 ms/op 171.18 ms/op 1.16
getNextSyncCommittee - vc 250000 319.72 ms/op 264.75 ms/op 1.21
pass gossip attestations to forkchoice per slot 3.8378 ms/op 5.7526 ms/op 0.67
computeDeltas 3.9428 ms/op 3.1336 ms/op 1.26
computeProposerBoostScoreFromBalances 1.0857 ms/op 907.63 us/op 1.20
getPubkeys - index2pubkey - req 1000 vs - 250000 vc 2.3589 ms/op 1.9751 ms/op 1.19
getPubkeys - validatorsArr - req 1000 vs - 250000 vc 88.551 us/op 73.091 us/op 1.21
BLS verify - blst-native 2.2299 ms/op 1.8580 ms/op 1.20
BLS verifyMultipleSignatures 3 - blst-native 4.5726 ms/op 3.7987 ms/op 1.20
BLS verifyMultipleSignatures 8 - blst-native 9.8498 ms/op 8.1804 ms/op 1.20
BLS verifyMultipleSignatures 32 - blst-native 35.719 ms/op 29.686 ms/op 1.20
BLS aggregatePubkeys 32 - blst-native 47.589 us/op 40.027 us/op 1.19
BLS aggregatePubkeys 128 - blst-native 184.76 us/op 153.53 us/op 1.20
getAttestationsForBlock 78.640 ms/op 63.894 ms/op 1.23
isKnown best case - 1 super set check 528.00 ns/op 434.00 ns/op 1.22
isKnown normal case - 2 super set checks 512.00 ns/op 425.00 ns/op 1.20
isKnown worse case - 16 super set checks 523.00 ns/op 426.00 ns/op 1.23
CheckpointStateCache - add get delete 13.012 us/op 10.223 us/op 1.27
validate gossip signedAggregateAndProof - struct 5.1262 ms/op 4.2617 ms/op 1.20
validate gossip attestation - struct 2.4378 ms/op 2.0291 ms/op 1.20
altair verifyImport mainnet_s3766816:31 7.3502 s/op 6.0880 s/op 1.21
pickEth1Vote - no votes 2.4953 ms/op 2.0711 ms/op 1.20
pickEth1Vote - max votes 29.554 ms/op 22.820 ms/op 1.30
pickEth1Vote - Eth1Data hashTreeRoot value x2048 14.178 ms/op 11.147 ms/op 1.27
pickEth1Vote - Eth1Data hashTreeRoot tree x2048 23.759 ms/op 17.508 ms/op 1.36
pickEth1Vote - Eth1Data fastSerialize value x2048 1.9224 ms/op 1.3079 ms/op 1.47
pickEth1Vote - Eth1Data fastSerialize tree x2048 20.832 ms/op 15.583 ms/op 1.34
bytes32 toHexString 1.3610 us/op 901.00 ns/op 1.51
bytes32 Buffer.toString(hex) 860.00 ns/op 637.00 ns/op 1.35
bytes32 Buffer.toString(hex) from Uint8Array 1.0870 us/op 830.00 ns/op 1.31
bytes32 Buffer.toString(hex) + 0x 847.00 ns/op 629.00 ns/op 1.35
Object access 1 prop 0.45200 ns/op 0.29600 ns/op 1.53
Map access 1 prop 0.36100 ns/op 0.25800 ns/op 1.40
Object get x1000 21.689 ns/op 15.384 ns/op 1.41
Map get x1000 1.3940 ns/op 0.85300 ns/op 1.63
Object set x1000 146.69 ns/op 100.35 ns/op 1.46
Map set x1000 88.994 ns/op 59.783 ns/op 1.49
Return object 10000 times 0.45050 ns/op 0.33100 ns/op 1.36
Throw Error 10000 times 7.0351 us/op 5.3666 us/op 1.31
enrSubnets - fastDeserialize 64 bits 3.3860 us/op 2.2470 us/op 1.51
enrSubnets - ssz BitVector 64 bits 985.00 ns/op 644.00 ns/op 1.53
enrSubnets - fastDeserialize 4 bits 519.00 ns/op 357.00 ns/op 1.45
enrSubnets - ssz BitVector 4 bits 934.00 ns/op 630.00 ns/op 1.48
prioritizePeers score -10:0 att 32-0.1 sync 2-0 117.30 us/op 80.042 us/op 1.47
prioritizePeers score 0:0 att 32-0.25 sync 2-0.25 150.17 us/op 124.21 us/op 1.21
prioritizePeers score 0:0 att 32-0.5 sync 2-0.5 266.33 us/op 205.83 us/op 1.29
prioritizePeers score 0:0 att 64-0.75 sync 4-0.75 550.86 us/op 442.55 us/op 1.24
prioritizePeers score 0:0 att 64-1 sync 4-1 548.14 us/op 459.68 us/op 1.19
RateTracker 1000000 limit, 1 obj count per request 229.72 ns/op 184.73 ns/op 1.24
RateTracker 1000000 limit, 2 obj count per request 172.73 ns/op 139.21 ns/op 1.24
RateTracker 1000000 limit, 4 obj count per request 142.88 ns/op 112.40 ns/op 1.27
RateTracker 1000000 limit, 8 obj count per request 131.53 ns/op 100.72 ns/op 1.31
RateTracker with prune 5.7250 us/op 4.0060 us/op 1.43
array of 16000 items push then shift 3.6888 us/op 2.9075 us/op 1.27
LinkedList of 16000 items push then shift 29.250 ns/op 21.576 ns/op 1.36
array of 16000 items push then pop 270.95 ns/op 248.65 ns/op 1.09
LinkedList of 16000 items push then pop 24.143 ns/op 20.460 ns/op 1.18
array of 24000 items push then shift 5.4556 us/op 4.5771 us/op 1.19
LinkedList of 24000 items push then shift 29.110 ns/op 22.360 ns/op 1.30
array of 24000 items push then pop 252.12 ns/op 194.22 ns/op 1.30
LinkedList of 24000 items push then pop 24.397 ns/op 20.451 ns/op 1.19
intersect bitArray bitLen 8 14.108 ns/op 11.765 ns/op 1.20
intersect array and set length 8 209.59 ns/op 158.16 ns/op 1.33
intersect bitArray bitLen 128 74.246 ns/op 62.047 ns/op 1.20
intersect array and set length 128 2.7349 us/op 2.2273 us/op 1.23

by benchmarkbot/action

@wemeetagain wemeetagain merged commit c9eea32 into unstable Jun 9, 2022
@wemeetagain wemeetagain deleted the dapplion/sync-committee-aggregator-overlap branch June 9, 2022 17:57
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