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

Remove dead code from chain/produceBlock #4844

Merged
merged 1 commit into from
Dec 5, 2022

Conversation

dapplion
Copy link
Contributor

@dapplion dapplion commented Dec 5, 2022

Motivation

Description

  • Remove dead code from chain/produceBlock

@dapplion dapplion requested a review from a team as a code owner December 5, 2022 08:05
@github-actions
Copy link
Contributor

github-actions bot commented Dec 5, 2022

Performance Report

✔️ no performance regression detected

Full benchmark results
Benchmark suite Current: 9728f94 Previous: 1fde79d Ratio
getPubkeys - index2pubkey - req 1000 vs - 250000 vc 1.8047 ms/op 2.3952 ms/op 0.75
getPubkeys - validatorsArr - req 1000 vs - 250000 vc 61.924 us/op 79.363 us/op 0.78
BLS verify - blst-native 2.1744 ms/op 1.9986 ms/op 1.09
BLS verifyMultipleSignatures 3 - blst-native 4.4974 ms/op 4.2332 ms/op 1.06
BLS verifyMultipleSignatures 8 - blst-native 9.7122 ms/op 8.8027 ms/op 1.10
BLS verifyMultipleSignatures 32 - blst-native 35.304 ms/op 34.314 ms/op 1.03
BLS aggregatePubkeys 32 - blst-native 46.733 us/op 48.821 us/op 0.96
BLS aggregatePubkeys 128 - blst-native 181.99 us/op 163.45 us/op 1.11
getAttestationsForBlock 82.806 ms/op 102.00 ms/op 0.81
isKnown best case - 1 super set check 496.00 ns/op 436.00 ns/op 1.14
isKnown normal case - 2 super set checks 487.00 ns/op 421.00 ns/op 1.16
isKnown worse case - 16 super set checks 487.00 ns/op 442.00 ns/op 1.10
CheckpointStateCache - add get delete 9.3170 us/op 9.4070 us/op 0.99
validate gossip signedAggregateAndProof - struct 5.0378 ms/op 4.7969 ms/op 1.05
validate gossip attestation - struct 2.3835 ms/op 2.0977 ms/op 1.14
pickEth1Vote - no votes 2.2559 ms/op 2.0058 ms/op 1.12
pickEth1Vote - max votes 18.957 ms/op 21.064 ms/op 0.90
pickEth1Vote - Eth1Data hashTreeRoot value x2048 12.570 ms/op 11.254 ms/op 1.12
pickEth1Vote - Eth1Data hashTreeRoot tree x2048 20.856 ms/op 21.036 ms/op 0.99
pickEth1Vote - Eth1Data fastSerialize value x2048 1.5385 ms/op 1.6766 ms/op 0.92
pickEth1Vote - Eth1Data fastSerialize tree x2048 13.030 ms/op 15.477 ms/op 0.84
bytes32 toHexString 1.0150 us/op 1.1290 us/op 0.90
bytes32 Buffer.toString(hex) 768.00 ns/op 746.00 ns/op 1.03
bytes32 Buffer.toString(hex) from Uint8Array 1.0660 us/op 1.0470 us/op 1.02
bytes32 Buffer.toString(hex) + 0x 790.00 ns/op 688.00 ns/op 1.15
Object access 1 prop 0.45100 ns/op 0.34100 ns/op 1.32
Map access 1 prop 0.34600 ns/op 0.27500 ns/op 1.26
Object get x1000 11.171 ns/op 13.368 ns/op 0.84
Map get x1000 1.0920 ns/op 0.75700 ns/op 1.44
Object set x1000 74.750 ns/op 85.592 ns/op 0.87
Map set x1000 48.933 ns/op 63.109 ns/op 0.78
Return object 10000 times 0.44210 ns/op 0.39670 ns/op 1.11
Throw Error 10000 times 6.0698 us/op 6.4669 us/op 0.94
fastMsgIdFn sha256 / 200 bytes 4.9000 us/op 5.1520 us/op 0.95
fastMsgIdFn h32 xxhash / 200 bytes 594.00 ns/op 579.00 ns/op 1.03
fastMsgIdFn h64 xxhash / 200 bytes 918.00 ns/op 721.00 ns/op 1.27
fastMsgIdFn sha256 / 1000 bytes 15.504 us/op 14.306 us/op 1.08
fastMsgIdFn h32 xxhash / 1000 bytes 790.00 ns/op 667.00 ns/op 1.18
fastMsgIdFn h64 xxhash / 1000 bytes 993.00 ns/op 881.00 ns/op 1.13
fastMsgIdFn sha256 / 10000 bytes 134.07 us/op 120.15 us/op 1.12
fastMsgIdFn h32 xxhash / 10000 bytes 2.5320 us/op 2.2780 us/op 1.11
fastMsgIdFn h64 xxhash / 10000 bytes 1.9660 us/op 1.7690 us/op 1.11
enrSubnets - fastDeserialize 64 bits 2.7250 us/op 2.7610 us/op 0.99
enrSubnets - ssz BitVector 64 bits 860.00 ns/op 861.00 ns/op 1.00
enrSubnets - fastDeserialize 4 bits 394.00 ns/op 364.00 ns/op 1.08
enrSubnets - ssz BitVector 4 bits 865.00 ns/op 695.00 ns/op 1.24
prioritizePeers score -10:0 att 32-0.1 sync 2-0 86.630 us/op 90.494 us/op 0.96
prioritizePeers score 0:0 att 32-0.25 sync 2-0.25 130.92 us/op 122.51 us/op 1.07
prioritizePeers score 0:0 att 32-0.5 sync 2-0.5 220.04 us/op 228.55 us/op 0.96
prioritizePeers score 0:0 att 64-0.75 sync 4-0.75 349.55 us/op 498.16 us/op 0.70
prioritizePeers score 0:0 att 64-1 sync 4-1 438.69 us/op 482.54 us/op 0.91
RateTracker 1000000 limit, 1 obj count per request 190.98 ns/op 163.35 ns/op 1.17
RateTracker 1000000 limit, 2 obj count per request 140.32 ns/op 116.16 ns/op 1.21
RateTracker 1000000 limit, 4 obj count per request 113.88 ns/op 97.823 ns/op 1.16
RateTracker 1000000 limit, 8 obj count per request 99.999 ns/op 89.142 ns/op 1.12
RateTracker with prune 4.0490 us/op 4.0900 us/op 0.99
array of 16000 items push then shift 51.614 us/op 4.2745 us/op 12.07
LinkedList of 16000 items push then shift 12.711 ns/op 14.993 ns/op 0.85
array of 16000 items push then pop 212.61 ns/op 212.11 ns/op 1.00
LinkedList of 16000 items push then pop 12.152 ns/op 13.661 ns/op 0.89
array of 24000 items push then shift 77.391 us/op 6.3622 us/op 12.16
LinkedList of 24000 items push then shift 13.063 ns/op 16.140 ns/op 0.81
array of 24000 items push then pop 195.51 ns/op 203.90 ns/op 0.96
LinkedList of 24000 items push then pop 12.135 ns/op 14.571 ns/op 0.83
intersect bitArray bitLen 8 10.760 ns/op 9.7590 ns/op 1.10
intersect array and set length 8 130.18 ns/op 152.06 ns/op 0.86
intersect bitArray bitLen 128 55.932 ns/op 57.488 ns/op 0.97
intersect array and set length 128 1.7847 us/op 1.7687 us/op 1.01
Buffer.concat 32 items 1.9140 ns/op 1.8720 ns/op 1.02
pass gossip attestations to forkchoice per slot 3.5867 ms/op 3.5583 ms/op 1.01
computeDeltas 4.4583 ms/op 5.1914 ms/op 0.86
computeProposerBoostScoreFromBalances 808.82 us/op 712.25 us/op 1.14
altair processAttestation - 250000 vs - 7PWei normalcase 3.3041 ms/op 3.7455 ms/op 0.88
altair processAttestation - 250000 vs - 7PWei worstcase 5.4276 ms/op 5.8901 ms/op 0.92
altair processAttestation - setStatus - 1/6 committees join 180.54 us/op 200.75 us/op 0.90
altair processAttestation - setStatus - 1/3 committees join 354.61 us/op 402.99 us/op 0.88
altair processAttestation - setStatus - 1/2 committees join 506.52 us/op 575.29 us/op 0.88
altair processAttestation - setStatus - 2/3 committees join 676.88 us/op 757.32 us/op 0.89
altair processAttestation - setStatus - 4/5 committees join 932.47 us/op 1.0110 ms/op 0.92
altair processAttestation - setStatus - 100% committees join 1.1238 ms/op 1.3092 ms/op 0.86
altair processBlock - 250000 vs - 7PWei normalcase 27.241 ms/op 26.738 ms/op 1.02
altair processBlock - 250000 vs - 7PWei normalcase hashState 33.966 ms/op 43.711 ms/op 0.78
altair processBlock - 250000 vs - 7PWei worstcase 92.774 ms/op 79.531 ms/op 1.17
altair processBlock - 250000 vs - 7PWei worstcase hashState 101.20 ms/op 98.296 ms/op 1.03
phase0 processBlock - 250000 vs - 7PWei normalcase 3.2381 ms/op 3.5202 ms/op 0.92
phase0 processBlock - 250000 vs - 7PWei worstcase 50.728 ms/op 43.190 ms/op 1.17
altair processEth1Data - 250000 vs - 7PWei normalcase 738.10 us/op 734.92 us/op 1.00
vc - 250000 eb 1 eth1 1 we 0 wn 0 - smpl 15 8.2080 us/op 20.075 us/op 0.41
vc - 250000 eb 0.95 eth1 0.1 we 0.05 wn 0 - smpl 219 20.231 us/op 45.087 us/op 0.45
vc - 250000 eb 0.95 eth1 0.3 we 0.05 wn 0 - smpl 42 10.062 us/op 25.600 us/op 0.39
vc - 250000 eb 0.95 eth1 0.7 we 0.05 wn 0 - smpl 18 7.4450 us/op 21.210 us/op 0.35
vc - 250000 eb 0.1 eth1 0.1 we 0 wn 0 - smpl 1020 93.848 us/op 134.01 us/op 0.70
vc - 250000 eb 0.03 eth1 0.03 we 0 wn 0 - smpl 11777 909.44 us/op 1.1139 ms/op 0.82
vc - 250000 eb 0.01 eth1 0.01 we 0 wn 0 - smpl 141069 11.560 ms/op 13.075 ms/op 0.88
vc - 250000 eb 0 eth1 0 we 0 wn 0 - smpl 250000 20.525 ms/op 23.415 ms/op 0.88
vc - 250000 eb 0 eth1 0 we 0 wn 0 nocache - smpl 250000 72.395 ms/op 76.872 ms/op 0.94
vc - 250000 eb 0 eth1 1 we 0 wn 0 - smpl 250000 36.989 ms/op 44.208 ms/op 0.84
vc - 250000 eb 0 eth1 1 we 0 wn 0 nocache - smpl 250000 124.09 ms/op 123.31 ms/op 1.01
Tree 40 250000 create 697.90 ms/op 757.50 ms/op 0.92
Tree 40 250000 get(125000) 225.37 ns/op 257.99 ns/op 0.87
Tree 40 250000 set(125000) 2.1610 us/op 2.1617 us/op 1.00
Tree 40 250000 toArray() 26.611 ms/op 32.374 ms/op 0.82
Tree 40 250000 iterate all - toArray() + loop 27.359 ms/op 32.960 ms/op 0.83
Tree 40 250000 iterate all - get(i) 113.59 ms/op 108.83 ms/op 1.04
MutableVector 250000 create 12.993 ms/op 13.369 ms/op 0.97
MutableVector 250000 get(125000) 10.798 ns/op 11.575 ns/op 0.93
MutableVector 250000 set(125000) 569.08 ns/op 545.94 ns/op 1.04
MutableVector 250000 toArray() 5.9701 ms/op 6.2579 ms/op 0.95
MutableVector 250000 iterate all - toArray() + loop 5.9645 ms/op 6.2043 ms/op 0.96
MutableVector 250000 iterate all - get(i) 2.5884 ms/op 2.6749 ms/op 0.97
Array 250000 create 5.7095 ms/op 5.6554 ms/op 1.01
Array 250000 clone - spread 3.2846 ms/op 3.1076 ms/op 1.06
Array 250000 get(125000) 1.5200 ns/op 1.3990 ns/op 1.09
Array 250000 set(125000) 1.4840 ns/op 1.3240 ns/op 1.12
Array 250000 iterate all - loop 159.89 us/op 119.56 us/op 1.34
effectiveBalanceIncrements clone Uint8Array 300000 335.35 us/op 64.298 us/op 5.22
effectiveBalanceIncrements clone MutableVector 300000 731.00 ns/op 934.00 ns/op 0.78
effectiveBalanceIncrements rw all Uint8Array 300000 247.60 us/op 242.30 us/op 1.02
effectiveBalanceIncrements rw all MutableVector 300000 144.22 ms/op 192.29 ms/op 0.75
phase0 afterProcessEpoch - 250000 vs - 7PWei 199.03 ms/op 165.34 ms/op 1.20
phase0 beforeProcessEpoch - 250000 vs - 7PWei 57.501 ms/op 99.949 ms/op 0.58
altair processEpoch - mainnet_e81889 552.11 ms/op 538.90 ms/op 1.02
mainnet_e81889 - altair beforeProcessEpoch 116.40 ms/op 130.98 ms/op 0.89
mainnet_e81889 - altair processJustificationAndFinalization 18.637 us/op 69.371 us/op 0.27
mainnet_e81889 - altair processInactivityUpdates 8.8066 ms/op 9.3178 ms/op 0.95
mainnet_e81889 - altair processRewardsAndPenalties 109.97 ms/op 89.595 ms/op 1.23
mainnet_e81889 - altair processRegistryUpdates 3.1160 us/op 14.945 us/op 0.21
mainnet_e81889 - altair processSlashings 806.00 ns/op 4.1410 us/op 0.19
mainnet_e81889 - altair processEth1DataReset 770.00 ns/op 4.3760 us/op 0.18
mainnet_e81889 - altair processEffectiveBalanceUpdates 1.9606 ms/op 1.9670 ms/op 1.00
mainnet_e81889 - altair processSlashingsReset 4.7990 us/op 27.487 us/op 0.17
mainnet_e81889 - altair processRandaoMixesReset 6.5110 us/op 25.159 us/op 0.26
mainnet_e81889 - altair processHistoricalRootsUpdate 791.00 ns/op 3.9940 us/op 0.20
mainnet_e81889 - altair processParticipationFlagUpdates 2.8000 us/op 15.278 us/op 0.18
mainnet_e81889 - altair processSyncCommitteeUpdates 705.00 ns/op 3.5080 us/op 0.20
mainnet_e81889 - altair afterProcessEpoch 200.09 ms/op 172.46 ms/op 1.16
phase0 processEpoch - mainnet_e58758 489.49 ms/op 493.85 ms/op 0.99
mainnet_e58758 - phase0 beforeProcessEpoch 179.92 ms/op 260.13 ms/op 0.69
mainnet_e58758 - phase0 processJustificationAndFinalization 18.481 us/op 63.352 us/op 0.29
mainnet_e58758 - phase0 processRewardsAndPenalties 98.948 ms/op 112.07 ms/op 0.88
mainnet_e58758 - phase0 processRegistryUpdates 8.7670 us/op 34.207 us/op 0.26
mainnet_e58758 - phase0 processSlashings 732.00 ns/op 3.9930 us/op 0.18
mainnet_e58758 - phase0 processEth1DataReset 835.00 ns/op 3.8360 us/op 0.22
mainnet_e58758 - phase0 processEffectiveBalanceUpdates 1.8023 ms/op 1.9498 ms/op 0.92
mainnet_e58758 - phase0 processSlashingsReset 4.3340 us/op 19.124 us/op 0.23
mainnet_e58758 - phase0 processRandaoMixesReset 4.7170 us/op 26.058 us/op 0.18
mainnet_e58758 - phase0 processHistoricalRootsUpdate 815.00 ns/op 4.3150 us/op 0.19
mainnet_e58758 - phase0 processParticipationRecordUpdates 5.4210 us/op 24.125 us/op 0.22
mainnet_e58758 - phase0 afterProcessEpoch 165.69 ms/op 134.75 ms/op 1.23
phase0 processEffectiveBalanceUpdates - 250000 normalcase 1.9494 ms/op 1.9822 ms/op 0.98
phase0 processEffectiveBalanceUpdates - 250000 worstcase 0.5 2.1770 ms/op 2.2041 ms/op 0.99
altair processInactivityUpdates - 250000 normalcase 41.419 ms/op 47.645 ms/op 0.87
altair processInactivityUpdates - 250000 worstcase 33.683 ms/op 55.703 ms/op 0.60
phase0 processRegistryUpdates - 250000 normalcase 6.3820 us/op 29.695 us/op 0.21
phase0 processRegistryUpdates - 250000 badcase_full_deposits 376.02 us/op 448.64 us/op 0.84
phase0 processRegistryUpdates - 250000 worstcase 0.5 192.36 ms/op 228.74 ms/op 0.84
altair processRewardsAndPenalties - 250000 normalcase 113.11 ms/op 135.80 ms/op 0.83
altair processRewardsAndPenalties - 250000 worstcase 73.634 ms/op 80.118 ms/op 0.92
phase0 getAttestationDeltas - 250000 normalcase 12.118 ms/op 11.512 ms/op 1.05
phase0 getAttestationDeltas - 250000 worstcase 11.464 ms/op 11.690 ms/op 0.98
phase0 processSlashings - 250000 worstcase 5.5516 ms/op 5.8091 ms/op 0.96
altair processSyncCommitteeUpdates - 250000 297.97 ms/op 267.40 ms/op 1.11
BeaconState.hashTreeRoot - No change 535.00 ns/op 460.00 ns/op 1.16
BeaconState.hashTreeRoot - 1 full validator 70.667 us/op 61.382 us/op 1.15
BeaconState.hashTreeRoot - 32 full validator 718.45 us/op 624.11 us/op 1.15
BeaconState.hashTreeRoot - 512 full validator 6.8378 ms/op 6.7505 ms/op 1.01
BeaconState.hashTreeRoot - 1 validator.effectiveBalance 89.495 us/op 84.040 us/op 1.06
BeaconState.hashTreeRoot - 32 validator.effectiveBalance 1.3063 ms/op 1.1719 ms/op 1.11
BeaconState.hashTreeRoot - 512 validator.effectiveBalance 16.665 ms/op 14.657 ms/op 1.14
BeaconState.hashTreeRoot - 1 balances 68.196 us/op 58.336 us/op 1.17
BeaconState.hashTreeRoot - 32 balances 649.26 us/op 561.78 us/op 1.16
BeaconState.hashTreeRoot - 512 balances 6.3523 ms/op 5.7629 ms/op 1.10
BeaconState.hashTreeRoot - 250000 balances 112.43 ms/op 88.042 ms/op 1.28
aggregationBits - 2048 els - zipIndexesInBitList 23.637 us/op 21.679 us/op 1.09
regular array get 100000 times 60.530 us/op 45.457 us/op 1.33
wrappedArray get 100000 times 60.559 us/op 46.295 us/op 1.31
arrayWithProxy get 100000 times 27.922 ms/op 27.715 ms/op 1.01
ssz.Root.equals 452.00 ns/op 466.00 ns/op 0.97
byteArrayEquals 447.00 ns/op 413.00 ns/op 1.08
shuffle list - 16384 els 11.618 ms/op 9.1569 ms/op 1.27
shuffle list - 250000 els 169.77 ms/op 137.88 ms/op 1.23
processSlot - 1 slots 12.962 us/op 13.045 us/op 0.99
processSlot - 32 slots 1.9778 ms/op 1.8176 ms/op 1.09
getEffectiveBalanceIncrementsZeroInactive - 250000 vs - 7PWei 432.79 us/op 357.18 us/op 1.21
getCommitteeAssignments - req 1 vs - 250000 vc 5.4256 ms/op 4.2755 ms/op 1.27
getCommitteeAssignments - req 100 vs - 250000 vc 8.0072 ms/op 6.1270 ms/op 1.31
getCommitteeAssignments - req 1000 vs - 250000 vc 8.5064 ms/op 6.4460 ms/op 1.32
RootCache.getBlockRootAtSlot - 250000 vs - 7PWei 8.0000 ns/op 7.8900 ns/op 1.01
state getBlockRootAtSlot - 250000 vs - 7PWei 990.90 ns/op 924.44 ns/op 1.07
computeProposers - vc 250000 17.699 ms/op 15.780 ms/op 1.12
computeEpochShuffling - vc 250000 173.60 ms/op 144.12 ms/op 1.20
getNextSyncCommittee - vc 250000 296.00 ms/op 268.06 ms/op 1.10

by benchmarkbot/action

@wemeetagain wemeetagain merged commit e5d9268 into unstable Dec 5, 2022
@wemeetagain wemeetagain deleted the dapplion/deadcode-produceBlock branch December 5, 2022 18:41
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