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 iteration order in onBlobsSidecarsByRange #4876

Merged
merged 1 commit into from
Dec 7, 2022

Conversation

dapplion
Copy link
Contributor

@dapplion dapplion commented Dec 7, 2022

Motivation

Description

  • Fix iteration order in onBlobsSidecarsByRange

@dapplion dapplion requested a review from a team as a code owner December 7, 2022 07:19
@github-actions
Copy link
Contributor

github-actions bot commented Dec 7, 2022

Performance Report

✔️ no performance regression detected

Full benchmark results
Benchmark suite Current: a1208e3 Previous: 17c4d85 Ratio
getPubkeys - index2pubkey - req 1000 vs - 250000 vc 2.2597 ms/op 1.7865 ms/op 1.26
getPubkeys - validatorsArr - req 1000 vs - 250000 vc 63.802 us/op 62.338 us/op 1.02
BLS verify - blst-native 2.1727 ms/op 2.1733 ms/op 1.00
BLS verifyMultipleSignatures 3 - blst-native 4.4922 ms/op 4.4870 ms/op 1.00
BLS verifyMultipleSignatures 8 - blst-native 9.7158 ms/op 9.7010 ms/op 1.00
BLS verifyMultipleSignatures 32 - blst-native 35.280 ms/op 35.257 ms/op 1.00
BLS aggregatePubkeys 32 - blst-native 46.809 us/op 46.708 us/op 1.00
BLS aggregatePubkeys 128 - blst-native 182.52 us/op 182.04 us/op 1.00
getAttestationsForBlock 87.898 ms/op 82.827 ms/op 1.06
isKnown best case - 1 super set check 467.00 ns/op 504.00 ns/op 0.93
isKnown normal case - 2 super set checks 458.00 ns/op 487.00 ns/op 0.94
isKnown worse case - 16 super set checks 457.00 ns/op 489.00 ns/op 0.93
CheckpointStateCache - add get delete 9.3970 us/op 8.9760 us/op 1.05
validate gossip signedAggregateAndProof - struct 5.0514 ms/op 5.0240 ms/op 1.01
validate gossip attestation - struct 2.3807 ms/op 2.3764 ms/op 1.00
pickEth1Vote - no votes 2.4910 ms/op 2.1464 ms/op 1.16
pickEth1Vote - max votes 20.897 ms/op 17.590 ms/op 1.19
pickEth1Vote - Eth1Data hashTreeRoot value x2048 12.730 ms/op 12.176 ms/op 1.05
pickEth1Vote - Eth1Data hashTreeRoot tree x2048 21.359 ms/op 19.560 ms/op 1.09
pickEth1Vote - Eth1Data fastSerialize value x2048 1.4863 ms/op 1.4423 ms/op 1.03
pickEth1Vote - Eth1Data fastSerialize tree x2048 14.440 ms/op 12.000 ms/op 1.20
bytes32 toHexString 1.0210 us/op 922.00 ns/op 1.11
bytes32 Buffer.toString(hex) 753.00 ns/op 730.00 ns/op 1.03
bytes32 Buffer.toString(hex) from Uint8Array 1.0040 us/op 1.0130 us/op 0.99
bytes32 Buffer.toString(hex) + 0x 757.00 ns/op 757.00 ns/op 1.00
Object access 1 prop 0.39300 ns/op 0.33900 ns/op 1.16
Map access 1 prop 0.31700 ns/op 0.33700 ns/op 0.94
Object get x1000 11.031 ns/op 11.216 ns/op 0.98
Map get x1000 0.94000 ns/op 0.92500 ns/op 1.02
Object set x1000 85.524 ns/op 70.867 ns/op 1.21
Map set x1000 56.511 ns/op 46.950 ns/op 1.20
Return object 10000 times 0.44120 ns/op 0.43840 ns/op 1.01
Throw Error 10000 times 6.0084 us/op 6.0904 us/op 0.99
fastMsgIdFn sha256 / 200 bytes 4.8950 us/op 4.9000 us/op 1.00
fastMsgIdFn h32 xxhash / 200 bytes 610.00 ns/op 536.00 ns/op 1.14
fastMsgIdFn h64 xxhash / 200 bytes 838.00 ns/op 799.00 ns/op 1.05
fastMsgIdFn sha256 / 1000 bytes 15.579 us/op 15.495 us/op 1.01
fastMsgIdFn h32 xxhash / 1000 bytes 772.00 ns/op 718.00 ns/op 1.08
fastMsgIdFn h64 xxhash / 1000 bytes 889.00 ns/op 851.00 ns/op 1.04
fastMsgIdFn sha256 / 10000 bytes 133.82 us/op 133.80 us/op 1.00
fastMsgIdFn h32 xxhash / 10000 bytes 2.6610 us/op 2.5280 us/op 1.05
fastMsgIdFn h64 xxhash / 10000 bytes 1.9410 us/op 1.8940 us/op 1.02
enrSubnets - fastDeserialize 64 bits 2.7530 us/op 2.6510 us/op 1.04
enrSubnets - ssz BitVector 64 bits 816.00 ns/op 803.00 ns/op 1.02
enrSubnets - fastDeserialize 4 bits 402.00 ns/op 374.00 ns/op 1.07
enrSubnets - ssz BitVector 4 bits 819.00 ns/op 824.00 ns/op 0.99
prioritizePeers score -10:0 att 32-0.1 sync 2-0 84.664 us/op 83.491 us/op 1.01
prioritizePeers score 0:0 att 32-0.25 sync 2-0.25 133.15 us/op 137.80 us/op 0.97
prioritizePeers score 0:0 att 32-0.5 sync 2-0.5 218.07 us/op 206.32 us/op 1.06
prioritizePeers score 0:0 att 64-0.75 sync 4-0.75 343.82 us/op 346.49 us/op 0.99
prioritizePeers score 0:0 att 64-1 sync 4-1 437.10 us/op 453.47 us/op 0.96
RateTracker 1000000 limit, 1 obj count per request 193.06 ns/op 189.94 ns/op 1.02
RateTracker 1000000 limit, 2 obj count per request 140.88 ns/op 138.33 ns/op 1.02
RateTracker 1000000 limit, 4 obj count per request 113.79 ns/op 111.29 ns/op 1.02
RateTracker 1000000 limit, 8 obj count per request 104.23 ns/op 98.946 ns/op 1.05
RateTracker with prune 4.2380 us/op 3.9130 us/op 1.08
array of 16000 items push then shift 51.639 us/op 51.607 us/op 1.00
LinkedList of 16000 items push then shift 12.446 ns/op 12.621 ns/op 0.99
array of 16000 items push then pop 208.74 ns/op 208.73 ns/op 1.00
LinkedList of 16000 items push then pop 12.215 ns/op 12.294 ns/op 0.99
array of 24000 items push then shift 77.398 us/op 77.376 us/op 1.00
LinkedList of 24000 items push then shift 12.999 ns/op 12.775 ns/op 1.02
array of 24000 items push then pop 193.63 ns/op 200.99 ns/op 0.96
LinkedList of 24000 items push then pop 12.314 ns/op 12.215 ns/op 1.01
intersect bitArray bitLen 8 10.741 ns/op 10.674 ns/op 1.01
intersect array and set length 8 145.42 ns/op 135.13 ns/op 1.08
intersect bitArray bitLen 128 57.613 ns/op 57.981 ns/op 0.99
intersect array and set length 128 1.8031 us/op 1.8278 us/op 0.99
Buffer.concat 32 items 1.7720 ns/op 1.7620 ns/op 1.01
pass gossip attestations to forkchoice per slot 5.5818 ms/op 3.6193 ms/op 1.54
computeDeltas 4.7577 ms/op 4.5552 ms/op 1.04
computeProposerBoostScoreFromBalances 804.81 us/op 803.76 us/op 1.00
altair processAttestation - 250000 vs - 7PWei normalcase 3.6612 ms/op 3.5124 ms/op 1.04
altair processAttestation - 250000 vs - 7PWei worstcase 5.3732 ms/op 5.6822 ms/op 0.95
altair processAttestation - setStatus - 1/6 committees join 183.59 us/op 181.00 us/op 1.01
altair processAttestation - setStatus - 1/3 committees join 358.22 us/op 352.80 us/op 1.02
altair processAttestation - setStatus - 1/2 committees join 514.68 us/op 507.60 us/op 1.01
altair processAttestation - setStatus - 2/3 committees join 678.92 us/op 661.37 us/op 1.03
altair processAttestation - setStatus - 4/5 committees join 941.53 us/op 922.42 us/op 1.02
altair processAttestation - setStatus - 100% committees join 1.1293 ms/op 1.1120 ms/op 1.02
altair processBlock - 250000 vs - 7PWei normalcase 24.764 ms/op 26.851 ms/op 0.92
altair processBlock - 250000 vs - 7PWei normalcase hashState 39.286 ms/op 33.677 ms/op 1.17
altair processBlock - 250000 vs - 7PWei worstcase 81.684 ms/op 91.382 ms/op 0.89
altair processBlock - 250000 vs - 7PWei worstcase hashState 102.50 ms/op 100.46 ms/op 1.02
phase0 processBlock - 250000 vs - 7PWei normalcase 3.3738 ms/op 3.2916 ms/op 1.02
phase0 processBlock - 250000 vs - 7PWei worstcase 51.725 ms/op 51.348 ms/op 1.01
altair processEth1Data - 250000 vs - 7PWei normalcase 734.72 us/op 737.71 us/op 1.00
vc - 250000 eb 1 eth1 1 we 0 wn 0 - smpl 15 6.4290 us/op 7.9190 us/op 0.81
vc - 250000 eb 0.95 eth1 0.1 we 0.05 wn 0 - smpl 219 20.675 us/op 23.682 us/op 0.87
vc - 250000 eb 0.95 eth1 0.3 we 0.05 wn 0 - smpl 42 8.9230 us/op 9.0460 us/op 0.99
vc - 250000 eb 0.95 eth1 0.7 we 0.05 wn 0 - smpl 18 6.8140 us/op 7.9400 us/op 0.86
vc - 250000 eb 0.1 eth1 0.1 we 0 wn 0 - smpl 1020 92.989 us/op 98.526 us/op 0.94
vc - 250000 eb 0.03 eth1 0.03 we 0 wn 0 - smpl 11777 922.29 us/op 934.67 us/op 0.99
vc - 250000 eb 0.01 eth1 0.01 we 0 wn 0 - smpl 141069 12.193 ms/op 11.752 ms/op 1.04
vc - 250000 eb 0 eth1 0 we 0 wn 0 - smpl 250000 21.553 ms/op 21.271 ms/op 1.01
vc - 250000 eb 0 eth1 0 we 0 wn 0 nocache - smpl 250000 72.012 ms/op 73.812 ms/op 0.98
vc - 250000 eb 0 eth1 1 we 0 wn 0 - smpl 250000 37.060 ms/op 37.824 ms/op 0.98
vc - 250000 eb 0 eth1 1 we 0 wn 0 nocache - smpl 250000 121.87 ms/op 120.96 ms/op 1.01
Tree 40 250000 create 699.24 ms/op 698.94 ms/op 1.00
Tree 40 250000 get(125000) 230.44 ns/op 256.62 ns/op 0.90
Tree 40 250000 set(125000) 2.5264 us/op 2.1495 us/op 1.18
Tree 40 250000 toArray() 28.993 ms/op 27.243 ms/op 1.06
Tree 40 250000 iterate all - toArray() + loop 29.022 ms/op 27.614 ms/op 1.05
Tree 40 250000 iterate all - get(i) 114.67 ms/op 112.66 ms/op 1.02
MutableVector 250000 create 15.939 ms/op 13.431 ms/op 1.19
MutableVector 250000 get(125000) 10.633 ns/op 10.681 ns/op 1.00
MutableVector 250000 set(125000) 582.41 ns/op 591.24 ns/op 0.99
MutableVector 250000 toArray() 6.3672 ms/op 6.1881 ms/op 1.03
MutableVector 250000 iterate all - toArray() + loop 6.5587 ms/op 6.5149 ms/op 1.01
MutableVector 250000 iterate all - get(i) 2.8371 ms/op 2.8697 ms/op 0.99
Array 250000 create 6.3069 ms/op 5.4269 ms/op 1.16
Array 250000 clone - spread 3.4401 ms/op 2.2871 ms/op 1.50
Array 250000 get(125000) 1.5310 ns/op 1.1380 ns/op 1.35
Array 250000 set(125000) 1.5460 ns/op 1.1230 ns/op 1.38
Array 250000 iterate all - loop 153.07 us/op 152.68 us/op 1.00
effectiveBalanceIncrements clone Uint8Array 300000 192.74 us/op 392.18 us/op 0.49
effectiveBalanceIncrements clone MutableVector 300000 688.00 ns/op 679.00 ns/op 1.01
effectiveBalanceIncrements rw all Uint8Array 300000 247.60 us/op 247.61 us/op 1.00
effectiveBalanceIncrements rw all MutableVector 300000 144.38 ms/op 144.78 ms/op 1.00
phase0 afterProcessEpoch - 250000 vs - 7PWei 188.90 ms/op 199.21 ms/op 0.95
phase0 beforeProcessEpoch - 250000 vs - 7PWei 59.609 ms/op 58.069 ms/op 1.03
altair processEpoch - mainnet_e81889 572.04 ms/op 570.97 ms/op 1.00
mainnet_e81889 - altair beforeProcessEpoch 82.077 ms/op 80.236 ms/op 1.02
mainnet_e81889 - altair processJustificationAndFinalization 16.721 us/op 19.451 us/op 0.86
mainnet_e81889 - altair processInactivityUpdates 17.355 ms/op 9.0018 ms/op 1.93
mainnet_e81889 - altair processRewardsAndPenalties 80.681 ms/op 131.42 ms/op 0.61
mainnet_e81889 - altair processRegistryUpdates 2.5230 us/op 2.7970 us/op 0.90
mainnet_e81889 - altair processSlashings 531.00 ns/op 542.00 ns/op 0.98
mainnet_e81889 - altair processEth1DataReset 600.00 ns/op 612.00 ns/op 0.98
mainnet_e81889 - altair processEffectiveBalanceUpdates 1.9806 ms/op 2.1020 ms/op 0.94
mainnet_e81889 - altair processSlashingsReset 4.0320 us/op 4.1160 us/op 0.98
mainnet_e81889 - altair processRandaoMixesReset 4.4660 us/op 4.5650 us/op 0.98
mainnet_e81889 - altair processHistoricalRootsUpdate 627.00 ns/op 720.00 ns/op 0.87
mainnet_e81889 - altair processParticipationFlagUpdates 2.2500 us/op 2.3890 us/op 0.94
mainnet_e81889 - altair processSyncCommitteeUpdates 492.00 ns/op 646.00 ns/op 0.76
mainnet_e81889 - altair afterProcessEpoch 200.60 ms/op 198.60 ms/op 1.01
phase0 processEpoch - mainnet_e58758 495.19 ms/op 488.50 ms/op 1.01
mainnet_e58758 - phase0 beforeProcessEpoch 187.02 ms/op 178.51 ms/op 1.05
mainnet_e58758 - phase0 processJustificationAndFinalization 17.815 us/op 18.278 us/op 0.97
mainnet_e58758 - phase0 processRewardsAndPenalties 119.54 ms/op 101.02 ms/op 1.18
mainnet_e58758 - phase0 processRegistryUpdates 7.6280 us/op 8.2860 us/op 0.92
mainnet_e58758 - phase0 processSlashings 560.00 ns/op 652.00 ns/op 0.86
mainnet_e58758 - phase0 processEth1DataReset 589.00 ns/op 722.00 ns/op 0.82
mainnet_e58758 - phase0 processEffectiveBalanceUpdates 1.7873 ms/op 1.6514 ms/op 1.08
mainnet_e58758 - phase0 processSlashingsReset 4.0270 us/op 4.3890 us/op 0.92
mainnet_e58758 - phase0 processRandaoMixesReset 4.2480 us/op 4.3940 us/op 0.97
mainnet_e58758 - phase0 processHistoricalRootsUpdate 617.00 ns/op 766.00 ns/op 0.81
mainnet_e58758 - phase0 processParticipationRecordUpdates 3.4820 us/op 3.8380 us/op 0.91
mainnet_e58758 - phase0 afterProcessEpoch 164.42 ms/op 163.63 ms/op 1.00
phase0 processEffectiveBalanceUpdates - 250000 normalcase 1.9398 ms/op 1.9713 ms/op 0.98
phase0 processEffectiveBalanceUpdates - 250000 worstcase 0.5 2.1673 ms/op 2.1841 ms/op 0.99
altair processInactivityUpdates - 250000 normalcase 36.931 ms/op 40.038 ms/op 0.92
altair processInactivityUpdates - 250000 worstcase 42.877 ms/op 33.422 ms/op 1.28
phase0 processRegistryUpdates - 250000 normalcase 6.2040 us/op 6.9980 us/op 0.89
phase0 processRegistryUpdates - 250000 badcase_full_deposits 375.54 us/op 379.80 us/op 0.99
phase0 processRegistryUpdates - 250000 worstcase 0.5 183.24 ms/op 174.92 ms/op 1.05
altair processRewardsAndPenalties - 250000 normalcase 110.17 ms/op 74.788 ms/op 1.47
altair processRewardsAndPenalties - 250000 worstcase 103.58 ms/op 107.40 ms/op 0.96
phase0 getAttestationDeltas - 250000 normalcase 12.022 ms/op 11.620 ms/op 1.03
phase0 getAttestationDeltas - 250000 worstcase 12.438 ms/op 11.588 ms/op 1.07
phase0 processSlashings - 250000 worstcase 5.6698 ms/op 5.6777 ms/op 1.00
altair processSyncCommitteeUpdates - 250000 297.39 ms/op 287.19 ms/op 1.04
BeaconState.hashTreeRoot - No change 527.00 ns/op 510.00 ns/op 1.03
BeaconState.hashTreeRoot - 1 full validator 69.617 us/op 72.446 us/op 0.96
BeaconState.hashTreeRoot - 32 full validator 729.91 us/op 727.37 us/op 1.00
BeaconState.hashTreeRoot - 512 full validator 6.8758 ms/op 6.8987 ms/op 1.00
BeaconState.hashTreeRoot - 1 validator.effectiveBalance 91.661 us/op 92.380 us/op 0.99
BeaconState.hashTreeRoot - 32 validator.effectiveBalance 1.2700 ms/op 1.2971 ms/op 0.98
BeaconState.hashTreeRoot - 512 validator.effectiveBalance 17.407 ms/op 17.143 ms/op 1.02
BeaconState.hashTreeRoot - 1 balances 68.587 us/op 69.073 us/op 0.99
BeaconState.hashTreeRoot - 32 balances 635.03 us/op 734.47 us/op 0.86
BeaconState.hashTreeRoot - 512 balances 6.5495 ms/op 6.1410 ms/op 1.07
BeaconState.hashTreeRoot - 250000 balances 101.41 ms/op 100.78 ms/op 1.01
aggregationBits - 2048 els - zipIndexesInBitList 26.417 us/op 25.164 us/op 1.05
regular array get 100000 times 62.007 us/op 60.600 us/op 1.02
wrappedArray get 100000 times 61.673 us/op 61.639 us/op 1.00
arrayWithProxy get 100000 times 27.983 ms/op 28.411 ms/op 0.98
ssz.Root.equals 485.00 ns/op 493.00 ns/op 0.98
byteArrayEquals 472.00 ns/op 474.00 ns/op 1.00
shuffle list - 16384 els 11.273 ms/op 11.545 ms/op 0.98
shuffle list - 250000 els 169.30 ms/op 169.20 ms/op 1.00
processSlot - 1 slots 13.790 us/op 12.820 us/op 1.08
processSlot - 32 slots 1.9883 ms/op 2.0043 ms/op 0.99
getEffectiveBalanceIncrementsZeroInactive - 250000 vs - 7PWei 413.40 us/op 391.18 us/op 1.06
getCommitteeAssignments - req 1 vs - 250000 vc 5.4552 ms/op 5.3342 ms/op 1.02
getCommitteeAssignments - req 100 vs - 250000 vc 8.1342 ms/op 7.8169 ms/op 1.04
getCommitteeAssignments - req 1000 vs - 250000 vc 8.7194 ms/op 8.4051 ms/op 1.04
RootCache.getBlockRootAtSlot - 250000 vs - 7PWei 8.1700 ns/op 8.5900 ns/op 0.95
state getBlockRootAtSlot - 250000 vs - 7PWei 1.1765 us/op 1.0173 us/op 1.16
computeProposers - vc 250000 17.911 ms/op 17.368 ms/op 1.03
computeEpochShuffling - vc 250000 172.48 ms/op 171.46 ms/op 1.01
getNextSyncCommittee - vc 250000 299.33 ms/op 288.26 ms/op 1.04

by benchmarkbot/action

@twoeths twoeths merged commit 4115f67 into unstable Dec 7, 2022
@twoeths twoeths deleted the dapplion/eip-4844-reqresp-byrange-fix branch December 7, 2022 07:46
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