Skip to content

Update beacon_aggregate_and_proof gossip scoring params - #4098

Closed
twoeths wants to merge 1 commit into
unstablefrom
tuyen/aggregate_and_proof_scoring_params
Closed

Update beacon_aggregate_and_proof gossip scoring params#4098
twoeths wants to merge 1 commit into
unstablefrom
tuyen/aggregate_and_proof_scoring_params

Conversation

@twoeths

@twoeths twoeths commented Jun 1, 2022

Copy link
Copy Markdown
Member

Motivation

After #4019 , we ignore AggregateAndProof gossip messages if all attesters are seen so we need to update respective params.

Description

  • As seen in prater and mainnet, 70%-80% messages are filtered so we have less accepted AggregateAndProof messages
  • Detail as below:
Param Old value New value Note
firstMessageDeliveriesWeight 0.33509 4x p1 (weight * cap) is unchanged
firstMessageDeliveriesCap 119.3712 1/4 x p1 (weight * cap) is unchanged
meshMessageDeliveriesCap 68.6255 1/4 x less accepted AggregateAndProof messages
meshFailurePenaltyWeight -0.7304 -11.68711 p3b, a little concerned, but this will likely not be applied since threshold is way smaller
meshMessageDeliveriesWeight -0.7304 -11.68711 p3, a little concerned, but this will likely not be applied since threshold is way smaller
meshMessageDeliveriesThreshold 17.15638 1/4 x (4.28909) more relaxed value, hopefully no p3 & p3b penalties are applied

Closes #4086

@github-actions

github-actions Bot commented Jun 1, 2022

Copy link
Copy Markdown
Contributor

Performance Report

鉁旓笍 no performance regression detected

Full benchmark results
Benchmark suite Current: 991c34a Previous: 34fdbde Ratio
BeaconState.hashTreeRoot - No change 433.00 ns/op 503.00 ns/op 0.86
BeaconState.hashTreeRoot - 1 full validator 55.941 us/op 66.929 us/op 0.84
BeaconState.hashTreeRoot - 32 full validator 546.27 us/op 660.12 us/op 0.83
BeaconState.hashTreeRoot - 512 full validator 6.3019 ms/op 8.0095 ms/op 0.79
BeaconState.hashTreeRoot - 1 validator.effectiveBalance 69.445 us/op 86.877 us/op 0.80
BeaconState.hashTreeRoot - 32 validator.effectiveBalance 963.47 us/op 1.1498 ms/op 0.84
BeaconState.hashTreeRoot - 512 validator.effectiveBalance 13.471 ms/op 16.724 ms/op 0.81
BeaconState.hashTreeRoot - 1 balances 55.095 us/op 65.833 us/op 0.84
BeaconState.hashTreeRoot - 32 balances 466.75 us/op 566.91 us/op 0.82
BeaconState.hashTreeRoot - 512 balances 4.6414 ms/op 5.8908 ms/op 0.79
BeaconState.hashTreeRoot - 250000 balances 109.10 ms/op 116.52 ms/op 0.94
processSlot - 1 slots 10.901 us/op 12.953 us/op 0.84
processSlot - 32 slots 1.6211 ms/op 1.9346 ms/op 0.84
getCommitteeAssignments - req 1 vs - 250000 vc 5.2913 ms/op 5.4407 ms/op 0.97
getCommitteeAssignments - req 100 vs - 250000 vc 7.3352 ms/op 7.9360 ms/op 0.92
getCommitteeAssignments - req 1000 vs - 250000 vc 7.7502 ms/op 8.4251 ms/op 0.92
computeProposers - vc 250000 16.396 ms/op 18.393 ms/op 0.89
computeEpochShuffling - vc 250000 165.93 ms/op 176.92 ms/op 0.94
getNextSyncCommittee - vc 250000 268.83 ms/op 304.57 ms/op 0.88
altair processAttestation - 250000 vs - 7PWei normalcase 4.0870 ms/op 4.2890 ms/op 0.95
altair processAttestation - 250000 vs - 7PWei worstcase 5.8618 ms/op 6.0270 ms/op 0.97
altair processAttestation - setStatus - 1/6 committees join 195.58 us/op 188.06 us/op 1.04
altair processAttestation - setStatus - 1/3 committees join 378.80 us/op 355.48 us/op 1.07
altair processAttestation - setStatus - 1/2 committees join 526.12 us/op 494.75 us/op 1.06
altair processAttestation - setStatus - 2/3 committees join 675.08 us/op 656.10 us/op 1.03
altair processAttestation - setStatus - 4/5 committees join 943.38 us/op 928.07 us/op 1.02
altair processAttestation - setStatus - 100% committees join 1.1237 ms/op 1.1107 ms/op 1.01
altair processBlock - 250000 vs - 7PWei normalcase 28.969 ms/op 25.404 ms/op 1.14
altair processBlock - 250000 vs - 7PWei normalcase hashState 38.628 ms/op 40.159 ms/op 0.96
altair processBlock - 250000 vs - 7PWei worstcase 75.526 ms/op 80.758 ms/op 0.94
altair processBlock - 250000 vs - 7PWei worstcase hashState 112.20 ms/op 105.09 ms/op 1.07
altair processEth1Data - 250000 vs - 7PWei normalcase 921.51 us/op 928.60 us/op 0.99
altair processEpoch - mainnet_e81889 586.42 ms/op 576.45 ms/op 1.02
mainnet_e81889 - altair beforeProcessEpoch 148.12 ms/op 149.93 ms/op 0.99
mainnet_e81889 - altair processJustificationAndFinalization 22.203 us/op 17.507 us/op 1.27
mainnet_e81889 - altair processInactivityUpdates 12.089 ms/op 10.875 ms/op 1.11
mainnet_e81889 - altair processRewardsAndPenalties 138.15 ms/op 85.468 ms/op 1.62
mainnet_e81889 - altair processRegistryUpdates 3.1340 us/op 2.8010 us/op 1.12
mainnet_e81889 - altair processSlashings 790.00 ns/op 657.00 ns/op 1.20
mainnet_e81889 - altair processEth1DataReset 807.00 ns/op 716.00 ns/op 1.13
mainnet_e81889 - altair processEffectiveBalanceUpdates 2.6760 ms/op 2.0343 ms/op 1.32
mainnet_e81889 - altair processSlashingsReset 4.4940 us/op 5.2490 us/op 0.86
mainnet_e81889 - altair processRandaoMixesReset 5.4120 us/op 6.3410 us/op 0.85
mainnet_e81889 - altair processHistoricalRootsUpdate 942.00 ns/op 1.2000 us/op 0.79
mainnet_e81889 - altair processParticipationFlagUpdates 2.4110 us/op 2.9200 us/op 0.83
mainnet_e81889 - altair processSyncCommitteeUpdates 703.00 ns/op 892.00 ns/op 0.79
mainnet_e81889 - altair afterProcessEpoch 192.74 ms/op 206.72 ms/op 0.93
altair processInactivityUpdates - 250000 normalcase 35.334 ms/op 37.699 ms/op 0.94
altair processInactivityUpdates - 250000 worstcase 29.125 ms/op 25.272 ms/op 1.15
altair processRewardsAndPenalties - 250000 normalcase 131.57 ms/op 80.856 ms/op 1.63
altair processRewardsAndPenalties - 250000 worstcase 113.58 ms/op 113.71 ms/op 1.00
altair processSyncCommitteeUpdates - 250000 280.52 ms/op 313.98 ms/op 0.89
Tree 40 250000 create 775.99 ms/op 1.2338 s/op 0.63
Tree 40 250000 get(125000) 297.00 ns/op 256.57 ns/op 1.16
Tree 40 250000 set(125000) 2.5904 us/op 3.7811 us/op 0.69
Tree 40 250000 toArray() 34.305 ms/op 32.362 ms/op 1.06
Tree 40 250000 iterate all - toArray() + loop 34.336 ms/op 32.886 ms/op 1.04
Tree 40 250000 iterate all - get(i) 116.12 ms/op 119.06 ms/op 0.98
MutableVector 250000 create 17.069 ms/op 15.861 ms/op 1.08
MutableVector 250000 get(125000) 13.133 ns/op 10.680 ns/op 1.23
MutableVector 250000 set(125000) 804.40 ns/op 990.37 ns/op 0.81
MutableVector 250000 toArray() 8.1184 ms/op 7.2920 ms/op 1.11
MutableVector 250000 iterate all - toArray() + loop 8.1600 ms/op 7.4857 ms/op 1.09
MutableVector 250000 iterate all - get(i) 3.4413 ms/op 2.6147 ms/op 1.32
Array 250000 create 7.0819 ms/op 7.3620 ms/op 0.96
Array 250000 clone - spread 3.8462 ms/op 7.5465 ms/op 0.51
Array 250000 get(125000) 1.6240 ns/op 2.8580 ns/op 0.57
Array 250000 set(125000) 1.7350 ns/op 2.9170 ns/op 0.59
Array 250000 iterate all - loop 167.89 us/op 151.05 us/op 1.11
effectiveBalanceIncrements clone Uint8Array 300000 97.483 us/op 103.61 us/op 0.94
effectiveBalanceIncrements clone MutableVector 300000 691.00 ns/op 2.2960 us/op 0.30
effectiveBalanceIncrements rw all Uint8Array 300000 252.55 us/op 247.52 us/op 1.02
effectiveBalanceIncrements rw all MutableVector 300000 187.76 ms/op 323.54 ms/op 0.58
aggregationBits - 2048 els - zipIndexesInBitList 30.021 us/op 49.661 us/op 0.60
regular array get 100000 times 67.421 us/op 60.585 us/op 1.11
wrappedArray get 100000 times 67.444 us/op 61.310 us/op 1.10
arrayWithProxy get 100000 times 33.723 ms/op 29.248 ms/op 1.15
ssz.Root.equals 533.00 ns/op 592.00 ns/op 0.90
byteArrayEquals 511.00 ns/op 576.00 ns/op 0.89
phase0 processBlock - 250000 vs - 7PWei normalcase 3.7332 ms/op 4.2853 ms/op 0.87
phase0 processBlock - 250000 vs - 7PWei worstcase 46.399 ms/op 54.068 ms/op 0.86
phase0 afterProcessEpoch - 250000 vs - 7PWei 182.91 ms/op 197.72 ms/op 0.93
phase0 beforeProcessEpoch - 250000 vs - 7PWei 81.202 ms/op 91.660 ms/op 0.89
phase0 processEpoch - mainnet_e58758 533.65 ms/op 538.66 ms/op 0.99
mainnet_e58758 - phase0 beforeProcessEpoch 243.27 ms/op 214.38 ms/op 1.13
mainnet_e58758 - phase0 processJustificationAndFinalization 20.554 us/op 18.397 us/op 1.12
mainnet_e58758 - phase0 processRewardsAndPenalties 136.84 ms/op 129.96 ms/op 1.05
mainnet_e58758 - phase0 processRegistryUpdates 10.977 us/op 8.6160 us/op 1.27
mainnet_e58758 - phase0 processSlashings 844.00 ns/op 587.00 ns/op 1.44
mainnet_e58758 - phase0 processEth1DataReset 829.00 ns/op 603.00 ns/op 1.37
mainnet_e58758 - phase0 processEffectiveBalanceUpdates 2.1955 ms/op 2.8867 ms/op 0.76
mainnet_e58758 - phase0 processSlashingsReset 4.4890 us/op 4.1740 us/op 1.08
mainnet_e58758 - phase0 processRandaoMixesReset 6.6310 us/op 4.2740 us/op 1.55
mainnet_e58758 - phase0 processHistoricalRootsUpdate 1.1640 us/op 720.00 ns/op 1.62
mainnet_e58758 - phase0 processParticipationRecordUpdates 6.0720 us/op 4.2860 us/op 1.42
mainnet_e58758 - phase0 afterProcessEpoch 159.91 ms/op 168.41 ms/op 0.95
phase0 processEffectiveBalanceUpdates - 250000 normalcase 2.8969 ms/op 2.0554 ms/op 1.41
phase0 processEffectiveBalanceUpdates - 250000 worstcase 0.5 3.2048 ms/op 2.2347 ms/op 1.43
phase0 processRegistryUpdates - 250000 normalcase 9.2300 us/op 6.5540 us/op 1.41
phase0 processRegistryUpdates - 250000 badcase_full_deposits 411.22 us/op 380.03 us/op 1.08
phase0 processRegistryUpdates - 250000 worstcase 0.5 220.85 ms/op 211.62 ms/op 1.04
phase0 getAttestationDeltas - 250000 normalcase 14.750 ms/op 17.301 ms/op 0.85
phase0 getAttestationDeltas - 250000 worstcase 15.077 ms/op 16.871 ms/op 0.89
phase0 processSlashings - 250000 worstcase 5.8871 ms/op 5.7204 ms/op 1.03
shuffle list - 16384 els 11.003 ms/op 11.678 ms/op 0.94
shuffle list - 250000 els 162.06 ms/op 171.70 ms/op 0.94
getEffectiveBalanceIncrementsZeroInactive - 250000 vs - 7PWei 379.52 us/op 440.27 us/op 0.86
pass gossip attestations to forkchoice per slot 3.2637 ms/op 3.1286 ms/op 1.04
computeDeltas 3.6963 ms/op 3.4726 ms/op 1.06
computeProposerBoostScoreFromBalances 907.98 us/op 805.52 us/op 1.13
getPubkeys - index2pubkey - req 1000 vs - 250000 vc 2.4357 ms/op 2.5345 ms/op 0.96
getPubkeys - validatorsArr - req 1000 vs - 250000 vc 90.743 us/op 81.483 us/op 1.11
BLS verify - blst-native 1.8598 ms/op 2.1750 ms/op 0.86
BLS verifyMultipleSignatures 3 - blst-native 3.8045 ms/op 4.4813 ms/op 0.85
BLS verifyMultipleSignatures 8 - blst-native 8.1873 ms/op 9.6904 ms/op 0.84
BLS verifyMultipleSignatures 32 - blst-native 29.672 ms/op 35.218 ms/op 0.84
BLS aggregatePubkeys 32 - blst-native 39.328 us/op 46.982 us/op 0.84
BLS aggregatePubkeys 128 - blst-native 153.69 us/op 182.65 us/op 0.84
getAttestationsForBlock 72.149 ms/op 72.442 ms/op 1.00
isKnown best case - 1 super set check 434.00 ns/op 507.00 ns/op 0.86
isKnown normal case - 2 super set checks 426.00 ns/op 493.00 ns/op 0.86
isKnown worse case - 16 super set checks 423.00 ns/op 496.00 ns/op 0.85
CheckpointStateCache - add get delete 11.524 us/op 12.094 us/op 0.95
validate gossip signedAggregateAndProof - struct 4.2602 ms/op 5.0431 ms/op 0.84
validate gossip attestation - struct 2.0243 ms/op 2.3715 ms/op 0.85
altair verifyImport mainnet_s3766816:31 6.2296 s/op 7.1273 s/op 0.87
pickEth1Vote - no votes 2.1340 ms/op 2.2714 ms/op 0.94
pickEth1Vote - max votes 28.420 ms/op 29.644 ms/op 0.96
pickEth1Vote - Eth1Data hashTreeRoot value x2048 11.905 ms/op 14.710 ms/op 0.81
pickEth1Vote - Eth1Data hashTreeRoot tree x2048 23.128 ms/op 31.426 ms/op 0.74
pickEth1Vote - Eth1Data fastSerialize value x2048 1.5512 ms/op 1.3996 ms/op 1.11
pickEth1Vote - Eth1Data fastSerialize tree x2048 19.475 ms/op 16.981 ms/op 1.15
bytes32 toHexString 1.1220 us/op 1.1040 us/op 1.02
bytes32 Buffer.toString(hex) 724.00 ns/op 741.00 ns/op 0.98
bytes32 Buffer.toString(hex) from Uint8Array 897.00 ns/op 1.0210 us/op 0.88
bytes32 Buffer.toString(hex) + 0x 718.00 ns/op 743.00 ns/op 0.97
Object access 1 prop 0.38900 ns/op 0.38800 ns/op 1.00
Map access 1 prop 0.30400 ns/op 0.30700 ns/op 0.99
Object get x1000 17.315 ns/op 11.196 ns/op 1.55
Map get x1000 1.0340 ns/op 1.0800 ns/op 0.96
Object set x1000 118.55 ns/op 90.184 ns/op 1.31
Map set x1000 78.156 ns/op 59.228 ns/op 1.32
Return object 10000 times 0.37580 ns/op 0.44130 ns/op 0.85
Throw Error 10000 times 5.9275 us/op 6.0932 us/op 0.97
enrSubnets - fastDeserialize 64 bits 2.9260 us/op 3.1030 us/op 0.94
enrSubnets - ssz BitVector 64 bits 778.00 ns/op 883.00 ns/op 0.88
enrSubnets - fastDeserialize 4 bits 447.00 ns/op 410.00 ns/op 1.09
enrSubnets - ssz BitVector 4 bits 804.00 ns/op 868.00 ns/op 0.93
prioritizePeers score -10:0 att 32-0.1 sync 2-0 97.805 us/op 91.143 us/op 1.07
prioritizePeers score 0:0 att 32-0.25 sync 2-0.25 141.33 us/op 137.63 us/op 1.03
prioritizePeers score 0:0 att 32-0.5 sync 2-0.5 232.10 us/op 223.94 us/op 1.04
prioritizePeers score 0:0 att 64-0.75 sync 4-0.75 393.27 us/op 359.28 us/op 1.09
prioritizePeers score 0:0 att 64-1 sync 4-1 463.05 us/op 455.00 us/op 1.02
RateTracker 1000000 limit, 1 obj count per request 196.40 ns/op 187.85 ns/op 1.05
RateTracker 1000000 limit, 2 obj count per request 145.42 ns/op 140.69 ns/op 1.03
RateTracker 1000000 limit, 4 obj count per request 119.95 ns/op 116.73 ns/op 1.03
RateTracker 1000000 limit, 8 obj count per request 111.52 ns/op 105.15 ns/op 1.06
RateTracker with prune 4.6380 us/op 5.0630 us/op 0.92
array of 16000 items push then shift 3.1687 us/op 51.637 us/op 0.06
LinkedList of 16000 items push then shift 28.081 ns/op 21.103 ns/op 1.33
array of 16000 items push then pop 257.20 ns/op 211.21 ns/op 1.22
LinkedList of 16000 items push then pop 22.715 ns/op 16.170 ns/op 1.40
array of 24000 items push then shift 4.5631 us/op 77.406 us/op 0.06
LinkedList of 24000 items push then shift 29.946 ns/op 30.199 ns/op 0.99
array of 24000 items push then pop 214.60 ns/op 216.80 ns/op 0.99
LinkedList of 24000 items push then pop 23.473 ns/op 18.417 ns/op 1.27
intersect bitArray bitLen 8 11.616 ns/op 10.642 ns/op 1.09
intersect array and set length 8 182.99 ns/op 155.35 ns/op 1.18
intersect bitArray bitLen 128 72.059 ns/op 55.524 ns/op 1.30
intersect array and set length 128 2.4119 us/op 1.9272 us/op 1.25

by benchmarkbot/action

@wemeetagain

Copy link
Copy Markdown
Member

@tuyennhv can this PR be changed to 'ready for review'?

@twoeths

twoeths commented Jul 6, 2022

Copy link
Copy Markdown
Member Author

@tuyennhv can this PR be changed to 'ready for review'?

@wemeetagain this is not ready, we need to take time to test it (nodes are busy with testing mesh peers issue). I also notice that other clients haven't changed the params like in this PR so looks like this is not a big issue at all, just something nice to improve

@dapplion

dapplion commented Sep 1, 2022

Copy link
Copy Markdown
Contributor

After merging libp2p, let's revisit this, do tests and if positive do a PR

@dapplion dapplion closed this Sep 1, 2022
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.

Correct beacon_aggregate_and_proof meshMessageDeliveriesThreshold scoring params

3 participants