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 zero finalized header in lightclient update gen #5121

Merged
merged 1 commit into from
Feb 9, 2023

Conversation

g11tech
Copy link
Contributor

@g11tech g11tech commented Feb 9, 2023

PR #5027 makes the light client update gen multi fork, however in the networks that start for e.g. with capella genesis, the zero assignment of finalized header is not correct

This PR fixes the finalized zero start

@g11tech g11tech requested a review from a team as a code owner February 9, 2023 16:04
@wemeetagain wemeetagain enabled auto-merge (squash) February 9, 2023 16:11
@github-actions
Copy link
Contributor

github-actions bot commented Feb 9, 2023

Performance Report

✔️ no performance regression detected

Full benchmark results
Benchmark suite Current: 00ba7f4 Previous: db612ea Ratio
getPubkeys - index2pubkey - req 1000 vs - 250000 vc 605.00 us/op 577.55 us/op 1.05
getPubkeys - validatorsArr - req 1000 vs - 250000 vc 58.719 us/op 53.164 us/op 1.10
BLS verify - blst-native 1.3041 ms/op 1.3088 ms/op 1.00
BLS verifyMultipleSignatures 3 - blst-native 2.6529 ms/op 2.5286 ms/op 1.05
BLS verifyMultipleSignatures 8 - blst-native 5.7139 ms/op 5.5245 ms/op 1.03
BLS verifyMultipleSignatures 32 - blst-native 21.042 ms/op 19.765 ms/op 1.06
BLS aggregatePubkeys 32 - blst-native 28.973 us/op 26.658 us/op 1.09
BLS aggregatePubkeys 128 - blst-native 109.94 us/op 103.27 us/op 1.06
getAttestationsForBlock 69.741 ms/op 64.569 ms/op 1.08
isKnown best case - 1 super set check 298.00 ns/op 284.00 ns/op 1.05
isKnown normal case - 2 super set checks 293.00 ns/op 268.00 ns/op 1.09
isKnown worse case - 16 super set checks 291.00 ns/op 268.00 ns/op 1.09
CheckpointStateCache - add get delete 6.4180 us/op 6.0080 us/op 1.07
validate gossip signedAggregateAndProof - struct 2.9035 ms/op 2.8547 ms/op 1.02
validate gossip attestation - struct 1.3916 ms/op 1.3549 ms/op 1.03
pickEth1Vote - no votes 1.4068 ms/op 1.4594 ms/op 0.96
pickEth1Vote - max votes 9.9612 ms/op 11.257 ms/op 0.88
pickEth1Vote - Eth1Data hashTreeRoot value x2048 9.3434 ms/op 9.6208 ms/op 0.97
pickEth1Vote - Eth1Data hashTreeRoot tree x2048 15.515 ms/op 15.531 ms/op 1.00
pickEth1Vote - Eth1Data fastSerialize value x2048 742.22 us/op 818.27 us/op 0.91
pickEth1Vote - Eth1Data fastSerialize tree x2048 7.7696 ms/op 5.7515 ms/op 1.35
bytes32 toHexString 702.00 ns/op 705.00 ns/op 1.00
bytes32 Buffer.toString(hex) 444.00 ns/op 428.00 ns/op 1.04
bytes32 Buffer.toString(hex) from Uint8Array 677.00 ns/op 642.00 ns/op 1.05
bytes32 Buffer.toString(hex) + 0x 439.00 ns/op 420.00 ns/op 1.05
Object access 1 prop 0.20800 ns/op 0.20200 ns/op 1.03
Map access 1 prop 0.18400 ns/op 0.16800 ns/op 1.10
Object get x1000 6.9400 ns/op 6.6330 ns/op 1.05
Map get x1000 0.70500 ns/op 0.63600 ns/op 1.11
Object set x1000 75.475 ns/op 62.724 ns/op 1.20
Map set x1000 57.009 ns/op 47.872 ns/op 1.19
Return object 10000 times 0.26330 ns/op 0.24460 ns/op 1.08
Throw Error 10000 times 4.3472 us/op 4.2421 us/op 1.02
fastMsgIdFn sha256 / 200 bytes 3.5820 us/op 3.5640 us/op 1.01
fastMsgIdFn h32 xxhash / 200 bytes 324.00 ns/op 305.00 ns/op 1.06
fastMsgIdFn h64 xxhash / 200 bytes 481.00 ns/op 447.00 ns/op 1.08
fastMsgIdFn sha256 / 1000 bytes 12.468 us/op 11.744 us/op 1.06
fastMsgIdFn h32 xxhash / 1000 bytes 466.00 ns/op 446.00 ns/op 1.04
fastMsgIdFn h64 xxhash / 1000 bytes 561.00 ns/op 520.00 ns/op 1.08
fastMsgIdFn sha256 / 10000 bytes 108.14 us/op 104.39 us/op 1.04
fastMsgIdFn h32 xxhash / 10000 bytes 2.0570 us/op 1.9570 us/op 1.05
fastMsgIdFn h64 xxhash / 10000 bytes 1.5010 us/op 1.4160 us/op 1.06
enrSubnets - fastDeserialize 64 bits 1.6170 us/op 1.4260 us/op 1.13
enrSubnets - ssz BitVector 64 bits 613.00 ns/op 557.00 ns/op 1.10
enrSubnets - fastDeserialize 4 bits 208.00 ns/op 193.00 ns/op 1.08
enrSubnets - ssz BitVector 4 bits 635.00 ns/op 562.00 ns/op 1.13
prioritizePeers score -10:0 att 32-0.1 sync 2-0 105.61 us/op 106.50 us/op 0.99
prioritizePeers score 0:0 att 32-0.25 sync 2-0.25 136.01 us/op 133.86 us/op 1.02
prioritizePeers score 0:0 att 32-0.5 sync 2-0.5 203.42 us/op 201.25 us/op 1.01
prioritizePeers score 0:0 att 64-0.75 sync 4-0.75 382.97 us/op 362.37 us/op 1.06
prioritizePeers score 0:0 att 64-1 sync 4-1 428.65 us/op 407.50 us/op 1.05
array of 16000 items push then shift 1.7352 us/op 1.6875 us/op 1.03
LinkedList of 16000 items push then shift 9.6060 ns/op 9.2050 ns/op 1.04
array of 16000 items push then pop 127.01 ns/op 115.17 ns/op 1.10
LinkedList of 16000 items push then pop 9.3860 ns/op 9.0670 ns/op 1.04
array of 24000 items push then shift 2.4857 us/op 2.4220 us/op 1.03
LinkedList of 24000 items push then shift 9.4850 ns/op 9.3970 ns/op 1.01
array of 24000 items push then pop 86.108 ns/op 88.324 ns/op 0.97
LinkedList of 24000 items push then pop 9.2090 ns/op 8.9810 ns/op 1.03
intersect bitArray bitLen 8 13.734 ns/op 13.250 ns/op 1.04
intersect array and set length 8 106.53 ns/op 105.85 ns/op 1.01
intersect bitArray bitLen 128 45.113 ns/op 44.374 ns/op 1.02
intersect array and set length 128 1.3106 us/op 1.3005 us/op 1.01
Buffer.concat 32 items 2.8860 us/op 3.0520 us/op 0.95
Uint8Array.set 32 items 2.4260 us/op 2.8860 us/op 0.84
pass gossip attestations to forkchoice per slot 2.4366 ms/op 2.3447 ms/op 1.04
computeDeltas 3.0843 ms/op 2.9801 ms/op 1.03
computeProposerBoostScoreFromBalances 1.8811 ms/op 1.8139 ms/op 1.04
altair processAttestation - 250000 vs - 7PWei normalcase 3.4864 ms/op 2.4526 ms/op 1.42
altair processAttestation - 250000 vs - 7PWei worstcase 4.6374 ms/op 3.9738 ms/op 1.17
altair processAttestation - setStatus - 1/6 committees join 150.14 us/op 142.15 us/op 1.06
altair processAttestation - setStatus - 1/3 committees join 288.92 us/op 280.66 us/op 1.03
altair processAttestation - setStatus - 1/2 committees join 384.86 us/op 375.69 us/op 1.02
altair processAttestation - setStatus - 2/3 committees join 501.33 us/op 477.55 us/op 1.05
altair processAttestation - setStatus - 4/5 committees join 768.13 us/op 645.50 us/op 1.19
altair processAttestation - setStatus - 100% committees join 940.22 us/op 761.29 us/op 1.24
altair processBlock - 250000 vs - 7PWei normalcase 21.670 ms/op 16.014 ms/op 1.35
altair processBlock - 250000 vs - 7PWei normalcase hashState 30.471 ms/op 27.712 ms/op 1.10
altair processBlock - 250000 vs - 7PWei worstcase 60.266 ms/op 48.311 ms/op 1.25
altair processBlock - 250000 vs - 7PWei worstcase hashState 74.047 ms/op 71.639 ms/op 1.03
phase0 processBlock - 250000 vs - 7PWei normalcase 2.5516 ms/op 2.0533 ms/op 1.24
phase0 processBlock - 250000 vs - 7PWei worstcase 34.568 ms/op 28.377 ms/op 1.22
altair processEth1Data - 250000 vs - 7PWei normalcase 571.60 us/op 466.89 us/op 1.22
vc - 250000 eb 1 eth1 1 we 0 wn 0 - smpl 15 10.171 us/op 8.4530 us/op 1.20
vc - 250000 eb 0.95 eth1 0.1 we 0.05 wn 0 - smpl 219 34.038 us/op 26.117 us/op 1.30
vc - 250000 eb 0.95 eth1 0.3 we 0.05 wn 0 - smpl 42 13.442 us/op 10.562 us/op 1.27
vc - 250000 eb 0.95 eth1 0.7 we 0.05 wn 0 - smpl 18 9.9970 us/op 9.2410 us/op 1.08
vc - 250000 eb 0.1 eth1 0.1 we 0 wn 0 - smpl 1020 120.86 us/op 93.162 us/op 1.30
vc - 250000 eb 0.03 eth1 0.03 we 0 wn 0 - smpl 11777 712.18 us/op 647.83 us/op 1.10
vc - 250000 eb 0.01 eth1 0.01 we 0 wn 0 - smpl 16384 1.0171 ms/op 884.27 us/op 1.15
vc - 250000 eb 0 eth1 0 we 0 wn 0 - smpl 16384 967.78 us/op 886.25 us/op 1.09
vc - 250000 eb 0 eth1 0 we 0 wn 0 nocache - smpl 16384 2.5815 ms/op 2.3578 ms/op 1.09
vc - 250000 eb 0 eth1 1 we 0 wn 0 - smpl 16384 1.5586 ms/op 1.4934 ms/op 1.04
vc - 250000 eb 0 eth1 1 we 0 wn 0 nocache - smpl 16384 4.3914 ms/op 3.8762 ms/op 1.13
Tree 40 250000 create 487.83 ms/op 320.18 ms/op 1.52
Tree 40 250000 get(125000) 203.82 ns/op 183.90 ns/op 1.11
Tree 40 250000 set(125000) 1.3820 us/op 935.08 ns/op 1.48
Tree 40 250000 toArray() 23.601 ms/op 19.051 ms/op 1.24
Tree 40 250000 iterate all - toArray() + loop 24.161 ms/op 17.769 ms/op 1.36
Tree 40 250000 iterate all - get(i) 80.644 ms/op 67.546 ms/op 1.19
MutableVector 250000 create 13.040 ms/op 10.020 ms/op 1.30
MutableVector 250000 get(125000) 6.9780 ns/op 6.3300 ns/op 1.10
MutableVector 250000 set(125000) 316.45 ns/op 261.12 ns/op 1.21
MutableVector 250000 toArray() 3.5039 ms/op 2.7260 ms/op 1.29
MutableVector 250000 iterate all - toArray() + loop 3.1620 ms/op 2.7384 ms/op 1.15
MutableVector 250000 iterate all - get(i) 1.5769 ms/op 1.4330 ms/op 1.10
Array 250000 create 3.3763 ms/op 2.4641 ms/op 1.37
Array 250000 clone - spread 1.2333 ms/op 1.1270 ms/op 1.09
Array 250000 get(125000) 0.63600 ns/op 0.58900 ns/op 1.08
Array 250000 set(125000) 0.72700 ns/op 0.66100 ns/op 1.10
Array 250000 iterate all - loop 91.292 us/op 89.389 us/op 1.02
effectiveBalanceIncrements clone Uint8Array 300000 39.867 us/op 29.902 us/op 1.33
effectiveBalanceIncrements clone MutableVector 300000 400.00 ns/op 367.00 ns/op 1.09
effectiveBalanceIncrements rw all Uint8Array 300000 176.66 us/op 160.53 us/op 1.10
effectiveBalanceIncrements rw all MutableVector 300000 95.318 ms/op 81.355 ms/op 1.17
phase0 afterProcessEpoch - 250000 vs - 7PWei 125.02 ms/op 120.70 ms/op 1.04
phase0 beforeProcessEpoch - 250000 vs - 7PWei 37.409 ms/op 41.958 ms/op 0.89
altair processEpoch - mainnet_e81889 380.93 ms/op 318.98 ms/op 1.19
mainnet_e81889 - altair beforeProcessEpoch 78.327 ms/op 61.518 ms/op 1.27
mainnet_e81889 - altair processJustificationAndFinalization 34.529 us/op 16.349 us/op 2.11
mainnet_e81889 - altair processInactivityUpdates 6.7057 ms/op 5.6423 ms/op 1.19
mainnet_e81889 - altair processRewardsAndPenalties 55.483 ms/op 47.620 ms/op 1.17
mainnet_e81889 - altair processRegistryUpdates 3.7280 us/op 2.7270 us/op 1.37
mainnet_e81889 - altair processSlashings 878.00 ns/op 463.00 ns/op 1.90
mainnet_e81889 - altair processEth1DataReset 1.0990 us/op 517.00 ns/op 2.13
mainnet_e81889 - altair processEffectiveBalanceUpdates 2.1729 ms/op 1.2438 ms/op 1.75
mainnet_e81889 - altair processSlashingsReset 6.6800 us/op 4.5200 us/op 1.48
mainnet_e81889 - altair processRandaoMixesReset 11.483 us/op 4.3560 us/op 2.64
mainnet_e81889 - altair processHistoricalRootsUpdate 1.8050 us/op 585.00 ns/op 3.09
mainnet_e81889 - altair processParticipationFlagUpdates 5.1120 us/op 2.5260 us/op 2.02
mainnet_e81889 - altair processSyncCommitteeUpdates 906.00 ns/op 567.00 ns/op 1.60
mainnet_e81889 - altair afterProcessEpoch 146.57 ms/op 123.85 ms/op 1.18
phase0 processEpoch - mainnet_e58758 421.13 ms/op 351.03 ms/op 1.20
mainnet_e58758 - phase0 beforeProcessEpoch 151.53 ms/op 136.19 ms/op 1.11
mainnet_e58758 - phase0 processJustificationAndFinalization 19.948 us/op 16.063 us/op 1.24
mainnet_e58758 - phase0 processRewardsAndPenalties 69.930 ms/op 63.276 ms/op 1.11
mainnet_e58758 - phase0 processRegistryUpdates 14.939 us/op 7.5670 us/op 1.97
mainnet_e58758 - phase0 processSlashings 1.0640 us/op 483.00 ns/op 2.20
mainnet_e58758 - phase0 processEth1DataReset 1.4270 us/op 506.00 ns/op 2.82
mainnet_e58758 - phase0 processEffectiveBalanceUpdates 1.8491 ms/op 1.2964 ms/op 1.43
mainnet_e58758 - phase0 processSlashingsReset 6.1600 us/op 3.3400 us/op 1.84
mainnet_e58758 - phase0 processRandaoMixesReset 7.6680 us/op 4.5250 us/op 1.69
mainnet_e58758 - phase0 processHistoricalRootsUpdate 894.00 ns/op 567.00 ns/op 1.58
mainnet_e58758 - phase0 processParticipationRecordUpdates 8.6180 us/op 3.8330 us/op 2.25
mainnet_e58758 - phase0 afterProcessEpoch 107.15 ms/op 96.757 ms/op 1.11
phase0 processEffectiveBalanceUpdates - 250000 normalcase 1.3345 ms/op 1.2295 ms/op 1.09
phase0 processEffectiveBalanceUpdates - 250000 worstcase 0.5 2.1113 ms/op 1.4731 ms/op 1.43
altair processInactivityUpdates - 250000 normalcase 28.263 ms/op 23.440 ms/op 1.21
altair processInactivityUpdates - 250000 worstcase 23.417 ms/op 25.585 ms/op 0.92
phase0 processRegistryUpdates - 250000 normalcase 11.562 us/op 7.1080 us/op 1.63
phase0 processRegistryUpdates - 250000 badcase_full_deposits 339.02 us/op 235.20 us/op 1.44
phase0 processRegistryUpdates - 250000 worstcase 0.5 144.97 ms/op 125.93 ms/op 1.15
altair processRewardsAndPenalties - 250000 normalcase 70.244 ms/op 68.089 ms/op 1.03
altair processRewardsAndPenalties - 250000 worstcase 75.798 ms/op 68.851 ms/op 1.10
phase0 getAttestationDeltas - 250000 normalcase 8.3239 ms/op 6.4199 ms/op 1.30
phase0 getAttestationDeltas - 250000 worstcase 8.9668 ms/op 6.4166 ms/op 1.40
phase0 processSlashings - 250000 worstcase 3.6535 ms/op 3.2727 ms/op 1.12
altair processSyncCommitteeUpdates - 250000 191.65 ms/op 168.59 ms/op 1.14
BeaconState.hashTreeRoot - No change 281.00 ns/op 248.00 ns/op 1.13
BeaconState.hashTreeRoot - 1 full validator 56.036 us/op 50.808 us/op 1.10
BeaconState.hashTreeRoot - 32 full validator 630.88 us/op 520.27 us/op 1.21
BeaconState.hashTreeRoot - 512 full validator 5.7935 ms/op 4.9085 ms/op 1.18
BeaconState.hashTreeRoot - 1 validator.effectiveBalance 68.487 us/op 64.197 us/op 1.07
BeaconState.hashTreeRoot - 32 validator.effectiveBalance 1.1015 ms/op 854.85 us/op 1.29
BeaconState.hashTreeRoot - 512 validator.effectiveBalance 12.661 ms/op 11.862 ms/op 1.07
BeaconState.hashTreeRoot - 1 balances 50.484 us/op 47.905 us/op 1.05
BeaconState.hashTreeRoot - 32 balances 498.55 us/op 445.87 us/op 1.12
BeaconState.hashTreeRoot - 512 balances 4.7631 ms/op 4.3415 ms/op 1.10
BeaconState.hashTreeRoot - 250000 balances 78.658 ms/op 73.405 ms/op 1.07
aggregationBits - 2048 els - zipIndexesInBitList 16.928 us/op 17.252 us/op 0.98
regular array get 100000 times 36.288 us/op 43.295 us/op 0.84
wrappedArray get 100000 times 34.371 us/op 33.090 us/op 1.04
arrayWithProxy get 100000 times 15.741 ms/op 15.454 ms/op 1.02
ssz.Root.equals 619.00 ns/op 567.00 ns/op 1.09
byteArrayEquals 578.00 ns/op 556.00 ns/op 1.04
shuffle list - 16384 els 7.1020 ms/op 6.8887 ms/op 1.03
shuffle list - 250000 els 105.79 ms/op 102.02 ms/op 1.04
processSlot - 1 slots 9.9400 us/op 8.7740 us/op 1.13
processSlot - 32 slots 1.5179 ms/op 1.3630 ms/op 1.11
getEffectiveBalanceIncrementsZeroInactive - 250000 vs - 7PWei 219.21 us/op 197.77 us/op 1.11
getCommitteeAssignments - req 1 vs - 250000 vc 3.0659 ms/op 2.9394 ms/op 1.04
getCommitteeAssignments - req 100 vs - 250000 vc 4.2977 ms/op 4.1810 ms/op 1.03
getCommitteeAssignments - req 1000 vs - 250000 vc 4.6992 ms/op 4.4544 ms/op 1.05
RootCache.getBlockRootAtSlot - 250000 vs - 7PWei 5.2000 ns/op 4.7000 ns/op 1.11
state getBlockRootAtSlot - 250000 vs - 7PWei 615.87 ns/op 553.56 ns/op 1.11
computeProposers - vc 250000 11.439 ms/op 10.538 ms/op 1.09
computeEpochShuffling - vc 250000 114.43 ms/op 102.02 ms/op 1.12
getNextSyncCommittee - vc 250000 195.01 ms/op 173.27 ms/op 1.13

by benchmarkbot/action

@wemeetagain wemeetagain merged commit 16cbdc3 into unstable Feb 9, 2023
@wemeetagain wemeetagain deleted the g11tech/fix-light-fin-zero branch February 9, 2023 16:29
dapplion added a commit that referenced this pull request Feb 28, 2023
* v1.5.0

* Add validatior option to specify builder block selection strategy (#5064)

* Add validatior option to specify builder block selection strategy

* cleanup and improvements

* server api fx

* fix test

* fix the testcase

* Re-gossip bls changes if submitted earlier than capella (#5049)

* Cache and retransmit bls changes if submitted early

* regossip when synced on/post capella

* fix tests

* modify publish vs cache condition

* add logging

* add error logging

* batchify the processing

* fix some of the cases

* fix log issues

* also delete included keys

* fix lint

* simplify gossip loop

* fix build

* refac to a versioned bls change store

* update

* logging improvements

* improve logging and finish behavior

* cleanup

* Rename eip4844 fork as Deneb (#5082)

* Fix and extract payload to header conversion (#5101)

* Remove unused eslint disable directives (#5046)

* Add execution payload header to light client header capella onwards (#5027)

* Add execution payload header to light client header capella onwards

* add more forks

* add allfork types

* make other types multifork

* make events multifork compatible

* make lightclient routes multifork

* update light-client transport

* upgrade the blocktype on lightclient server import block

* fixes

* fix test

* fix event serialization/deserilization type

* update proof constants

* fix payload index

* update the light client update generation to multi fork

* fix types

* add spec override to pass specs

* make event types allforks

* make req/resp multifork

* make types multifork throughout

* fix the update serialize/deserialize

* fix error log

* better fork determination for update

* fix the fork of finalized

* fix tests

* fix header upgradation

* Fix zero finalized header in lightclient update gen (#5121)

* Schedule capella on sepolia (#5127)

* Get the capella builder functional (#5179)

* Allow blsChange reprocess/republish via API submission (#5185)

* Fix gossiping blsChange on submit if post capella

* comment improvement

* Use new db bucket for light client updates (#5205)

---------

Co-authored-by: Cayman <caymannava@gmail.com>
Co-authored-by: g11tech <develop@g11tech.io>
Co-authored-by: Nico Flaig <nflaig@protonmail.com>
@wemeetagain
Copy link
Member

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

2 participants