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

feat: implement eip 4788 for deneb #5703

Merged
merged 3 commits into from
Jun 26, 2023
Merged

feat: implement eip 4788 for deneb #5703

merged 3 commits into from
Jun 26, 2023

Conversation

g11tech
Copy link
Contributor

@g11tech g11tech commented Jun 25, 2023

@g11tech g11tech requested a review from a team as a code owner June 25, 2023 12:59
@github-actions
Copy link
Contributor

Performance Report

✔️ no performance regression detected

Full benchmark results
Benchmark suite Current: b64dfb0 Previous: 50daa01 Ratio
getPubkeys - index2pubkey - req 1000 vs - 250000 vc 826.25 us/op 589.73 us/op 1.40
getPubkeys - validatorsArr - req 1000 vs - 250000 vc 44.988 us/op 48.519 us/op 0.93
BLS verify - blst-native 1.2069 ms/op 1.2556 ms/op 0.96
BLS verifyMultipleSignatures 3 - blst-native 2.4461 ms/op 2.5537 ms/op 0.96
BLS verifyMultipleSignatures 8 - blst-native 5.1650 ms/op 5.4710 ms/op 0.94
BLS verifyMultipleSignatures 32 - blst-native 18.781 ms/op 19.790 ms/op 0.95
BLS aggregatePubkeys 32 - blst-native 24.928 us/op 26.302 us/op 0.95
BLS aggregatePubkeys 128 - blst-native 97.605 us/op 103.18 us/op 0.95
getAttestationsForBlock 63.372 ms/op 62.719 ms/op 1.01
isKnown best case - 1 super set check 254.00 ns/op 275.00 ns/op 0.92
isKnown normal case - 2 super set checks 242.00 ns/op 274.00 ns/op 0.88
isKnown worse case - 16 super set checks 243.00 ns/op 266.00 ns/op 0.91
CheckpointStateCache - add get delete 5.2050 us/op 6.0970 us/op 0.85
validate gossip signedAggregateAndProof - struct 2.7420 ms/op 2.9150 ms/op 0.94
validate gossip attestation - struct 1.3044 ms/op 1.3727 ms/op 0.95
pickEth1Vote - no votes 1.2589 ms/op 1.4074 ms/op 0.89
pickEth1Vote - max votes 11.303 ms/op 10.411 ms/op 1.09
pickEth1Vote - Eth1Data hashTreeRoot value x2048 8.9868 ms/op 9.6298 ms/op 0.93
pickEth1Vote - Eth1Data hashTreeRoot tree x2048 18.947 ms/op 19.029 ms/op 1.00
pickEth1Vote - Eth1Data fastSerialize value x2048 656.40 us/op 842.96 us/op 0.78
pickEth1Vote - Eth1Data fastSerialize tree x2048 7.0819 ms/op 6.3115 ms/op 1.12
bytes32 toHexString 496.00 ns/op 542.00 ns/op 0.92
bytes32 Buffer.toString(hex) 336.00 ns/op 418.00 ns/op 0.80
bytes32 Buffer.toString(hex) from Uint8Array 525.00 ns/op 630.00 ns/op 0.83
bytes32 Buffer.toString(hex) + 0x 348.00 ns/op 425.00 ns/op 0.82
Object access 1 prop 0.16300 ns/op 0.18800 ns/op 0.87
Map access 1 prop 0.15600 ns/op 0.16300 ns/op 0.96
Object get x1000 6.6070 ns/op 6.6120 ns/op 1.00
Map get x1000 0.53400 ns/op 0.67800 ns/op 0.79
Object set x1000 52.154 ns/op 61.688 ns/op 0.85
Map set x1000 43.497 ns/op 50.814 ns/op 0.86
Return object 10000 times 0.23630 ns/op 0.24760 ns/op 0.95
Throw Error 10000 times 4.1538 us/op 4.3598 us/op 0.95
fastMsgIdFn sha256 / 200 bytes 3.4110 us/op 3.7180 us/op 0.92
fastMsgIdFn h32 xxhash / 200 bytes 278.00 ns/op 316.00 ns/op 0.88
fastMsgIdFn h64 xxhash / 200 bytes 389.00 ns/op 483.00 ns/op 0.81
fastMsgIdFn sha256 / 1000 bytes 11.645 us/op 12.247 us/op 0.95
fastMsgIdFn h32 xxhash / 1000 bytes 407.00 ns/op 462.00 ns/op 0.88
fastMsgIdFn h64 xxhash / 1000 bytes 466.00 ns/op 575.00 ns/op 0.81
fastMsgIdFn sha256 / 10000 bytes 102.78 us/op 107.37 us/op 0.96
fastMsgIdFn h32 xxhash / 10000 bytes 1.8770 us/op 2.0630 us/op 0.91
fastMsgIdFn h64 xxhash / 10000 bytes 1.3380 us/op 1.5140 us/op 0.88
enrSubnets - fastDeserialize 64 bits 1.2540 us/op 1.7350 us/op 0.72
enrSubnets - ssz BitVector 64 bits 465.00 ns/op 617.00 ns/op 0.75
enrSubnets - fastDeserialize 4 bits 163.00 ns/op 210.00 ns/op 0.78
enrSubnets - ssz BitVector 4 bits 469.00 ns/op 614.00 ns/op 0.76
prioritizePeers score -10:0 att 32-0.1 sync 2-0 103.81 us/op 119.31 us/op 0.87
prioritizePeers score 0:0 att 32-0.25 sync 2-0.25 129.51 us/op 161.03 us/op 0.80
prioritizePeers score 0:0 att 32-0.5 sync 2-0.5 156.98 us/op 223.55 us/op 0.70
prioritizePeers score 0:0 att 64-0.75 sync 4-0.75 291.23 us/op 410.92 us/op 0.71
prioritizePeers score 0:0 att 64-1 sync 4-1 353.29 us/op 492.82 us/op 0.72
array of 16000 items push then shift 1.6387 us/op 1.8610 us/op 0.88
LinkedList of 16000 items push then shift 8.6300 ns/op 11.361 ns/op 0.76
array of 16000 items push then pop 69.535 ns/op 139.49 ns/op 0.50
LinkedList of 16000 items push then pop 8.5110 ns/op 9.8890 ns/op 0.86
array of 24000 items push then shift 2.3831 us/op 2.5815 us/op 0.92
LinkedList of 24000 items push then shift 10.640 ns/op 10.305 ns/op 1.03
array of 24000 items push then pop 65.905 ns/op 98.245 ns/op 0.67
LinkedList of 24000 items push then pop 8.8210 ns/op 9.9900 ns/op 0.88
intersect bitArray bitLen 8 12.931 ns/op 14.298 ns/op 0.90
intersect array and set length 8 73.103 ns/op 90.980 ns/op 0.80
intersect bitArray bitLen 128 42.971 ns/op 45.586 ns/op 0.94
intersect array and set length 128 1.0062 us/op 1.3221 us/op 0.76
Buffer.concat 32 items 2.5500 us/op 3.0840 us/op 0.83
Uint8Array.set 32 items 2.0740 us/op 2.3100 us/op 0.90
transfer serialized Status (84 B) 1.9540 us/op 2.0880 us/op 0.94
copy serialized Status (84 B) 1.6360 us/op 1.7250 us/op 0.95
transfer serialized SignedVoluntaryExit (112 B) 2.0560 us/op 2.1220 us/op 0.97
copy serialized SignedVoluntaryExit (112 B) 1.7250 us/op 1.7420 us/op 0.99
transfer serialized ProposerSlashing (416 B) 2.8330 us/op 2.3590 us/op 1.20
copy serialized ProposerSlashing (416 B) 2.5800 us/op 2.3150 us/op 1.11
transfer serialized Attestation (485 B) 2.6920 us/op 2.4670 us/op 1.09
copy serialized Attestation (485 B) 2.0300 us/op 2.1320 us/op 0.95
transfer serialized AttesterSlashing (33232 B) 2.7560 us/op 2.4530 us/op 1.12
copy serialized AttesterSlashing (33232 B) 6.0520 us/op 6.6100 us/op 0.92
transfer serialized Small SignedBeaconBlock (128000 B) 2.8990 us/op 2.7130 us/op 1.07
copy serialized Small SignedBeaconBlock (128000 B) 39.031 us/op 17.649 us/op 2.21
transfer serialized Avg SignedBeaconBlock (200000 B) 3.1400 us/op 4.0590 us/op 0.77
copy serialized Avg SignedBeaconBlock (200000 B) 17.904 us/op 23.602 us/op 0.76
transfer serialized BlobsSidecar (524380 B) 3.0170 us/op 3.9500 us/op 0.76
copy serialized BlobsSidecar (524380 B) 143.66 us/op 198.59 us/op 0.72
transfer serialized Big SignedBeaconBlock (1000000 B) 3.3340 us/op 4.0500 us/op 0.82
copy serialized Big SignedBeaconBlock (1000000 B) 306.39 us/op 244.16 us/op 1.25
pass gossip attestations to forkchoice per slot 2.7566 ms/op 2.6409 ms/op 1.04
forkChoice updateHead vc 100000 bc 64 eq 0 2.0618 ms/op 2.1015 ms/op 0.98
forkChoice updateHead vc 600000 bc 64 eq 0 13.711 ms/op 13.789 ms/op 0.99
forkChoice updateHead vc 1000000 bc 64 eq 0 17.784 ms/op 20.840 ms/op 0.85
forkChoice updateHead vc 600000 bc 320 eq 0 16.243 ms/op 16.829 ms/op 0.97
forkChoice updateHead vc 600000 bc 1200 eq 0 80.103 ms/op 84.318 ms/op 0.95
forkChoice updateHead vc 600000 bc 64 eq 1000 23.213 ms/op 21.554 ms/op 1.08
forkChoice updateHead vc 600000 bc 64 eq 10000 25.041 ms/op 23.186 ms/op 1.08
forkChoice updateHead vc 600000 bc 64 eq 300000 31.471 ms/op 34.184 ms/op 0.92
computeDeltas 3.0219 ms/op 3.7002 ms/op 0.82
computeProposerBoostScoreFromBalances 1.7644 ms/op 1.8282 ms/op 0.97
altair processAttestation - 250000 vs - 7PWei normalcase 2.0818 ms/op 2.4530 ms/op 0.85
altair processAttestation - 250000 vs - 7PWei worstcase 3.2095 ms/op 3.8956 ms/op 0.82
altair processAttestation - setStatus - 1/6 committees join 135.86 us/op 149.85 us/op 0.91
altair processAttestation - setStatus - 1/3 committees join 268.90 us/op 281.44 us/op 0.96
altair processAttestation - setStatus - 1/2 committees join 355.97 us/op 371.27 us/op 0.96
altair processAttestation - setStatus - 2/3 committees join 436.09 us/op 471.94 us/op 0.92
altair processAttestation - setStatus - 4/5 committees join 643.05 us/op 669.83 us/op 0.96
altair processAttestation - setStatus - 100% committees join 741.65 us/op 756.47 us/op 0.98
altair processBlock - 250000 vs - 7PWei normalcase 20.450 ms/op 18.480 ms/op 1.11
altair processBlock - 250000 vs - 7PWei normalcase hashState 27.703 ms/op 27.935 ms/op 0.99
altair processBlock - 250000 vs - 7PWei worstcase 66.019 ms/op 53.136 ms/op 1.24
altair processBlock - 250000 vs - 7PWei worstcase hashState 93.040 ms/op 82.010 ms/op 1.13
phase0 processBlock - 250000 vs - 7PWei normalcase 2.0170 ms/op 2.2720 ms/op 0.89
phase0 processBlock - 250000 vs - 7PWei worstcase 32.193 ms/op 31.718 ms/op 1.01
altair processEth1Data - 250000 vs - 7PWei normalcase 464.12 us/op 542.09 us/op 0.86
getExpectedWithdrawals 250000 eb:1,eth1:1,we:0,wn:0,smpl:15 10.815 us/op 12.278 us/op 0.88
getExpectedWithdrawals 250000 eb:0.95,eth1:0.1,we:0.05,wn:0,smpl:219 24.362 us/op 26.347 us/op 0.92
getExpectedWithdrawals 250000 eb:0.95,eth1:0.3,we:0.05,wn:0,smpl:42 13.758 us/op 13.872 us/op 0.99
getExpectedWithdrawals 250000 eb:0.95,eth1:0.7,we:0.05,wn:0,smpl:18 10.235 us/op 8.1290 us/op 1.26
getExpectedWithdrawals 250000 eb:0.1,eth1:0.1,we:0,wn:0,smpl:1020 123.48 us/op 98.577 us/op 1.25
getExpectedWithdrawals 250000 eb:0.03,eth1:0.03,we:0,wn:0,smpl:11777 1.2437 ms/op 649.51 us/op 1.91
getExpectedWithdrawals 250000 eb:0.01,eth1:0.01,we:0,wn:0,smpl:16384 900.02 us/op 917.24 us/op 0.98
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,smpl:16384 863.78 us/op 881.20 us/op 0.98
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,nocache,smpl:16384 2.2594 ms/op 2.3795 ms/op 0.95
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,smpl:16384 2.4198 ms/op 1.8319 ms/op 1.32
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,nocache,smpl:16384 3.6212 ms/op 4.0150 ms/op 0.90
Tree 40 250000 create 310.95 ms/op 303.46 ms/op 1.02
Tree 40 250000 get(125000) 183.09 ns/op 186.07 ns/op 0.98
Tree 40 250000 set(125000) 945.09 ns/op 946.89 ns/op 1.00
Tree 40 250000 toArray() 18.095 ms/op 17.749 ms/op 1.02
Tree 40 250000 iterate all - toArray() + loop 17.742 ms/op 18.368 ms/op 0.97
Tree 40 250000 iterate all - get(i) 68.798 ms/op 70.397 ms/op 0.98
MutableVector 250000 create 13.498 ms/op 13.951 ms/op 0.97
MutableVector 250000 get(125000) 6.2820 ns/op 6.5480 ns/op 0.96
MutableVector 250000 set(125000) 241.47 ns/op 260.85 ns/op 0.93
MutableVector 250000 toArray() 2.7545 ms/op 2.7203 ms/op 1.01
MutableVector 250000 iterate all - toArray() + loop 2.9327 ms/op 2.8504 ms/op 1.03
MutableVector 250000 iterate all - get(i) 1.5093 ms/op 1.5218 ms/op 0.99
Array 250000 create 2.4856 ms/op 2.8594 ms/op 0.87
Array 250000 clone - spread 1.0883 ms/op 1.2756 ms/op 0.85
Array 250000 get(125000) 0.55200 ns/op 0.63200 ns/op 0.87
Array 250000 set(125000) 0.62300 ns/op 0.71100 ns/op 0.88
Array 250000 iterate all - loop 81.925 us/op 84.557 us/op 0.97
effectiveBalanceIncrements clone Uint8Array 300000 25.552 us/op 36.299 us/op 0.70
effectiveBalanceIncrements clone MutableVector 300000 343.00 ns/op 409.00 ns/op 0.84
effectiveBalanceIncrements rw all Uint8Array 300000 168.66 us/op 172.33 us/op 0.98
effectiveBalanceIncrements rw all MutableVector 300000 79.264 ms/op 89.414 ms/op 0.89
phase0 afterProcessEpoch - 250000 vs - 7PWei 112.32 ms/op 119.46 ms/op 0.94
phase0 beforeProcessEpoch - 250000 vs - 7PWei 49.359 ms/op 33.830 ms/op 1.46
altair processEpoch - mainnet_e81889 372.40 ms/op 343.91 ms/op 1.08
mainnet_e81889 - altair beforeProcessEpoch 70.605 ms/op 70.992 ms/op 0.99
mainnet_e81889 - altair processJustificationAndFinalization 27.102 us/op 18.313 us/op 1.48
mainnet_e81889 - altair processInactivityUpdates 5.8889 ms/op 6.7899 ms/op 0.87
mainnet_e81889 - altair processRewardsAndPenalties 89.718 ms/op 78.193 ms/op 1.15
mainnet_e81889 - altair processRegistryUpdates 4.0830 us/op 2.7390 us/op 1.49
mainnet_e81889 - altair processSlashings 955.00 ns/op 608.00 ns/op 1.57
mainnet_e81889 - altair processEth1DataReset 933.00 ns/op 635.00 ns/op 1.47
mainnet_e81889 - altair processEffectiveBalanceUpdates 2.3124 ms/op 1.4958 ms/op 1.55
mainnet_e81889 - altair processSlashingsReset 7.7240 us/op 4.1900 us/op 1.84
mainnet_e81889 - altair processRandaoMixesReset 7.3560 us/op 7.5540 us/op 0.97
mainnet_e81889 - altair processHistoricalRootsUpdate 1.1500 us/op 1.0050 us/op 1.14
mainnet_e81889 - altair processParticipationFlagUpdates 4.2500 us/op 3.2490 us/op 1.31
mainnet_e81889 - altair processSyncCommitteeUpdates 964.00 ns/op 514.00 ns/op 1.88
mainnet_e81889 - altair afterProcessEpoch 120.65 ms/op 126.90 ms/op 0.95
phase0 processEpoch - mainnet_e58758 346.41 ms/op 396.69 ms/op 0.87
mainnet_e58758 - phase0 beforeProcessEpoch 150.39 ms/op 151.14 ms/op 1.00
mainnet_e58758 - phase0 processJustificationAndFinalization 26.868 us/op 16.673 us/op 1.61
mainnet_e58758 - phase0 processRewardsAndPenalties 73.781 ms/op 62.091 ms/op 1.19
mainnet_e58758 - phase0 processRegistryUpdates 12.530 us/op 9.0490 us/op 1.38
mainnet_e58758 - phase0 processSlashings 839.00 ns/op 495.00 ns/op 1.69
mainnet_e58758 - phase0 processEth1DataReset 784.00 ns/op 468.00 ns/op 1.68
mainnet_e58758 - phase0 processEffectiveBalanceUpdates 1.8757 ms/op 1.2114 ms/op 1.55
mainnet_e58758 - phase0 processSlashingsReset 5.0110 us/op 4.3900 us/op 1.14
mainnet_e58758 - phase0 processRandaoMixesReset 7.5150 us/op 4.3830 us/op 1.71
mainnet_e58758 - phase0 processHistoricalRootsUpdate 1.0350 us/op 812.00 ns/op 1.27
mainnet_e58758 - phase0 processParticipationRecordUpdates 6.7150 us/op 3.9440 us/op 1.70
mainnet_e58758 - phase0 afterProcessEpoch 97.353 ms/op 99.470 ms/op 0.98
phase0 processEffectiveBalanceUpdates - 250000 normalcase 1.1175 ms/op 1.2596 ms/op 0.89
phase0 processEffectiveBalanceUpdates - 250000 worstcase 0.5 2.7772 ms/op 2.1926 ms/op 1.27
altair processInactivityUpdates - 250000 normalcase 27.067 ms/op 29.305 ms/op 0.92
altair processInactivityUpdates - 250000 worstcase 28.432 ms/op 27.119 ms/op 1.05
phase0 processRegistryUpdates - 250000 normalcase 10.634 us/op 6.9910 us/op 1.52
phase0 processRegistryUpdates - 250000 badcase_full_deposits 462.47 us/op 463.39 us/op 1.00
phase0 processRegistryUpdates - 250000 worstcase 0.5 134.62 ms/op 136.16 ms/op 0.99
altair processRewardsAndPenalties - 250000 normalcase 75.197 ms/op 72.337 ms/op 1.04
altair processRewardsAndPenalties - 250000 worstcase 75.688 ms/op 76.844 ms/op 0.98
phase0 getAttestationDeltas - 250000 normalcase 6.3078 ms/op 7.0474 ms/op 0.90
phase0 getAttestationDeltas - 250000 worstcase 6.5743 ms/op 6.8474 ms/op 0.96
phase0 processSlashings - 250000 worstcase 3.2217 ms/op 3.7063 ms/op 0.87
altair processSyncCommitteeUpdates - 250000 183.86 ms/op 191.13 ms/op 0.96
BeaconState.hashTreeRoot - No change 266.00 ns/op 276.00 ns/op 0.96
BeaconState.hashTreeRoot - 1 full validator 64.720 us/op 55.929 us/op 1.16
BeaconState.hashTreeRoot - 32 full validator 634.77 us/op 586.49 us/op 1.08
BeaconState.hashTreeRoot - 512 full validator 5.2433 ms/op 5.7034 ms/op 0.92
BeaconState.hashTreeRoot - 1 validator.effectiveBalance 67.443 us/op 67.105 us/op 1.01
BeaconState.hashTreeRoot - 32 validator.effectiveBalance 1.0077 ms/op 1.0139 ms/op 0.99
BeaconState.hashTreeRoot - 512 validator.effectiveBalance 11.570 ms/op 12.312 ms/op 0.94
BeaconState.hashTreeRoot - 1 balances 53.221 us/op 51.242 us/op 1.04
BeaconState.hashTreeRoot - 32 balances 556.74 us/op 491.26 us/op 1.13
BeaconState.hashTreeRoot - 512 balances 4.6737 ms/op 4.8837 ms/op 0.96
BeaconState.hashTreeRoot - 250000 balances 80.666 ms/op 82.422 ms/op 0.98
aggregationBits - 2048 els - zipIndexesInBitList 16.149 us/op 16.994 us/op 0.95
regular array get 100000 times 33.004 us/op 43.194 us/op 0.76
wrappedArray get 100000 times 33.014 us/op 33.817 us/op 0.98
arrayWithProxy get 100000 times 15.668 ms/op 17.029 ms/op 0.92
ssz.Root.equals 549.00 ns/op 568.00 ns/op 0.97
byteArrayEquals 543.00 ns/op 571.00 ns/op 0.95
shuffle list - 16384 els 6.8470 ms/op 7.1627 ms/op 0.96
shuffle list - 250000 els 101.24 ms/op 106.41 ms/op 0.95
processSlot - 1 slots 8.8780 us/op 9.4050 us/op 0.94
processSlot - 32 slots 1.3992 ms/op 1.4931 ms/op 0.94
getEffectiveBalanceIncrementsZeroInactive - 250000 vs - 7PWei 36.284 ms/op 38.459 ms/op 0.94
getCommitteeAssignments - req 1 vs - 250000 vc 2.9977 ms/op 2.9384 ms/op 1.02
getCommitteeAssignments - req 100 vs - 250000 vc 4.2306 ms/op 4.1221 ms/op 1.03
getCommitteeAssignments - req 1000 vs - 250000 vc 4.5975 ms/op 4.4899 ms/op 1.02
RootCache.getBlockRootAtSlot - 250000 vs - 7PWei 4.6700 ns/op 4.5000 ns/op 1.04
state getBlockRootAtSlot - 250000 vs - 7PWei 618.79 ns/op 1.0186 us/op 0.61
computeProposers - vc 250000 10.805 ms/op 10.432 ms/op 1.04
computeEpochShuffling - vc 250000 104.97 ms/op 102.85 ms/op 1.02
getNextSyncCommittee - vc 250000 179.72 ms/op 180.83 ms/op 0.99
computeSigningRoot for AttestationData 13.503 us/op 13.791 us/op 0.98
hash AttestationData serialized data then Buffer.toString(base64) 2.5146 us/op 2.4861 us/op 1.01
toHexString serialized data 1.1489 us/op 1.0765 us/op 1.07
Buffer.toString(base64) 344.51 ns/op 314.56 ns/op 1.10

by benchmarkbot/action

@g11tech g11tech merged commit f5d12a8 into unstable Jun 26, 2023
@g11tech g11tech deleted the g11tech/eip4788 branch June 26, 2023 07:02
@wemeetagain
Copy link
Member

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