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

Fix getDomain() #4461

Merged
merged 1 commit into from
Aug 21, 2022
Merged

Fix getDomain() #4461

merged 1 commit into from
Aug 21, 2022

Conversation

twoeths
Copy link
Contributor

@twoeths twoeths commented Aug 21, 2022

Motivation

Missing parenthese when calculating epoch in getDomain() function

Description

A fix for #4430

@twoeths twoeths requested a review from a team as a code owner August 21, 2022 07:29
@g11tech g11tech merged commit bdf60bd into unstable Aug 21, 2022
@g11tech g11tech deleted the tuyen/fix-getDomain branch August 21, 2022 07:53
@github-actions
Copy link
Contributor

Performance Report

✔️ no performance regression detected

Full benchmark results
Benchmark suite Current: d08ca5a Previous: b2d6a55 Ratio
getPubkeys - index2pubkey - req 1000 vs - 250000 vc 1.8465 ms/op 1.8519 ms/op 1.00
getPubkeys - validatorsArr - req 1000 vs - 250000 vc 64.565 us/op 64.516 us/op 1.00
BLS verify - blst-native 2.1691 ms/op 2.1656 ms/op 1.00
BLS verifyMultipleSignatures 3 - blst-native 4.4800 ms/op 4.4768 ms/op 1.00
BLS verifyMultipleSignatures 8 - blst-native 9.6883 ms/op 9.6679 ms/op 1.00
BLS verifyMultipleSignatures 32 - blst-native 35.231 ms/op 35.168 ms/op 1.00
BLS aggregatePubkeys 32 - blst-native 46.746 us/op 46.812 us/op 1.00
BLS aggregatePubkeys 128 - blst-native 182.99 us/op 182.56 us/op 1.00
getAttestationsForBlock 146.15 ms/op 149.71 ms/op 0.98
isKnown best case - 1 super set check 482.00 ns/op 476.00 ns/op 1.01
isKnown normal case - 2 super set checks 477.00 ns/op 469.00 ns/op 1.02
isKnown worse case - 16 super set checks 478.00 ns/op 465.00 ns/op 1.03
CheckpointStateCache - add get delete 8.6330 us/op 9.0090 us/op 0.96
validate gossip signedAggregateAndProof - struct 5.0238 ms/op 5.0252 ms/op 1.00
validate gossip attestation - struct 2.3720 ms/op 2.3629 ms/op 1.00
altair verifyImport mainnet_s3766816:31 4.7483 s/op 4.7753 s/op 0.99
pickEth1Vote - no votes 2.0699 ms/op 2.1015 ms/op 0.98
pickEth1Vote - max votes 19.917 ms/op 21.776 ms/op 0.91
pickEth1Vote - Eth1Data hashTreeRoot value x2048 12.364 ms/op 12.870 ms/op 0.96
pickEth1Vote - Eth1Data hashTreeRoot tree x2048 23.094 ms/op 20.291 ms/op 1.14
pickEth1Vote - Eth1Data fastSerialize value x2048 1.3801 ms/op 1.5023 ms/op 0.92
pickEth1Vote - Eth1Data fastSerialize tree x2048 12.158 ms/op 16.040 ms/op 0.76
bytes32 toHexString 887.00 ns/op 1.1130 us/op 0.80
bytes32 Buffer.toString(hex) 732.00 ns/op 847.00 ns/op 0.86
bytes32 Buffer.toString(hex) from Uint8Array 982.00 ns/op 1.0790 us/op 0.91
bytes32 Buffer.toString(hex) + 0x 743.00 ns/op 839.00 ns/op 0.89
Object access 1 prop 0.32600 ns/op 0.38400 ns/op 0.85
Map access 1 prop 0.30600 ns/op 0.34500 ns/op 0.89
Object get x1000 10.676 ns/op 10.790 ns/op 0.99
Map get x1000 1.0060 ns/op 1.0000 ns/op 1.01
Object set x1000 65.680 ns/op 72.202 ns/op 0.91
Map set x1000 42.916 ns/op 49.927 ns/op 0.86
Return object 10000 times 0.43260 ns/op 0.43660 ns/op 0.99
Throw Error 10000 times 6.0463 us/op 5.9313 us/op 1.02
enrSubnets - fastDeserialize 64 bits 2.4900 us/op 2.7370 us/op 0.91
enrSubnets - ssz BitVector 64 bits 742.00 ns/op 836.00 ns/op 0.89
enrSubnets - fastDeserialize 4 bits 349.00 ns/op 444.00 ns/op 0.79
enrSubnets - ssz BitVector 4 bits 721.00 ns/op 813.00 ns/op 0.89
prioritizePeers score -10:0 att 32-0.1 sync 2-0 78.762 us/op 83.164 us/op 0.95
prioritizePeers score 0:0 att 32-0.25 sync 2-0.25 125.82 us/op 130.30 us/op 0.97
prioritizePeers score 0:0 att 32-0.5 sync 2-0.5 199.21 us/op 208.68 us/op 0.95
prioritizePeers score 0:0 att 64-0.75 sync 4-0.75 336.11 us/op 334.18 us/op 1.01
prioritizePeers score 0:0 att 64-1 sync 4-1 405.24 us/op 409.26 us/op 0.99
RateTracker 1000000 limit, 1 obj count per request 179.05 ns/op 184.76 ns/op 0.97
RateTracker 1000000 limit, 2 obj count per request 130.26 ns/op 136.36 ns/op 0.96
RateTracker 1000000 limit, 4 obj count per request 104.57 ns/op 110.23 ns/op 0.95
RateTracker 1000000 limit, 8 obj count per request 94.644 ns/op 97.540 ns/op 0.97
RateTracker with prune 3.5230 us/op 4.0380 us/op 0.87
array of 16000 items push then shift 51.576 us/op 51.604 us/op 1.00
LinkedList of 16000 items push then shift 15.093 ns/op 15.801 ns/op 0.96
array of 16000 items push then pop 201.50 ns/op 210.36 ns/op 0.96
LinkedList of 16000 items push then pop 14.326 ns/op 14.421 ns/op 0.99
array of 24000 items push then shift 77.378 us/op 77.369 us/op 1.00
LinkedList of 24000 items push then shift 19.011 ns/op 18.536 ns/op 1.03
array of 24000 items push then pop 199.12 ns/op 196.02 ns/op 1.02
LinkedList of 24000 items push then pop 15.348 ns/op 16.001 ns/op 0.96
intersect bitArray bitLen 8 10.698 ns/op 10.887 ns/op 0.98
intersect array and set length 8 124.28 ns/op 134.15 ns/op 0.93
intersect bitArray bitLen 128 55.600 ns/op 57.850 ns/op 0.96
intersect array and set length 128 1.7442 us/op 1.7887 us/op 0.98
Buffer.concat 32 items 1.8060 ns/op 1.8220 ns/op 0.99
pass gossip attestations to forkchoice per slot 2.8755 ms/op 3.2203 ms/op 0.89
computeDeltas 3.8033 ms/op 3.6385 ms/op 1.05
computeProposerBoostScoreFromBalances 812.18 us/op 809.14 us/op 1.00
altair processAttestation - 250000 vs - 7PWei normalcase 3.4497 ms/op 3.4607 ms/op 1.00
altair processAttestation - 250000 vs - 7PWei worstcase 6.0272 ms/op 5.2505 ms/op 1.15
altair processAttestation - setStatus - 1/6 committees join 175.75 us/op 187.09 us/op 0.94
altair processAttestation - setStatus - 1/3 committees join 342.28 us/op 361.99 us/op 0.95
altair processAttestation - setStatus - 1/2 committees join 489.31 us/op 523.62 us/op 0.93
altair processAttestation - setStatus - 2/3 committees join 635.99 us/op 674.08 us/op 0.94
altair processAttestation - setStatus - 4/5 committees join 904.84 us/op 945.33 us/op 0.96
altair processAttestation - setStatus - 100% committees join 1.0882 ms/op 1.1323 ms/op 0.96
altair processBlock - 250000 vs - 7PWei normalcase 25.657 ms/op 26.000 ms/op 0.99
altair processBlock - 250000 vs - 7PWei normalcase hashState 33.916 ms/op 31.651 ms/op 1.07
altair processBlock - 250000 vs - 7PWei worstcase 91.639 ms/op 84.861 ms/op 1.08
altair processBlock - 250000 vs - 7PWei worstcase hashState 111.42 ms/op 108.93 ms/op 1.02
phase0 processBlock - 250000 vs - 7PWei normalcase 4.7681 ms/op 3.5717 ms/op 1.33
phase0 processBlock - 250000 vs - 7PWei worstcase 52.252 ms/op 52.408 ms/op 1.00
altair processEth1Data - 250000 vs - 7PWei normalcase 1.0628 ms/op 704.93 us/op 1.51
Tree 40 250000 create 687.99 ms/op 704.03 ms/op 0.98
Tree 40 250000 get(125000) 265.64 ns/op 232.35 ns/op 1.14
Tree 40 250000 set(125000) 1.9796 us/op 2.0159 us/op 0.98
Tree 40 250000 toArray() 32.003 ms/op 27.064 ms/op 1.18
Tree 40 250000 iterate all - toArray() + loop 28.344 ms/op 27.208 ms/op 1.04
Tree 40 250000 iterate all - get(i) 113.37 ms/op 124.94 ms/op 0.91
MutableVector 250000 create 18.538 ms/op 19.579 ms/op 0.95
MutableVector 250000 get(125000) 11.601 ns/op 10.737 ns/op 1.08
MutableVector 250000 set(125000) 434.22 ns/op 454.50 ns/op 0.96
MutableVector 250000 toArray() 5.6265 ms/op 5.7572 ms/op 0.98
MutableVector 250000 iterate all - toArray() + loop 5.6784 ms/op 5.9281 ms/op 0.96
MutableVector 250000 iterate all - get(i) 2.6083 ms/op 2.6051 ms/op 1.00
Array 250000 create 5.4377 ms/op 5.9415 ms/op 0.92
Array 250000 clone - spread 2.4012 ms/op 2.4892 ms/op 0.96
Array 250000 get(125000) 1.1460 ns/op 1.2360 ns/op 0.93
Array 250000 set(125000) 1.1480 ns/op 1.2370 ns/op 0.93
Array 250000 iterate all - loop 152.09 us/op 152.93 us/op 0.99
effectiveBalanceIncrements clone Uint8Array 300000 67.673 us/op 43.706 us/op 1.55
effectiveBalanceIncrements clone MutableVector 300000 644.00 ns/op 807.00 ns/op 0.80
effectiveBalanceIncrements rw all Uint8Array 300000 247.30 us/op 247.45 us/op 1.00
effectiveBalanceIncrements rw all MutableVector 300000 132.41 ms/op 148.15 ms/op 0.89
phase0 afterProcessEpoch - 250000 vs - 7PWei 188.20 ms/op 187.11 ms/op 1.01
phase0 beforeProcessEpoch - 250000 vs - 7PWei 114.09 ms/op 117.21 ms/op 0.97
altair processEpoch - mainnet_e81889 646.47 ms/op 647.87 ms/op 1.00
mainnet_e81889 - altair beforeProcessEpoch 168.18 ms/op 173.22 ms/op 0.97
mainnet_e81889 - altair processJustificationAndFinalization 20.235 us/op 18.973 us/op 1.07
mainnet_e81889 - altair processInactivityUpdates 8.7040 ms/op 8.7177 ms/op 1.00
mainnet_e81889 - altair processRewardsAndPenalties 161.29 ms/op 160.22 ms/op 1.01
mainnet_e81889 - altair processRegistryUpdates 2.6660 us/op 2.8730 us/op 0.93
mainnet_e81889 - altair processSlashings 625.00 ns/op 955.00 ns/op 0.65
mainnet_e81889 - altair processEth1DataReset 583.00 ns/op 853.00 ns/op 0.68
mainnet_e81889 - altair processEffectiveBalanceUpdates 2.7039 ms/op 2.1903 ms/op 1.23
mainnet_e81889 - altair processSlashingsReset 5.4900 us/op 5.3230 us/op 1.03
mainnet_e81889 - altair processRandaoMixesReset 5.7070 us/op 4.7720 us/op 1.20
mainnet_e81889 - altair processHistoricalRootsUpdate 778.00 ns/op 764.00 ns/op 1.02
mainnet_e81889 - altair processParticipationFlagUpdates 2.8600 us/op 2.8630 us/op 1.00
mainnet_e81889 - altair processSyncCommitteeUpdates 765.00 ns/op 700.00 ns/op 1.09
mainnet_e81889 - altair afterProcessEpoch 197.95 ms/op 197.12 ms/op 1.00
phase0 processEpoch - mainnet_e58758 616.72 ms/op 624.83 ms/op 0.99
mainnet_e58758 - phase0 beforeProcessEpoch 224.11 ms/op 227.02 ms/op 0.99
mainnet_e58758 - phase0 processJustificationAndFinalization 18.901 us/op 19.678 us/op 0.96
mainnet_e58758 - phase0 processRewardsAndPenalties 123.74 ms/op 128.64 ms/op 0.96
mainnet_e58758 - phase0 processRegistryUpdates 8.8520 us/op 8.7260 us/op 1.01
mainnet_e58758 - phase0 processSlashings 717.00 ns/op 748.00 ns/op 0.96
mainnet_e58758 - phase0 processEth1DataReset 691.00 ns/op 857.00 ns/op 0.81
mainnet_e58758 - phase0 processEffectiveBalanceUpdates 2.0952 ms/op 1.7504 ms/op 1.20
mainnet_e58758 - phase0 processSlashingsReset 3.8300 us/op 4.9670 us/op 0.77
mainnet_e58758 - phase0 processRandaoMixesReset 5.2770 us/op 4.2060 us/op 1.25
mainnet_e58758 - phase0 processHistoricalRootsUpdate 846.00 ns/op 669.00 ns/op 1.26
mainnet_e58758 - phase0 processParticipationRecordUpdates 4.6630 us/op 4.5570 us/op 1.02
mainnet_e58758 - phase0 afterProcessEpoch 163.82 ms/op 162.59 ms/op 1.01
phase0 processEffectiveBalanceUpdates - 250000 normalcase 2.1195 ms/op 1.9427 ms/op 1.09
phase0 processEffectiveBalanceUpdates - 250000 worstcase 0.5 2.4466 ms/op 2.2102 ms/op 1.11
altair processInactivityUpdates - 250000 normalcase 53.368 ms/op 52.201 ms/op 1.02
altair processInactivityUpdates - 250000 worstcase 49.657 ms/op 52.009 ms/op 0.95
phase0 processRegistryUpdates - 250000 normalcase 7.8910 us/op 6.9180 us/op 1.14
phase0 processRegistryUpdates - 250000 badcase_full_deposits 476.28 us/op 381.23 us/op 1.25
phase0 processRegistryUpdates - 250000 worstcase 0.5 227.03 ms/op 226.35 ms/op 1.00
altair processRewardsAndPenalties - 250000 normalcase 130.74 ms/op 129.08 ms/op 1.01
altair processRewardsAndPenalties - 250000 worstcase 138.53 ms/op 135.33 ms/op 1.02
phase0 getAttestationDeltas - 250000 normalcase 11.715 ms/op 12.501 ms/op 0.94
phase0 getAttestationDeltas - 250000 worstcase 11.720 ms/op 12.801 ms/op 0.92
phase0 processSlashings - 250000 worstcase 5.1764 ms/op 5.7398 ms/op 0.90
altair processSyncCommitteeUpdates - 250000 288.86 ms/op 301.36 ms/op 0.96
BeaconState.hashTreeRoot - No change 524.00 ns/op 524.00 ns/op 1.00
BeaconState.hashTreeRoot - 1 full validator 70.064 us/op 66.555 us/op 1.05
BeaconState.hashTreeRoot - 32 full validator 841.54 us/op 722.62 us/op 1.16
BeaconState.hashTreeRoot - 512 full validator 8.4764 ms/op 8.5404 ms/op 0.99
BeaconState.hashTreeRoot - 1 validator.effectiveBalance 89.116 us/op 91.151 us/op 0.98
BeaconState.hashTreeRoot - 32 validator.effectiveBalance 1.4016 ms/op 1.4756 ms/op 0.95
BeaconState.hashTreeRoot - 512 validator.effectiveBalance 16.394 ms/op 17.327 ms/op 0.95
BeaconState.hashTreeRoot - 1 balances 70.712 us/op 63.705 us/op 1.11
BeaconState.hashTreeRoot - 32 balances 698.92 us/op 742.34 us/op 0.94
BeaconState.hashTreeRoot - 512 balances 6.1199 ms/op 7.1192 ms/op 0.86
BeaconState.hashTreeRoot - 250000 balances 109.02 ms/op 96.104 ms/op 1.13
aggregationBits - 2048 els - zipIndexesInBitList 24.840 us/op 25.373 us/op 0.98
regular array get 100000 times 60.559 us/op 60.640 us/op 1.00
wrappedArray get 100000 times 60.636 us/op 60.636 us/op 1.00
arrayWithProxy get 100000 times 28.758 ms/op 28.830 ms/op 1.00
ssz.Root.equals 513.00 ns/op 606.00 ns/op 0.85
byteArrayEquals 447.00 ns/op 509.00 ns/op 0.88
shuffle list - 16384 els 11.274 ms/op 11.198 ms/op 1.01
shuffle list - 250000 els 167.84 ms/op 166.78 ms/op 1.01
processSlot - 1 slots 13.268 us/op 13.300 us/op 1.00
processSlot - 32 slots 1.9197 ms/op 2.2122 ms/op 0.87
getEffectiveBalanceIncrementsZeroInactive - 250000 vs - 7PWei 344.01 us/op 366.87 us/op 0.94
getCommitteeAssignments - req 1 vs - 250000 vc 5.3923 ms/op 5.4594 ms/op 0.99
getCommitteeAssignments - req 100 vs - 250000 vc 7.8169 ms/op 7.9674 ms/op 0.98
getCommitteeAssignments - req 1000 vs - 250000 vc 8.4411 ms/op 8.5887 ms/op 0.98
RootCache.getBlockRootAtSlot - 250000 vs - 7PWei 7.8800 ns/op 7.8400 ns/op 1.01
state getBlockRootAtSlot - 250000 vs - 7PWei 975.80 ns/op 1.1459 us/op 0.85
computeProposers - vc 250000 17.418 ms/op 17.915 ms/op 0.97
computeEpochShuffling - vc 250000 172.78 ms/op 170.81 ms/op 1.01
getNextSyncCommittee - vc 250000 291.61 ms/op 299.65 ms/op 0.97

by benchmarkbot/action

twoeths added a commit that referenced this pull request Aug 21, 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.

2 participants