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

Add historicalSummaries capella onwards #4974

Merged
merged 15 commits into from
Jan 9, 2023
Merged

Conversation

g11tech
Copy link
Contributor

@g11tech g11tech commented Jan 4, 2023

Add historicalSummaries capella onwards

Ref

TODO:

  • get it merge ready when new spec tests are released

@github-actions
Copy link
Contributor

github-actions bot commented Jan 4, 2023

Performance Report

✔️ no performance regression detected

Full benchmark results
Benchmark suite Current: 8727544 Previous: e53cde0 Ratio
getPubkeys - index2pubkey - req 1000 vs - 250000 vc 1.4011 ms/op 1.0080 ms/op 1.39
getPubkeys - validatorsArr - req 1000 vs - 250000 vc 83.686 us/op 60.007 us/op 1.39
BLS verify - blst-native 2.3289 ms/op 2.1737 ms/op 1.07
BLS verifyMultipleSignatures 3 - blst-native 4.7612 ms/op 4.4853 ms/op 1.06
BLS verifyMultipleSignatures 8 - blst-native 10.249 ms/op 9.6958 ms/op 1.06
BLS verifyMultipleSignatures 32 - blst-native 37.145 ms/op 35.236 ms/op 1.05
BLS aggregatePubkeys 32 - blst-native 49.225 us/op 47.067 us/op 1.05
BLS aggregatePubkeys 128 - blst-native 192.98 us/op 183.68 us/op 1.05
getAttestationsForBlock 105.90 ms/op 77.632 ms/op 1.36
isKnown best case - 1 super set check 516.00 ns/op 448.00 ns/op 1.15
isKnown normal case - 2 super set checks 508.00 ns/op 437.00 ns/op 1.16
isKnown worse case - 16 super set checks 505.00 ns/op 435.00 ns/op 1.16
CheckpointStateCache - add get delete 10.287 us/op 8.4680 us/op 1.21
validate gossip signedAggregateAndProof - struct 5.3394 ms/op 5.0136 ms/op 1.06
validate gossip attestation - struct 2.5208 ms/op 2.3604 ms/op 1.07
pickEth1Vote - no votes 2.6471 ms/op 2.4980 ms/op 1.06
pickEth1Vote - max votes 19.794 ms/op 15.580 ms/op 1.27
pickEth1Vote - Eth1Data hashTreeRoot value x2048 14.309 ms/op 13.175 ms/op 1.09
pickEth1Vote - Eth1Data hashTreeRoot tree x2048 25.264 ms/op 20.539 ms/op 1.23
pickEth1Vote - Eth1Data fastSerialize value x2048 1.5211 ms/op 1.0786 ms/op 1.41
pickEth1Vote - Eth1Data fastSerialize tree x2048 11.497 ms/op 9.6047 ms/op 1.20
bytes32 toHexString 1.2790 us/op 844.00 ns/op 1.52
bytes32 Buffer.toString(hex) 710.00 ns/op 657.00 ns/op 1.08
bytes32 Buffer.toString(hex) from Uint8Array 1.1990 us/op 1.0030 us/op 1.20
bytes32 Buffer.toString(hex) + 0x 705.00 ns/op 675.00 ns/op 1.04
Object access 1 prop 0.34600 ns/op 0.28400 ns/op 1.22
Map access 1 prop 0.31900 ns/op 0.26100 ns/op 1.22
Object get x1000 20.574 ns/op 10.905 ns/op 1.89
Map get x1000 1.2550 ns/op 0.92900 ns/op 1.35
Object set x1000 134.24 ns/op 70.028 ns/op 1.92
Map set x1000 85.206 ns/op 41.093 ns/op 2.07
Return object 10000 times 0.46220 ns/op 0.43390 ns/op 1.07
Throw Error 10000 times 8.3836 us/op 6.6032 us/op 1.27
fastMsgIdFn sha256 / 200 bytes 5.4150 us/op 4.7480 us/op 1.14
fastMsgIdFn h32 xxhash / 200 bytes 560.00 ns/op 476.00 ns/op 1.18
fastMsgIdFn h64 xxhash / 200 bytes 780.00 ns/op 675.00 ns/op 1.16
fastMsgIdFn sha256 / 1000 bytes 16.892 us/op 15.713 us/op 1.08
fastMsgIdFn h32 xxhash / 1000 bytes 748.00 ns/op 650.00 ns/op 1.15
fastMsgIdFn h64 xxhash / 1000 bytes 863.00 ns/op 762.00 ns/op 1.13
fastMsgIdFn sha256 / 10000 bytes 146.12 us/op 136.51 us/op 1.07
fastMsgIdFn h32 xxhash / 10000 bytes 2.8770 us/op 2.5430 us/op 1.13
fastMsgIdFn h64 xxhash / 10000 bytes 2.0400 us/op 1.7310 us/op 1.18
enrSubnets - fastDeserialize 64 bits 2.8240 us/op 2.2600 us/op 1.25
enrSubnets - ssz BitVector 64 bits 978.00 ns/op 800.00 ns/op 1.22
enrSubnets - fastDeserialize 4 bits 367.00 ns/op 282.00 ns/op 1.30
enrSubnets - ssz BitVector 4 bits 985.00 ns/op 804.00 ns/op 1.23
prioritizePeers score -10:0 att 32-0.1 sync 2-0 207.40 us/op 152.17 us/op 1.36
prioritizePeers score 0:0 att 32-0.25 sync 2-0.25 274.09 us/op 163.04 us/op 1.68
prioritizePeers score 0:0 att 32-0.5 sync 2-0.5 374.50 us/op 262.97 us/op 1.42
prioritizePeers score 0:0 att 64-0.75 sync 4-0.75 668.32 us/op 440.29 us/op 1.52
prioritizePeers score 0:0 att 64-1 sync 4-1 759.19 us/op 501.95 us/op 1.51
array of 16000 items push then shift 3.4551 us/op 51.618 us/op 0.07
LinkedList of 16000 items push then shift 21.180 ns/op 12.190 ns/op 1.74
array of 16000 items push then pop 253.21 ns/op 188.94 ns/op 1.34
LinkedList of 16000 items push then pop 20.498 ns/op 12.058 ns/op 1.70
array of 24000 items push then shift 4.9363 us/op 77.380 us/op 0.06
LinkedList of 24000 items push then shift 24.071 ns/op 12.608 ns/op 1.91
array of 24000 items push then pop 252.73 ns/op 192.88 ns/op 1.31
LinkedList of 24000 items push then pop 21.507 ns/op 12.005 ns/op 1.79
intersect bitArray bitLen 8 36.511 ns/op 21.722 ns/op 1.68
intersect array and set length 8 201.50 ns/op 123.51 ns/op 1.63
intersect bitArray bitLen 128 135.49 ns/op 70.828 ns/op 1.91
intersect array and set length 128 2.7911 us/op 1.7903 us/op 1.56
Buffer.concat 32 items 7.5210 us/op 4.4970 us/op 1.67
Uint8Array.set 32 items 4.9870 us/op 3.4200 us/op 1.46
pass gossip attestations to forkchoice per slot 9.4207 ms/op 3.7623 ms/op 2.50
computeDeltas 7.2641 ms/op 4.2634 ms/op 1.70
computeProposerBoostScoreFromBalances 3.1804 ms/op 2.4742 ms/op 1.29
altair processAttestation - 250000 vs - 7PWei normalcase 4.7040 ms/op 3.4389 ms/op 1.37
altair processAttestation - 250000 vs - 7PWei worstcase 8.9305 ms/op 6.2246 ms/op 1.43
altair processAttestation - setStatus - 1/6 committees join 250.05 us/op 175.44 us/op 1.43
altair processAttestation - setStatus - 1/3 committees join 489.35 us/op 354.10 us/op 1.38
altair processAttestation - setStatus - 1/2 committees join 674.70 us/op 511.00 us/op 1.32
altair processAttestation - setStatus - 2/3 committees join 868.63 us/op 669.77 us/op 1.30
altair processAttestation - setStatus - 4/5 committees join 1.1996 ms/op 937.93 us/op 1.28
altair processAttestation - setStatus - 100% committees join 1.4214 ms/op 1.1209 ms/op 1.27
altair processBlock - 250000 vs - 7PWei normalcase 30.212 ms/op 23.034 ms/op 1.31
altair processBlock - 250000 vs - 7PWei normalcase hashState 41.387 ms/op 38.864 ms/op 1.06
altair processBlock - 250000 vs - 7PWei worstcase 104.65 ms/op 74.996 ms/op 1.40
altair processBlock - 250000 vs - 7PWei worstcase hashState 117.68 ms/op 110.41 ms/op 1.07
phase0 processBlock - 250000 vs - 7PWei normalcase 4.3085 ms/op 3.1838 ms/op 1.35
phase0 processBlock - 250000 vs - 7PWei worstcase 56.815 ms/op 51.013 ms/op 1.11
altair processEth1Data - 250000 vs - 7PWei normalcase 956.61 us/op 652.80 us/op 1.47
vc - 250000 eb 1 eth1 1 we 0 wn 0 - smpl 15 15.350 us/op 7.7240 us/op 1.99
vc - 250000 eb 0.95 eth1 0.1 we 0.05 wn 0 - smpl 219 37.678 us/op 22.670 us/op 1.66
vc - 250000 eb 0.95 eth1 0.3 we 0.05 wn 0 - smpl 42 20.356 us/op 9.9680 us/op 2.04
vc - 250000 eb 0.95 eth1 0.7 we 0.05 wn 0 - smpl 18 16.062 us/op 7.5790 us/op 2.12
vc - 250000 eb 0.1 eth1 0.1 we 0 wn 0 - smpl 1020 145.50 us/op 88.778 us/op 1.64
vc - 250000 eb 0.03 eth1 0.03 we 0 wn 0 - smpl 11777 1.3370 ms/op 860.24 us/op 1.55
vc - 250000 eb 0.01 eth1 0.01 we 0 wn 0 - smpl 16384 1.7650 ms/op 1.1409 ms/op 1.55
vc - 250000 eb 0 eth1 0 we 0 wn 0 - smpl 16384 1.7344 ms/op 1.1115 ms/op 1.56
vc - 250000 eb 0 eth1 0 we 0 wn 0 nocache - smpl 16384 5.5149 ms/op 4.0378 ms/op 1.37
vc - 250000 eb 0 eth1 1 we 0 wn 0 - smpl 16384 3.4417 ms/op 2.4395 ms/op 1.41
vc - 250000 eb 0 eth1 1 we 0 wn 0 nocache - smpl 16384 8.5544 ms/op 6.9475 ms/op 1.23
Tree 40 250000 create 827.87 ms/op 614.53 ms/op 1.35
Tree 40 250000 get(125000) 364.87 ns/op 232.14 ns/op 1.57
Tree 40 250000 set(125000) 2.5825 us/op 1.9514 us/op 1.32
Tree 40 250000 toArray() 37.422 ms/op 27.003 ms/op 1.39
Tree 40 250000 iterate all - toArray() + loop 37.463 ms/op 26.707 ms/op 1.40
Tree 40 250000 iterate all - get(i) 135.53 ms/op 111.58 ms/op 1.21
MutableVector 250000 create 21.096 ms/op 12.947 ms/op 1.63
MutableVector 250000 get(125000) 16.490 ns/op 10.733 ns/op 1.54
MutableVector 250000 set(125000) 701.83 ns/op 512.17 ns/op 1.37
MutableVector 250000 toArray() 7.5972 ms/op 6.1815 ms/op 1.23
MutableVector 250000 iterate all - toArray() + loop 7.7985 ms/op 5.4768 ms/op 1.42
MutableVector 250000 iterate all - get(i) 4.3357 ms/op 2.7643 ms/op 1.57
Array 250000 create 7.3697 ms/op 5.3649 ms/op 1.37
Array 250000 clone - spread 3.3075 ms/op 1.8888 ms/op 1.75
Array 250000 get(125000) 1.3660 ns/op 0.95000 ns/op 1.44
Array 250000 set(125000) 1.4520 ns/op 0.93900 ns/op 1.55
Array 250000 iterate all - loop 209.77 us/op 151.28 us/op 1.39
effectiveBalanceIncrements clone Uint8Array 300000 94.004 us/op 37.694 us/op 2.49
effectiveBalanceIncrements clone MutableVector 300000 985.00 ns/op 535.00 ns/op 1.84
effectiveBalanceIncrements rw all Uint8Array 300000 316.30 us/op 243.85 us/op 1.30
effectiveBalanceIncrements rw all MutableVector 300000 222.16 ms/op 137.05 ms/op 1.62
phase0 afterProcessEpoch - 250000 vs - 7PWei 232.64 ms/op 183.90 ms/op 1.27
phase0 beforeProcessEpoch - 250000 vs - 7PWei 115.57 ms/op 57.613 ms/op 2.01
altair processEpoch - mainnet_e81889 688.75 ms/op 516.83 ms/op 1.33
mainnet_e81889 - altair beforeProcessEpoch 180.78 ms/op 127.07 ms/op 1.42
mainnet_e81889 - altair processJustificationAndFinalization 43.796 us/op 17.104 us/op 2.56
mainnet_e81889 - altair processInactivityUpdates 13.530 ms/op 8.5944 ms/op 1.57
mainnet_e81889 - altair processRewardsAndPenalties 109.47 ms/op 76.706 ms/op 1.43
mainnet_e81889 - altair processRegistryUpdates 7.3150 us/op 2.1760 us/op 3.36
mainnet_e81889 - altair processSlashings 1.9960 us/op 549.00 ns/op 3.64
mainnet_e81889 - altair processEth1DataReset 1.7300 us/op 524.00 ns/op 3.30
mainnet_e81889 - altair processEffectiveBalanceUpdates 2.9126 ms/op 1.9704 ms/op 1.48
mainnet_e81889 - altair processSlashingsReset 13.032 us/op 4.4130 us/op 2.95
mainnet_e81889 - altair processRandaoMixesReset 14.449 us/op 3.9470 us/op 3.66
mainnet_e81889 - altair processHistoricalRootsUpdate 2.0970 us/op 626.00 ns/op 3.35
mainnet_e81889 - altair processParticipationFlagUpdates 7.7940 us/op 2.0860 us/op 3.74
mainnet_e81889 - altair processSyncCommitteeUpdates 1.7450 us/op 472.00 ns/op 3.70
mainnet_e81889 - altair afterProcessEpoch 251.57 ms/op 194.41 ms/op 1.29
phase0 processEpoch - mainnet_e58758 750.36 ms/op 470.31 ms/op 1.60
mainnet_e58758 - phase0 beforeProcessEpoch 218.75 ms/op 167.00 ms/op 1.31
mainnet_e58758 - phase0 processJustificationAndFinalization 34.527 us/op 16.121 us/op 2.14
mainnet_e58758 - phase0 processRewardsAndPenalties 92.534 ms/op 99.205 ms/op 0.93
mainnet_e58758 - phase0 processRegistryUpdates 17.118 us/op 7.5300 us/op 2.27
mainnet_e58758 - phase0 processSlashings 1.6690 us/op 543.00 ns/op 3.07
mainnet_e58758 - phase0 processEth1DataReset 1.6710 us/op 578.00 ns/op 2.89
mainnet_e58758 - phase0 processEffectiveBalanceUpdates 2.5099 ms/op 1.5864 ms/op 1.58
mainnet_e58758 - phase0 processSlashingsReset 8.2510 us/op 3.2580 us/op 2.53
mainnet_e58758 - phase0 processRandaoMixesReset 13.916 us/op 4.5090 us/op 3.09
mainnet_e58758 - phase0 processHistoricalRootsUpdate 2.0130 us/op 630.00 ns/op 3.20
mainnet_e58758 - phase0 processParticipationRecordUpdates 10.369 us/op 3.5020 us/op 2.96
mainnet_e58758 - phase0 afterProcessEpoch 227.22 ms/op 159.70 ms/op 1.42
phase0 processEffectiveBalanceUpdates - 250000 normalcase 3.7036 ms/op 1.9430 ms/op 1.91
phase0 processEffectiveBalanceUpdates - 250000 worstcase 0.5 3.7296 ms/op 2.3210 ms/op 1.61
altair processInactivityUpdates - 250000 normalcase 45.140 ms/op 39.696 ms/op 1.14
altair processInactivityUpdates - 250000 worstcase 58.095 ms/op 32.949 ms/op 1.76
phase0 processRegistryUpdates - 250000 normalcase 15.354 us/op 6.3320 us/op 2.42
phase0 processRegistryUpdates - 250000 badcase_full_deposits 586.71 us/op 408.16 us/op 1.44
phase0 processRegistryUpdates - 250000 worstcase 0.5 258.13 ms/op 172.49 ms/op 1.50
altair processRewardsAndPenalties - 250000 normalcase 150.59 ms/op 68.653 ms/op 2.19
altair processRewardsAndPenalties - 250000 worstcase 102.81 ms/op 105.56 ms/op 0.97
phase0 getAttestationDeltas - 250000 normalcase 15.135 ms/op 11.557 ms/op 1.31
phase0 getAttestationDeltas - 250000 worstcase 15.435 ms/op 11.633 ms/op 1.33
phase0 processSlashings - 250000 worstcase 8.1990 ms/op 5.3117 ms/op 1.54
altair processSyncCommitteeUpdates - 250000 328.08 ms/op 289.58 ms/op 1.13
BeaconState.hashTreeRoot - No change 533.00 ns/op 486.00 ns/op 1.10
BeaconState.hashTreeRoot - 1 full validator 79.418 us/op 72.805 us/op 1.09
BeaconState.hashTreeRoot - 32 full validator 798.11 us/op 724.28 us/op 1.10
BeaconState.hashTreeRoot - 512 full validator 7.4974 ms/op 6.8234 ms/op 1.10
BeaconState.hashTreeRoot - 1 validator.effectiveBalance 117.61 us/op 87.646 us/op 1.34
BeaconState.hashTreeRoot - 32 validator.effectiveBalance 1.3500 ms/op 1.3067 ms/op 1.03
BeaconState.hashTreeRoot - 512 validator.effectiveBalance 18.725 ms/op 16.576 ms/op 1.13
BeaconState.hashTreeRoot - 1 balances 66.655 us/op 70.445 us/op 0.95
BeaconState.hashTreeRoot - 32 balances 722.15 us/op 625.87 us/op 1.15
BeaconState.hashTreeRoot - 512 balances 7.1747 ms/op 6.7369 ms/op 1.06
BeaconState.hashTreeRoot - 250000 balances 116.30 ms/op 107.78 ms/op 1.08
aggregationBits - 2048 els - zipIndexesInBitList 35.824 us/op 23.909 us/op 1.50
regular array get 100000 times 84.170 us/op 60.521 us/op 1.39
wrappedArray get 100000 times 84.206 us/op 60.535 us/op 1.39
arrayWithProxy get 100000 times 34.595 ms/op 26.123 ms/op 1.32
ssz.Root.equals 1.3290 us/op 935.00 ns/op 1.42
byteArrayEquals 1.3510 us/op 909.00 ns/op 1.49
shuffle list - 16384 els 14.143 ms/op 11.244 ms/op 1.26
shuffle list - 250000 els 207.57 ms/op 165.07 ms/op 1.26
processSlot - 1 slots 15.119 us/op 13.199 us/op 1.15
processSlot - 32 slots 2.1698 ms/op 1.9562 ms/op 1.11
getEffectiveBalanceIncrementsZeroInactive - 250000 vs - 7PWei 412.98 us/op 322.48 us/op 1.28
getCommitteeAssignments - req 1 vs - 250000 vc 7.8960 ms/op 5.4477 ms/op 1.45
getCommitteeAssignments - req 100 vs - 250000 vc 9.4373 ms/op 7.9616 ms/op 1.19
getCommitteeAssignments - req 1000 vs - 250000 vc 10.003 ms/op 8.5030 ms/op 1.18
RootCache.getBlockRootAtSlot - 250000 vs - 7PWei 12.170 ns/op 7.4900 ns/op 1.62
state getBlockRootAtSlot - 250000 vs - 7PWei 1.4095 us/op 1.1052 us/op 1.28
computeProposers - vc 250000 19.819 ms/op 17.323 ms/op 1.14
computeEpochShuffling - vc 250000 211.22 ms/op 169.25 ms/op 1.25
getNextSyncCommittee - vc 250000 327.84 ms/op 288.24 ms/op 1.14

by benchmarkbot/action

@g11tech g11tech force-pushed the g11tech/hist-summaries branch from 9e129f0 to 1ba926d Compare January 8, 2023 12:29
@@ -1,48 +0,0 @@
import fs from "node:fs";
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this test was based on beacon state structure from devnet1, since it has changed, is no longer relvant here

@g11tech g11tech marked this pull request as ready for review January 8, 2023 18:47
@g11tech g11tech requested a review from a team as a code owner January 8, 2023 18:47
"historical_summaries_update",
],
// This test right now has been escalted as history summary should have been pushed
// in the state, but in the expected state as per test, nothing has been pushed
Copy link
Contributor Author

Choose a reason for hiding this comment

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

escalated the test to the CL group, waiting on revert but seems like lodestar is doing the right thing

"partial_withdrawals",
"bls_to_execution_change",
"withdrawals",
"historical_summaries_update",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

added to pending tracker list
-#4680,
but other transition tests cover summaries update as well so we can take it up as a separate task

Copy link
Contributor Author

Choose a reason for hiding this comment

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

added the epochfn handler for historical_summaries_update, so its not skipped now 👍

dapplion
dapplion previously approved these changes Jan 9, 2023
Copy link
Contributor

@dapplion dapplion left a comment

Choose a reason for hiding this comment

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

LGMT!

@g11tech g11tech force-pushed the g11tech/hist-summaries branch from e766505 to af0a0b4 Compare January 9, 2023 08:19
@g11tech g11tech enabled auto-merge (squash) January 9, 2023 08:21
@g11tech g11tech merged commit 45d7c01 into unstable Jan 9, 2023
@g11tech g11tech deleted the g11tech/hist-summaries branch January 9, 2023 08:53
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