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 option to run beacon node in follow mode to EL #4399

Merged
merged 1 commit into from Aug 11, 2022

Conversation

g11tech
Copy link
Contributor

@g11tech g11tech commented Aug 11, 2022

Motivation
We in our test/dev setups want to connect multiple beacon nodes to same EL, the only complication for this is multiple EL requesting head change to the EL causing unknown EL head transitions and issues.

This PR enables to run beacon node in "follow" mode to an EL, which will be driven by only one beacon node in the normal way.
Assuming the EL and its driving beacon node are synced well, this should work out well for other bns as well as they will also be able to follow heads as well as propose when its time for their validators.

This is achieved by adding a flag which can be turned on in the follow nodes disableImportExecutionFcU which will turn off giving head fcU to the EL.

@g11tech g11tech requested a review from a team as a code owner August 11, 2022 13:52
@github-actions
Copy link
Contributor

Performance Report

✔️ no performance regression detected

Full benchmark results
Benchmark suite Current: ebdc06e Previous: 1901f97 Ratio
getPubkeys - index2pubkey - req 1000 vs - 250000 vc 3.1829 ms/op 2.9851 ms/op 1.07
getPubkeys - validatorsArr - req 1000 vs - 250000 vc 99.393 us/op 85.457 us/op 1.16
BLS verify - blst-native 2.4622 ms/op 2.2471 ms/op 1.10
BLS verifyMultipleSignatures 3 - blst-native 4.8567 ms/op 4.7621 ms/op 1.02
BLS verifyMultipleSignatures 8 - blst-native 10.544 ms/op 10.539 ms/op 1.00
BLS verifyMultipleSignatures 32 - blst-native 37.583 ms/op 38.958 ms/op 0.96
BLS aggregatePubkeys 32 - blst-native 50.431 us/op 50.409 us/op 1.00
BLS aggregatePubkeys 128 - blst-native 198.90 us/op 204.47 us/op 0.97
getAttestationsForBlock 210.55 ms/op 216.66 ms/op 0.97
isKnown best case - 1 super set check 536.00 ns/op 544.00 ns/op 0.99
isKnown normal case - 2 super set checks 546.00 ns/op 535.00 ns/op 1.02
isKnown worse case - 16 super set checks 531.00 ns/op 531.00 ns/op 1.00
CheckpointStateCache - add get delete 11.682 us/op 11.880 us/op 0.98
validate gossip signedAggregateAndProof - struct 5.4642 ms/op 5.6114 ms/op 0.97
validate gossip attestation - struct 2.5730 ms/op 2.6225 ms/op 0.98
altair verifyImport mainnet_s3766816:31 11.086 s/op 10.689 s/op 1.04
pickEth1Vote - no votes 2.6499 ms/op 2.6007 ms/op 1.02
pickEth1Vote - max votes 31.618 ms/op 28.377 ms/op 1.11
pickEth1Vote - Eth1Data hashTreeRoot value x2048 15.110 ms/op 14.698 ms/op 1.03
pickEth1Vote - Eth1Data hashTreeRoot tree x2048 27.613 ms/op 25.593 ms/op 1.08
pickEth1Vote - Eth1Data fastSerialize value x2048 1.9507 ms/op 1.9212 ms/op 1.02
pickEth1Vote - Eth1Data fastSerialize tree x2048 21.571 ms/op 21.824 ms/op 0.99
bytes32 toHexString 1.4930 us/op 1.4810 us/op 1.01
bytes32 Buffer.toString(hex) 913.00 ns/op 905.00 ns/op 1.01
bytes32 Buffer.toString(hex) from Uint8Array 1.2190 us/op 1.1710 us/op 1.04
bytes32 Buffer.toString(hex) + 0x 920.00 ns/op 852.00 ns/op 1.08
Object access 1 prop 0.50200 ns/op 0.48400 ns/op 1.04
Map access 1 prop 0.36300 ns/op 0.34800 ns/op 1.04
Object get x1000 17.501 ns/op 16.514 ns/op 1.06
Map get x1000 1.2290 ns/op 0.98700 ns/op 1.25
Object set x1000 137.44 ns/op 133.50 ns/op 1.03
Map set x1000 93.188 ns/op 89.261 ns/op 1.04
Return object 10000 times 0.43690 ns/op 0.42410 ns/op 1.03
Throw Error 10000 times 7.3517 us/op 7.0176 us/op 1.05
enrSubnets - fastDeserialize 64 bits 3.7410 us/op 3.8100 us/op 0.98
enrSubnets - ssz BitVector 64 bits 997.00 ns/op 924.00 ns/op 1.08
enrSubnets - fastDeserialize 4 bits 520.00 ns/op 557.00 ns/op 0.93
enrSubnets - ssz BitVector 4 bits 937.00 ns/op 1.0060 us/op 0.93
prioritizePeers score -10:0 att 32-0.1 sync 2-0 128.86 us/op 129.72 us/op 0.99
prioritizePeers score 0:0 att 32-0.25 sync 2-0.25 161.59 us/op 173.83 us/op 0.93
prioritizePeers score 0:0 att 32-0.5 sync 2-0.5 302.98 us/op 329.04 us/op 0.92
prioritizePeers score 0:0 att 64-0.75 sync 4-0.75 694.93 us/op 561.37 us/op 1.24
prioritizePeers score 0:0 att 64-1 sync 4-1 579.01 us/op 564.49 us/op 1.03
RateTracker 1000000 limit, 1 obj count per request 231.22 ns/op 221.40 ns/op 1.04
RateTracker 1000000 limit, 2 obj count per request 175.17 ns/op 173.01 ns/op 1.01
RateTracker 1000000 limit, 4 obj count per request 147.93 ns/op 143.20 ns/op 1.03
RateTracker 1000000 limit, 8 obj count per request 137.04 ns/op 128.82 ns/op 1.06
RateTracker with prune 7.5650 us/op 6.5130 us/op 1.16
array of 16000 items push then shift 5.7604 us/op 5.5294 us/op 1.04
LinkedList of 16000 items push then shift 21.215 ns/op 40.405 ns/op 0.53
array of 16000 items push then pop 296.50 ns/op 297.10 ns/op 1.00
LinkedList of 16000 items push then pop 18.964 ns/op 30.343 ns/op 0.62
array of 24000 items push then shift 8.2777 us/op 8.1109 us/op 1.02
LinkedList of 24000 items push then shift 21.278 ns/op 41.082 ns/op 0.52
array of 24000 items push then pop 262.07 ns/op 252.57 ns/op 1.04
LinkedList of 24000 items push then pop 18.976 ns/op 28.319 ns/op 0.67
intersect bitArray bitLen 8 13.957 ns/op 12.746 ns/op 1.10
intersect array and set length 8 240.18 ns/op 197.35 ns/op 1.22
intersect bitArray bitLen 128 79.023 ns/op 72.182 ns/op 1.09
intersect array and set length 128 2.7660 us/op 2.3526 us/op 1.18
Buffer.concat 32 items 2.3680 ns/op 2.2240 ns/op 1.06
pass gossip attestations to forkchoice per slot 6.6074 ms/op 7.2873 ms/op 0.91
computeDeltas 3.7879 ms/op 4.3001 ms/op 0.88
computeProposerBoostScoreFromBalances 942.23 us/op 890.58 us/op 1.06
altair processAttestation - 250000 vs - 7PWei normalcase 6.2767 ms/op 5.7473 ms/op 1.09
altair processAttestation - 250000 vs - 7PWei worstcase 8.5900 ms/op 8.1202 ms/op 1.06
altair processAttestation - setStatus - 1/6 committees join 256.63 us/op 260.75 us/op 0.98
altair processAttestation - setStatus - 1/3 committees join 477.44 us/op 485.61 us/op 0.98
altair processAttestation - setStatus - 1/2 committees join 679.49 us/op 691.86 us/op 0.98
altair processAttestation - setStatus - 2/3 committees join 918.74 us/op 945.69 us/op 0.97
altair processAttestation - setStatus - 4/5 committees join 1.2747 ms/op 1.3654 ms/op 0.93
altair processAttestation - setStatus - 100% committees join 1.6372 ms/op 1.5584 ms/op 1.05
altair processBlock - 250000 vs - 7PWei normalcase 31.999 ms/op 33.241 ms/op 0.96
altair processBlock - 250000 vs - 7PWei normalcase hashState 49.498 ms/op 44.355 ms/op 1.12
altair processBlock - 250000 vs - 7PWei worstcase 100.57 ms/op 114.80 ms/op 0.88
altair processBlock - 250000 vs - 7PWei worstcase hashState 126.92 ms/op 121.93 ms/op 1.04
phase0 processBlock - 250000 vs - 7PWei normalcase 6.9277 ms/op 5.6303 ms/op 1.23
phase0 processBlock - 250000 vs - 7PWei worstcase 62.147 ms/op 60.875 ms/op 1.02
altair processEth1Data - 250000 vs - 7PWei normalcase 1.1675 ms/op 1.3269 ms/op 0.88
Tree 40 250000 create 1.2432 s/op 1.0784 s/op 1.15
Tree 40 250000 get(125000) 349.93 ns/op 345.64 ns/op 1.01
Tree 40 250000 set(125000) 3.9360 us/op 3.8222 us/op 1.03
Tree 40 250000 toArray() 38.832 ms/op 38.688 ms/op 1.00
Tree 40 250000 iterate all - toArray() + loop 40.153 ms/op 41.141 ms/op 0.98
Tree 40 250000 iterate all - get(i) 145.17 ms/op 146.56 ms/op 0.99
MutableVector 250000 create 18.885 ms/op 21.977 ms/op 0.86
MutableVector 250000 get(125000) 14.780 ns/op 14.795 ns/op 1.00
MutableVector 250000 set(125000) 1.0674 us/op 903.86 ns/op 1.18
MutableVector 250000 toArray() 8.4963 ms/op 8.3745 ms/op 1.01
MutableVector 250000 iterate all - toArray() + loop 9.8068 ms/op 8.5875 ms/op 1.14
MutableVector 250000 iterate all - get(i) 3.6883 ms/op 3.5236 ms/op 1.05
Array 250000 create 7.7897 ms/op 8.2626 ms/op 0.94
Array 250000 clone - spread 3.4225 ms/op 5.9233 ms/op 0.58
Array 250000 get(125000) 1.5770 ns/op 2.1940 ns/op 0.72
Array 250000 set(125000) 1.5480 ns/op 2.0680 ns/op 0.75
Array 250000 iterate all - loop 151.75 us/op 148.93 us/op 1.02
effectiveBalanceIncrements clone Uint8Array 300000 117.72 us/op 278.04 us/op 0.42
effectiveBalanceIncrements clone MutableVector 300000 1.0650 us/op 808.00 ns/op 1.32
effectiveBalanceIncrements rw all Uint8Array 300000 309.62 us/op 308.19 us/op 1.00
effectiveBalanceIncrements rw all MutableVector 300000 279.06 ms/op 227.90 ms/op 1.22
phase0 afterProcessEpoch - 250000 vs - 7PWei 209.07 ms/op 225.28 ms/op 0.93
phase0 beforeProcessEpoch - 250000 vs - 7PWei 101.03 ms/op 86.649 ms/op 1.17
altair processEpoch - mainnet_e81889 603.91 ms/op 700.69 ms/op 0.86
mainnet_e81889 - altair beforeProcessEpoch 171.06 ms/op 189.50 ms/op 0.90
mainnet_e81889 - altair processJustificationAndFinalization 71.115 us/op 66.182 us/op 1.07
mainnet_e81889 - altair processInactivityUpdates 14.151 ms/op 11.552 ms/op 1.22
mainnet_e81889 - altair processRewardsAndPenalties 111.73 ms/op 113.35 ms/op 0.99
mainnet_e81889 - altair processRegistryUpdates 14.271 us/op 17.744 us/op 0.80
mainnet_e81889 - altair processSlashings 3.2820 us/op 3.1610 us/op 1.04
mainnet_e81889 - altair processEth1DataReset 3.6860 us/op 3.6490 us/op 1.01
mainnet_e81889 - altair processEffectiveBalanceUpdates 2.5207 ms/op 2.3984 ms/op 1.05
mainnet_e81889 - altair processSlashingsReset 24.721 us/op 27.180 us/op 0.91
mainnet_e81889 - altair processRandaoMixesReset 25.189 us/op 37.959 us/op 0.66
mainnet_e81889 - altair processHistoricalRootsUpdate 4.4300 us/op 3.8790 us/op 1.14
mainnet_e81889 - altair processParticipationFlagUpdates 15.613 us/op 17.092 us/op 0.91
mainnet_e81889 - altair processSyncCommitteeUpdates 3.1640 us/op 3.6650 us/op 0.86
mainnet_e81889 - altair afterProcessEpoch 218.22 ms/op 212.46 ms/op 1.03
phase0 processEpoch - mainnet_e58758 661.49 ms/op 653.82 ms/op 1.01
mainnet_e58758 - phase0 beforeProcessEpoch 304.04 ms/op 305.33 ms/op 1.00
mainnet_e58758 - phase0 processJustificationAndFinalization 66.588 us/op 68.362 us/op 0.97
mainnet_e58758 - phase0 processRewardsAndPenalties 174.45 ms/op 169.12 ms/op 1.03
mainnet_e58758 - phase0 processRegistryUpdates 33.635 us/op 33.909 us/op 0.99
mainnet_e58758 - phase0 processSlashings 4.0080 us/op 3.5800 us/op 1.12
mainnet_e58758 - phase0 processEth1DataReset 4.2570 us/op 3.7330 us/op 1.14
mainnet_e58758 - phase0 processEffectiveBalanceUpdates 2.1910 ms/op 2.4820 ms/op 0.88
mainnet_e58758 - phase0 processSlashingsReset 22.028 us/op 19.126 us/op 1.15
mainnet_e58758 - phase0 processRandaoMixesReset 26.821 us/op 28.211 us/op 0.95
mainnet_e58758 - phase0 processHistoricalRootsUpdate 4.8050 us/op 4.5070 us/op 1.07
mainnet_e58758 - phase0 processParticipationRecordUpdates 25.956 us/op 21.916 us/op 1.18
mainnet_e58758 - phase0 afterProcessEpoch 183.75 ms/op 181.01 ms/op 1.02
phase0 processEffectiveBalanceUpdates - 250000 normalcase 2.6508 ms/op 2.4895 ms/op 1.06
phase0 processEffectiveBalanceUpdates - 250000 worstcase 0.5 2.8848 ms/op 2.6658 ms/op 1.08
altair processInactivityUpdates - 250000 normalcase 56.829 ms/op 53.171 ms/op 1.07
altair processInactivityUpdates - 250000 worstcase 58.908 ms/op 65.004 ms/op 0.91
phase0 processRegistryUpdates - 250000 normalcase 28.891 us/op 27.427 us/op 1.05
phase0 processRegistryUpdates - 250000 badcase_full_deposits 532.73 us/op 513.98 us/op 1.04
phase0 processRegistryUpdates - 250000 worstcase 0.5 265.86 ms/op 262.77 ms/op 1.01
altair processRewardsAndPenalties - 250000 normalcase 150.79 ms/op 144.23 ms/op 1.05
altair processRewardsAndPenalties - 250000 worstcase 103.03 ms/op 152.93 ms/op 0.67
phase0 getAttestationDeltas - 250000 normalcase 16.890 ms/op 14.562 ms/op 1.16
phase0 getAttestationDeltas - 250000 worstcase 17.756 ms/op 14.644 ms/op 1.21
phase0 processSlashings - 250000 worstcase 6.9875 ms/op 6.4637 ms/op 1.08
altair processSyncCommitteeUpdates - 250000 362.21 ms/op 346.41 ms/op 1.05
BeaconState.hashTreeRoot - No change 624.00 ns/op 629.00 ns/op 0.99
BeaconState.hashTreeRoot - 1 full validator 80.968 us/op 87.090 us/op 0.93
BeaconState.hashTreeRoot - 32 full validator 986.52 us/op 821.87 us/op 1.20
BeaconState.hashTreeRoot - 512 full validator 8.0245 ms/op 7.9976 ms/op 1.00
BeaconState.hashTreeRoot - 1 validator.effectiveBalance 102.67 us/op 104.95 us/op 0.98
BeaconState.hashTreeRoot - 32 validator.effectiveBalance 1.5724 ms/op 1.5879 ms/op 0.99
BeaconState.hashTreeRoot - 512 validator.effectiveBalance 20.308 ms/op 20.905 ms/op 0.97
BeaconState.hashTreeRoot - 1 balances 81.741 us/op 78.552 us/op 1.04
BeaconState.hashTreeRoot - 32 balances 762.97 us/op 748.56 us/op 1.02
BeaconState.hashTreeRoot - 512 balances 7.5904 ms/op 8.5867 ms/op 0.88
BeaconState.hashTreeRoot - 250000 balances 126.15 ms/op 115.96 ms/op 1.09
aggregationBits - 2048 els - zipIndexesInBitList 39.795 us/op 36.041 us/op 1.10
regular array get 100000 times 62.559 us/op 61.746 us/op 1.01
wrappedArray get 100000 times 62.661 us/op 58.216 us/op 1.08
arrayWithProxy get 100000 times 38.866 ms/op 36.817 ms/op 1.06
ssz.Root.equals 622.00 ns/op 589.00 ns/op 1.06
byteArrayEquals 610.00 ns/op 621.00 ns/op 0.98
shuffle list - 16384 els 12.636 ms/op 12.133 ms/op 1.04
shuffle list - 250000 els 185.65 ms/op 178.91 ms/op 1.04
processSlot - 1 slots 18.610 us/op 18.737 us/op 0.99
processSlot - 32 slots 2.4556 ms/op 2.4455 ms/op 1.00
getEffectiveBalanceIncrementsZeroInactive - 250000 vs - 7PWei 500.29 us/op 519.30 us/op 0.96
getCommitteeAssignments - req 1 vs - 250000 vc 5.7980 ms/op 5.3468 ms/op 1.08
getCommitteeAssignments - req 100 vs - 250000 vc 8.4086 ms/op 7.8878 ms/op 1.07
getCommitteeAssignments - req 1000 vs - 250000 vc 8.8159 ms/op 8.3145 ms/op 1.06
RootCache.getBlockRootAtSlot - 250000 vs - 7PWei 9.9100 ns/op 11.390 ns/op 0.87
state getBlockRootAtSlot - 250000 vs - 7PWei 1.4387 us/op 1.4295 us/op 1.01
computeProposers - vc 250000 21.775 ms/op 21.840 ms/op 1.00
computeEpochShuffling - vc 250000 185.80 ms/op 189.66 ms/op 0.98
getNextSyncCommittee - vc 250000 355.97 ms/op 346.43 ms/op 1.03

by benchmarkbot/action

@g11tech
Copy link
Contributor Author

g11tech commented Aug 11, 2022

deployed on unstable dev nodes, all synced up sharing the same EL
image

validators also attesting (no block proposal yet)
image

@g11tech
Copy link
Contributor Author

g11tech commented Aug 11, 2022

Block production also looks successful:
image

@g11tech
Copy link
Contributor Author

g11tech commented Aug 11, 2022

merging since all aspects look good!

@g11tech g11tech merged commit 551ad74 into unstable Aug 11, 2022
@g11tech g11tech deleted the g11tech/disable-import-fcu-option branch August 11, 2022 18:37
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.

None yet

2 participants