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

Upgrade light-client data on fork boundaries #5301

Merged
merged 1 commit into from
Mar 25, 2023

Conversation

g11tech
Copy link
Contributor

@g11tech g11tech commented Mar 23, 2023

Upgrade light-client data on fork boundaries for gossip. Light client store's update processing doesn't seem to be affected by fork boundaries as of now.

Bootstrap is not gossiped and req/resp of bootstrap/updates comes with their own version which is used to pick correct forktype for to/from json

Closes #5102

@g11tech g11tech requested a review from a team as a code owner March 23, 2023 15:51
@g11tech g11tech mentioned this pull request Mar 23, 2023
4 tasks
@github-actions
Copy link
Contributor

Performance Report

✔️ no performance regression detected

Full benchmark results
Benchmark suite Current: ac45ae9 Previous: ac77c6f Ratio
getPubkeys - index2pubkey - req 1000 vs - 250000 vc 564.11 us/op 1.3514 ms/op 0.42
getPubkeys - validatorsArr - req 1000 vs - 250000 vc 60.823 us/op 73.268 us/op 0.83
BLS verify - blst-native 1.2999 ms/op 1.4163 ms/op 0.92
BLS verifyMultipleSignatures 3 - blst-native 2.6231 ms/op 2.8833 ms/op 0.91
BLS verifyMultipleSignatures 8 - blst-native 5.7621 ms/op 6.1700 ms/op 0.93
BLS verifyMultipleSignatures 32 - blst-native 20.047 ms/op 21.248 ms/op 0.94
BLS aggregatePubkeys 32 - blst-native 28.033 us/op 29.505 us/op 0.95
BLS aggregatePubkeys 128 - blst-native 107.63 us/op 107.60 us/op 1.00
getAttestationsForBlock 66.434 ms/op 87.419 ms/op 0.76
isKnown best case - 1 super set check 272.00 ns/op 301.00 ns/op 0.90
isKnown normal case - 2 super set checks 268.00 ns/op 307.00 ns/op 0.87
isKnown worse case - 16 super set checks 267.00 ns/op 292.00 ns/op 0.91
CheckpointStateCache - add get delete 6.0190 us/op 6.7390 us/op 0.89
validate gossip signedAggregateAndProof - struct 2.9408 ms/op 2.9639 ms/op 0.99
validate gossip attestation - struct 1.3991 ms/op 1.5476 ms/op 0.90
pickEth1Vote - no votes 1.4296 ms/op 1.5972 ms/op 0.90
pickEth1Vote - max votes 11.525 ms/op 16.635 ms/op 0.69
pickEth1Vote - Eth1Data hashTreeRoot value x2048 9.8530 ms/op 12.172 ms/op 0.81
pickEth1Vote - Eth1Data hashTreeRoot tree x2048 17.362 ms/op 21.993 ms/op 0.79
pickEth1Vote - Eth1Data fastSerialize value x2048 810.20 us/op 997.57 us/op 0.81
pickEth1Vote - Eth1Data fastSerialize tree x2048 6.1497 ms/op 10.518 ms/op 0.58
bytes32 toHexString 789.00 ns/op 872.00 ns/op 0.90
bytes32 Buffer.toString(hex) 447.00 ns/op 468.00 ns/op 0.96
bytes32 Buffer.toString(hex) from Uint8Array 649.00 ns/op 694.00 ns/op 0.94
bytes32 Buffer.toString(hex) + 0x 456.00 ns/op 467.00 ns/op 0.98
Object access 1 prop 0.22400 ns/op 0.23000 ns/op 0.97
Map access 1 prop 0.16800 ns/op 0.18700 ns/op 0.90
Object get x1000 7.8790 ns/op 10.909 ns/op 0.72
Map get x1000 0.73100 ns/op 0.85400 ns/op 0.86
Object set x1000 74.440 ns/op 84.894 ns/op 0.88
Map set x1000 59.382 ns/op 63.142 ns/op 0.94
Return object 10000 times 0.32080 ns/op 0.37480 ns/op 0.86
Throw Error 10000 times 4.6582 us/op 5.0684 us/op 0.92
fastMsgIdFn sha256 / 200 bytes 3.8550 us/op 3.8600 us/op 1.00
fastMsgIdFn h32 xxhash / 200 bytes 344.00 ns/op 353.00 ns/op 0.97
fastMsgIdFn h64 xxhash / 200 bytes 491.00 ns/op 495.00 ns/op 0.99
fastMsgIdFn sha256 / 1000 bytes 12.184 us/op 12.962 us/op 0.94
fastMsgIdFn h32 xxhash / 1000 bytes 519.00 ns/op 492.00 ns/op 1.05
fastMsgIdFn h64 xxhash / 1000 bytes 635.00 ns/op 578.00 ns/op 1.10
fastMsgIdFn sha256 / 10000 bytes 111.11 us/op 112.08 us/op 0.99
fastMsgIdFn h32 xxhash / 10000 bytes 2.2460 us/op 2.1400 us/op 1.05
fastMsgIdFn h64 xxhash / 10000 bytes 1.6540 us/op 1.5690 us/op 1.05
enrSubnets - fastDeserialize 64 bits 2.0160 us/op 2.1710 us/op 0.93
enrSubnets - ssz BitVector 64 bits 665.00 ns/op 679.00 ns/op 0.98
enrSubnets - fastDeserialize 4 bits 232.00 ns/op 248.00 ns/op 0.94
enrSubnets - ssz BitVector 4 bits 684.00 ns/op 700.00 ns/op 0.98
prioritizePeers score -10:0 att 32-0.1 sync 2-0 125.10 us/op 163.34 us/op 0.77
prioritizePeers score 0:0 att 32-0.25 sync 2-0.25 165.03 us/op 175.23 us/op 0.94
prioritizePeers score 0:0 att 32-0.5 sync 2-0.5 208.24 us/op 210.60 us/op 0.99
prioritizePeers score 0:0 att 64-0.75 sync 4-0.75 388.10 us/op 333.69 us/op 1.16
prioritizePeers score 0:0 att 64-1 sync 4-1 475.02 us/op 378.55 us/op 1.25
array of 16000 items push then shift 1.7422 us/op 1.7502 us/op 1.00
LinkedList of 16000 items push then shift 9.7010 ns/op 9.2670 ns/op 1.05
array of 16000 items push then pop 121.62 ns/op 99.992 ns/op 1.22
LinkedList of 16000 items push then pop 10.612 ns/op 8.6480 ns/op 1.23
array of 24000 items push then shift 3.2228 us/op 2.4946 us/op 1.29
LinkedList of 24000 items push then shift 12.239 ns/op 9.2620 ns/op 1.32
array of 24000 items push then pop 115.19 ns/op 80.192 ns/op 1.44
LinkedList of 24000 items push then pop 10.126 ns/op 8.7920 ns/op 1.15
intersect bitArray bitLen 8 14.348 ns/op 14.083 ns/op 1.02
intersect array and set length 8 137.66 ns/op 78.806 ns/op 1.75
intersect bitArray bitLen 128 56.907 ns/op 44.612 ns/op 1.28
intersect array and set length 128 1.5026 us/op 1.0661 us/op 1.41
Buffer.concat 32 items 3.5010 us/op 2.7030 us/op 1.30
Uint8Array.set 32 items 2.7650 us/op 2.1780 us/op 1.27
pass gossip attestations to forkchoice per slot 4.1240 ms/op 3.0293 ms/op 1.36
computeDeltas 3.5174 ms/op 3.1452 ms/op 1.12
computeProposerBoostScoreFromBalances 2.0429 ms/op 1.8342 ms/op 1.11
altair processAttestation - 250000 vs - 7PWei normalcase 3.6249 ms/op 2.6876 ms/op 1.35
altair processAttestation - 250000 vs - 7PWei worstcase 4.9467 ms/op 4.8372 ms/op 1.02
altair processAttestation - setStatus - 1/6 committees join 159.31 us/op 155.07 us/op 1.03
altair processAttestation - setStatus - 1/3 committees join 310.97 us/op 284.84 us/op 1.09
altair processAttestation - setStatus - 1/2 committees join 423.35 us/op 387.15 us/op 1.09
altair processAttestation - setStatus - 2/3 committees join 503.50 us/op 492.99 us/op 1.02
altair processAttestation - setStatus - 4/5 committees join 688.40 us/op 688.55 us/op 1.00
altair processAttestation - setStatus - 100% committees join 841.30 us/op 781.79 us/op 1.08
altair processBlock - 250000 vs - 7PWei normalcase 21.648 ms/op 17.086 ms/op 1.27
altair processBlock - 250000 vs - 7PWei normalcase hashState 31.073 ms/op 28.814 ms/op 1.08
altair processBlock - 250000 vs - 7PWei worstcase 56.375 ms/op 55.995 ms/op 1.01
altair processBlock - 250000 vs - 7PWei worstcase hashState 73.217 ms/op 71.757 ms/op 1.02
phase0 processBlock - 250000 vs - 7PWei normalcase 2.4470 ms/op 2.2320 ms/op 1.10
phase0 processBlock - 250000 vs - 7PWei worstcase 31.599 ms/op 31.519 ms/op 1.00
altair processEth1Data - 250000 vs - 7PWei normalcase 623.94 us/op 598.60 us/op 1.04
vc - 250000 eb 1 eth1 1 we 0 wn 0 - smpl 15 11.969 us/op 9.2960 us/op 1.29
vc - 250000 eb 0.95 eth1 0.1 we 0.05 wn 0 - smpl 219 38.531 us/op 30.000 us/op 1.28
vc - 250000 eb 0.95 eth1 0.3 we 0.05 wn 0 - smpl 42 12.654 us/op 11.612 us/op 1.09
vc - 250000 eb 0.95 eth1 0.7 we 0.05 wn 0 - smpl 18 10.430 us/op 10.800 us/op 0.97
vc - 250000 eb 0.1 eth1 0.1 we 0 wn 0 - smpl 1020 116.58 us/op 109.54 us/op 1.06
vc - 250000 eb 0.03 eth1 0.03 we 0 wn 0 - smpl 11777 709.58 us/op 655.23 us/op 1.08
vc - 250000 eb 0.01 eth1 0.01 we 0 wn 0 - smpl 16384 926.43 us/op 914.83 us/op 1.01
vc - 250000 eb 0 eth1 0 we 0 wn 0 - smpl 16384 943.71 us/op 869.16 us/op 1.09
vc - 250000 eb 0 eth1 0 we 0 wn 0 nocache - smpl 16384 2.9697 ms/op 2.4213 ms/op 1.23
vc - 250000 eb 0 eth1 1 we 0 wn 0 - smpl 16384 1.8183 ms/op 1.5723 ms/op 1.16
vc - 250000 eb 0 eth1 1 we 0 wn 0 nocache - smpl 16384 5.4819 ms/op 3.9014 ms/op 1.41
Tree 40 250000 create 479.01 ms/op 317.46 ms/op 1.51
Tree 40 250000 get(125000) 217.57 ns/op 199.25 ns/op 1.09
Tree 40 250000 set(125000) 1.0277 us/op 1.1707 us/op 0.88
Tree 40 250000 toArray() 23.588 ms/op 21.741 ms/op 1.08
Tree 40 250000 iterate all - toArray() + loop 23.783 ms/op 21.422 ms/op 1.11
Tree 40 250000 iterate all - get(i) 78.929 ms/op 74.717 ms/op 1.06
MutableVector 250000 create 12.155 ms/op 10.795 ms/op 1.13
MutableVector 250000 get(125000) 6.7140 ns/op 6.3270 ns/op 1.06
MutableVector 250000 set(125000) 338.59 ns/op 256.30 ns/op 1.32
MutableVector 250000 toArray() 4.7202 ms/op 2.7015 ms/op 1.75
MutableVector 250000 iterate all - toArray() + loop 5.3258 ms/op 3.2822 ms/op 1.62
MutableVector 250000 iterate all - get(i) 1.5654 ms/op 1.5278 ms/op 1.02
Array 250000 create 3.7044 ms/op 2.5343 ms/op 1.46
Array 250000 clone - spread 1.1778 ms/op 1.2674 ms/op 0.93
Array 250000 get(125000) 0.61400 ns/op 0.61200 ns/op 1.00
Array 250000 set(125000) 0.68000 ns/op 0.68500 ns/op 0.99
Array 250000 iterate all - loop 112.16 us/op 83.162 us/op 1.35
effectiveBalanceIncrements clone Uint8Array 300000 62.143 us/op 30.183 us/op 2.06
effectiveBalanceIncrements clone MutableVector 300000 498.00 ns/op 390.00 ns/op 1.28
effectiveBalanceIncrements rw all Uint8Array 300000 218.31 us/op 168.74 us/op 1.29
effectiveBalanceIncrements rw all MutableVector 300000 169.72 ms/op 87.270 ms/op 1.94
phase0 afterProcessEpoch - 250000 vs - 7PWei 136.46 ms/op 120.10 ms/op 1.14
phase0 beforeProcessEpoch - 250000 vs - 7PWei 53.080 ms/op 36.095 ms/op 1.47
altair processEpoch - mainnet_e81889 368.71 ms/op 306.41 ms/op 1.20
mainnet_e81889 - altair beforeProcessEpoch 79.411 ms/op 67.688 ms/op 1.17
mainnet_e81889 - altair processJustificationAndFinalization 26.506 us/op 16.763 us/op 1.58
mainnet_e81889 - altair processInactivityUpdates 7.2531 ms/op 5.4399 ms/op 1.33
mainnet_e81889 - altair processRewardsAndPenalties 53.944 ms/op 66.131 ms/op 0.82
mainnet_e81889 - altair processRegistryUpdates 4.3860 us/op 2.8180 us/op 1.56
mainnet_e81889 - altair processSlashings 1.0850 us/op 548.00 ns/op 1.98
mainnet_e81889 - altair processEth1DataReset 966.00 ns/op 558.00 ns/op 1.73
mainnet_e81889 - altair processEffectiveBalanceUpdates 1.9711 ms/op 1.2420 ms/op 1.59
mainnet_e81889 - altair processSlashingsReset 4.7520 us/op 4.6630 us/op 1.02
mainnet_e81889 - altair processRandaoMixesReset 7.2480 us/op 4.2720 us/op 1.70
mainnet_e81889 - altair processHistoricalRootsUpdate 1.9950 us/op 606.00 ns/op 3.29
mainnet_e81889 - altair processParticipationFlagUpdates 3.9100 us/op 3.2540 us/op 1.20
mainnet_e81889 - altair processSyncCommitteeUpdates 857.00 ns/op 895.00 ns/op 0.96
mainnet_e81889 - altair afterProcessEpoch 132.07 ms/op 129.76 ms/op 1.02
phase0 processEpoch - mainnet_e58758 373.77 ms/op 329.12 ms/op 1.14
mainnet_e58758 - phase0 beforeProcessEpoch 143.44 ms/op 106.14 ms/op 1.35
mainnet_e58758 - phase0 processJustificationAndFinalization 22.021 us/op 16.083 us/op 1.37
mainnet_e58758 - phase0 processRewardsAndPenalties 67.030 ms/op 54.412 ms/op 1.23
mainnet_e58758 - phase0 processRegistryUpdates 13.447 us/op 7.8630 us/op 1.71
mainnet_e58758 - phase0 processSlashings 1.5800 us/op 524.00 ns/op 3.02
mainnet_e58758 - phase0 processEth1DataReset 974.00 ns/op 472.00 ns/op 2.06
mainnet_e58758 - phase0 processEffectiveBalanceUpdates 2.0569 ms/op 971.44 us/op 2.12
mainnet_e58758 - phase0 processSlashingsReset 5.7250 us/op 3.8130 us/op 1.50
mainnet_e58758 - phase0 processRandaoMixesReset 8.1070 us/op 4.6630 us/op 1.74
mainnet_e58758 - phase0 processHistoricalRootsUpdate 1.1780 us/op 999.00 ns/op 1.18
mainnet_e58758 - phase0 processParticipationRecordUpdates 7.9120 us/op 4.4640 us/op 1.77
mainnet_e58758 - phase0 afterProcessEpoch 121.02 ms/op 95.769 ms/op 1.26
phase0 processEffectiveBalanceUpdates - 250000 normalcase 2.5389 ms/op 1.2333 ms/op 2.06
phase0 processEffectiveBalanceUpdates - 250000 worstcase 0.5 2.2313 ms/op 1.5434 ms/op 1.45
altair processInactivityUpdates - 250000 normalcase 37.460 ms/op 25.962 ms/op 1.44
altair processInactivityUpdates - 250000 worstcase 27.533 ms/op 27.495 ms/op 1.00
phase0 processRegistryUpdates - 250000 normalcase 15.493 us/op 6.9530 us/op 2.23
phase0 processRegistryUpdates - 250000 badcase_full_deposits 428.67 us/op 239.22 us/op 1.79
phase0 processRegistryUpdates - 250000 worstcase 0.5 166.01 ms/op 134.23 ms/op 1.24
altair processRewardsAndPenalties - 250000 normalcase 81.749 ms/op 67.220 ms/op 1.22
altair processRewardsAndPenalties - 250000 worstcase 81.433 ms/op 69.682 ms/op 1.17
phase0 getAttestationDeltas - 250000 normalcase 8.9810 ms/op 6.8663 ms/op 1.31
phase0 getAttestationDeltas - 250000 worstcase 9.3307 ms/op 6.8279 ms/op 1.37
phase0 processSlashings - 250000 worstcase 3.7375 ms/op 3.6571 ms/op 1.02
altair processSyncCommitteeUpdates - 250000 188.09 ms/op 183.18 ms/op 1.03
BeaconState.hashTreeRoot - No change 307.00 ns/op 267.00 ns/op 1.15
BeaconState.hashTreeRoot - 1 full validator 58.582 us/op 52.959 us/op 1.11
BeaconState.hashTreeRoot - 32 full validator 636.27 us/op 521.33 us/op 1.22
BeaconState.hashTreeRoot - 512 full validator 6.9418 ms/op 5.8735 ms/op 1.18
BeaconState.hashTreeRoot - 1 validator.effectiveBalance 64.956 us/op 63.217 us/op 1.03
BeaconState.hashTreeRoot - 32 validator.effectiveBalance 1.0172 ms/op 919.53 us/op 1.11
BeaconState.hashTreeRoot - 512 validator.effectiveBalance 13.891 ms/op 11.904 ms/op 1.17
BeaconState.hashTreeRoot - 1 balances 60.267 us/op 49.228 us/op 1.22
BeaconState.hashTreeRoot - 32 balances 516.35 us/op 448.59 us/op 1.15
BeaconState.hashTreeRoot - 512 balances 4.5886 ms/op 4.5551 ms/op 1.01
BeaconState.hashTreeRoot - 250000 balances 87.928 ms/op 71.903 ms/op 1.22
aggregationBits - 2048 els - zipIndexesInBitList 23.018 us/op 16.280 us/op 1.41
regular array get 100000 times 42.087 us/op 33.052 us/op 1.27
wrappedArray get 100000 times 36.334 us/op 33.069 us/op 1.10
arrayWithProxy get 100000 times 19.877 ms/op 17.309 ms/op 1.15
ssz.Root.equals 713.00 ns/op 543.00 ns/op 1.31
byteArrayEquals 811.00 ns/op 538.00 ns/op 1.51
shuffle list - 16384 els 8.1424 ms/op 6.9746 ms/op 1.17
shuffle list - 250000 els 123.56 ms/op 105.41 ms/op 1.17
processSlot - 1 slots 10.715 us/op 9.2520 us/op 1.16
processSlot - 32 slots 1.5038 ms/op 1.4446 ms/op 1.04
getEffectiveBalanceIncrementsZeroInactive - 250000 vs - 7PWei 44.888 ms/op 37.201 ms/op 1.21
getCommitteeAssignments - req 1 vs - 250000 vc 3.6632 ms/op 2.9981 ms/op 1.22
getCommitteeAssignments - req 100 vs - 250000 vc 4.9056 ms/op 4.2245 ms/op 1.16
getCommitteeAssignments - req 1000 vs - 250000 vc 5.2044 ms/op 4.6735 ms/op 1.11
RootCache.getBlockRootAtSlot - 250000 vs - 7PWei 5.9700 ns/op 5.3100 ns/op 1.12
state getBlockRootAtSlot - 250000 vs - 7PWei 912.78 ns/op 913.67 ns/op 1.00
computeProposers - vc 250000 13.257 ms/op 11.365 ms/op 1.17
computeEpochShuffling - vc 250000 132.79 ms/op 107.75 ms/op 1.23
getNextSyncCommittee - vc 250000 217.81 ms/op 186.90 ms/op 1.17

by benchmarkbot/action

@g11tech g11tech enabled auto-merge (squash) March 23, 2023 16:22
@g11tech g11tech merged commit 6d3ec2b into unstable Mar 25, 2023
@g11tech g11tech deleted the g11tech/upgrade-lc-data branch March 25, 2023 00:06
@wemeetagain
Copy link
Member

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

Capella lightclient protocol
2 participants