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: handle dataGasUsed in engine for deneb payload #5629

Merged
merged 1 commit into from
Jun 13, 2023

Conversation

g11tech
Copy link
Contributor

@g11tech g11tech commented Jun 12, 2023

fix serialization/deserialization of deneb payload

@g11tech g11tech requested a review from a team as a code owner June 12, 2023 12:43
@g11tech g11tech enabled auto-merge (squash) June 12, 2023 12:44
@github-actions
Copy link
Contributor

github-actions bot commented Jun 12, 2023

Performance Report

✔️ no performance regression detected

Full benchmark results
Benchmark suite Current: e1589cf Previous: 09ecf99 Ratio
getPubkeys - index2pubkey - req 1000 vs - 250000 vc 711.78 us/op 1.0137 ms/op 0.70
getPubkeys - validatorsArr - req 1000 vs - 250000 vc 52.325 us/op 53.559 us/op 0.98
BLS verify - blst-native 1.2621 ms/op 1.2788 ms/op 0.99
BLS verifyMultipleSignatures 3 - blst-native 2.5975 ms/op 2.5960 ms/op 1.00
BLS verifyMultipleSignatures 8 - blst-native 5.4749 ms/op 5.4902 ms/op 1.00
BLS verifyMultipleSignatures 32 - blst-native 19.778 ms/op 19.858 ms/op 1.00
BLS aggregatePubkeys 32 - blst-native 26.484 us/op 26.578 us/op 1.00
BLS aggregatePubkeys 128 - blst-native 104.21 us/op 104.25 us/op 1.00
getAttestationsForBlock 61.244 ms/op 64.855 ms/op 0.94
isKnown best case - 1 super set check 282.00 ns/op 275.00 ns/op 1.03
isKnown normal case - 2 super set checks 272.00 ns/op 268.00 ns/op 1.01
isKnown worse case - 16 super set checks 275.00 ns/op 265.00 ns/op 1.04
CheckpointStateCache - add get delete 5.5480 us/op 5.9640 us/op 0.93
validate gossip signedAggregateAndProof - struct 2.8371 ms/op 2.9571 ms/op 0.96
validate gossip attestation - struct 1.3467 ms/op 1.4232 ms/op 0.95
pickEth1Vote - no votes 1.3198 ms/op 1.4284 ms/op 0.92
pickEth1Vote - max votes 9.4229 ms/op 14.877 ms/op 0.63
pickEth1Vote - Eth1Data hashTreeRoot value x2048 9.2756 ms/op 10.081 ms/op 0.92
pickEth1Vote - Eth1Data hashTreeRoot tree x2048 15.171 ms/op 17.812 ms/op 0.85
pickEth1Vote - Eth1Data fastSerialize value x2048 821.42 us/op 752.96 us/op 1.09
pickEth1Vote - Eth1Data fastSerialize tree x2048 5.2868 ms/op 9.8292 ms/op 0.54
bytes32 toHexString 620.00 ns/op 736.00 ns/op 0.84
bytes32 Buffer.toString(hex) 452.00 ns/op 456.00 ns/op 0.99
bytes32 Buffer.toString(hex) from Uint8Array 598.00 ns/op 678.00 ns/op 0.88
bytes32 Buffer.toString(hex) + 0x 397.00 ns/op 469.00 ns/op 0.85
Object access 1 prop 0.17800 ns/op 0.22500 ns/op 0.79
Map access 1 prop 0.16500 ns/op 0.17000 ns/op 0.97
Object get x1000 7.5360 ns/op 7.1080 ns/op 1.06
Map get x1000 0.66600 ns/op 0.67000 ns/op 0.99
Object set x1000 62.729 ns/op 60.698 ns/op 1.03
Map set x1000 47.178 ns/op 50.714 ns/op 0.93
Return object 10000 times 0.25570 ns/op 0.26020 ns/op 0.98
Throw Error 10000 times 4.4022 us/op 4.2993 us/op 1.02
fastMsgIdFn sha256 / 200 bytes 3.6410 us/op 3.4910 us/op 1.04
fastMsgIdFn h32 xxhash / 200 bytes 310.00 ns/op 301.00 ns/op 1.03
fastMsgIdFn h64 xxhash / 200 bytes 475.00 ns/op 425.00 ns/op 1.12
fastMsgIdFn sha256 / 1000 bytes 12.133 us/op 11.574 us/op 1.05
fastMsgIdFn h32 xxhash / 1000 bytes 459.00 ns/op 425.00 ns/op 1.08
fastMsgIdFn h64 xxhash / 1000 bytes 559.00 ns/op 469.00 ns/op 1.19
fastMsgIdFn sha256 / 10000 bytes 106.56 us/op 103.28 us/op 1.03
fastMsgIdFn h32 xxhash / 10000 bytes 2.0640 us/op 1.9770 us/op 1.04
fastMsgIdFn h64 xxhash / 10000 bytes 1.4070 us/op 1.4250 us/op 0.99
enrSubnets - fastDeserialize 64 bits 1.6770 us/op 1.4380 us/op 1.17
enrSubnets - ssz BitVector 64 bits 618.00 ns/op 509.00 ns/op 1.21
enrSubnets - fastDeserialize 4 bits 210.00 ns/op 183.00 ns/op 1.15
enrSubnets - ssz BitVector 4 bits 632.00 ns/op 544.00 ns/op 1.16
prioritizePeers score -10:0 att 32-0.1 sync 2-0 134.47 us/op 113.48 us/op 1.18
prioritizePeers score 0:0 att 32-0.25 sync 2-0.25 171.46 us/op 138.58 us/op 1.24
prioritizePeers score 0:0 att 32-0.5 sync 2-0.5 210.98 us/op 185.41 us/op 1.14
prioritizePeers score 0:0 att 64-0.75 sync 4-0.75 383.95 us/op 329.68 us/op 1.16
prioritizePeers score 0:0 att 64-1 sync 4-1 461.26 us/op 413.27 us/op 1.12
array of 16000 items push then shift 1.7652 us/op 1.7090 us/op 1.03
LinkedList of 16000 items push then shift 9.6730 ns/op 9.6770 ns/op 1.00
array of 16000 items push then pop 121.10 ns/op 118.71 ns/op 1.02
LinkedList of 16000 items push then pop 9.6560 ns/op 9.5350 ns/op 1.01
array of 24000 items push then shift 2.5603 us/op 2.4719 us/op 1.04
LinkedList of 24000 items push then shift 10.550 ns/op 11.056 ns/op 0.95
array of 24000 items push then pop 94.417 ns/op 94.731 ns/op 1.00
LinkedList of 24000 items push then pop 9.1070 ns/op 9.7040 ns/op 0.94
intersect bitArray bitLen 8 13.992 ns/op 17.202 ns/op 0.81
intersect array and set length 8 89.026 ns/op 120.46 ns/op 0.74
intersect bitArray bitLen 128 46.490 ns/op 47.152 ns/op 0.99
intersect array and set length 128 1.1556 us/op 1.4054 us/op 0.82
Buffer.concat 32 items 2.7600 us/op 3.2910 us/op 0.84
Uint8Array.set 32 items 3.0540 us/op 3.1990 us/op 0.95
transfer serialized Status (84 B) 2.4750 us/op 2.5630 us/op 0.97
copy serialized Status (84 B) 1.9710 us/op 1.9980 us/op 0.99
transfer serialized SignedVoluntaryExit (112 B) 2.4550 us/op 2.4950 us/op 0.98
copy serialized SignedVoluntaryExit (112 B) 1.8290 us/op 2.0610 us/op 0.89
transfer serialized ProposerSlashing (416 B) 2.6840 us/op 3.4910 us/op 0.77
copy serialized ProposerSlashing (416 B) 2.9530 us/op 3.3580 us/op 0.88
transfer serialized Attestation (485 B) 2.9530 us/op 3.2460 us/op 0.91
copy serialized Attestation (485 B) 3.3000 us/op 2.9380 us/op 1.12
transfer serialized AttesterSlashing (33232 B) 2.9270 us/op 3.5120 us/op 0.83
copy serialized AttesterSlashing (33232 B) 7.6770 us/op 9.4320 us/op 0.81
transfer serialized Small SignedBeaconBlock (128000 B) 2.8670 us/op 3.1600 us/op 0.91
copy serialized Small SignedBeaconBlock (128000 B) 21.950 us/op 55.287 us/op 0.40
transfer serialized Avg SignedBeaconBlock (200000 B) 3.5050 us/op 3.8640 us/op 0.91
copy serialized Avg SignedBeaconBlock (200000 B) 37.633 us/op 40.627 us/op 0.93
transfer serialized BlobsSidecar (524380 B) 4.1080 us/op 4.1830 us/op 0.98
copy serialized BlobsSidecar (524380 B) 217.82 us/op 137.87 us/op 1.58
transfer serialized Big SignedBeaconBlock (1000000 B) 4.8010 us/op 4.8240 us/op 1.00
copy serialized Big SignedBeaconBlock (1000000 B) 381.32 us/op 366.17 us/op 1.04
pass gossip attestations to forkchoice per slot 3.3364 ms/op 2.8918 ms/op 1.15
forkChoice updateHead vc 100000 bc 64 eq 0 2.4599 ms/op 2.4583 ms/op 1.00
forkChoice updateHead vc 600000 bc 64 eq 0 17.744 ms/op 13.200 ms/op 1.34
forkChoice updateHead vc 1000000 bc 64 eq 0 22.362 ms/op 25.580 ms/op 0.87
forkChoice updateHead vc 600000 bc 320 eq 0 17.789 ms/op 18.363 ms/op 0.97
forkChoice updateHead vc 600000 bc 1200 eq 0 92.085 ms/op 86.627 ms/op 1.06
forkChoice updateHead vc 600000 bc 64 eq 1000 22.678 ms/op 21.611 ms/op 1.05
forkChoice updateHead vc 600000 bc 64 eq 10000 27.536 ms/op 23.486 ms/op 1.17
forkChoice updateHead vc 600000 bc 64 eq 300000 53.841 ms/op 32.147 ms/op 1.67
computeDeltas 3.4354 ms/op 3.7329 ms/op 0.92
computeProposerBoostScoreFromBalances 1.9098 ms/op 1.8434 ms/op 1.04
altair processAttestation - 250000 vs - 7PWei normalcase 3.4456 ms/op 2.3341 ms/op 1.48
altair processAttestation - 250000 vs - 7PWei worstcase 5.9254 ms/op 3.9845 ms/op 1.49
altair processAttestation - setStatus - 1/6 committees join 153.99 us/op 149.53 us/op 1.03
altair processAttestation - setStatus - 1/3 committees join 343.77 us/op 300.59 us/op 1.14
altair processAttestation - setStatus - 1/2 committees join 411.80 us/op 386.77 us/op 1.06
altair processAttestation - setStatus - 2/3 committees join 524.00 us/op 491.83 us/op 1.07
altair processAttestation - setStatus - 4/5 committees join 834.69 us/op 694.94 us/op 1.20
altair processAttestation - setStatus - 100% committees join 840.85 us/op 802.49 us/op 1.05
altair processBlock - 250000 vs - 7PWei normalcase 18.196 ms/op 20.485 ms/op 0.89
altair processBlock - 250000 vs - 7PWei normalcase hashState 29.042 ms/op 31.046 ms/op 0.94
altair processBlock - 250000 vs - 7PWei worstcase 59.656 ms/op 56.260 ms/op 1.06
altair processBlock - 250000 vs - 7PWei worstcase hashState 73.505 ms/op 79.955 ms/op 0.92
phase0 processBlock - 250000 vs - 7PWei normalcase 2.4096 ms/op 2.5768 ms/op 0.94
phase0 processBlock - 250000 vs - 7PWei worstcase 32.031 ms/op 30.622 ms/op 1.05
altair processEth1Data - 250000 vs - 7PWei normalcase 671.70 us/op 663.52 us/op 1.01
getExpectedWithdrawals 250000 eb:1,eth1:1,we:0,wn:0,smpl:15 9.4460 us/op 9.1110 us/op 1.04
getExpectedWithdrawals 250000 eb:0.95,eth1:0.1,we:0.05,wn:0,smpl:219 29.779 us/op 24.952 us/op 1.19
getExpectedWithdrawals 250000 eb:0.95,eth1:0.3,we:0.05,wn:0,smpl:42 12.784 us/op 11.603 us/op 1.10
getExpectedWithdrawals 250000 eb:0.95,eth1:0.7,we:0.05,wn:0,smpl:18 12.025 us/op 11.319 us/op 1.06
getExpectedWithdrawals 250000 eb:0.1,eth1:0.1,we:0,wn:0,smpl:1020 124.75 us/op 138.38 us/op 0.90
getExpectedWithdrawals 250000 eb:0.03,eth1:0.03,we:0,wn:0,smpl:11777 735.07 us/op 814.54 us/op 0.90
getExpectedWithdrawals 250000 eb:0.01,eth1:0.01,we:0,wn:0,smpl:16384 977.19 us/op 1.1704 ms/op 0.83
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,smpl:16384 926.55 us/op 1.0279 ms/op 0.90
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,nocache,smpl:16384 2.8511 ms/op 2.4328 ms/op 1.17
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,smpl:16384 1.5271 ms/op 1.8677 ms/op 0.82
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,nocache,smpl:16384 4.7429 ms/op 4.7313 ms/op 1.00
Tree 40 250000 create 355.82 ms/op 996.88 ms/op 0.36
Tree 40 250000 get(125000) 197.56 ns/op 205.96 ns/op 0.96
Tree 40 250000 set(125000) 1.0361 us/op 2.3018 us/op 0.45
Tree 40 250000 toArray() 24.706 ms/op 30.007 ms/op 0.82
Tree 40 250000 iterate all - toArray() + loop 24.623 ms/op 34.231 ms/op 0.72
Tree 40 250000 iterate all - get(i) 78.366 ms/op 93.006 ms/op 0.84
MutableVector 250000 create 11.605 ms/op 15.402 ms/op 0.75
MutableVector 250000 get(125000) 7.6350 ns/op 7.3600 ns/op 1.04
MutableVector 250000 set(125000) 335.45 ns/op 673.20 ns/op 0.50
MutableVector 250000 toArray() 3.4833 ms/op 5.9052 ms/op 0.59
MutableVector 250000 iterate all - toArray() + loop 3.9372 ms/op 6.0408 ms/op 0.65
MutableVector 250000 iterate all - get(i) 1.5505 ms/op 1.6231 ms/op 0.96
Array 250000 create 3.4462 ms/op 5.4281 ms/op 0.63
Array 250000 clone - spread 1.1870 ms/op 1.8292 ms/op 0.65
Array 250000 get(125000) 0.62000 ns/op 1.4420 ns/op 0.43
Array 250000 set(125000) 0.71100 ns/op 2.3190 ns/op 0.31
Array 250000 iterate all - loop 125.26 us/op 93.232 us/op 1.34
effectiveBalanceIncrements clone Uint8Array 300000 39.726 us/op 101.36 us/op 0.39
effectiveBalanceIncrements clone MutableVector 300000 345.00 ns/op 1.9090 us/op 0.18
effectiveBalanceIncrements rw all Uint8Array 300000 183.95 us/op 182.45 us/op 1.01
effectiveBalanceIncrements rw all MutableVector 300000 101.35 ms/op 220.55 ms/op 0.46
phase0 afterProcessEpoch - 250000 vs - 7PWei 119.19 ms/op 128.44 ms/op 0.93
phase0 beforeProcessEpoch - 250000 vs - 7PWei 49.205 ms/op 63.851 ms/op 0.77
altair processEpoch - mainnet_e81889 324.22 ms/op 461.50 ms/op 0.70
mainnet_e81889 - altair beforeProcessEpoch 72.981 ms/op 89.419 ms/op 0.82
mainnet_e81889 - altair processJustificationAndFinalization 18.180 us/op 30.775 us/op 0.59
mainnet_e81889 - altair processInactivityUpdates 5.8934 ms/op 11.002 ms/op 0.54
mainnet_e81889 - altair processRewardsAndPenalties 54.868 ms/op 83.137 ms/op 0.66
mainnet_e81889 - altair processRegistryUpdates 2.9590 us/op 6.8240 us/op 0.43
mainnet_e81889 - altair processSlashings 654.00 ns/op 1.3460 us/op 0.49
mainnet_e81889 - altair processEth1DataReset 674.00 ns/op 1.6560 us/op 0.41
mainnet_e81889 - altair processEffectiveBalanceUpdates 1.2856 ms/op 2.3385 ms/op 0.55
mainnet_e81889 - altair processSlashingsReset 5.3440 us/op 8.9040 us/op 0.60
mainnet_e81889 - altair processRandaoMixesReset 11.034 us/op 12.484 us/op 0.88
mainnet_e81889 - altair processHistoricalRootsUpdate 1.7690 us/op 2.1050 us/op 0.84
mainnet_e81889 - altair processParticipationFlagUpdates 6.0100 us/op 6.1660 us/op 0.97
mainnet_e81889 - altair processSyncCommitteeUpdates 1.2710 us/op 1.9430 us/op 0.65
mainnet_e81889 - altair afterProcessEpoch 153.56 ms/op 168.02 ms/op 0.91
phase0 processEpoch - mainnet_e58758 430.48 ms/op 425.39 ms/op 1.01
mainnet_e58758 - phase0 beforeProcessEpoch 176.74 ms/op 190.61 ms/op 0.93
mainnet_e58758 - phase0 processJustificationAndFinalization 27.878 us/op 25.227 us/op 1.11
mainnet_e58758 - phase0 processRewardsAndPenalties 76.392 ms/op 55.741 ms/op 1.37
mainnet_e58758 - phase0 processRegistryUpdates 15.134 us/op 8.8410 us/op 1.71
mainnet_e58758 - phase0 processSlashings 894.00 ns/op 858.00 ns/op 1.04
mainnet_e58758 - phase0 processEth1DataReset 1.2680 us/op 1.3140 us/op 0.96
mainnet_e58758 - phase0 processEffectiveBalanceUpdates 2.2321 ms/op 1.8522 ms/op 1.21
mainnet_e58758 - phase0 processSlashingsReset 8.5990 us/op 7.9200 us/op 1.09
mainnet_e58758 - phase0 processRandaoMixesReset 14.216 us/op 10.164 us/op 1.40
mainnet_e58758 - phase0 processHistoricalRootsUpdate 2.1540 us/op 2.1230 us/op 1.01
mainnet_e58758 - phase0 processParticipationRecordUpdates 5.5760 us/op 10.253 us/op 0.54
mainnet_e58758 - phase0 afterProcessEpoch 104.77 ms/op 106.03 ms/op 0.99
phase0 processEffectiveBalanceUpdates - 250000 normalcase 1.5702 ms/op 1.4867 ms/op 1.06
phase0 processEffectiveBalanceUpdates - 250000 worstcase 0.5 1.6509 ms/op 2.0344 ms/op 0.81
altair processInactivityUpdates - 250000 normalcase 27.186 ms/op 29.461 ms/op 0.92
altair processInactivityUpdates - 250000 worstcase 33.078 ms/op 29.324 ms/op 1.13
phase0 processRegistryUpdates - 250000 normalcase 12.970 us/op 14.080 us/op 0.92
phase0 processRegistryUpdates - 250000 badcase_full_deposits 306.26 us/op 345.61 us/op 0.89
phase0 processRegistryUpdates - 250000 worstcase 0.5 175.67 ms/op 158.03 ms/op 1.11
altair processRewardsAndPenalties - 250000 normalcase 85.869 ms/op 74.260 ms/op 1.16
altair processRewardsAndPenalties - 250000 worstcase 80.800 ms/op 71.136 ms/op 1.14
phase0 getAttestationDeltas - 250000 normalcase 11.657 ms/op 8.2559 ms/op 1.41
phase0 getAttestationDeltas - 250000 worstcase 9.3700 ms/op 7.8933 ms/op 1.19
phase0 processSlashings - 250000 worstcase 3.6875 ms/op 3.6884 ms/op 1.00
altair processSyncCommitteeUpdates - 250000 197.64 ms/op 191.89 ms/op 1.03
BeaconState.hashTreeRoot - No change 304.00 ns/op 382.00 ns/op 0.80
BeaconState.hashTreeRoot - 1 full validator 59.130 us/op 58.232 us/op 1.02
BeaconState.hashTreeRoot - 32 full validator 561.07 us/op 610.00 us/op 0.92
BeaconState.hashTreeRoot - 512 full validator 5.3298 ms/op 5.6213 ms/op 0.95
BeaconState.hashTreeRoot - 1 validator.effectiveBalance 67.989 us/op 69.939 us/op 0.97
BeaconState.hashTreeRoot - 32 validator.effectiveBalance 959.75 us/op 1.1075 ms/op 0.87
BeaconState.hashTreeRoot - 512 validator.effectiveBalance 14.866 ms/op 12.544 ms/op 1.19
BeaconState.hashTreeRoot - 1 balances 53.385 us/op 48.389 us/op 1.10
BeaconState.hashTreeRoot - 32 balances 502.17 us/op 497.82 us/op 1.01
BeaconState.hashTreeRoot - 512 balances 4.6822 ms/op 4.7371 ms/op 0.99
BeaconState.hashTreeRoot - 250000 balances 81.476 ms/op 81.919 ms/op 0.99
aggregationBits - 2048 els - zipIndexesInBitList 21.925 us/op 20.367 us/op 1.08
regular array get 100000 times 37.423 us/op 36.302 us/op 1.03
wrappedArray get 100000 times 37.745 us/op 43.481 us/op 0.87
arrayWithProxy get 100000 times 20.559 ms/op 16.188 ms/op 1.27
ssz.Root.equals 669.00 ns/op 578.00 ns/op 1.16
byteArrayEquals 616.00 ns/op 562.00 ns/op 1.10
shuffle list - 16384 els 7.5582 ms/op 7.0897 ms/op 1.07
shuffle list - 250000 els 121.67 ms/op 105.66 ms/op 1.15
processSlot - 1 slots 10.731 us/op 9.5480 us/op 1.12
processSlot - 32 slots 1.6133 ms/op 1.4706 ms/op 1.10
getEffectiveBalanceIncrementsZeroInactive - 250000 vs - 7PWei 37.572 ms/op 38.977 ms/op 0.96
getCommitteeAssignments - req 1 vs - 250000 vc 3.0415 ms/op 3.0855 ms/op 0.99
getCommitteeAssignments - req 100 vs - 250000 vc 4.3229 ms/op 4.2915 ms/op 1.01
getCommitteeAssignments - req 1000 vs - 250000 vc 4.6342 ms/op 4.7103 ms/op 0.98
RootCache.getBlockRootAtSlot - 250000 vs - 7PWei 5.0900 ns/op 5.2000 ns/op 0.98
state getBlockRootAtSlot - 250000 vs - 7PWei 1.1631 us/op 762.23 ns/op 1.53
computeProposers - vc 250000 11.060 ms/op 12.200 ms/op 0.91
computeEpochShuffling - vc 250000 107.28 ms/op 108.35 ms/op 0.99
getNextSyncCommittee - vc 250000 187.37 ms/op 191.13 ms/op 0.98
computeSigningRoot for AttestationData 14.965 us/op 14.925 us/op 1.00
hash AttestationData serialized data then Buffer.toString(base64) 2.6367 us/op 2.6569 us/op 0.99
toHexString serialized data 1.3890 us/op 1.1984 us/op 1.16
Buffer.toString(base64) 359.17 ns/op 333.57 ns/op 1.08

by benchmarkbot/action

@g11tech g11tech merged commit c0115b0 into unstable Jun 13, 2023
@g11tech g11tech deleted the g11tech/engine-datagas branch June 13, 2023 05:58
@wemeetagain
Copy link
Member

🎉 This PR is included in v1.9.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.

3 participants