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
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 4 additions & 1 deletion packages/beacon-node/src/chain/blocks/importBlock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,10 @@ export async function importBlock(
// Notifying EL of head and finalized updates as below is usually done within the 1st 4s of the slot.
// If there is an advanced payload generation in the next slot, we'll notify EL again 4s before next
// slot via PrepareNextSlotScheduler. There is no harm updating the ELs with same data, it will just ignore it.
if (newHead.blockRoot !== oldHead.blockRoot || currFinalizedEpoch !== prevFinalizedEpoch) {
if (
!this.opts.disableImportExecutionFcU &&
(newHead.blockRoot !== oldHead.blockRoot || currFinalizedEpoch !== prevFinalizedEpoch)
) {
/**
* On post BELLATRIX_EPOCH but pre TTD, blocks include empty execution payload with a zero block hash.
* The consensus clients must not send notifyForkchoiceUpdate before TTD since the execution client will error.
Expand Down
5 changes: 5 additions & 0 deletions packages/beacon-node/src/chain/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@ export type BlockProcessOpts = {
disableOnBlockError?: boolean;
/** Used for fork_choice spec tests */
disablePrepareNextSlot?: boolean;
/**
* Used to connect beacon in follow mode to an EL,
* will still issue fcU for block proposal
*/
disableImportExecutionFcU?: boolean;
};

export const defaultChainOptions: IChainOptions = {
Expand Down
9 changes: 9 additions & 0 deletions packages/cli/src/options/beaconNodeOptions/chain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export interface IChainArgs {
// as this is defined as part of IBeaconPaths
// "chain.persistInvalidSszObjectsDir": string;
"chain.proposerBoostEnabled": boolean;
"chain.disableImportExecutionFcU": boolean;
"chain.computeUnrealized": boolean;
"chain.defaultFeeRecipient": string;
"chain.assertCorrectProgressiveBalances": boolean;
Expand All @@ -26,6 +27,7 @@ export function parseArgs(args: IChainArgs): IBeaconNodeOptions["chain"] {
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-explicit-any
persistInvalidSszObjectsDir: undefined as any,
proposerBoostEnabled: args["chain.proposerBoostEnabled"],
disableImportExecutionFcU: args["chain.disableImportExecutionFcU"],
computeUnrealized: args["chain.computeUnrealized"],
defaultFeeRecipient: args["chain.defaultFeeRecipient"],
assertCorrectProgressiveBalances: args["chain.assertCorrectProgressiveBalances"],
Expand Down Expand Up @@ -75,6 +77,13 @@ Will double processing times. Use only for debugging purposes.",
group: "chain",
},

"chain.disableImportExecutionFcU": {
hidden: true,
type: "boolean",
description: "Disable issuing FcUs to the execution engine on block import",
group: "chain",
},

"chain.computeUnrealized": {
type: "boolean",
description: "Compute unrealized checkpoints and use it in fork choice or not",
Expand Down
2 changes: 2 additions & 0 deletions packages/cli/test/unit/options/beaconNodeOptions.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ describe("options / beaconNodeOptions", () => {
"chain.disableBlsBatchVerify": true,
"chain.persistInvalidSszObjects": true,
"chain.proposerBoostEnabled": false,
"chain.disableImportExecutionFcU": false,
"chain.computeUnrealized": true,
"chain.defaultFeeRecipient": "0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"chain.assertCorrectProgressiveBalances": true,
Expand Down Expand Up @@ -90,6 +91,7 @@ describe("options / beaconNodeOptions", () => {
disableBlsBatchVerify: true,
persistInvalidSszObjects: true,
proposerBoostEnabled: false,
disableImportExecutionFcU: false,
computeUnrealized: true,
safeSlotsToImportOptimistically: 256,
defaultFeeRecipient: "0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
Expand Down