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

Add unit test for lc header upgrade #5156

Merged
merged 3 commits into from
Feb 16, 2023
Merged

Conversation

g11tech
Copy link
Contributor

@g11tech g11tech commented Feb 15, 2023

Add unit test for lc header upgrade

@g11tech g11tech requested a review from a team as a code owner February 15, 2023 12:51
@g11tech g11tech enabled auto-merge (squash) February 15, 2023 12:56
@github-actions
Copy link
Contributor

github-actions bot commented Feb 15, 2023

Performance Report

✔️ no performance regression detected

Full benchmark results
Benchmark suite Current: 8b13e2d Previous: e518ca4 Ratio
getPubkeys - index2pubkey - req 1000 vs - 250000 vc 751.24 us/op 814.97 us/op 0.92
getPubkeys - validatorsArr - req 1000 vs - 250000 vc 68.962 us/op 46.388 us/op 1.49
BLS verify - blst-native 1.2690 ms/op 1.2010 ms/op 1.06
BLS verifyMultipleSignatures 3 - blst-native 2.5735 ms/op 2.4484 ms/op 1.05
BLS verifyMultipleSignatures 8 - blst-native 5.5521 ms/op 5.2963 ms/op 1.05
BLS verifyMultipleSignatures 32 - blst-native 19.736 ms/op 19.213 ms/op 1.03
BLS aggregatePubkeys 32 - blst-native 26.372 us/op 25.831 us/op 1.02
BLS aggregatePubkeys 128 - blst-native 103.06 us/op 100.19 us/op 1.03
getAttestationsForBlock 60.513 ms/op 56.283 ms/op 1.08
isKnown best case - 1 super set check 269.00 ns/op 286.00 ns/op 0.94
isKnown normal case - 2 super set checks 249.00 ns/op 290.00 ns/op 0.86
isKnown worse case - 16 super set checks 258.00 ns/op 281.00 ns/op 0.92
CheckpointStateCache - add get delete 5.9230 us/op 5.1930 us/op 1.14
validate gossip signedAggregateAndProof - struct 2.8874 ms/op 2.7720 ms/op 1.04
validate gossip attestation - struct 1.3503 ms/op 1.3260 ms/op 1.02
pickEth1Vote - no votes 1.3958 ms/op 1.2209 ms/op 1.14
pickEth1Vote - max votes 9.1852 ms/op 8.2729 ms/op 1.11
pickEth1Vote - Eth1Data hashTreeRoot value x2048 8.9874 ms/op 8.4017 ms/op 1.07
pickEth1Vote - Eth1Data hashTreeRoot tree x2048 16.148 ms/op 13.888 ms/op 1.16
pickEth1Vote - Eth1Data fastSerialize value x2048 739.16 us/op 650.51 us/op 1.14
pickEth1Vote - Eth1Data fastSerialize tree x2048 5.0971 ms/op 8.0271 ms/op 0.63
bytes32 toHexString 522.00 ns/op 494.00 ns/op 1.06
bytes32 Buffer.toString(hex) 406.00 ns/op 351.00 ns/op 1.16
bytes32 Buffer.toString(hex) from Uint8Array 598.00 ns/op 544.00 ns/op 1.10
bytes32 Buffer.toString(hex) + 0x 434.00 ns/op 354.00 ns/op 1.23
Object access 1 prop 0.21500 ns/op 0.17300 ns/op 1.24
Map access 1 prop 0.17800 ns/op 0.16700 ns/op 1.07
Object get x1000 6.9670 ns/op 6.4980 ns/op 1.07
Map get x1000 0.61700 ns/op 0.55300 ns/op 1.12
Object set x1000 79.801 ns/op 52.177 ns/op 1.53
Map set x1000 65.237 ns/op 43.741 ns/op 1.49
Return object 10000 times 0.25280 ns/op 0.23750 ns/op 1.06
Throw Error 10000 times 4.1912 us/op 4.1388 us/op 1.01
fastMsgIdFn sha256 / 200 bytes 3.5740 us/op 3.4770 us/op 1.03
fastMsgIdFn h32 xxhash / 200 bytes 299.00 ns/op 315.00 ns/op 0.95
fastMsgIdFn h64 xxhash / 200 bytes 416.00 ns/op 429.00 ns/op 0.97
fastMsgIdFn sha256 / 1000 bytes 11.778 us/op 11.869 us/op 0.99
fastMsgIdFn h32 xxhash / 1000 bytes 424.00 ns/op 457.00 ns/op 0.93
fastMsgIdFn h64 xxhash / 1000 bytes 497.00 ns/op 486.00 ns/op 1.02
fastMsgIdFn sha256 / 10000 bytes 104.45 us/op 104.07 us/op 1.00
fastMsgIdFn h32 xxhash / 10000 bytes 1.9700 us/op 1.9080 us/op 1.03
fastMsgIdFn h64 xxhash / 10000 bytes 1.3900 us/op 1.3480 us/op 1.03
enrSubnets - fastDeserialize 64 bits 1.3110 us/op 1.2900 us/op 1.02
enrSubnets - ssz BitVector 64 bits 494.00 ns/op 482.00 ns/op 1.02
enrSubnets - fastDeserialize 4 bits 170.00 ns/op 174.00 ns/op 0.98
enrSubnets - ssz BitVector 4 bits 489.00 ns/op 496.00 ns/op 0.99
prioritizePeers score -10:0 att 32-0.1 sync 2-0 103.17 us/op 96.856 us/op 1.07
prioritizePeers score 0:0 att 32-0.25 sync 2-0.25 129.81 us/op 125.43 us/op 1.03
prioritizePeers score 0:0 att 32-0.5 sync 2-0.5 219.23 us/op 175.39 us/op 1.25
prioritizePeers score 0:0 att 64-0.75 sync 4-0.75 375.29 us/op 306.90 us/op 1.22
prioritizePeers score 0:0 att 64-1 sync 4-1 412.08 us/op 375.01 us/op 1.10
array of 16000 items push then shift 1.6636 us/op 1.6643 us/op 1.00
LinkedList of 16000 items push then shift 9.0080 ns/op 8.9770 ns/op 1.00
array of 16000 items push then pop 133.06 ns/op 79.658 ns/op 1.67
LinkedList of 16000 items push then pop 10.485 ns/op 8.6740 ns/op 1.21
array of 24000 items push then shift 2.4702 us/op 2.3630 us/op 1.05
LinkedList of 24000 items push then shift 10.896 ns/op 8.7730 ns/op 1.24
array of 24000 items push then pop 102.67 ns/op 78.843 ns/op 1.30
LinkedList of 24000 items push then pop 10.462 ns/op 8.5240 ns/op 1.23
intersect bitArray bitLen 8 13.992 ns/op 13.510 ns/op 1.04
intersect array and set length 8 125.41 ns/op 78.641 ns/op 1.59
intersect bitArray bitLen 128 45.160 ns/op 44.364 ns/op 1.02
intersect array and set length 128 1.0792 us/op 1.0581 us/op 1.02
Buffer.concat 32 items 3.0040 us/op 2.6830 us/op 1.12
Uint8Array.set 32 items 2.7680 us/op 2.9460 us/op 0.94
pass gossip attestations to forkchoice per slot 3.1844 ms/op 2.3229 ms/op 1.37
computeDeltas 2.8659 ms/op 3.2718 ms/op 0.88
computeProposerBoostScoreFromBalances 1.7280 ms/op 1.8198 ms/op 0.95
altair processAttestation - 250000 vs - 7PWei normalcase 2.2228 ms/op 2.7474 ms/op 0.81
altair processAttestation - 250000 vs - 7PWei worstcase 3.4519 ms/op 4.4075 ms/op 0.78
altair processAttestation - setStatus - 1/6 committees join 143.04 us/op 145.69 us/op 0.98
altair processAttestation - setStatus - 1/3 committees join 281.04 us/op 291.56 us/op 0.96
altair processAttestation - setStatus - 1/2 committees join 377.79 us/op 383.64 us/op 0.98
altair processAttestation - setStatus - 2/3 committees join 469.65 us/op 485.88 us/op 0.97
altair processAttestation - setStatus - 4/5 committees join 660.05 us/op 699.78 us/op 0.94
altair processAttestation - setStatus - 100% committees join 724.92 us/op 800.73 us/op 0.91
altair processBlock - 250000 vs - 7PWei normalcase 18.733 ms/op 22.463 ms/op 0.83
altair processBlock - 250000 vs - 7PWei normalcase hashState 25.699 ms/op 28.233 ms/op 0.91
altair processBlock - 250000 vs - 7PWei worstcase 54.089 ms/op 55.446 ms/op 0.98
altair processBlock - 250000 vs - 7PWei worstcase hashState 66.609 ms/op 77.978 ms/op 0.85
phase0 processBlock - 250000 vs - 7PWei normalcase 1.9735 ms/op 2.6501 ms/op 0.74
phase0 processBlock - 250000 vs - 7PWei worstcase 26.762 ms/op 33.882 ms/op 0.79
altair processEth1Data - 250000 vs - 7PWei normalcase 438.41 us/op 611.32 us/op 0.72
vc - 250000 eb 1 eth1 1 we 0 wn 0 - smpl 15 6.7330 us/op 13.786 us/op 0.49
vc - 250000 eb 0.95 eth1 0.1 we 0.05 wn 0 - smpl 219 19.261 us/op 34.366 us/op 0.56
vc - 250000 eb 0.95 eth1 0.3 we 0.05 wn 0 - smpl 42 8.5190 us/op 16.871 us/op 0.50
vc - 250000 eb 0.95 eth1 0.7 we 0.05 wn 0 - smpl 18 7.8070 us/op 13.077 us/op 0.60
vc - 250000 eb 0.1 eth1 0.1 we 0 wn 0 - smpl 1020 101.85 us/op 124.19 us/op 0.82
vc - 250000 eb 0.03 eth1 0.03 we 0 wn 0 - smpl 11777 644.14 us/op 720.68 us/op 0.89
vc - 250000 eb 0.01 eth1 0.01 we 0 wn 0 - smpl 16384 931.48 us/op 942.14 us/op 0.99
vc - 250000 eb 0 eth1 0 we 0 wn 0 - smpl 16384 895.45 us/op 922.99 us/op 0.97
vc - 250000 eb 0 eth1 0 we 0 wn 0 nocache - smpl 16384 2.3545 ms/op 2.6774 ms/op 0.88
vc - 250000 eb 0 eth1 1 we 0 wn 0 - smpl 16384 1.5157 ms/op 1.6533 ms/op 0.92
vc - 250000 eb 0 eth1 1 we 0 wn 0 nocache - smpl 16384 3.8802 ms/op 6.6091 ms/op 0.59
Tree 40 250000 create 319.44 ms/op 451.28 ms/op 0.71
Tree 40 250000 get(125000) 182.40 ns/op 203.71 ns/op 0.90
Tree 40 250000 set(125000) 990.61 ns/op 1.2914 us/op 0.77
Tree 40 250000 toArray() 17.936 ms/op 23.894 ms/op 0.75
Tree 40 250000 iterate all - toArray() + loop 17.411 ms/op 23.752 ms/op 0.73
Tree 40 250000 iterate all - get(i) 66.691 ms/op 79.932 ms/op 0.83
MutableVector 250000 create 9.9364 ms/op 13.155 ms/op 0.76
MutableVector 250000 get(125000) 6.4060 ns/op 6.8470 ns/op 0.94
MutableVector 250000 set(125000) 277.09 ns/op 296.82 ns/op 0.93
MutableVector 250000 toArray() 2.9539 ms/op 4.3433 ms/op 0.68
MutableVector 250000 iterate all - toArray() + loop 3.3227 ms/op 3.9880 ms/op 0.83
MutableVector 250000 iterate all - get(i) 1.5461 ms/op 1.5515 ms/op 1.00
Array 250000 create 2.5489 ms/op 3.2521 ms/op 0.78
Array 250000 clone - spread 1.1859 ms/op 1.2919 ms/op 0.92
Array 250000 get(125000) 0.56100 ns/op 0.74900 ns/op 0.75
Array 250000 set(125000) 0.64700 ns/op 0.88300 ns/op 0.73
Array 250000 iterate all - loop 82.793 us/op 93.898 us/op 0.88
effectiveBalanceIncrements clone Uint8Array 300000 28.183 us/op 49.689 us/op 0.57
effectiveBalanceIncrements clone MutableVector 300000 363.00 ns/op 458.00 ns/op 0.79
effectiveBalanceIncrements rw all Uint8Array 300000 169.25 us/op 181.55 us/op 0.93
effectiveBalanceIncrements rw all MutableVector 300000 84.473 ms/op 99.968 ms/op 0.85
phase0 afterProcessEpoch - 250000 vs - 7PWei 114.29 ms/op 123.14 ms/op 0.93
phase0 beforeProcessEpoch - 250000 vs - 7PWei 40.838 ms/op 49.149 ms/op 0.83
altair processEpoch - mainnet_e81889 305.87 ms/op 338.15 ms/op 0.90
mainnet_e81889 - altair beforeProcessEpoch 65.389 ms/op 74.032 ms/op 0.88
mainnet_e81889 - altair processJustificationAndFinalization 16.539 us/op 21.731 us/op 0.76
mainnet_e81889 - altair processInactivityUpdates 6.0958 ms/op 6.2038 ms/op 0.98
mainnet_e81889 - altair processRewardsAndPenalties 52.445 ms/op 77.245 ms/op 0.68
mainnet_e81889 - altair processRegistryUpdates 2.7210 us/op 6.6500 us/op 0.41
mainnet_e81889 - altair processSlashings 509.00 ns/op 1.6380 us/op 0.31
mainnet_e81889 - altair processEth1DataReset 528.00 ns/op 1.7320 us/op 0.30
mainnet_e81889 - altair processEffectiveBalanceUpdates 1.2700 ms/op 2.5578 ms/op 0.50
mainnet_e81889 - altair processSlashingsReset 4.5420 us/op 10.678 us/op 0.43
mainnet_e81889 - altair processRandaoMixesReset 4.4810 us/op 11.803 us/op 0.38
mainnet_e81889 - altair processHistoricalRootsUpdate 548.00 ns/op 1.8940 us/op 0.29
mainnet_e81889 - altair processParticipationFlagUpdates 2.1980 us/op 5.6160 us/op 0.39
mainnet_e81889 - altair processSyncCommitteeUpdates 940.00 ns/op 1.8740 us/op 0.50
mainnet_e81889 - altair afterProcessEpoch 117.03 ms/op 147.13 ms/op 0.80
phase0 processEpoch - mainnet_e58758 347.97 ms/op 482.99 ms/op 0.72
mainnet_e58758 - phase0 beforeProcessEpoch 136.88 ms/op 200.36 ms/op 0.68
mainnet_e58758 - phase0 processJustificationAndFinalization 16.128 us/op 37.098 us/op 0.43
mainnet_e58758 - phase0 processRewardsAndPenalties 64.460 ms/op 87.071 ms/op 0.74
mainnet_e58758 - phase0 processRegistryUpdates 7.5680 us/op 16.006 us/op 0.47
mainnet_e58758 - phase0 processSlashings 480.00 ns/op 1.0630 us/op 0.45
mainnet_e58758 - phase0 processEth1DataReset 472.00 ns/op 636.00 ns/op 0.74
mainnet_e58758 - phase0 processEffectiveBalanceUpdates 957.06 us/op 1.0575 ms/op 0.90
mainnet_e58758 - phase0 processSlashingsReset 4.0630 us/op 6.5020 us/op 0.62
mainnet_e58758 - phase0 processRandaoMixesReset 4.5950 us/op 6.2950 us/op 0.73
mainnet_e58758 - phase0 processHistoricalRootsUpdate 613.00 ns/op 740.00 ns/op 0.83
mainnet_e58758 - phase0 processParticipationRecordUpdates 3.9400 us/op 5.4370 us/op 0.72
mainnet_e58758 - phase0 afterProcessEpoch 97.792 ms/op 103.87 ms/op 0.94
phase0 processEffectiveBalanceUpdates - 250000 normalcase 1.2451 ms/op 1.2963 ms/op 0.96
phase0 processEffectiveBalanceUpdates - 250000 worstcase 0.5 1.5007 ms/op 1.5833 ms/op 0.95
altair processInactivityUpdates - 250000 normalcase 25.170 ms/op 25.787 ms/op 0.98
altair processInactivityUpdates - 250000 worstcase 26.086 ms/op 25.419 ms/op 1.03
phase0 processRegistryUpdates - 250000 normalcase 6.4340 us/op 10.639 us/op 0.60
phase0 processRegistryUpdates - 250000 badcase_full_deposits 227.49 us/op 283.54 us/op 0.80
phase0 processRegistryUpdates - 250000 worstcase 0.5 126.19 ms/op 145.19 ms/op 0.87
altair processRewardsAndPenalties - 250000 normalcase 67.214 ms/op 70.597 ms/op 0.95
altair processRewardsAndPenalties - 250000 worstcase 69.371 ms/op 74.342 ms/op 0.93
phase0 getAttestationDeltas - 250000 normalcase 6.8576 ms/op 6.7383 ms/op 1.02
phase0 getAttestationDeltas - 250000 worstcase 6.5917 ms/op 6.7532 ms/op 0.98
phase0 processSlashings - 250000 worstcase 3.8303 ms/op 3.5060 ms/op 1.09
altair processSyncCommitteeUpdates - 250000 182.41 ms/op 178.94 ms/op 1.02
BeaconState.hashTreeRoot - No change 320.00 ns/op 264.00 ns/op 1.21
BeaconState.hashTreeRoot - 1 full validator 57.714 us/op 51.629 us/op 1.12
BeaconState.hashTreeRoot - 32 full validator 548.59 us/op 530.86 us/op 1.03
BeaconState.hashTreeRoot - 512 full validator 5.4534 ms/op 5.8237 ms/op 0.94
BeaconState.hashTreeRoot - 1 validator.effectiveBalance 67.877 us/op 63.901 us/op 1.06
BeaconState.hashTreeRoot - 32 validator.effectiveBalance 866.83 us/op 891.15 us/op 0.97
BeaconState.hashTreeRoot - 512 validator.effectiveBalance 11.817 ms/op 12.122 ms/op 0.97
BeaconState.hashTreeRoot - 1 balances 52.652 us/op 50.353 us/op 1.05
BeaconState.hashTreeRoot - 32 balances 449.68 us/op 428.60 us/op 1.05
BeaconState.hashTreeRoot - 512 balances 4.5171 ms/op 4.3557 ms/op 1.04
BeaconState.hashTreeRoot - 250000 balances 71.698 ms/op 75.431 ms/op 0.95
aggregationBits - 2048 els - zipIndexesInBitList 16.952 us/op 16.057 us/op 1.06
regular array get 100000 times 33.217 us/op 44.090 us/op 0.75
wrappedArray get 100000 times 33.167 us/op 34.010 us/op 0.98
arrayWithProxy get 100000 times 15.053 ms/op 16.511 ms/op 0.91
ssz.Root.equals 542.00 ns/op 557.00 ns/op 0.97
byteArrayEquals 554.00 ns/op 547.00 ns/op 1.01
shuffle list - 16384 els 6.9648 ms/op 6.8584 ms/op 1.02
shuffle list - 250000 els 101.97 ms/op 100.96 ms/op 1.01
processSlot - 1 slots 9.0860 us/op 8.5380 us/op 1.06
processSlot - 32 slots 1.3974 ms/op 1.3463 ms/op 1.04
getEffectiveBalanceIncrementsZeroInactive - 250000 vs - 7PWei 205.52 us/op 191.94 us/op 1.07
getCommitteeAssignments - req 1 vs - 250000 vc 2.9201 ms/op 2.9429 ms/op 0.99
getCommitteeAssignments - req 100 vs - 250000 vc 4.1940 ms/op 4.1017 ms/op 1.02
getCommitteeAssignments - req 1000 vs - 250000 vc 4.5276 ms/op 4.5208 ms/op 1.00
RootCache.getBlockRootAtSlot - 250000 vs - 7PWei 5.0800 ns/op 4.7900 ns/op 1.06
state getBlockRootAtSlot - 250000 vs - 7PWei 630.32 ns/op 827.26 ns/op 0.76
computeProposers - vc 250000 11.620 ms/op 10.358 ms/op 1.12
computeEpochShuffling - vc 250000 105.86 ms/op 102.78 ms/op 1.03
getNextSyncCommittee - vc 250000 197.76 ms/op 174.59 ms/op 1.13

by benchmarkbot/action

@g11tech g11tech merged commit 6ce9c2f into unstable Feb 16, 2023
@g11tech g11tech deleted the g11tech/upgrade-lc-test branch February 16, 2023 03:02
@wemeetagain
Copy link
Member

🎉 This PR is included in v1.6.0 🎉

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