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

Use parentBlockSlot in importBlock #4282

Merged
merged 1 commit into from
Jul 12, 2022
Merged

Conversation

dapplion
Copy link
Contributor

Motivation

Small cosmetic adjustment from #3989

Description

No need to pass full ProtoBlock of the parent, just the slot is sufficient

@dapplion dapplion requested a review from a team as a code owner July 11, 2022 20:19
@github-actions
Copy link
Contributor

Performance Report

✔️ no performance regression detected

Full benchmark results
Benchmark suite Current: 08ad34d Previous: 2b16141 Ratio
getPubkeys - index2pubkey - req 1000 vs - 250000 vc 2.3508 ms/op 2.6927 ms/op 0.87
getPubkeys - validatorsArr - req 1000 vs - 250000 vc 69.276 us/op 92.340 us/op 0.75
BLS verify - blst-native 2.1639 ms/op 2.8921 ms/op 0.75
BLS verifyMultipleSignatures 3 - blst-native 4.4736 ms/op 5.9057 ms/op 0.76
BLS verifyMultipleSignatures 8 - blst-native 9.6725 ms/op 13.004 ms/op 0.74
BLS verifyMultipleSignatures 32 - blst-native 35.183 ms/op 46.398 ms/op 0.76
BLS aggregatePubkeys 32 - blst-native 46.838 us/op 63.077 us/op 0.74
BLS aggregatePubkeys 128 - blst-native 182.81 us/op 242.45 us/op 0.75
getAttestationsForBlock 42.711 ms/op 57.367 ms/op 0.74
isKnown best case - 1 super set check 505.00 ns/op 549.00 ns/op 0.92
isKnown normal case - 2 super set checks 493.00 ns/op 485.00 ns/op 1.02
isKnown worse case - 16 super set checks 484.00 ns/op 500.00 ns/op 0.97
CheckpointStateCache - add get delete 11.305 us/op 14.336 us/op 0.79
validate gossip signedAggregateAndProof - struct 5.0352 ms/op 6.5086 ms/op 0.77
validate gossip attestation - struct 2.3610 ms/op 3.0918 ms/op 0.76
altair verifyImport mainnet_s3766816:31 7.0560 s/op 9.0404 s/op 0.78
pickEth1Vote - no votes 2.1788 ms/op 2.6472 ms/op 0.82
pickEth1Vote - max votes 25.772 ms/op 34.875 ms/op 0.74
pickEth1Vote - Eth1Data hashTreeRoot value x2048 13.672 ms/op 16.601 ms/op 0.82
pickEth1Vote - Eth1Data hashTreeRoot tree x2048 23.615 ms/op 27.557 ms/op 0.86
pickEth1Vote - Eth1Data fastSerialize value x2048 1.5104 ms/op 2.0762 ms/op 0.73
pickEth1Vote - Eth1Data fastSerialize tree x2048 19.187 ms/op 22.800 ms/op 0.84
bytes32 toHexString 1.0660 us/op 1.3820 us/op 0.77
bytes32 Buffer.toString(hex) 808.00 ns/op 913.00 ns/op 0.88
bytes32 Buffer.toString(hex) from Uint8Array 1.0750 us/op 1.1650 us/op 0.92
bytes32 Buffer.toString(hex) + 0x 824.00 ns/op 920.00 ns/op 0.90
Object access 1 prop 0.39600 ns/op 0.48100 ns/op 0.82
Map access 1 prop 0.30500 ns/op 0.35500 ns/op 0.86
Object get x1000 10.719 ns/op 16.596 ns/op 0.65
Map get x1000 0.96800 ns/op 1.0610 ns/op 0.91
Object set x1000 79.524 ns/op 124.92 ns/op 0.64
Map set x1000 50.154 ns/op 88.787 ns/op 0.56
Return object 10000 times 0.44420 ns/op 0.42820 ns/op 1.04
Throw Error 10000 times 6.2634 us/op 7.1103 us/op 0.88
enrSubnets - fastDeserialize 64 bits 3.0540 us/op 3.3870 us/op 0.90
enrSubnets - ssz BitVector 64 bits 869.00 ns/op 954.00 ns/op 0.91
enrSubnets - fastDeserialize 4 bits 410.00 ns/op 493.00 ns/op 0.83
enrSubnets - ssz BitVector 4 bits 893.00 ns/op 931.00 ns/op 0.96
prioritizePeers score -10:0 att 32-0.1 sync 2-0 90.358 us/op 119.55 us/op 0.76
prioritizePeers score 0:0 att 32-0.25 sync 2-0.25 129.90 us/op 153.73 us/op 0.85
prioritizePeers score 0:0 att 32-0.5 sync 2-0.5 232.63 us/op 297.21 us/op 0.78
prioritizePeers score 0:0 att 64-0.75 sync 4-0.75 337.95 us/op 652.96 us/op 0.52
prioritizePeers score 0:0 att 64-1 sync 4-1 406.38 us/op 630.66 us/op 0.64
RateTracker 1000000 limit, 1 obj count per request 192.28 ns/op 229.94 ns/op 0.84
RateTracker 1000000 limit, 2 obj count per request 141.55 ns/op 171.57 ns/op 0.83
RateTracker 1000000 limit, 4 obj count per request 115.43 ns/op 141.84 ns/op 0.81
RateTracker 1000000 limit, 8 obj count per request 103.80 ns/op 128.80 ns/op 0.81
RateTracker with prune 4.1720 us/op 6.4260 us/op 0.65
array of 16000 items push then shift 52.355 us/op 5.5906 us/op 9.36
LinkedList of 16000 items push then shift 16.714 ns/op 28.941 ns/op 0.58
array of 16000 items push then pop 223.23 ns/op 278.10 ns/op 0.80
LinkedList of 16000 items push then pop 14.910 ns/op 24.327 ns/op 0.61
array of 24000 items push then shift 77.390 us/op 8.0868 us/op 9.57
LinkedList of 24000 items push then shift 19.667 ns/op 27.138 ns/op 0.72
array of 24000 items push then pop 196.87 ns/op 249.15 ns/op 0.79
LinkedList of 24000 items push then pop 15.671 ns/op 27.446 ns/op 0.57
intersect bitArray bitLen 8 10.727 ns/op 13.257 ns/op 0.81
intersect array and set length 8 150.28 ns/op 227.10 ns/op 0.66
intersect bitArray bitLen 128 55.576 ns/op 72.451 ns/op 0.77
intersect array and set length 128 1.8896 us/op 2.6163 us/op 0.72
pass gossip attestations to forkchoice per slot 3.2110 ms/op 4.8020 ms/op 0.67
computeDeltas 3.2801 ms/op 4.2541 ms/op 0.77
computeProposerBoostScoreFromBalances 807.87 us/op 938.58 us/op 0.86
altair processAttestation - 250000 vs - 7PWei normalcase 3.9330 ms/op 5.8939 ms/op 0.67
altair processAttestation - 250000 vs - 7PWei worstcase 5.6496 ms/op 8.6438 ms/op 0.65
altair processAttestation - setStatus - 1/6 committees join 186.07 us/op 258.74 us/op 0.72
altair processAttestation - setStatus - 1/3 committees join 363.06 us/op 487.92 us/op 0.74
altair processAttestation - setStatus - 1/2 committees join 535.52 us/op 752.26 us/op 0.71
altair processAttestation - setStatus - 2/3 committees join 684.35 us/op 881.30 us/op 0.78
altair processAttestation - setStatus - 4/5 committees join 958.22 us/op 1.2678 ms/op 0.76
altair processAttestation - setStatus - 100% committees join 1.1532 ms/op 1.5109 ms/op 0.76
altair processBlock - 250000 vs - 7PWei normalcase 26.355 ms/op 32.677 ms/op 0.81
altair processBlock - 250000 vs - 7PWei normalcase hashState 34.397 ms/op 46.598 ms/op 0.74
altair processBlock - 250000 vs - 7PWei worstcase 78.061 ms/op 114.26 ms/op 0.68
altair processBlock - 250000 vs - 7PWei worstcase hashState 111.54 ms/op 133.49 ms/op 0.84
phase0 processBlock - 250000 vs - 7PWei normalcase 3.4659 ms/op 5.2536 ms/op 0.66
phase0 processBlock - 250000 vs - 7PWei worstcase 51.844 ms/op 68.786 ms/op 0.75
altair processEth1Data - 250000 vs - 7PWei normalcase 797.07 us/op 1.1473 ms/op 0.69
Tree 40 250000 create 814.71 ms/op 1.2530 s/op 0.65
Tree 40 250000 get(125000) 254.46 ns/op 345.04 ns/op 0.74
Tree 40 250000 set(125000) 2.6266 us/op 4.6165 us/op 0.57
Tree 40 250000 toArray() 29.227 ms/op 37.139 ms/op 0.79
Tree 40 250000 iterate all - toArray() + loop 29.426 ms/op 35.982 ms/op 0.82
Tree 40 250000 iterate all - get(i) 119.81 ms/op 139.05 ms/op 0.86
MutableVector 250000 create 15.355 ms/op 18.027 ms/op 0.85
MutableVector 250000 get(125000) 10.843 ns/op 15.385 ns/op 0.70
MutableVector 250000 set(125000) 574.40 ns/op 1.0908 us/op 0.53
MutableVector 250000 toArray() 6.1886 ms/op 8.7551 ms/op 0.71
MutableVector 250000 iterate all - toArray() + loop 6.4362 ms/op 7.8069 ms/op 0.82
MutableVector 250000 iterate all - get(i) 2.6189 ms/op 3.6000 ms/op 0.73
Array 250000 create 6.5672 ms/op 6.8400 ms/op 0.96
Array 250000 clone - spread 4.0203 ms/op 3.2960 ms/op 1.22
Array 250000 get(125000) 1.5800 ns/op 1.4290 ns/op 1.11
Array 250000 set(125000) 1.5510 ns/op 1.6050 ns/op 0.97
Array 250000 iterate all - loop 155.35 us/op 152.19 us/op 1.02
effectiveBalanceIncrements clone Uint8Array 300000 73.072 us/op 105.47 us/op 0.69
effectiveBalanceIncrements clone MutableVector 300000 1.1250 us/op 1.0170 us/op 1.11
effectiveBalanceIncrements rw all Uint8Array 300000 247.41 us/op 308.58 us/op 0.80
effectiveBalanceIncrements rw all MutableVector 300000 209.45 ms/op 262.22 ms/op 0.80
phase0 afterProcessEpoch - 250000 vs - 7PWei 188.85 ms/op 217.18 ms/op 0.87
phase0 beforeProcessEpoch - 250000 vs - 7PWei 83.076 ms/op 81.365 ms/op 1.02
altair processEpoch - mainnet_e81889 549.84 ms/op 699.78 ms/op 0.79
mainnet_e81889 - altair beforeProcessEpoch 141.86 ms/op 169.33 ms/op 0.84
mainnet_e81889 - altair processJustificationAndFinalization 17.261 us/op 78.045 us/op 0.22
mainnet_e81889 - altair processInactivityUpdates 9.0369 ms/op 11.875 ms/op 0.76
mainnet_e81889 - altair processRewardsAndPenalties 81.192 ms/op 110.27 ms/op 0.74
mainnet_e81889 - altair processRegistryUpdates 2.5300 us/op 17.597 us/op 0.14
mainnet_e81889 - altair processSlashings 631.00 ns/op 4.4220 us/op 0.14
mainnet_e81889 - altair processEth1DataReset 597.00 ns/op 5.0450 us/op 0.12
mainnet_e81889 - altair processEffectiveBalanceUpdates 1.9977 ms/op 2.7828 ms/op 0.72
mainnet_e81889 - altair processSlashingsReset 4.6300 us/op 22.576 us/op 0.21
mainnet_e81889 - altair processRandaoMixesReset 6.2490 us/op 26.856 us/op 0.23
mainnet_e81889 - altair processHistoricalRootsUpdate 836.00 ns/op 4.6000 us/op 0.18
mainnet_e81889 - altair processParticipationFlagUpdates 3.0240 us/op 17.685 us/op 0.17
mainnet_e81889 - altair processSyncCommitteeUpdates 537.00 ns/op 4.1230 us/op 0.13
mainnet_e81889 - altair afterProcessEpoch 197.11 ms/op 235.89 ms/op 0.84
phase0 processEpoch - mainnet_e58758 488.60 ms/op 676.76 ms/op 0.72
mainnet_e58758 - phase0 beforeProcessEpoch 182.81 ms/op 311.10 ms/op 0.59
mainnet_e58758 - phase0 processJustificationAndFinalization 17.129 us/op 74.300 us/op 0.23
mainnet_e58758 - phase0 processRewardsAndPenalties 97.370 ms/op 155.45 ms/op 0.63
mainnet_e58758 - phase0 processRegistryUpdates 8.1390 us/op 36.859 us/op 0.22
mainnet_e58758 - phase0 processSlashings 557.00 ns/op 3.8290 us/op 0.15
mainnet_e58758 - phase0 processEth1DataReset 565.00 ns/op 4.2580 us/op 0.13
mainnet_e58758 - phase0 processEffectiveBalanceUpdates 1.8550 ms/op 2.8730 ms/op 0.65
mainnet_e58758 - phase0 processSlashingsReset 4.0030 us/op 19.833 us/op 0.20
mainnet_e58758 - phase0 processRandaoMixesReset 5.2850 us/op 28.064 us/op 0.19
mainnet_e58758 - phase0 processHistoricalRootsUpdate 854.00 ns/op 4.8310 us/op 0.18
mainnet_e58758 - phase0 processParticipationRecordUpdates 3.7980 us/op 28.581 us/op 0.13
mainnet_e58758 - phase0 afterProcessEpoch 161.65 ms/op 191.61 ms/op 0.84
phase0 processEffectiveBalanceUpdates - 250000 normalcase 1.9867 ms/op 2.6036 ms/op 0.76
phase0 processEffectiveBalanceUpdates - 250000 worstcase 0.5 2.1272 ms/op 2.9278 ms/op 0.73
altair processInactivityUpdates - 250000 normalcase 39.485 ms/op 52.809 ms/op 0.75
altair processInactivityUpdates - 250000 worstcase 33.564 ms/op 49.990 ms/op 0.67
phase0 processRegistryUpdates - 250000 normalcase 6.2440 us/op 29.115 us/op 0.21
phase0 processRegistryUpdates - 250000 badcase_full_deposits 380.78 us/op 628.66 us/op 0.61
phase0 processRegistryUpdates - 250000 worstcase 0.5 169.22 ms/op 246.51 ms/op 0.69
altair processRewardsAndPenalties - 250000 normalcase 76.319 ms/op 104.44 ms/op 0.73
altair processRewardsAndPenalties - 250000 worstcase 111.82 ms/op 155.83 ms/op 0.72
phase0 getAttestationDeltas - 250000 normalcase 12.801 ms/op 15.235 ms/op 0.84
phase0 getAttestationDeltas - 250000 worstcase 12.038 ms/op 15.634 ms/op 0.77
phase0 processSlashings - 250000 worstcase 5.0483 ms/op 7.1838 ms/op 0.70
altair processSyncCommitteeUpdates - 250000 296.87 ms/op 370.06 ms/op 0.80
BeaconState.hashTreeRoot - No change 552.00 ns/op 677.00 ns/op 0.82
BeaconState.hashTreeRoot - 1 full validator 66.057 us/op 82.703 us/op 0.80
BeaconState.hashTreeRoot - 32 full validator 650.94 us/op 794.58 us/op 0.82
BeaconState.hashTreeRoot - 512 full validator 7.0392 ms/op 8.8024 ms/op 0.80
BeaconState.hashTreeRoot - 1 validator.effectiveBalance 85.160 us/op 104.95 us/op 0.81
BeaconState.hashTreeRoot - 32 validator.effectiveBalance 1.1922 ms/op 1.5300 ms/op 0.78
BeaconState.hashTreeRoot - 512 validator.effectiveBalance 16.191 ms/op 17.870 ms/op 0.91
BeaconState.hashTreeRoot - 1 balances 65.172 us/op 79.018 us/op 0.82
BeaconState.hashTreeRoot - 32 balances 582.77 us/op 706.77 us/op 0.82
BeaconState.hashTreeRoot - 512 balances 5.2796 ms/op 6.0678 ms/op 0.87
BeaconState.hashTreeRoot - 250000 balances 99.323 ms/op 112.51 ms/op 0.88
aggregationBits - 2048 els - zipIndexesInBitList 28.121 us/op 38.787 us/op 0.73
regular array get 100000 times 61.869 us/op 59.752 us/op 1.04
wrappedArray get 100000 times 65.481 us/op 58.595 us/op 1.12
arrayWithProxy get 100000 times 28.102 ms/op 36.920 ms/op 0.76
ssz.Root.equals 508.00 ns/op 634.00 ns/op 0.80
byteArrayEquals 499.00 ns/op 615.00 ns/op 0.81
shuffle list - 16384 els 11.703 ms/op 13.311 ms/op 0.88
shuffle list - 250000 els 167.35 ms/op 191.26 ms/op 0.87
processSlot - 1 slots 13.613 us/op 18.105 us/op 0.75
processSlot - 32 slots 1.9688 ms/op 2.5384 ms/op 0.78
getEffectiveBalanceIncrementsZeroInactive - 250000 vs - 7PWei 406.91 us/op 633.71 us/op 0.64
getCommitteeAssignments - req 1 vs - 250000 vc 5.4676 ms/op 5.6878 ms/op 0.96
getCommitteeAssignments - req 100 vs - 250000 vc 7.9924 ms/op 8.3168 ms/op 0.96
getCommitteeAssignments - req 1000 vs - 250000 vc 8.6969 ms/op 8.7955 ms/op 0.99
computeProposers - vc 250000 18.803 ms/op 21.480 ms/op 0.88
computeEpochShuffling - vc 250000 169.97 ms/op 205.26 ms/op 0.83
getNextSyncCommittee - vc 250000 282.86 ms/op 360.95 ms/op 0.78

by benchmarkbot/action

@dapplion dapplion changed the title Dapplion/parent block slot Use parentBlockSlot in importBlock Jul 11, 2022
@wemeetagain wemeetagain merged commit 370a049 into unstable Jul 12, 2022
@wemeetagain wemeetagain deleted the dapplion/parentBlockSlot branch July 12, 2022 01:58
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.

3 participants