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

EIP-4844: Implement beaconBlocksMaybeBlobsByRoot #4869

Merged
merged 2 commits into from
Dec 7, 2022

Conversation

dapplion
Copy link
Contributor

@dapplion dapplion commented Dec 6, 2022

Motivation

Description

@dapplion dapplion requested a review from a team as a code owner December 6, 2022 10:04
@dapplion dapplion changed the title Implement beaconBlocksMaybeBlobsByRoot EIP-4844: Implement beaconBlocksMaybeBlobsByRoot Dec 6, 2022
@dapplion dapplion added the spec-deneb 🐡 Issues targeting the Deneb spec version label Dec 6, 2022
@github-actions
Copy link
Contributor

github-actions bot commented Dec 6, 2022

Performance Report

✔️ no performance regression detected

Full benchmark results
Benchmark suite Current: b8e2d41 Previous: 4115f67 Ratio
getPubkeys - index2pubkey - req 1000 vs - 250000 vc 2.0344 ms/op 2.3522 ms/op 0.86
getPubkeys - validatorsArr - req 1000 vs - 250000 vc 76.642 us/op 88.916 us/op 0.86
BLS verify - blst-native 2.0166 ms/op 2.7517 ms/op 0.73
BLS verifyMultipleSignatures 3 - blst-native 4.2017 ms/op 5.5217 ms/op 0.76
BLS verifyMultipleSignatures 8 - blst-native 9.1440 ms/op 12.040 ms/op 0.76
BLS verifyMultipleSignatures 32 - blst-native 31.997 ms/op 40.842 ms/op 0.78
BLS aggregatePubkeys 32 - blst-native 42.888 us/op 55.862 us/op 0.77
BLS aggregatePubkeys 128 - blst-native 167.47 us/op 238.52 us/op 0.70
getAttestationsForBlock 92.388 ms/op 119.79 ms/op 0.77
isKnown best case - 1 super set check 507.00 ns/op 508.00 ns/op 1.00
isKnown normal case - 2 super set checks 469.00 ns/op 493.00 ns/op 0.95
isKnown worse case - 16 super set checks 478.00 ns/op 475.00 ns/op 1.01
CheckpointStateCache - add get delete 9.1440 us/op 10.883 us/op 0.84
validate gossip signedAggregateAndProof - struct 4.7319 ms/op 6.0945 ms/op 0.78
validate gossip attestation - struct 2.2813 ms/op 2.8254 ms/op 0.81
pickEth1Vote - no votes 2.2689 ms/op 2.6825 ms/op 0.85
pickEth1Vote - max votes 20.223 ms/op 22.183 ms/op 0.91
pickEth1Vote - Eth1Data hashTreeRoot value x2048 11.901 ms/op 14.179 ms/op 0.84
pickEth1Vote - Eth1Data hashTreeRoot tree x2048 21.561 ms/op 24.148 ms/op 0.89
pickEth1Vote - Eth1Data fastSerialize value x2048 1.6621 ms/op 1.8585 ms/op 0.89
pickEth1Vote - Eth1Data fastSerialize tree x2048 14.113 ms/op 15.190 ms/op 0.93
bytes32 toHexString 1.1260 us/op 1.2230 us/op 0.92
bytes32 Buffer.toString(hex) 742.00 ns/op 799.00 ns/op 0.93
bytes32 Buffer.toString(hex) from Uint8Array 1.0220 us/op 1.0640 us/op 0.96
bytes32 Buffer.toString(hex) + 0x 758.00 ns/op 778.00 ns/op 0.97
Object access 1 prop 0.38600 ns/op 0.42700 ns/op 0.90
Map access 1 prop 0.32000 ns/op 0.32900 ns/op 0.97
Object get x1000 19.308 ns/op 15.740 ns/op 1.23
Map get x1000 1.1410 ns/op 0.91500 ns/op 1.25
Object set x1000 127.91 ns/op 120.88 ns/op 1.06
Map set x1000 76.567 ns/op 79.547 ns/op 0.96
Return object 10000 times 0.41850 ns/op 0.41480 ns/op 1.01
Throw Error 10000 times 6.6224 us/op 7.1478 us/op 0.93
fastMsgIdFn sha256 / 200 bytes 4.7340 us/op 5.2810 us/op 0.90
fastMsgIdFn h32 xxhash / 200 bytes 599.00 ns/op 616.00 ns/op 0.97
fastMsgIdFn h64 xxhash / 200 bytes 790.00 ns/op 890.00 ns/op 0.89
fastMsgIdFn sha256 / 1000 bytes 15.492 us/op 16.590 us/op 0.93
fastMsgIdFn h32 xxhash / 1000 bytes 836.00 ns/op 804.00 ns/op 1.04
fastMsgIdFn h64 xxhash / 1000 bytes 954.00 ns/op 975.00 ns/op 0.98
fastMsgIdFn sha256 / 10000 bytes 131.31 us/op 153.73 us/op 0.85
fastMsgIdFn h32 xxhash / 10000 bytes 2.7060 us/op 2.8630 us/op 0.95
fastMsgIdFn h64 xxhash / 10000 bytes 1.9040 us/op 2.0510 us/op 0.93
enrSubnets - fastDeserialize 64 bits 2.8440 us/op 2.9950 us/op 0.95
enrSubnets - ssz BitVector 64 bits 795.00 ns/op 806.00 ns/op 0.99
enrSubnets - fastDeserialize 4 bits 388.00 ns/op 475.00 ns/op 0.82
enrSubnets - ssz BitVector 4 bits 806.00 ns/op 886.00 ns/op 0.91
prioritizePeers score -10:0 att 32-0.1 sync 2-0 100.79 us/op 109.49 us/op 0.92
prioritizePeers score 0:0 att 32-0.25 sync 2-0.25 148.45 us/op 152.52 us/op 0.97
prioritizePeers score 0:0 att 32-0.5 sync 2-0.5 232.31 us/op 287.05 us/op 0.81
prioritizePeers score 0:0 att 64-0.75 sync 4-0.75 434.00 us/op 580.28 us/op 0.75
prioritizePeers score 0:0 att 64-1 sync 4-1 517.93 us/op 615.01 us/op 0.84
RateTracker 1000000 limit, 1 obj count per request 213.13 ns/op 206.50 ns/op 1.03
RateTracker 1000000 limit, 2 obj count per request 153.64 ns/op 156.96 ns/op 0.98
RateTracker 1000000 limit, 4 obj count per request 132.02 ns/op 131.21 ns/op 1.01
RateTracker 1000000 limit, 8 obj count per request 121.68 ns/op 111.18 ns/op 1.09
RateTracker with prune 5.0300 us/op 5.3770 us/op 0.94
array of 16000 items push then shift 3.3281 us/op 5.0871 us/op 0.65
LinkedList of 16000 items push then shift 18.659 ns/op 19.017 ns/op 0.98
array of 16000 items push then pop 277.13 ns/op 248.49 ns/op 1.12
LinkedList of 16000 items push then pop 18.581 ns/op 18.341 ns/op 1.01
array of 24000 items push then shift 4.5177 us/op 7.5670 us/op 0.60
LinkedList of 24000 items push then shift 21.345 ns/op 19.743 ns/op 1.08
array of 24000 items push then pop 232.10 ns/op 249.49 ns/op 0.93
LinkedList of 24000 items push then pop 18.854 ns/op 17.892 ns/op 1.05
intersect bitArray bitLen 8 13.074 ns/op 12.097 ns/op 1.08
intersect array and set length 8 178.59 ns/op 199.97 ns/op 0.89
intersect bitArray bitLen 128 66.879 ns/op 69.326 ns/op 0.96
intersect array and set length 128 2.3697 us/op 2.5573 us/op 0.93
Buffer.concat 32 items 2.1070 ns/op 2.6230 ns/op 0.80
pass gossip attestations to forkchoice per slot 4.6405 ms/op 4.5404 ms/op 1.02
computeDeltas 6.4842 ms/op 5.5700 ms/op 1.16
computeProposerBoostScoreFromBalances 1.0407 ms/op 856.30 us/op 1.22
altair processAttestation - 250000 vs - 7PWei normalcase 3.8146 ms/op 5.2350 ms/op 0.73
altair processAttestation - 250000 vs - 7PWei worstcase 6.3794 ms/op 9.2972 ms/op 0.69
altair processAttestation - setStatus - 1/6 committees join 242.54 us/op 235.31 us/op 1.03
altair processAttestation - setStatus - 1/3 committees join 447.19 us/op 450.41 us/op 0.99
altair processAttestation - setStatus - 1/2 committees join 653.33 us/op 656.47 us/op 1.00
altair processAttestation - setStatus - 2/3 committees join 808.73 us/op 910.97 us/op 0.89
altair processAttestation - setStatus - 4/5 committees join 1.1383 ms/op 1.1653 ms/op 0.98
altair processAttestation - setStatus - 100% committees join 1.3785 ms/op 1.4386 ms/op 0.96
altair processBlock - 250000 vs - 7PWei normalcase 30.470 ms/op 30.195 ms/op 1.01
altair processBlock - 250000 vs - 7PWei normalcase hashState 41.023 ms/op 41.124 ms/op 1.00
altair processBlock - 250000 vs - 7PWei worstcase 89.013 ms/op 103.73 ms/op 0.86
altair processBlock - 250000 vs - 7PWei worstcase hashState 105.00 ms/op 121.24 ms/op 0.87
phase0 processBlock - 250000 vs - 7PWei normalcase 3.7536 ms/op 4.0784 ms/op 0.92
phase0 processBlock - 250000 vs - 7PWei worstcase 49.159 ms/op 61.153 ms/op 0.80
altair processEth1Data - 250000 vs - 7PWei normalcase 916.14 us/op 1.0219 ms/op 0.90
vc - 250000 eb 1 eth1 1 we 0 wn 0 - smpl 15 15.803 us/op 23.186 us/op 0.68
vc - 250000 eb 0.95 eth1 0.1 we 0.05 wn 0 - smpl 219 45.285 us/op 48.326 us/op 0.94
vc - 250000 eb 0.95 eth1 0.3 we 0.05 wn 0 - smpl 42 22.949 us/op 27.610 us/op 0.83
vc - 250000 eb 0.95 eth1 0.7 we 0.05 wn 0 - smpl 18 18.643 us/op 22.435 us/op 0.83
vc - 250000 eb 0.1 eth1 0.1 we 0 wn 0 - smpl 1020 163.19 us/op 152.19 us/op 1.07
vc - 250000 eb 0.03 eth1 0.03 we 0 wn 0 - smpl 11777 1.2714 ms/op 1.2901 ms/op 0.99
vc - 250000 eb 0.01 eth1 0.01 we 0 wn 0 - smpl 141069 14.818 ms/op 17.251 ms/op 0.86
vc - 250000 eb 0 eth1 0 we 0 wn 0 - smpl 250000 25.933 ms/op 27.341 ms/op 0.95
vc - 250000 eb 0 eth1 0 we 0 wn 0 nocache - smpl 250000 96.454 ms/op 88.937 ms/op 1.08
vc - 250000 eb 0 eth1 1 we 0 wn 0 - smpl 250000 54.113 ms/op 55.331 ms/op 0.98
vc - 250000 eb 0 eth1 1 we 0 wn 0 nocache - smpl 250000 145.62 ms/op 144.32 ms/op 1.01
Tree 40 250000 create 857.30 ms/op 1.0225 s/op 0.84
Tree 40 250000 get(125000) 305.24 ns/op 334.77 ns/op 0.91
Tree 40 250000 set(125000) 2.5108 us/op 3.0285 us/op 0.83
Tree 40 250000 toArray() 34.015 ms/op 33.783 ms/op 1.01
Tree 40 250000 iterate all - toArray() + loop 34.624 ms/op 35.296 ms/op 0.98
Tree 40 250000 iterate all - get(i) 117.80 ms/op 126.14 ms/op 0.93
MutableVector 250000 create 16.209 ms/op 16.614 ms/op 0.98
MutableVector 250000 get(125000) 16.196 ns/op 13.525 ns/op 1.20
MutableVector 250000 set(125000) 682.98 ns/op 845.46 ns/op 0.81
MutableVector 250000 toArray() 7.7906 ms/op 7.3368 ms/op 1.06
MutableVector 250000 iterate all - toArray() + loop 8.0532 ms/op 7.6059 ms/op 1.06
MutableVector 250000 iterate all - get(i) 3.7531 ms/op 3.4709 ms/op 1.08
Array 250000 create 7.2821 ms/op 7.1322 ms/op 1.02
Array 250000 clone - spread 4.1628 ms/op 4.1867 ms/op 0.99
Array 250000 get(125000) 1.6810 ns/op 1.7440 ns/op 0.96
Array 250000 set(125000) 1.6740 ns/op 1.7780 ns/op 0.94
Array 250000 iterate all - loop 184.50 us/op 137.41 us/op 1.34
effectiveBalanceIncrements clone Uint8Array 300000 88.429 us/op 113.17 us/op 0.78
effectiveBalanceIncrements clone MutableVector 300000 1.2580 us/op 1.2770 us/op 0.99
effectiveBalanceIncrements rw all Uint8Array 300000 279.33 us/op 286.55 us/op 0.97
effectiveBalanceIncrements rw all MutableVector 300000 226.00 ms/op 276.22 ms/op 0.82
phase0 afterProcessEpoch - 250000 vs - 7PWei 205.58 ms/op 206.47 ms/op 1.00
phase0 beforeProcessEpoch - 250000 vs - 7PWei 69.618 ms/op 76.951 ms/op 0.90
altair processEpoch - mainnet_e81889 653.46 ms/op 660.23 ms/op 0.99
mainnet_e81889 - altair beforeProcessEpoch 167.90 ms/op 156.18 ms/op 1.08
mainnet_e81889 - altair processJustificationAndFinalization 26.376 us/op 72.865 us/op 0.36
mainnet_e81889 - altair processInactivityUpdates 11.354 ms/op 11.698 ms/op 0.97
mainnet_e81889 - altair processRewardsAndPenalties 103.89 ms/op 105.60 ms/op 0.98
mainnet_e81889 - altair processRegistryUpdates 7.9580 us/op 18.375 us/op 0.43
mainnet_e81889 - altair processSlashings 1.8470 us/op 4.6040 us/op 0.40
mainnet_e81889 - altair processEth1DataReset 2.0890 us/op 4.7720 us/op 0.44
mainnet_e81889 - altair processEffectiveBalanceUpdates 2.7118 ms/op 2.4133 ms/op 1.12
mainnet_e81889 - altair processSlashingsReset 10.988 us/op 23.082 us/op 0.48
mainnet_e81889 - altair processRandaoMixesReset 10.862 us/op 27.887 us/op 0.39
mainnet_e81889 - altair processHistoricalRootsUpdate 2.0310 us/op 4.1220 us/op 0.49
mainnet_e81889 - altair processParticipationFlagUpdates 7.6990 us/op 18.535 us/op 0.42
mainnet_e81889 - altair processSyncCommitteeUpdates 1.6940 us/op 3.5830 us/op 0.47
mainnet_e81889 - altair afterProcessEpoch 214.91 ms/op 211.89 ms/op 1.01
phase0 processEpoch - mainnet_e58758 589.06 ms/op 626.25 ms/op 0.94
mainnet_e58758 - phase0 beforeProcessEpoch 247.33 ms/op 285.78 ms/op 0.87
mainnet_e58758 - phase0 processJustificationAndFinalization 36.482 us/op 68.988 us/op 0.53
mainnet_e58758 - phase0 processRewardsAndPenalties 85.139 ms/op 157.13 ms/op 0.54
mainnet_e58758 - phase0 processRegistryUpdates 18.976 us/op 36.968 us/op 0.51
mainnet_e58758 - phase0 processSlashings 2.0910 us/op 3.7740 us/op 0.55
mainnet_e58758 - phase0 processEth1DataReset 2.1320 us/op 3.8180 us/op 0.56
mainnet_e58758 - phase0 processEffectiveBalanceUpdates 2.3111 ms/op 2.4555 ms/op 0.94
mainnet_e58758 - phase0 processSlashingsReset 10.583 us/op 20.997 us/op 0.50
mainnet_e58758 - phase0 processRandaoMixesReset 13.833 us/op 28.811 us/op 0.48
mainnet_e58758 - phase0 processHistoricalRootsUpdate 2.3660 us/op 4.5820 us/op 0.52
mainnet_e58758 - phase0 processParticipationRecordUpdates 11.810 us/op 27.352 us/op 0.43
mainnet_e58758 - phase0 afterProcessEpoch 176.51 ms/op 174.31 ms/op 1.01
phase0 processEffectiveBalanceUpdates - 250000 normalcase 2.9345 ms/op 2.3961 ms/op 1.22
phase0 processEffectiveBalanceUpdates - 250000 worstcase 0.5 3.9502 ms/op 2.8524 ms/op 1.38
altair processInactivityUpdates - 250000 normalcase 57.119 ms/op 52.093 ms/op 1.10
altair processInactivityUpdates - 250000 worstcase 46.133 ms/op 67.390 ms/op 0.68
phase0 processRegistryUpdates - 250000 normalcase 17.863 us/op 33.216 us/op 0.54
phase0 processRegistryUpdates - 250000 badcase_full_deposits 561.16 us/op 510.75 us/op 1.10
phase0 processRegistryUpdates - 250000 worstcase 0.5 246.14 ms/op 245.52 ms/op 1.00
altair processRewardsAndPenalties - 250000 normalcase 145.72 ms/op 151.09 ms/op 0.96
altair processRewardsAndPenalties - 250000 worstcase 95.572 ms/op 98.810 ms/op 0.97
phase0 getAttestationDeltas - 250000 normalcase 14.241 ms/op 15.104 ms/op 0.94
phase0 getAttestationDeltas - 250000 worstcase 14.575 ms/op 15.673 ms/op 0.93
phase0 processSlashings - 250000 worstcase 6.4429 ms/op 7.2596 ms/op 0.89
altair processSyncCommitteeUpdates - 250000 301.28 ms/op 342.69 ms/op 0.88
BeaconState.hashTreeRoot - No change 517.00 ns/op 740.00 ns/op 0.70
BeaconState.hashTreeRoot - 1 full validator 69.520 us/op 81.661 us/op 0.85
BeaconState.hashTreeRoot - 32 full validator 698.43 us/op 840.81 us/op 0.83
BeaconState.hashTreeRoot - 512 full validator 9.0661 ms/op 7.7104 ms/op 1.18
BeaconState.hashTreeRoot - 1 validator.effectiveBalance 91.082 us/op 129.14 us/op 0.71
BeaconState.hashTreeRoot - 32 validator.effectiveBalance 1.3622 ms/op 1.5287 ms/op 0.89
BeaconState.hashTreeRoot - 512 validator.effectiveBalance 17.483 ms/op 18.943 ms/op 0.92
BeaconState.hashTreeRoot - 1 balances 72.183 us/op 77.637 us/op 0.93
BeaconState.hashTreeRoot - 32 balances 613.29 us/op 784.71 us/op 0.78
BeaconState.hashTreeRoot - 512 balances 6.6389 ms/op 6.9252 ms/op 0.96
BeaconState.hashTreeRoot - 250000 balances 104.12 ms/op 116.06 ms/op 0.90
aggregationBits - 2048 els - zipIndexesInBitList 35.966 us/op 37.999 us/op 0.95
regular array get 100000 times 73.153 us/op 54.712 us/op 1.34
wrappedArray get 100000 times 72.552 us/op 56.565 us/op 1.28
arrayWithProxy get 100000 times 31.707 ms/op 33.007 ms/op 0.96
ssz.Root.equals 524.00 ns/op 562.00 ns/op 0.93
byteArrayEquals 518.00 ns/op 575.00 ns/op 0.90
shuffle list - 16384 els 12.045 ms/op 12.242 ms/op 0.98
shuffle list - 250000 els 179.25 ms/op 173.84 ms/op 1.03
processSlot - 1 slots 13.902 us/op 19.449 us/op 0.71
processSlot - 32 slots 1.8434 ms/op 2.5994 ms/op 0.71
getEffectiveBalanceIncrementsZeroInactive - 250000 vs - 7PWei 416.85 us/op 578.32 us/op 0.72
getCommitteeAssignments - req 1 vs - 250000 vc 5.7984 ms/op 5.5800 ms/op 1.04
getCommitteeAssignments - req 100 vs - 250000 vc 7.9946 ms/op 7.8092 ms/op 1.02
getCommitteeAssignments - req 1000 vs - 250000 vc 8.5773 ms/op 8.7725 ms/op 0.98
RootCache.getBlockRootAtSlot - 250000 vs - 7PWei 10.960 ns/op 9.4900 ns/op 1.15
state getBlockRootAtSlot - 250000 vs - 7PWei 1.1685 us/op 1.3194 us/op 0.89
computeProposers - vc 250000 17.802 ms/op 21.538 ms/op 0.83
computeEpochShuffling - vc 250000 181.31 ms/op 189.10 ms/op 0.96
getNextSyncCommittee - vc 250000 299.30 ms/op 353.99 ms/op 0.85

by benchmarkbot/action

@dapplion dapplion force-pushed the dapplion/eip-4844-reqresp-byroot-call branch from fd2d7d1 to 52ef18a Compare December 6, 2022 12:40
g11tech
g11tech previously approved these changes Dec 7, 2022
Copy link
Contributor

@g11tech g11tech left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

Copy link
Contributor

@g11tech g11tech left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@g11tech g11tech merged commit 30246e5 into unstable Dec 7, 2022
@g11tech g11tech deleted the dapplion/eip-4844-reqresp-byroot-call branch December 7, 2022 09:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
spec-deneb 🐡 Issues targeting the Deneb spec version
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants