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

Eth1 tracker improvements #3930

Merged
merged 1 commit into from
Apr 25, 2022
Merged

Conversation

g11tech
Copy link
Contributor

@g11tech g11tech commented Apr 16, 2022

This PR aims to improve the following eth1 desposit tracker behavior :

  • If the deployContract is a high number, the eth1 tracker which is linked to a syncing execution engine starts to flood the the EL with the getLogs and getBlocks calls even when its before deployContract. This has been reported by MarekM from nethermind. This PR wouldn't attempt to make those calls to the tracker unless remoteFollowBlock has actually reached deployContract.
  • If the EL with which lodestar was linked, was wiped and started clean, lodestar would print incessant NO_DEPOSITS_FOR_BLOCK_RANGE error till the remoteFollowBlock actually crossed the first deposit event.

Closes #3851

@g11tech g11tech requested a review from a team as a code owner April 16, 2022 12:38
@codecov
Copy link

codecov bot commented Apr 16, 2022

Codecov Report

Merging #3930 (a3029f7) into master (bb7ca8d) will increase coverage by 0.30%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##           master    #3930      +/-   ##
==========================================
+ Coverage   36.32%   36.63%   +0.30%     
==========================================
  Files         324      324              
  Lines        9059     9140      +81     
  Branches     1453     1485      +32     
==========================================
+ Hits         3291     3348      +57     
- Misses       5597     5611      +14     
- Partials      171      181      +10     

@github-actions
Copy link
Contributor

Performance Report

✔️ no performance regression detected

Full benchmark results
Benchmark suite Current: 9890053 Previous: 9f0c7a6 Ratio
BeaconState.hashTreeRoot - No change 514.00 ns/op 387.00 ns/op 1.33
BeaconState.hashTreeRoot - 1 full validator 65.175 us/op 54.406 us/op 1.20
BeaconState.hashTreeRoot - 32 full validator 647.18 us/op 555.65 us/op 1.16
BeaconState.hashTreeRoot - 512 full validator 7.2639 ms/op 5.6500 ms/op 1.29
BeaconState.hashTreeRoot - 1 validator.effectiveBalance 81.065 us/op 70.132 us/op 1.16
BeaconState.hashTreeRoot - 32 validator.effectiveBalance 1.1403 ms/op 973.32 us/op 1.17
BeaconState.hashTreeRoot - 512 validator.effectiveBalance 16.202 ms/op 12.271 ms/op 1.32
BeaconState.hashTreeRoot - 1 balances 62.353 us/op 53.209 us/op 1.17
BeaconState.hashTreeRoot - 32 balances 556.93 us/op 458.92 us/op 1.21
BeaconState.hashTreeRoot - 512 balances 5.4739 ms/op 4.3359 ms/op 1.26
BeaconState.hashTreeRoot - 250000 balances 122.07 ms/op 92.594 ms/op 1.32
processSlot - 1 slots 11.279 us/op 10.228 us/op 1.10
processSlot - 32 slots 1.8975 ms/op 1.6438 ms/op 1.15
getCommitteeAssignments - req 1 vs - 250000 vc 6.7976 ms/op 4.1707 ms/op 1.63
getCommitteeAssignments - req 100 vs - 250000 vc 8.7653 ms/op 5.7603 ms/op 1.52
getCommitteeAssignments - req 1000 vs - 250000 vc 9.3854 ms/op 6.4013 ms/op 1.47
computeProposers - vc 250000 20.757 ms/op 14.789 ms/op 1.40
computeEpochShuffling - vc 250000 187.49 ms/op 124.07 ms/op 1.51
getNextSyncCommittee - vc 250000 340.83 ms/op 250.67 ms/op 1.36
altair processAttestation - 250000 vs - 7PWei normalcase 4.6643 ms/op 3.3542 ms/op 1.39
altair processAttestation - 250000 vs - 7PWei worstcase 6.8736 ms/op 4.6880 ms/op 1.47
altair processAttestation - setStatus - 1/6 committees join 230.65 us/op 162.17 us/op 1.42
altair processAttestation - setStatus - 1/3 committees join 451.17 us/op 298.50 us/op 1.51
altair processAttestation - setStatus - 1/2 committees join 630.04 us/op 447.52 us/op 1.41
altair processAttestation - setStatus - 2/3 committees join 814.38 us/op 603.88 us/op 1.35
altair processAttestation - setStatus - 4/5 committees join 1.1340 ms/op 854.52 us/op 1.33
altair processAttestation - setStatus - 100% committees join 1.3406 ms/op 938.98 us/op 1.43
altair processBlock - 250000 vs - 7PWei normalcase 30.865 ms/op 23.353 ms/op 1.32
altair processBlock - 250000 vs - 7PWei normalcase hashState 40.468 ms/op 32.812 ms/op 1.23
altair processBlock - 250000 vs - 7PWei worstcase 86.050 ms/op 67.385 ms/op 1.28
altair processBlock - 250000 vs - 7PWei worstcase hashState 132.83 ms/op 104.11 ms/op 1.28
altair processEth1Data - 250000 vs - 7PWei normalcase 936.60 us/op 727.89 us/op 1.29
altair processEpoch - mainnet_e81889 677.89 ms/op 491.04 ms/op 1.38
mainnet_e81889 - altair beforeProcessEpoch 113.18 ms/op 142.91 ms/op 0.79
mainnet_e81889 - altair processJustificationAndFinalization 33.762 us/op 73.468 us/op 0.46
mainnet_e81889 - altair processInactivityUpdates 13.247 ms/op 8.8833 ms/op 1.49
mainnet_e81889 - altair processRewardsAndPenalties 183.06 ms/op 77.429 ms/op 2.36
mainnet_e81889 - altair processRegistryUpdates 9.5750 us/op 18.927 us/op 0.51
mainnet_e81889 - altair processSlashings 3.5240 us/op 6.1160 us/op 0.58
mainnet_e81889 - altair processEth1DataReset 3.9560 us/op 6.4080 us/op 0.62
mainnet_e81889 - altair processEffectiveBalanceUpdates 9.1820 ms/op 6.4788 ms/op 1.42
mainnet_e81889 - altair processSlashingsReset 12.514 us/op 21.473 us/op 0.58
mainnet_e81889 - altair processRandaoMixesReset 14.630 us/op 26.896 us/op 0.54
mainnet_e81889 - altair processHistoricalRootsUpdate 5.2420 us/op 9.6210 us/op 0.54
mainnet_e81889 - altair processParticipationFlagUpdates 8.7640 us/op 19.759 us/op 0.44
mainnet_e81889 - altair processSyncCommitteeUpdates 2.9420 us/op 5.6440 us/op 0.52
mainnet_e81889 - altair afterProcessEpoch 221.21 ms/op 144.34 ms/op 1.53
altair processInactivityUpdates - 250000 normalcase 39.845 ms/op 37.134 ms/op 1.07
altair processInactivityUpdates - 250000 worstcase 33.934 ms/op 29.292 ms/op 1.16
altair processRewardsAndPenalties - 250000 normalcase 145.31 ms/op 78.694 ms/op 1.85
altair processRewardsAndPenalties - 250000 worstcase 91.530 ms/op 106.60 ms/op 0.86
altair processSyncCommitteeUpdates - 250000 356.32 ms/op 245.81 ms/op 1.45
Tree 40 250000 create 947.05 ms/op 569.47 ms/op 1.66
Tree 40 250000 get(125000) 341.93 ns/op 248.85 ns/op 1.37
Tree 40 250000 set(125000) 2.6960 us/op 1.8691 us/op 1.44
Tree 40 250000 toArray() 37.311 ms/op 27.736 ms/op 1.35
Tree 40 250000 iterate all - toArray() + loop 37.175 ms/op 28.812 ms/op 1.29
Tree 40 250000 iterate all - get(i) 130.88 ms/op 102.40 ms/op 1.28
MutableVector 250000 create 18.291 ms/op 12.584 ms/op 1.45
MutableVector 250000 get(125000) 17.814 ns/op 17.971 ns/op 0.99
MutableVector 250000 set(125000) 746.69 ns/op 466.56 ns/op 1.60
MutableVector 250000 toArray() 8.1184 ms/op 4.7393 ms/op 1.71
MutableVector 250000 iterate all - toArray() + loop 8.3554 ms/op 5.1470 ms/op 1.62
MutableVector 250000 iterate all - get(i) 4.1554 ms/op 2.6322 ms/op 1.58
Array 250000 create 7.5005 ms/op 3.9591 ms/op 1.89
Array 250000 clone - spread 3.8902 ms/op 1.5475 ms/op 2.51
Array 250000 get(125000) 1.6720 ns/op 0.81000 ns/op 2.06
Array 250000 set(125000) 1.7160 ns/op 0.80900 ns/op 2.12
Array 250000 iterate all - loop 201.50 us/op 119.00 us/op 1.69
effectiveBalanceIncrements clone Uint8Array 300000 107.41 us/op 50.634 us/op 2.12
effectiveBalanceIncrements clone MutableVector 300000 1.1880 us/op 493.00 ns/op 2.41
effectiveBalanceIncrements rw all Uint8Array 300000 362.47 us/op 148.51 us/op 2.44
effectiveBalanceIncrements rw all MutableVector 300000 262.20 ms/op 125.21 ms/op 2.09
aggregationBits - 2048 els - zipIndexesInBitList 41.596 us/op 18.025 us/op 2.31
regular array get 100000 times 80.962 us/op 45.128 us/op 1.79
wrappedArray get 100000 times 81.039 us/op 44.051 us/op 1.84
arrayWithProxy get 100000 times 35.601 ms/op 26.408 ms/op 1.35
ssz.Root.equals 588.00 ns/op 362.00 ns/op 1.62
byteArrayEquals 557.00 ns/op 337.00 ns/op 1.65
phase0 processBlock - 250000 vs - 7PWei normalcase 4.4964 ms/op 3.0538 ms/op 1.47
phase0 processBlock - 250000 vs - 7PWei worstcase 55.577 ms/op 41.753 ms/op 1.33
phase0 afterProcessEpoch - 250000 vs - 7PWei 216.80 ms/op 138.15 ms/op 1.57
phase0 beforeProcessEpoch - 250000 vs - 7PWei 83.048 ms/op 95.640 ms/op 0.87
phase0 processEpoch - mainnet_e58758 618.96 ms/op 455.42 ms/op 1.36
mainnet_e58758 - phase0 beforeProcessEpoch 267.10 ms/op 182.81 ms/op 1.46
mainnet_e58758 - phase0 processJustificationAndFinalization 32.966 us/op 80.083 us/op 0.41
mainnet_e58758 - phase0 processRewardsAndPenalties 90.732 ms/op 64.262 ms/op 1.41
mainnet_e58758 - phase0 processRegistryUpdates 17.391 us/op 41.229 us/op 0.42
mainnet_e58758 - phase0 processSlashings 3.5960 us/op 9.1290 us/op 0.39
mainnet_e58758 - phase0 processEth1DataReset 3.3820 us/op 7.9110 us/op 0.43
mainnet_e58758 - phase0 processEffectiveBalanceUpdates 6.2114 ms/op 5.2692 ms/op 1.18
mainnet_e58758 - phase0 processSlashingsReset 11.656 us/op 24.462 us/op 0.48
mainnet_e58758 - phase0 processRandaoMixesReset 12.375 us/op 28.992 us/op 0.43
mainnet_e58758 - phase0 processHistoricalRootsUpdate 5.0820 us/op 9.3850 us/op 0.54
mainnet_e58758 - phase0 processParticipationRecordUpdates 12.032 us/op 27.552 us/op 0.44
mainnet_e58758 - phase0 afterProcessEpoch 193.05 ms/op 120.47 ms/op 1.60
phase0 processEffectiveBalanceUpdates - 250000 normalcase 7.8272 ms/op 5.6085 ms/op 1.40
phase0 processEffectiveBalanceUpdates - 250000 worstcase 0.5 8.1933 ms/op 5.8245 ms/op 1.41
phase0 processRegistryUpdates - 250000 normalcase 16.323 us/op 35.373 us/op 0.46
phase0 processRegistryUpdates - 250000 badcase_full_deposits 496.27 us/op 416.80 us/op 1.19
phase0 processRegistryUpdates - 250000 worstcase 0.5 256.54 ms/op 203.90 ms/op 1.26
phase0 getAttestationDeltas - 250000 normalcase 18.614 ms/op 11.385 ms/op 1.63
phase0 getAttestationDeltas - 250000 worstcase 19.038 ms/op 11.573 ms/op 1.65
phase0 processSlashings - 250000 worstcase 6.8325 ms/op 5.0166 ms/op 1.36
shuffle list - 16384 els 14.525 ms/op 8.3301 ms/op 1.74
shuffle list - 250000 els 184.65 ms/op 120.35 ms/op 1.53
getEffectiveBalanceIncrementsZeroInactive - 250000 vs - 7PWei 397.99 us/op 341.98 us/op 1.16
pass gossip attestations to forkchoice per slot 4.0610 ms/op 3.0055 ms/op 1.35
computeDeltas 3.9355 ms/op 2.9638 ms/op 1.33
computeProposerBoostScoreFromBalances 603.58 us/op 371.15 us/op 1.63
getPubkeys - index2pubkey - req 1000 vs - 250000 vc 2.4703 ms/op 1.6510 ms/op 1.50
getPubkeys - validatorsArr - req 1000 vs - 250000 vc 95.945 us/op 60.892 us/op 1.58
BLS verify - blst-native 2.2320 ms/op 1.6961 ms/op 1.32
BLS verifyMultipleSignatures 3 - blst-native 4.5747 ms/op 3.4895 ms/op 1.31
BLS verifyMultipleSignatures 8 - blst-native 9.8434 ms/op 7.6204 ms/op 1.29
BLS verifyMultipleSignatures 32 - blst-native 35.646 ms/op 27.252 ms/op 1.31
BLS aggregatePubkeys 32 - blst-native 47.364 us/op 36.981 us/op 1.28
BLS aggregatePubkeys 128 - blst-native 183.77 us/op 142.65 us/op 1.29
getAttestationsForBlock 70.637 ms/op 49.592 ms/op 1.42
CheckpointStateCache - add get delete 13.169 us/op 9.5220 us/op 1.38
validate gossip signedAggregateAndProof - struct 5.1334 ms/op 3.9829 ms/op 1.29
validate gossip attestation - struct 2.4412 ms/op 1.9313 ms/op 1.26
pickEth1Vote - no votes 2.6741 ms/op 1.9573 ms/op 1.37
pickEth1Vote - max votes 24.808 ms/op 15.722 ms/op 1.58
pickEth1Vote - Eth1Data hashTreeRoot value x2048 13.338 ms/op 10.327 ms/op 1.29
pickEth1Vote - Eth1Data hashTreeRoot tree x2048 25.845 ms/op 17.136 ms/op 1.51
pickEth1Vote - Eth1Data fastSerialize value x2048 2.0541 ms/op 1.4500 ms/op 1.42
pickEth1Vote - Eth1Data fastSerialize tree x2048 16.467 ms/op 10.666 ms/op 1.54
bytes32 toHexString 1.2460 us/op 858.00 ns/op 1.45
bytes32 Buffer.toString(hex) 876.00 ns/op 575.00 ns/op 1.52
bytes32 Buffer.toString(hex) from Uint8Array 1.1480 us/op 815.00 ns/op 1.41
bytes32 Buffer.toString(hex) + 0x 885.00 ns/op 590.00 ns/op 1.50
Object access 1 prop 0.44300 ns/op 0.27300 ns/op 1.62
Map access 1 prop 0.35100 ns/op 0.27000 ns/op 1.30
Object get x1000 21.169 ns/op 13.116 ns/op 1.61
Map get x1000 1.1860 ns/op 0.74900 ns/op 1.58
Object set x1000 135.62 ns/op 73.350 ns/op 1.85
Map set x1000 81.912 ns/op 52.945 ns/op 1.55
Return object 10000 times 0.45470 ns/op 0.32940 ns/op 1.38
Throw Error 10000 times 7.1301 us/op 5.3877 us/op 1.32
enrSubnets - fastDeserialize 64 bits 1.1510 us/op 758.00 ns/op 1.52
enrSubnets - ssz BitVector 64 bits 888.00 ns/op 624.00 ns/op 1.42
enrSubnets - fastDeserialize 4 bits 488.00 ns/op 314.00 ns/op 1.55
enrSubnets - ssz BitVector 4 bits 911.00 ns/op 593.00 ns/op 1.54
RateTracker 1000000 limit, 1 obj count per request 222.76 ns/op 147.85 ns/op 1.51
RateTracker 1000000 limit, 2 obj count per request 167.47 ns/op 108.07 ns/op 1.55
RateTracker 1000000 limit, 4 obj count per request 140.47 ns/op 91.328 ns/op 1.54
RateTracker 1000000 limit, 8 obj count per request 126.63 ns/op 78.652 ns/op 1.61
RateTracker with prune 5.1660 us/op 3.2790 us/op 1.58
array of 16000 items push then shift 3.7885 us/op 4.1981 us/op 0.90
LinkedList of 16000 items push then shift 19.516 ns/op 13.609 ns/op 1.43
array of 16000 items push then pop 248.28 ns/op 191.17 ns/op 1.30
LinkedList of 16000 items push then pop 19.254 ns/op 12.953 ns/op 1.49
array of 24000 items push then shift 5.4621 us/op 6.2446 us/op 0.87
LinkedList of 24000 items push then shift 22.831 ns/op 14.890 ns/op 1.53
array of 24000 items push then pop 252.01 ns/op 168.83 ns/op 1.49
LinkedList of 24000 items push then pop 20.804 ns/op 12.658 ns/op 1.64

by benchmarkbot/action

@g11tech g11tech mentioned this pull request Apr 22, 2022
22 tasks
@wemeetagain wemeetagain merged commit e448ece into master Apr 25, 2022
@wemeetagain wemeetagain deleted the g11tech/eth1trackerimprovements branch April 25, 2022 13:32
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.

Investigate: ETH1_ERROR_NO_DEPOSITS_FOR_BLOCK_RANGE, fromBlock=0, toBlock=0 error
2 participants