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

vc: configure afterBlockDelaySlotFraction for Attestation and SyncCommitteeSignature #4626

Merged
merged 3 commits into from Oct 5, 2022

Conversation

twoeths
Copy link
Contributor

@twoeths twoeths commented Oct 3, 2022

Motivation

  • A continuation of Vc to submit SyncCommitteeSignature on early block #4615: add scAfterBlockDelaySlotFraction just in case we want to delay the submission of SyncCommitteeSignature (due to some clients validate block in SyncCommitteeSignature gossip validation for example)
  • The afterBlockDelaySlotFraction is confusing and it's not possible to configure a 0 value (no delay)

Description

  • Both this param (for SyncCommitteeSignature) and afterBlockDelaySlotFraction is configured as a fraction of slot from0 (inclusive) to 1 (exclusive)

Before (not possible to configure 0 value)

┌─────────┬──────────────────┬─────────────────────────────┐
│ (index) │ target delay (s) │ afterBlockDelaySlotFraction │
├─────────┼──────────────────┼─────────────────────────────┤
│  bn-0   │       0.1        │             120             │
│  bn-1   │       0.5        │             24              │
│  bn-2   │       0.9        │           13.3333           │
│  bn-3   │       1.3        │           9.2307            │
│  bn-4   │       1.7        │           7.0588            │
└─────────┴──────────────────┴─────────────────────────────┘

After (value from 0 to 1)

┌─────────┬──────────────────┬─────────────────────────────┐
│ (index) │ target delay (s) │ afterBlockDelaySlotFraction │
├─────────┼──────────────────┼─────────────────────────────┤
│  bn-0   │        0         │              0              │
│  bn-1   │       0.5        │           0.0416            │
│  bn-2   │       0.9        │            0.075            │
│  bn-3   │       1.3        │           0.1083            │
│  bn-4   │       1.7        │           0.1416            │
└─────────┴──────────────────┴─────────────────────────────┘

@github-actions
Copy link
Contributor

github-actions bot commented Oct 3, 2022

Performance Report

✔️ no performance regression detected

Full benchmark results
Benchmark suite Current: f3310bc Previous: edb327d Ratio
getPubkeys - index2pubkey - req 1000 vs - 250000 vc 2.9471 ms/op 1.8062 ms/op 1.63
getPubkeys - validatorsArr - req 1000 vs - 250000 vc 86.880 us/op 66.694 us/op 1.30
BLS verify - blst-native 2.2020 ms/op 2.1678 ms/op 1.02
BLS verifyMultipleSignatures 3 - blst-native 4.4922 ms/op 4.4732 ms/op 1.00
BLS verifyMultipleSignatures 8 - blst-native 9.8717 ms/op 9.6843 ms/op 1.02
BLS verifyMultipleSignatures 32 - blst-native 35.790 ms/op 35.233 ms/op 1.02
BLS aggregatePubkeys 32 - blst-native 49.823 us/op 46.590 us/op 1.07
BLS aggregatePubkeys 128 - blst-native 184.42 us/op 182.75 us/op 1.01
getAttestationsForBlock 118.81 ms/op 78.132 ms/op 1.52
isKnown best case - 1 super set check 488.00 ns/op 493.00 ns/op 0.99
isKnown normal case - 2 super set checks 485.00 ns/op 473.00 ns/op 1.03
isKnown worse case - 16 super set checks 475.00 ns/op 481.00 ns/op 0.99
CheckpointStateCache - add get delete 10.808 us/op 8.6390 us/op 1.25
validate gossip signedAggregateAndProof - struct 4.6817 ms/op 5.0301 ms/op 0.93
validate gossip attestation - struct 2.2089 ms/op 2.3651 ms/op 0.93
pickEth1Vote - no votes 2.3363 ms/op 2.1824 ms/op 1.07
pickEth1Vote - max votes 23.092 ms/op 18.627 ms/op 1.24
pickEth1Vote - Eth1Data hashTreeRoot value x2048 13.314 ms/op 12.235 ms/op 1.09
pickEth1Vote - Eth1Data hashTreeRoot tree x2048 22.768 ms/op 20.530 ms/op 1.11
pickEth1Vote - Eth1Data fastSerialize value x2048 1.7884 ms/op 1.5091 ms/op 1.19
pickEth1Vote - Eth1Data fastSerialize tree x2048 16.458 ms/op 13.783 ms/op 1.19
bytes32 toHexString 1.2370 us/op 1.0120 us/op 1.22
bytes32 Buffer.toString(hex) 804.00 ns/op 764.00 ns/op 1.05
bytes32 Buffer.toString(hex) from Uint8Array 1.1050 us/op 1.0060 us/op 1.10
bytes32 Buffer.toString(hex) + 0x 806.00 ns/op 769.00 ns/op 1.05
Object access 1 prop 0.40800 ns/op 0.35600 ns/op 1.15
Map access 1 prop 0.31400 ns/op 0.30400 ns/op 1.03
Object get x1000 15.920 ns/op 10.861 ns/op 1.47
Map get x1000 0.94800 ns/op 0.96600 ns/op 0.98
Object set x1000 119.08 ns/op 73.523 ns/op 1.62
Map set x1000 81.574 ns/op 47.722 ns/op 1.71
Return object 10000 times 0.40860 ns/op 0.44280 ns/op 0.92
Throw Error 10000 times 7.9868 us/op 6.0004 us/op 1.33
enrSubnets - fastDeserialize 64 bits 3.2460 us/op 2.5310 us/op 1.28
enrSubnets - ssz BitVector 64 bits 850.00 ns/op 800.00 ns/op 1.06
enrSubnets - fastDeserialize 4 bits 460.00 ns/op 389.00 ns/op 1.18
enrSubnets - ssz BitVector 4 bits 846.00 ns/op 794.00 ns/op 1.07
prioritizePeers score -10:0 att 32-0.1 sync 2-0 111.61 us/op 84.126 us/op 1.33
prioritizePeers score 0:0 att 32-0.25 sync 2-0.25 146.76 us/op 115.05 us/op 1.28
prioritizePeers score 0:0 att 32-0.5 sync 2-0.5 269.64 us/op 207.79 us/op 1.30
prioritizePeers score 0:0 att 64-0.75 sync 4-0.75 593.27 us/op 378.00 us/op 1.57
prioritizePeers score 0:0 att 64-1 sync 4-1 536.52 us/op 409.31 us/op 1.31
RateTracker 1000000 limit, 1 obj count per request 222.75 ns/op 189.02 ns/op 1.18
RateTracker 1000000 limit, 2 obj count per request 165.92 ns/op 136.21 ns/op 1.22
RateTracker 1000000 limit, 4 obj count per request 137.50 ns/op 109.49 ns/op 1.26
RateTracker 1000000 limit, 8 obj count per request 124.79 ns/op 97.440 ns/op 1.28
RateTracker with prune 5.6270 us/op 4.0230 us/op 1.40
array of 16000 items push then shift 5.1318 us/op 51.593 us/op 0.10
LinkedList of 16000 items push then shift 20.527 ns/op 12.659 ns/op 1.62
array of 16000 items push then pop 259.16 ns/op 215.53 ns/op 1.20
LinkedList of 16000 items push then pop 19.113 ns/op 11.991 ns/op 1.59
array of 24000 items push then shift 7.3293 us/op 77.359 us/op 0.09
LinkedList of 24000 items push then shift 20.500 ns/op 12.955 ns/op 1.58
array of 24000 items push then pop 242.53 ns/op 194.56 ns/op 1.25
LinkedList of 24000 items push then pop 18.556 ns/op 12.073 ns/op 1.54
intersect bitArray bitLen 8 11.474 ns/op 10.785 ns/op 1.06
intersect array and set length 8 208.51 ns/op 136.47 ns/op 1.53
intersect bitArray bitLen 128 66.546 ns/op 55.600 ns/op 1.20
intersect array and set length 128 2.4251 us/op 1.7928 us/op 1.35
Buffer.concat 32 items 2.7730 ns/op 1.8460 ns/op 1.50
pass gossip attestations to forkchoice per slot 4.6408 ms/op 3.5878 ms/op 1.29
computeDeltas 5.4177 ms/op 4.9499 ms/op 1.09
computeProposerBoostScoreFromBalances 825.43 us/op 804.86 us/op 1.03
altair processAttestation - 250000 vs - 7PWei normalcase 4.9240 ms/op 3.4292 ms/op 1.44
altair processAttestation - 250000 vs - 7PWei worstcase 7.9992 ms/op 5.1394 ms/op 1.56
altair processAttestation - setStatus - 1/6 committees join 237.64 us/op 182.81 us/op 1.30
altair processAttestation - setStatus - 1/3 committees join 464.29 us/op 355.34 us/op 1.31
altair processAttestation - setStatus - 1/2 committees join 704.08 us/op 507.80 us/op 1.39
altair processAttestation - setStatus - 2/3 committees join 856.61 us/op 671.95 us/op 1.27
altair processAttestation - setStatus - 4/5 committees join 1.1792 ms/op 935.29 us/op 1.26
altair processAttestation - setStatus - 100% committees join 1.4622 ms/op 1.1262 ms/op 1.30
altair processBlock - 250000 vs - 7PWei normalcase 29.255 ms/op 25.123 ms/op 1.16
altair processBlock - 250000 vs - 7PWei normalcase hashState 43.680 ms/op 37.624 ms/op 1.16
altair processBlock - 250000 vs - 7PWei worstcase 91.246 ms/op 78.464 ms/op 1.16
altair processBlock - 250000 vs - 7PWei worstcase hashState 116.57 ms/op 100.82 ms/op 1.16
phase0 processBlock - 250000 vs - 7PWei normalcase 4.0164 ms/op 3.2502 ms/op 1.24
phase0 processBlock - 250000 vs - 7PWei worstcase 52.524 ms/op 50.877 ms/op 1.03
altair processEth1Data - 250000 vs - 7PWei normalcase 1.0209 ms/op 723.51 us/op 1.41
Tree 40 250000 create 986.21 ms/op 709.91 ms/op 1.39
Tree 40 250000 get(125000) 304.10 ns/op 258.59 ns/op 1.18
Tree 40 250000 set(125000) 3.2136 us/op 2.0870 us/op 1.54
Tree 40 250000 toArray() 36.186 ms/op 27.475 ms/op 1.32
Tree 40 250000 iterate all - toArray() + loop 37.813 ms/op 27.711 ms/op 1.36
Tree 40 250000 iterate all - get(i) 125.98 ms/op 111.38 ms/op 1.13
MutableVector 250000 create 16.442 ms/op 13.687 ms/op 1.20
MutableVector 250000 get(125000) 13.987 ns/op 11.435 ns/op 1.22
MutableVector 250000 set(125000) 849.80 ns/op 540.25 ns/op 1.57
MutableVector 250000 toArray() 7.7951 ms/op 5.9592 ms/op 1.31
MutableVector 250000 iterate all - toArray() + loop 7.6018 ms/op 6.8171 ms/op 1.12
MutableVector 250000 iterate all - get(i) 3.1277 ms/op 2.6388 ms/op 1.19
Array 250000 create 7.1027 ms/op 6.2872 ms/op 1.13
Array 250000 clone - spread 4.3778 ms/op 3.4588 ms/op 1.27
Array 250000 get(125000) 1.7270 ns/op 1.5380 ns/op 1.12
Array 250000 set(125000) 1.6780 ns/op 1.5000 ns/op 1.12
Array 250000 iterate all - loop 132.57 us/op 180.92 us/op 0.73
effectiveBalanceIncrements clone Uint8Array 300000 245.78 us/op 46.340 us/op 5.30
effectiveBalanceIncrements clone MutableVector 300000 700.00 ns/op 1.1140 us/op 0.63
effectiveBalanceIncrements rw all Uint8Array 300000 269.97 us/op 247.28 us/op 1.09
effectiveBalanceIncrements rw all MutableVector 300000 205.50 ms/op 171.90 ms/op 1.20
phase0 afterProcessEpoch - 250000 vs - 7PWei 193.86 ms/op 207.95 ms/op 0.93
phase0 beforeProcessEpoch - 250000 vs - 7PWei 75.735 ms/op 58.590 ms/op 1.29
altair processEpoch - mainnet_e81889 650.13 ms/op 550.57 ms/op 1.18
mainnet_e81889 - altair beforeProcessEpoch 177.37 ms/op 124.74 ms/op 1.42
mainnet_e81889 - altair processJustificationAndFinalization 62.488 us/op 17.772 us/op 3.52
mainnet_e81889 - altair processInactivityUpdates 11.572 ms/op 9.0378 ms/op 1.28
mainnet_e81889 - altair processRewardsAndPenalties 107.18 ms/op 79.463 ms/op 1.35
mainnet_e81889 - altair processRegistryUpdates 13.013 us/op 2.9400 us/op 4.43
mainnet_e81889 - altair processSlashings 3.0180 us/op 724.00 ns/op 4.17
mainnet_e81889 - altair processEth1DataReset 3.1730 us/op 698.00 ns/op 4.55
mainnet_e81889 - altair processEffectiveBalanceUpdates 2.8569 ms/op 1.9221 ms/op 1.49
mainnet_e81889 - altair processSlashingsReset 26.772 us/op 5.0810 us/op 5.27
mainnet_e81889 - altair processRandaoMixesReset 22.809 us/op 4.6280 us/op 4.93
mainnet_e81889 - altair processHistoricalRootsUpdate 3.6240 us/op 1.3670 us/op 2.65
mainnet_e81889 - altair processParticipationFlagUpdates 15.001 us/op 2.2740 us/op 6.60
mainnet_e81889 - altair processSyncCommitteeUpdates 3.1330 us/op 857.00 ns/op 3.66
mainnet_e81889 - altair afterProcessEpoch 203.06 ms/op 220.75 ms/op 0.92
phase0 processEpoch - mainnet_e58758 595.99 ms/op 629.29 ms/op 0.95
mainnet_e58758 - phase0 beforeProcessEpoch 273.06 ms/op 222.78 ms/op 1.23
mainnet_e58758 - phase0 processJustificationAndFinalization 55.888 us/op 20.934 us/op 2.67
mainnet_e58758 - phase0 processRewardsAndPenalties 157.72 ms/op 126.00 ms/op 1.25
mainnet_e58758 - phase0 processRegistryUpdates 29.054 us/op 9.2860 us/op 3.13
mainnet_e58758 - phase0 processSlashings 2.9070 us/op 710.00 ns/op 4.09
mainnet_e58758 - phase0 processEth1DataReset 2.9670 us/op 739.00 ns/op 4.01
mainnet_e58758 - phase0 processEffectiveBalanceUpdates 2.4533 ms/op 1.7834 ms/op 1.38
mainnet_e58758 - phase0 processSlashingsReset 16.244 us/op 5.0580 us/op 3.21
mainnet_e58758 - phase0 processRandaoMixesReset 23.658 us/op 4.3890 us/op 5.39
mainnet_e58758 - phase0 processHistoricalRootsUpdate 3.5520 us/op 627.00 ns/op 5.67
mainnet_e58758 - phase0 processParticipationRecordUpdates 22.312 us/op 5.6090 us/op 3.98
mainnet_e58758 - phase0 afterProcessEpoch 162.67 ms/op 164.31 ms/op 0.99
phase0 processEffectiveBalanceUpdates - 250000 normalcase 2.3003 ms/op 1.9418 ms/op 1.18
phase0 processEffectiveBalanceUpdates - 250000 worstcase 0.5 2.8095 ms/op 2.2370 ms/op 1.26
altair processInactivityUpdates - 250000 normalcase 52.948 ms/op 51.831 ms/op 1.02
altair processInactivityUpdates - 250000 worstcase 52.002 ms/op 52.714 ms/op 0.99
phase0 processRegistryUpdates - 250000 normalcase 26.179 us/op 6.7230 us/op 3.89
phase0 processRegistryUpdates - 250000 badcase_full_deposits 516.99 us/op 375.77 us/op 1.38
phase0 processRegistryUpdates - 250000 worstcase 0.5 244.72 ms/op 228.26 ms/op 1.07
altair processRewardsAndPenalties - 250000 normalcase 95.845 ms/op 130.70 ms/op 0.73
altair processRewardsAndPenalties - 250000 worstcase 148.66 ms/op 134.13 ms/op 1.11
phase0 getAttestationDeltas - 250000 normalcase 13.842 ms/op 11.885 ms/op 1.16
phase0 getAttestationDeltas - 250000 worstcase 13.844 ms/op 11.632 ms/op 1.19
phase0 processSlashings - 250000 worstcase 6.1140 ms/op 5.0292 ms/op 1.22
altair processSyncCommitteeUpdates - 250000 331.91 ms/op 289.63 ms/op 1.15
BeaconState.hashTreeRoot - No change 663.00 ns/op 615.00 ns/op 1.08
BeaconState.hashTreeRoot - 1 full validator 69.506 us/op 74.875 us/op 0.93
BeaconState.hashTreeRoot - 32 full validator 687.96 us/op 707.78 us/op 0.97
BeaconState.hashTreeRoot - 512 full validator 6.8111 ms/op 9.2791 ms/op 0.73
BeaconState.hashTreeRoot - 1 validator.effectiveBalance 95.221 us/op 87.087 us/op 1.09
BeaconState.hashTreeRoot - 32 validator.effectiveBalance 1.3767 ms/op 1.4634 ms/op 0.94
BeaconState.hashTreeRoot - 512 validator.effectiveBalance 17.770 ms/op 16.483 ms/op 1.08
BeaconState.hashTreeRoot - 1 balances 74.611 us/op 75.906 us/op 0.98
BeaconState.hashTreeRoot - 32 balances 676.21 us/op 624.96 us/op 1.08
BeaconState.hashTreeRoot - 512 balances 6.9859 ms/op 6.6710 ms/op 1.05
BeaconState.hashTreeRoot - 250000 balances 104.67 ms/op 111.36 ms/op 0.94
aggregationBits - 2048 els - zipIndexesInBitList 34.171 us/op 26.595 us/op 1.28
regular array get 100000 times 56.415 us/op 60.571 us/op 0.93
wrappedArray get 100000 times 54.655 us/op 60.569 us/op 0.90
arrayWithProxy get 100000 times 32.742 ms/op 26.913 ms/op 1.22
ssz.Root.equals 501.00 ns/op 458.00 ns/op 1.09
byteArrayEquals 475.00 ns/op 451.00 ns/op 1.05
shuffle list - 16384 els 11.611 ms/op 11.339 ms/op 1.02
shuffle list - 250000 els 158.37 ms/op 168.59 ms/op 0.94
processSlot - 1 slots 16.468 us/op 14.222 us/op 1.16
processSlot - 32 slots 2.1955 ms/op 1.9735 ms/op 1.11
getEffectiveBalanceIncrementsZeroInactive - 250000 vs - 7PWei 472.10 us/op 393.80 us/op 1.20
getCommitteeAssignments - req 1 vs - 250000 vc 4.9867 ms/op 5.5788 ms/op 0.89
getCommitteeAssignments - req 100 vs - 250000 vc 7.2655 ms/op 8.1077 ms/op 0.90
getCommitteeAssignments - req 1000 vs - 250000 vc 7.4968 ms/op 8.6180 ms/op 0.87
RootCache.getBlockRootAtSlot - 250000 vs - 7PWei 8.9600 ns/op 7.8900 ns/op 1.14
state getBlockRootAtSlot - 250000 vs - 7PWei 1.5211 us/op 1.0197 us/op 1.49
computeProposers - vc 250000 21.001 ms/op 17.599 ms/op 1.19
computeEpochShuffling - vc 250000 160.25 ms/op 172.65 ms/op 0.93
getNextSyncCommittee - vc 250000 326.29 ms/op 289.00 ms/op 1.13

by benchmarkbot/action

@twoeths twoeths marked this pull request as ready for review October 4, 2022 02:29
@twoeths twoeths requested a review from a team as a code owner October 4, 2022 02:29
@dapplion dapplion enabled auto-merge (squash) October 5, 2022 08:55
@dapplion dapplion merged commit 92fc936 into unstable Oct 5, 2022
@dapplion dapplion deleted the tuyen/afterBlockDelaySlotFraction branch October 5, 2022 09:09
twoeths added a commit that referenced this pull request Oct 19, 2022
…mitteeSignature (#4626)

* vc: configure afterBlockDelaySlotFraction for Attestation and SyncCommitteeSignature

* Correct SyncCommitteeSignature delay logic

Co-authored-by: dapplion <35266934+dapplion@users.noreply.github.com>
wemeetagain pushed a commit that referenced this pull request Oct 19, 2022
…mitteeSignature (#4626)

* vc: configure afterBlockDelaySlotFraction for Attestation and SyncCommitteeSignature

* Correct SyncCommitteeSignature delay logic

Co-authored-by: dapplion <35266934+dapplion@users.noreply.github.com>
@wemeetagain wemeetagain mentioned this pull request Oct 19, 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.

None yet

2 participants